const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BhtVN9_m.js","assets/sha3--8JbGYfk.js","assets/utils-CqP-FaiV.js","assets/clsx.m-DHulAg21.js","assets/index-Bftpp1YE.js","assets/events-DQ172AOg.js","assets/index-B8lqC164.js","assets/index-Bgc9HhbY.js","assets/index-Dwm2KIpY.js","assets/index.es-BDexHQlT.js"])))=>i.map(i=>d[i]);
var KGe=Object.defineProperty;var fde=e=>{throw TypeError(e)};var YGe=(e,t,n)=>t in e?KGe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Dn=(e,t,n)=>YGe(e,typeof t!="symbol"?t+"":t,n),oz=(e,t,n)=>t.has(e)||fde("Cannot "+n);var He=(e,t,n)=>(oz(e,t,"read from private field"),n?n.call(e):t.get(e)),On=(e,t,n)=>t.has(e)?fde("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ht=(e,t,n,r)=>(oz(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),wr=(e,t,n)=>(oz(e,t,"access private method"),n);var ib=(e,t,n,r)=>({set _(s){Ht(e,t,s,n)},get _(){return He(e,t,r)}});function PNe(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 Iu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ii(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function i2n(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 lz={exports:{}},u7={},cz={exports:{}},Hi={};/**
 * @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 hde;function XGe(){if(hde)return Hi;hde=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,Ne){this.props=ae,this.context=fe,this.refs=w,this.updater=Ne||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 P(ae,fe,Ne){this.props=ae,this.context=fe,this.refs=w,this.updater=Ne||g}var I=P.prototype=new N;I.constructor=P,v(I,C.prototype),I.isPureReactComponent=!0;var R=Array.isArray,O=Object.prototype.hasOwnProperty,U={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};function z(ae,fe,Ne){var me,we={},xe=null,ye=null;if(fe!=null)for(me in fe.ref!==void 0&&(ye=fe.ref),fe.key!==void 0&&(xe=""+fe.key),fe)O.call(fe,me)&&!L.hasOwnProperty(me)&&(we[me]=fe[me]);var je=arguments.length-2;if(je===1)we.children=Ne;else if(1<je){for(var Pe=Array(je),Re=0;Re<je;Re++)Pe[Re]=arguments[Re+2];we.children=Pe}if(ae&&ae.defaultProps)for(me in je=ae.defaultProps,je)we[me]===void 0&&(we[me]=je[me]);return{$$typeof:e,type:ae,key:xe,ref:ye,props:we,_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(Ne){return fe[Ne]})}var K=/\/+/g;function re(ae,fe){return typeof ae=="object"&&ae!==null&&ae.key!=null?J(""+ae.key):fe.toString(36)}function he(ae,fe,Ne,me,we){var xe=typeof ae;(xe==="undefined"||xe==="boolean")&&(ae=null);var ye=!1;if(ae===null)ye=!0;else switch(xe){case"string":case"number":ye=!0;break;case"object":switch(ae.$$typeof){case e:case t:ye=!0}}if(ye)return ye=ae,we=we(ye),ae=me===""?"."+re(ye,0):me,R(we)?(Ne="",ae!=null&&(Ne=ae.replace(K,"$&/")+"/"),he(we,fe,Ne,"",function(Re){return Re})):we!=null&&(ne(we)&&(we=X(we,Ne+(!we.key||ye&&ye.key===we.key?"":(""+we.key).replace(K,"$&/")+"/")+ae)),fe.push(we)),1;if(ye=0,me=me===""?".":me+":",R(ae))for(var je=0;je<ae.length;je++){xe=ae[je];var Pe=me+re(xe,je);ye+=he(xe,fe,Ne,Pe,we)}else if(Pe=x(ae),typeof Pe=="function")for(ae=Pe.call(ae),je=0;!(xe=ae.next()).done;)xe=xe.value,Pe=me+re(xe,je++),ye+=he(xe,fe,Ne,Pe,we);else if(xe==="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 ye}function Q(ae,fe,Ne){if(ae==null)return ae;var me=[],we=0;return he(ae,me,"","",function(xe){return fe.call(Ne,xe,we++)}),me}function ie(ae){if(ae._status===-1){var fe=ae._result;fe=fe(),fe.then(function(Ne){(ae._status===0||ae._status===-1)&&(ae._status=1,ae._result=Ne)},function(Ne){(ae._status===0||ae._status===-1)&&(ae._status=2,ae._result=Ne)}),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 te(){throw Error("act(...) is not supported in production builds of React.")}return Hi.Children={map:Q,forEach:function(ae,fe,Ne){Q(ae,function(){fe.apply(this,arguments)},Ne)},count:function(ae){var fe=0;return Q(ae,function(){fe++}),fe},toArray:function(ae){return Q(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}},Hi.Component=C,Hi.Fragment=n,Hi.Profiler=s,Hi.PureComponent=P,Hi.StrictMode=r,Hi.Suspense=c,Hi.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=V,Hi.act=te,Hi.cloneElement=function(ae,fe,Ne){if(ae==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+ae+".");var me=v({},ae.props),we=ae.key,xe=ae.ref,ye=ae._owner;if(fe!=null){if(fe.ref!==void 0&&(xe=fe.ref,ye=U.current),fe.key!==void 0&&(we=""+fe.key),ae.type&&ae.type.defaultProps)var je=ae.type.defaultProps;for(Pe in fe)O.call(fe,Pe)&&!L.hasOwnProperty(Pe)&&(me[Pe]=fe[Pe]===void 0&&je!==void 0?je[Pe]:fe[Pe])}var Pe=arguments.length-2;if(Pe===1)me.children=Ne;else if(1<Pe){je=Array(Pe);for(var Re=0;Re<Pe;Re++)je[Re]=arguments[Re+2];me.children=je}return{$$typeof:e,type:ae.type,key:we,ref:xe,props:me,_owner:ye}},Hi.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},Hi.createElement=z,Hi.createFactory=function(ae){var fe=z.bind(null,ae);return fe.type=ae,fe},Hi.createRef=function(){return{current:null}},Hi.forwardRef=function(ae){return{$$typeof:l,render:ae}},Hi.isValidElement=ne,Hi.lazy=function(ae){return{$$typeof:d,_payload:{_status:-1,_result:ae},_init:ie}},Hi.memo=function(ae,fe){return{$$typeof:u,type:ae,compare:fe===void 0?null:fe}},Hi.startTransition=function(ae){var fe=G.transition;G.transition={};try{ae()}finally{G.transition=fe}},Hi.unstable_act=te,Hi.useCallback=function(ae,fe){return oe.current.useCallback(ae,fe)},Hi.useContext=function(ae){return oe.current.useContext(ae)},Hi.useDebugValue=function(){},Hi.useDeferredValue=function(ae){return oe.current.useDeferredValue(ae)},Hi.useEffect=function(ae,fe){return oe.current.useEffect(ae,fe)},Hi.useId=function(){return oe.current.useId()},Hi.useImperativeHandle=function(ae,fe,Ne){return oe.current.useImperativeHandle(ae,fe,Ne)},Hi.useInsertionEffect=function(ae,fe){return oe.current.useInsertionEffect(ae,fe)},Hi.useLayoutEffect=function(ae,fe){return oe.current.useLayoutEffect(ae,fe)},Hi.useMemo=function(ae,fe){return oe.current.useMemo(ae,fe)},Hi.useReducer=function(ae,fe,Ne){return oe.current.useReducer(ae,fe,Ne)},Hi.useRef=function(ae){return oe.current.useRef(ae)},Hi.useState=function(ae){return oe.current.useState(ae)},Hi.useSyncExternalStore=function(ae,fe,Ne){return oe.current.useSyncExternalStore(ae,fe,Ne)},Hi.useTransition=function(){return oe.current.useTransition()},Hi.version="18.3.1",Hi}var pde;function ox(){return pde||(pde=1,cz.exports=XGe()),cz.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 mde;function QGe(){if(mde)return u7;mde=1;var e=ox(),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 u7.Fragment=n,u7.jsx=o,u7.jsxs=o,u7}var xde;function ZGe(){return xde||(xde=1,lz.exports=QGe()),lz.exports}var i=ZGe(),wI={},uz={exports:{}},Rd={},dz={exports:{}},fz={};/**
 * @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 gde;function JGe(){return gde||(gde=1,function(e){function t(G,V){var te=G.length;G.push(V);e:for(;0<te;){var ae=te-1>>>1,fe=G[ae];if(0<s(fe,V))G[ae]=V,G[te]=fe,te=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],te=G.pop();if(te!==V){G[0]=te;e:for(var ae=0,fe=G.length,Ne=fe>>>1;ae<Ne;){var me=2*(ae+1)-1,we=G[me],xe=me+1,ye=G[xe];if(0>s(we,te))xe<fe&&0>s(ye,we)?(G[ae]=ye,G[xe]=te,ae=xe):(G[ae]=we,G[me]=te,ae=me);else if(xe<fe&&0>s(ye,te))G[ae]=ye,G[xe]=te,ae=xe;else break e}}return V}function s(G,V){var te=G.sortIndex-V.sortIndex;return te!==0?te: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,P=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function I(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,I(G),!v)if(n(c)!==null)v=!0,ie(O);else{var V=n(u);V!==null&&oe(R,V.startTime-G)}}function O(G,V){v=!1,w&&(w=!1,N(z),z=-1),g=!0;var te=x;try{for(I(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),I(V)}else r(c);f=n(c)}if(f!==null)var Ne=!0;else{var me=n(u);me!==null&&oe(R,me.startTime-V),Ne=!1}return Ne}finally{f=null,x=te,g=!1}}var U=!1,L=null,z=-1,X=5,ne=-1;function J(){return!(e.unstable_now()-ne<X)}function K(){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 P=="function")re=function(){P(K)};else if(typeof MessageChannel<"u"){var he=new MessageChannel,Q=he.port2;he.port1.onmessage=K,re=function(){Q.postMessage(null)}}else re=function(){C(K,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(O))},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 te=x;x=V;try{return G()}finally{x=te}},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 te=x;x=G;try{return V()}finally{x=te}},e.unstable_scheduleCallback=function(G,V,te){var ae=e.unstable_now();switch(typeof te=="object"&&te!==null?(te=te.delay,te=typeof te=="number"&&0<te?ae+te:ae):te=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=te+fe,G={id:d++,callback:V,priorityLevel:G,startTime:te,expirationTime:fe,sortIndex:-1},te>ae?(G.sortIndex=te,t(u,G),n(c)===null&&G===n(u)&&(w?(N(z),z=-1):w=!0,oe(R,te-ae))):(G.sortIndex=fe,t(c,G),v||g||(v=!0,ie(O))),G},e.unstable_shouldYield=J,e.unstable_wrapCallback=function(G){var V=x;return function(){var te=x;x=V;try{return G.apply(this,arguments)}finally{x=te}}}}(fz)),fz}var bde;function eKe(){return bde||(bde=1,dz.exports=JGe()),dz.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 yde;function tKe(){if(yde)return Rd;yde=1;var e=ox(),t=eKe();function n(A){for(var M="https://reactjs.org/docs/error-decoder.html?invariant="+A,Z=1;Z<arguments.length;Z++)M+="&args[]="+encodeURIComponent(arguments[Z]);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,Z,pe){if(Z!==null&&Z.type===0)return!1;switch(typeof M){case"function":case"symbol":return!0;case"boolean":return pe?!1:Z!==null?!Z.acceptsBooleans:(A=A.toLowerCase().slice(0,5),A!=="data-"&&A!=="aria-");default:return!1}}function v(A,M,Z,pe){if(M===null||typeof M>"u"||g(A,M,Z,pe))return!0;if(pe)return!1;if(Z!==null)switch(Z.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,Z,pe,Ie,Ve,Nt){this.acceptsBooleans=M===2||M===3||M===4,this.attributeName=pe,this.attributeNamespace=Ie,this.mustUseProperty=Z,this.propertyName=A,this.type=M,this.sanitizeURL=Ve,this.removeEmptyString=Nt}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 P(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,P);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,P);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,P);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 I(A,M,Z,pe){var Ie=C.hasOwnProperty(M)?C[M]:null;(Ie!==null?Ie.type!==0:pe||!(2<M.length)||M[0]!=="o"&&M[0]!=="O"||M[1]!=="n"&&M[1]!=="N")&&(v(M,Z,Ie,pe)&&(Z=null),pe||Ie===null?x(M)&&(Z===null?A.removeAttribute(M):A.setAttribute(M,""+Z)):Ie.mustUseProperty?A[Ie.propertyName]=Z===null?Ie.type===3?!1:"":Z:(M=Ie.attributeName,pe=Ie.attributeNamespace,Z===null?A.removeAttribute(M):(Ie=Ie.type,Z=Ie===3||Ie===4&&Z===!0?"":""+Z,pe?A.setAttributeNS(pe,M,Z):A.setAttribute(M,Z))))}var R=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,O=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"),K=Symbol.for("react.forward_ref"),re=Symbol.for("react.suspense"),he=Symbol.for("react.suspense_list"),Q=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 te=Object.assign,ae;function fe(A){if(ae===void 0)try{throw Error()}catch(Z){var M=Z.stack.trim().match(/\n( *(at )?)/);ae=M&&M[1]||""}return`
`+ae+A}var Ne=!1;function me(A,M){if(!A||Ne)return"";Ne=!0;var Z=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(lr){var pe=lr}Reflect.construct(A,[],M)}else{try{M.call()}catch(lr){pe=lr}A.call(M.prototype)}else{try{throw Error()}catch(lr){pe=lr}A()}}catch(lr){if(lr&&pe&&typeof lr.stack=="string"){for(var Ie=lr.stack.split(`
`),Ve=pe.stack.split(`
`),Nt=Ie.length-1,fn=Ve.length-1;1<=Nt&&0<=fn&&Ie[Nt]!==Ve[fn];)fn--;for(;1<=Nt&&0<=fn;Nt--,fn--)if(Ie[Nt]!==Ve[fn]){if(Nt!==1||fn!==1)do if(Nt--,fn--,0>fn||Ie[Nt]!==Ve[fn]){var _n=`
`+Ie[Nt].replace(" at new "," at ");return A.displayName&&_n.includes("<anonymous>")&&(_n=_n.replace("<anonymous>",A.displayName)),_n}while(1<=Nt&&0<=fn);break}}}finally{Ne=!1,Error.prepareStackTrace=Z}return(A=A?A.displayName||A.name:"")?fe(A):""}function we(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=me(A.type,!1),A;case 11:return A=me(A.type.render,!1),A;case 1:return A=me(A.type,!0),A;default:return""}}function xe(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 K:var M=A.render;return A=A.displayName,A||(A=M.displayName||M.name||"",A=A!==""?"ForwardRef("+A+")":"ForwardRef"),A;case Q:return M=A.displayName||null,M!==null?M:xe(A.type)||"Memo";case ie:M=A._payload,A=A._init;try{return xe(A(M))}catch{}}return null}function ye(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 xe(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 Pe(A){var M=A.type;return(A=A.nodeName)&&A.toLowerCase()==="input"&&(M==="checkbox"||M==="radio")}function Re(A){var M=Pe(A)?"checked":"value",Z=Object.getOwnPropertyDescriptor(A.constructor.prototype,M),pe=""+A[M];if(!A.hasOwnProperty(M)&&typeof Z<"u"&&typeof Z.get=="function"&&typeof Z.set=="function"){var Ie=Z.get,Ve=Z.set;return Object.defineProperty(A,M,{configurable:!0,get:function(){return Ie.call(this)},set:function(Nt){pe=""+Nt,Ve.call(this,Nt)}}),Object.defineProperty(A,M,{enumerable:Z.enumerable}),{getValue:function(){return pe},setValue:function(Nt){pe=""+Nt},stopTracking:function(){A._valueTracker=null,delete A[M]}}}}function Xe(A){A._valueTracker||(A._valueTracker=Re(A))}function Ke(A){if(!A)return!1;var M=A._valueTracker;if(!M)return!0;var Z=M.getValue(),pe="";return A&&(pe=Pe(A)?A.checked?"true":"false":A.value),A=pe,A!==Z?(M.setValue(A),!0):!1}function ut(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 et(A,M){var Z=M.checked;return te({},M,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:Z??A._wrapperState.initialChecked})}function tt(A,M){var Z=M.defaultValue==null?"":M.defaultValue,pe=M.checked!=null?M.checked:M.defaultChecked;Z=je(M.value!=null?M.value:Z),A._wrapperState={initialChecked:pe,initialValue:Z,controlled:M.type==="checkbox"||M.type==="radio"?M.checked!=null:M.value!=null}}function Le(A,M){M=M.checked,M!=null&&I(A,"checked",M,!1)}function $e(A,M){Le(A,M);var Z=je(M.value),pe=M.type;if(Z!=null)pe==="number"?(Z===0&&A.value===""||A.value!=Z)&&(A.value=""+Z):A.value!==""+Z&&(A.value=""+Z);else if(pe==="submit"||pe==="reset"){A.removeAttribute("value");return}M.hasOwnProperty("value")?pt(A,M.type,Z):M.hasOwnProperty("defaultValue")&&pt(A,M.type,je(M.defaultValue)),M.checked==null&&M.defaultChecked!=null&&(A.defaultChecked=!!M.defaultChecked)}function ht(A,M,Z){if(M.hasOwnProperty("value")||M.hasOwnProperty("defaultValue")){var pe=M.type;if(!(pe!=="submit"&&pe!=="reset"||M.value!==void 0&&M.value!==null))return;M=""+A._wrapperState.initialValue,Z||M===A.value||(A.value=M),A.defaultValue=M}Z=A.name,Z!==""&&(A.name=""),A.defaultChecked=!!A._wrapperState.initialChecked,Z!==""&&(A.name=Z)}function pt(A,M,Z){(M!=="number"||ut(A.ownerDocument)!==A)&&(Z==null?A.defaultValue=""+A._wrapperState.initialValue:A.defaultValue!==""+Z&&(A.defaultValue=""+Z))}var Kt=Array.isArray;function wt(A,M,Z,pe){if(A=A.options,M){M={};for(var Ie=0;Ie<Z.length;Ie++)M["$"+Z[Ie]]=!0;for(Z=0;Z<A.length;Z++)Ie=M.hasOwnProperty("$"+A[Z].value),A[Z].selected!==Ie&&(A[Z].selected=Ie),Ie&&pe&&(A[Z].defaultSelected=!0)}else{for(Z=""+je(Z),M=null,Ie=0;Ie<A.length;Ie++){if(A[Ie].value===Z){A[Ie].selected=!0,pe&&(A[Ie].defaultSelected=!0);return}M!==null||A[Ie].disabled||(M=A[Ie])}M!==null&&(M.selected=!0)}}function nn(A,M){if(M.dangerouslySetInnerHTML!=null)throw Error(n(91));return te({},M,{value:void 0,defaultValue:void 0,children:""+A._wrapperState.initialValue})}function cn(A,M){var Z=M.value;if(Z==null){if(Z=M.children,M=M.defaultValue,Z!=null){if(M!=null)throw Error(n(92));if(Kt(Z)){if(1<Z.length)throw Error(n(93));Z=Z[0]}M=Z}M==null&&(M=""),Z=M}A._wrapperState={initialValue:je(Z)}}function zn(A,M){var Z=je(M.value),pe=je(M.defaultValue);Z!=null&&(Z=""+Z,Z!==A.value&&(A.value=Z),M.defaultValue==null&&A.defaultValue!==Z&&(A.defaultValue=Z)),pe!=null&&(A.defaultValue=""+pe)}function Xt(A){var M=A.textContent;M===A._wrapperState.initialValue&&M!==""&&M!==null&&(A.value=M)}function on(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 Zt(A,M){return A==null||A==="http://www.w3.org/1999/xhtml"?on(M):A==="http://www.w3.org/2000/svg"&&M==="foreignObject"?"http://www.w3.org/1999/xhtml":A}var Ye,Ze=function(A){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(M,Z,pe,Ie){MSApp.execUnsafeLocalFunction(function(){return A(M,Z,pe,Ie)})}:A}(function(A,M){if(A.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in A)A.innerHTML=M;else{for(Ye=Ye||document.createElement("div"),Ye.innerHTML="<svg>"+M.valueOf().toString()+"</svg>",M=Ye.firstChild;A.firstChild;)A.removeChild(A.firstChild);for(;M.firstChild;)A.appendChild(M.firstChild)}});function Ft(A,M){if(M){var Z=A.firstChild;if(Z&&Z===A.lastChild&&Z.nodeType===3){Z.nodeValue=M;return}}A.textContent=M}var dn={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},Yt=["Webkit","ms","Moz","O"];Object.keys(dn).forEach(function(A){Yt.forEach(function(M){M=M+A.charAt(0).toUpperCase()+A.substring(1),dn[M]=dn[A]})});function Bt(A,M,Z){return M==null||typeof M=="boolean"||M===""?"":Z||typeof M!="number"||M===0||dn.hasOwnProperty(A)&&dn[A]?(""+M).trim():M+"px"}function ot(A,M){A=A.style;for(var Z in M)if(M.hasOwnProperty(Z)){var pe=Z.indexOf("--")===0,Ie=Bt(Z,M[Z],pe);Z==="float"&&(Z="cssFloat"),pe?A.setProperty(Z,Ie):A[Z]=Ie}}var De=te({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 _t(A,M){if(M){if(De[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 ze(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 nt=null;function mt(A){return A=A.target||A.srcElement||window,A.correspondingUseElement&&(A=A.correspondingUseElement),A.nodeType===3?A.parentNode:A}var $t=null,Pt=null,un=null;function an(A){if(A=pc(A)){if(typeof $t!="function")throw Error(n(280));var M=A.stateNode;M&&(M=B5(M),$t(A.stateNode,A.type,M))}}function xn(A){Pt?un?un.push(A):un=[A]:Pt=A}function An(){if(Pt){var A=Pt,M=un;if(un=Pt=null,an(A),M)for(A=0;A<M.length;A++)an(M[A])}}function kn(A,M){return A(M)}function yn(){}var Vn=!1;function Gn(A,M,Z){if(Vn)return A(M,Z);Vn=!0;try{return kn(A,M,Z)}finally{Vn=!1,(Pt!==null||un!==null)&&(yn(),An())}}function Rn(A,M){var Z=A.stateNode;if(Z===null)return null;var pe=B5(Z);if(pe===null)return null;Z=pe[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":(pe=!pe.disabled)||(A=A.type,pe=!(A==="button"||A==="input"||A==="select"||A==="textarea")),A=!pe;break e;default:A=!1}if(A)return null;if(Z&&typeof Z!="function")throw Error(n(231,M,typeof Z));return Z}var Yn=!1;if(l)try{var Cn={};Object.defineProperty(Cn,"passive",{get:function(){Yn=!0}}),window.addEventListener("test",Cn,Cn),window.removeEventListener("test",Cn,Cn)}catch{Yn=!1}function rn(A,M,Z,pe,Ie,Ve,Nt,fn,_n){var lr=Array.prototype.slice.call(arguments,3);try{M.apply(Z,lr)}catch($r){this.onError($r)}}var Oe=!1,Jt=null,sn=!1,Et=null,Xn={onError:function(A){Oe=!0,Jt=A}};function gn(A,M,Z,pe,Ie,Ve,Nt,fn,_n){Oe=!1,Jt=null,rn.apply(Xn,arguments)}function Dt(A,M,Z,pe,Ie,Ve,Nt,fn,_n){if(gn.apply(this,arguments),Oe){if(Oe){var lr=Jt;Oe=!1,Jt=null}else throw Error(n(198));sn||(sn=!0,Et=lr)}}function en(A){var M=A,Z=A;if(A.alternate)for(;M.return;)M=M.return;else{A=M;do M=A,M.flags&4098&&(Z=M.return),A=M.return;while(A)}return M.tag===3?Z:null}function In(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(en(A)!==A)throw Error(n(188))}function ar(A){var M=A.alternate;if(!M){if(M=en(A),M===null)throw Error(n(188));return M!==A?null:A}for(var Z=A,pe=M;;){var Ie=Z.return;if(Ie===null)break;var Ve=Ie.alternate;if(Ve===null){if(pe=Ie.return,pe!==null){Z=pe;continue}break}if(Ie.child===Ve.child){for(Ve=Ie.child;Ve;){if(Ve===Z)return Qn(Ie),A;if(Ve===pe)return Qn(Ie),M;Ve=Ve.sibling}throw Error(n(188))}if(Z.return!==pe.return)Z=Ie,pe=Ve;else{for(var Nt=!1,fn=Ie.child;fn;){if(fn===Z){Nt=!0,Z=Ie,pe=Ve;break}if(fn===pe){Nt=!0,pe=Ie,Z=Ve;break}fn=fn.sibling}if(!Nt){for(fn=Ve.child;fn;){if(fn===Z){Nt=!0,Z=Ve,pe=Ie;break}if(fn===pe){Nt=!0,pe=Ve,Z=Ie;break}fn=fn.sibling}if(!Nt)throw Error(n(189))}}if(Z.alternate!==pe)throw Error(n(190))}if(Z.tag!==3)throw Error(n(188));return Z.stateNode.current===Z?A:M}function hr(A){return A=ar(A),A!==null?Gt(A):null}function Gt(A){if(A.tag===5||A.tag===6)return A;for(A=A.child;A!==null;){var M=Gt(A);if(M!==null)return M;A=A.sibling}return null}var $n=t.unstable_scheduleCallback,nr=t.unstable_cancelCallback,Rt=t.unstable_shouldYield,En=t.unstable_requestPaint,Ee=t.unstable_now,h=t.unstable_getCurrentPriorityLevel,p=t.unstable_ImmediatePriority,S=t.unstable_UserBlockingPriority,_=t.unstable_NormalPriority,k=t.unstable_LowPriority,T=t.unstable_IdlePriority,B=null,W=null;function ee(A){if(W&&typeof W.onCommitFiberRoot=="function")try{W.onCommitFiberRoot(B,A,void 0,(A.current.flags&128)===128)}catch{}}var ce=Math.clz32?Math.clz32:Se,ue=Math.log,ge=Math.LN2;function Se(A){return A>>>=0,A===0?32:31-(ue(A)/ge|0)|0}var ke=64,Me=4194304;function qe(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 Z=A.pendingLanes;if(Z===0)return 0;var pe=0,Ie=A.suspendedLanes,Ve=A.pingedLanes,Nt=Z&268435455;if(Nt!==0){var fn=Nt&~Ie;fn!==0?pe=qe(fn):(Ve&=Nt,Ve!==0&&(pe=qe(Ve)))}else Nt=Z&~Ie,Nt!==0?pe=qe(Nt):Ve!==0&&(pe=qe(Ve));if(pe===0)return 0;if(M!==0&&M!==pe&&!(M&Ie)&&(Ie=pe&-pe,Ve=M&-M,Ie>=Ve||Ie===16&&(Ve&4194240)!==0))return M;if(pe&4&&(pe|=Z&16),M=A.entangledLanes,M!==0)for(A=A.entanglements,M&=pe;0<M;)Z=31-ce(M),Ie=1<<Z,pe|=A[Z],M&=~Ie;return pe}function at(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 Z=A.suspendedLanes,pe=A.pingedLanes,Ie=A.expirationTimes,Ve=A.pendingLanes;0<Ve;){var Nt=31-ce(Ve),fn=1<<Nt,_n=Ie[Nt];_n===-1?(!(fn&Z)||fn&pe)&&(Ie[Nt]=at(fn,M)):_n<=M&&(A.expiredLanes|=fn),Ve&=~fn}}function Ce(A){return A=A.pendingLanes&-1073741825,A!==0?A:A&1073741824?1073741824:0}function Ue(){var A=ke;return ke<<=1,!(ke&4194240)&&(ke=64),A}function Be(A){for(var M=[],Z=0;31>Z;Z++)M.push(A);return M}function _e(A,M,Z){A.pendingLanes|=M,M!==536870912&&(A.suspendedLanes=0,A.pingedLanes=0),A=A.eventTimes,M=31-ce(M),A[M]=Z}function rt(A,M){var Z=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 pe=A.eventTimes;for(A=A.expirationTimes;0<Z;){var Ie=31-ce(Z),Ve=1<<Ie;M[Ie]=0,pe[Ie]=-1,A[Ie]=-1,Z&=~Ve}}function ct(A,M){var Z=A.entangledLanes|=M;for(A=A.entanglements;Z;){var pe=31-ce(Z),Ie=1<<pe;Ie&M|A[pe]&M&&(A[pe]|=M),Z&=~Ie}}var yt=0;function Lt(A){return A&=-A,1<A?4<A?A&268435455?16:536870912:4:1}var ft,Tt,Ge,At,Ot,it=!1,jt=[],Nn=null,mn=null,ir=null,Sn=new Map,Bn=new Map,rr=[],ur="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 _r(A,M){switch(A){case"focusin":case"focusout":Nn=null;break;case"dragenter":case"dragleave":mn=null;break;case"mouseover":case"mouseout":ir=null;break;case"pointerover":case"pointerout":Sn.delete(M.pointerId);break;case"gotpointercapture":case"lostpointercapture":Bn.delete(M.pointerId)}}function Un(A,M,Z,pe,Ie,Ve){return A===null||A.nativeEvent!==Ve?(A={blockedOn:M,domEventName:Z,eventSystemFlags:pe,nativeEvent:Ve,targetContainers:[Ie]},M!==null&&(M=pc(M),M!==null&&Tt(M)),A):(A.eventSystemFlags|=pe,M=A.targetContainers,Ie!==null&&M.indexOf(Ie)===-1&&M.push(Ie),A)}function Ln(A,M,Z,pe,Ie){switch(M){case"focusin":return Nn=Un(Nn,A,M,Z,pe,Ie),!0;case"dragenter":return mn=Un(mn,A,M,Z,pe,Ie),!0;case"mouseover":return ir=Un(ir,A,M,Z,pe,Ie),!0;case"pointerover":var Ve=Ie.pointerId;return Sn.set(Ve,Un(Sn.get(Ve)||null,A,M,Z,pe,Ie)),!0;case"gotpointercapture":return Ve=Ie.pointerId,Bn.set(Ve,Un(Bn.get(Ve)||null,A,M,Z,pe,Ie)),!0}return!1}function Kn(A){var M=nh(A.target);if(M!==null){var Z=en(M);if(Z!==null){if(M=Z.tag,M===13){if(M=In(Z),M!==null){A.blockedOn=M,Ot(A.priority,function(){Ge(Z)});return}}else if(M===3&&Z.stateNode.current.memoizedState.isDehydrated){A.blockedOn=Z.tag===3?Z.stateNode.containerInfo:null;return}}}A.blockedOn=null}function Yr(A){if(A.blockedOn!==null)return!1;for(var M=A.targetContainers;0<M.length;){var Z=Cr(A.domEventName,A.eventSystemFlags,M[0],A.nativeEvent);if(Z===null){Z=A.nativeEvent;var pe=new Z.constructor(Z.type,Z);nt=pe,Z.target.dispatchEvent(pe),nt=null}else return M=pc(Z),M!==null&&Tt(M),A.blockedOn=Z,!1;M.shift()}return!0}function os(A,M,Z){Yr(A)&&Z.delete(M)}function ds(){it=!1,Nn!==null&&Yr(Nn)&&(Nn=null),mn!==null&&Yr(mn)&&(mn=null),ir!==null&&Yr(ir)&&(ir=null),Sn.forEach(os),Bn.forEach(os)}function Je(A,M){A.blockedOn===M&&(A.blockedOn=null,it||(it=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,ds)))}function bt(A){function M(Ie){return Je(Ie,A)}if(0<jt.length){Je(jt[0],A);for(var Z=1;Z<jt.length;Z++){var pe=jt[Z];pe.blockedOn===A&&(pe.blockedOn=null)}}for(Nn!==null&&Je(Nn,A),mn!==null&&Je(mn,A),ir!==null&&Je(ir,A),Sn.forEach(M),Bn.forEach(M),Z=0;Z<rr.length;Z++)pe=rr[Z],pe.blockedOn===A&&(pe.blockedOn=null);for(;0<rr.length&&(Z=rr[0],Z.blockedOn===null);)Kn(Z),Z.blockedOn===null&&rr.shift()}var Tn=R.ReactCurrentBatchConfig,er=!0;function kr(A,M,Z,pe){var Ie=yt,Ve=Tn.transition;Tn.transition=null;try{yt=1,Ur(A,M,Z,pe)}finally{yt=Ie,Tn.transition=Ve}}function Dr(A,M,Z,pe){var Ie=yt,Ve=Tn.transition;Tn.transition=null;try{yt=4,Ur(A,M,Z,pe)}finally{yt=Ie,Tn.transition=Ve}}function Ur(A,M,Z,pe){if(er){var Ie=Cr(A,M,Z,pe);if(Ie===null)h8(A,M,pe,cr,Z),_r(A,pe);else if(Ln(Ie,A,M,Z,pe))pe.stopPropagation();else if(_r(A,pe),M&4&&-1<ur.indexOf(A)){for(;Ie!==null;){var Ve=pc(Ie);if(Ve!==null&&ft(Ve),Ve=Cr(A,M,Z,pe),Ve===null&&h8(A,M,pe,cr,Z),Ve===Ie)break;Ie=Ve}Ie!==null&&pe.stopPropagation()}else h8(A,M,pe,null,Z)}}var cr=null;function Cr(A,M,Z,pe){if(cr=null,A=mt(pe),A=nh(A),A!==null)if(M=en(A),M===null)A=null;else if(Z=M.tag,Z===13){if(A=In(M),A!==null)return A;A=null}else if(Z===3){if(M.stateNode.current.memoizedState.isDehydrated)return M.tag===3?M.stateNode.containerInfo:null;A=null}else M!==A&&(A=null);return cr=A,null}function ls(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(h()){case p:return 1;case S:return 4;case _:case k:return 16;case T:return 536870912;default:return 16}default:return 16}}var yr=null,Jr=null,Ks=null;function Es(){if(Ks)return Ks;var A,M=Jr,Z=M.length,pe,Ie="value"in yr?yr.value:yr.textContent,Ve=Ie.length;for(A=0;A<Z&&M[A]===Ie[A];A++);var Nt=Z-A;for(pe=1;pe<=Nt&&M[Z-pe]===Ie[Ve-pe];pe++);return Ks=Ie.slice(A,1<pe?1-pe:void 0)}function gr(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 Vt(){return!0}function de(){return!1}function st(A){function M(Z,pe,Ie,Ve,Nt){this._reactName=Z,this._targetInst=Ie,this.type=pe,this.nativeEvent=Ve,this.target=Nt,this.currentTarget=null;for(var fn in A)A.hasOwnProperty(fn)&&(Z=A[fn],this[fn]=Z?Z(Ve):Ve[fn]);return this.isDefaultPrevented=(Ve.defaultPrevented!=null?Ve.defaultPrevented:Ve.returnValue===!1)?Vt:de,this.isPropagationStopped=de,this}return te(M.prototype,{preventDefault:function(){this.defaultPrevented=!0;var Z=this.nativeEvent;Z&&(Z.preventDefault?Z.preventDefault():typeof Z.returnValue!="unknown"&&(Z.returnValue=!1),this.isDefaultPrevented=Vt)},stopPropagation:function(){var Z=this.nativeEvent;Z&&(Z.stopPropagation?Z.stopPropagation():typeof Z.cancelBubble!="unknown"&&(Z.cancelBubble=!0),this.isPropagationStopped=Vt)},persist:function(){},isPersistent:Vt}),M}var Ct={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(A){return A.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vt=st(Ct),ln=te({},Ct,{view:0,detail:0}),pn=st(ln),dr,jr,pr,fr=te({},ln,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fr,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!==pr&&(pr&&A.type==="mousemove"?(dr=A.screenX-pr.screenX,jr=A.screenY-pr.screenY):jr=dr=0,pr=A),dr)},movementY:function(A){return"movementY"in A?A.movementY:jr}}),Kr=st(fr),rs=te({},fr,{dataTransfer:0}),Ir=st(rs),br=te({},ln,{relatedTarget:0}),Zn=st(br),xs=te({},Ct,{animationName:0,elapsedTime:0,pseudoElement:0}),Qs=st(xs),ai=te({},Ct,{clipboardData:function(A){return"clipboardData"in A?A.clipboardData:window.clipboardData}}),Pr=st(ai),vn=te({},Ct,{data:0}),Fn=st(vn),lt={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ut={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"},tr={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Wn(A){var M=this.nativeEvent;return M.getModifierState?M.getModifierState(A):(A=tr[A])?!!M[A]:!1}function Fr(){return Wn}var Tr=te({},ln,{key:function(A){if(A.key){var M=lt[A.key]||A.key;if(M!=="Unidentified")return M}return A.type==="keypress"?(A=gr(A),A===13?"Enter":String.fromCharCode(A)):A.type==="keydown"||A.type==="keyup"?Ut[A.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fr,charCode:function(A){return A.type==="keypress"?gr(A):0},keyCode:function(A){return A.type==="keydown"||A.type==="keyup"?A.keyCode:0},which:function(A){return A.type==="keypress"?gr(A):A.type==="keydown"||A.type==="keyup"?A.keyCode:0}}),es=st(Tr),Rs=te({},fr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),kt=st(Rs),or=te({},ln,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fr}),Hn=st(or),Hr=te({},Ct,{propertyName:0,elapsedTime:0,pseudoElement:0}),as=st(Hr),ss=te({},fr,{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}),ms=st(ss),gs=[9,13,27,32],Ui=l&&"CompositionEvent"in window,$s=null;l&&"documentMode"in document&&($s=document.documentMode);var bs=l&&"TextEvent"in window&&!$s,Cs=l&&(!Ui||$s&&8<$s&&11>=$s),dc=" ",_s=!1;function _a(A,M){switch(A){case"keyup":return gs.indexOf(M.keyCode)!==-1;case"keydown":return M.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $u(A){return A=A.detail,typeof A=="object"&&"data"in A?A.data:null}var ba=!1;function qo(A,M){switch(A){case"compositionend":return $u(M);case"keypress":return M.which!==32?null:(_s=!0,dc);case"textInput":return A=M.data,A===dc&&_s?null:A;default:return null}}function Uu(A,M){if(ba)return A==="compositionend"||!Ui&&_a(A,M)?(A=Es(),Ks=Jr=yr=null,ba=!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 Cs&&M.locale!=="ko"?null:M.data;default:return null}}var Wl={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 bi(A){var M=A&&A.nodeName&&A.nodeName.toLowerCase();return M==="input"?!!Wl[A.type]:M==="textarea"}function wd(A,M,Z,pe){xn(pe),M=M5(M,"onChange"),0<M.length&&(Z=new vt("onChange","change",null,Z,pe),A.push({event:Z,listeners:M}))}var dt=null,y=null;function E(A){_T(A,0)}function F(A){var M=Si(A);if(Ke(M))return A}function $(A,M){if(A==="change")return M}var H=!1;if(l){var Y;if(l){var le="oninput"in document;if(!le){var ve=document.createElement("div");ve.setAttribute("oninput","return;"),le=typeof ve.oninput=="function"}Y=le}else Y=!1;H=Y&&(!document.documentMode||9<document.documentMode)}function Te(){dt&&(dt.detachEvent("onpropertychange",Qe),y=dt=null)}function Qe(A){if(A.propertyName==="value"&&F(y)){var M=[];wd(M,y,A,mt(A)),Gn(E,M)}}function xt(A,M,Z){A==="focusin"?(Te(),dt=M,y=Z,dt.attachEvent("onpropertychange",Qe)):A==="focusout"&&Te()}function It(A){if(A==="selectionchange"||A==="keyup"||A==="keydown")return F(y)}function Qt(A,M){if(A==="click")return F(M)}function St(A,M){if(A==="input"||A==="change")return F(M)}function zt(A,M){return A===M&&(A!==0||1/A===1/M)||A!==A&&M!==M}var Wt=typeof Object.is=="function"?Object.is:zt;function jn(A,M){if(Wt(A,M))return!0;if(typeof A!="object"||A===null||typeof M!="object"||M===null)return!1;var Z=Object.keys(A),pe=Object.keys(M);if(Z.length!==pe.length)return!1;for(pe=0;pe<Z.length;pe++){var Ie=Z[pe];if(!c.call(M,Ie)||!Wt(A[Ie],M[Ie]))return!1}return!0}function mr(A){for(;A&&A.firstChild;)A=A.firstChild;return A}function Sr(A,M){var Z=mr(A);A=0;for(var pe;Z;){if(Z.nodeType===3){if(pe=A+Z.textContent.length,A<=M&&pe>=M)return{node:Z,offset:M-A};A=pe}e:{for(;Z;){if(Z.nextSibling){Z=Z.nextSibling;break e}Z=Z.parentNode}Z=void 0}Z=mr(Z)}}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 Ss(){for(var A=window,M=ut();M instanceof A.HTMLIFrameElement;){try{var Z=typeof M.contentWindow.location.href=="string"}catch{Z=!1}if(Z)A=M.contentWindow;else break;M=ut(A.document)}return M}function Zs(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 fc(A){var M=Ss(),Z=A.focusedElem,pe=A.selectionRange;if(M!==Z&&Z&&Z.ownerDocument&&Ar(Z.ownerDocument.documentElement,Z)){if(pe!==null&&Zs(Z)){if(M=pe.start,A=pe.end,A===void 0&&(A=M),"selectionStart"in Z)Z.selectionStart=M,Z.selectionEnd=Math.min(A,Z.value.length);else if(A=(M=Z.ownerDocument||document)&&M.defaultView||window,A.getSelection){A=A.getSelection();var Ie=Z.textContent.length,Ve=Math.min(pe.start,Ie);pe=pe.end===void 0?Ve:Math.min(pe.end,Ie),!A.extend&&Ve>pe&&(Ie=pe,pe=Ve,Ve=Ie),Ie=Sr(Z,Ve);var Nt=Sr(Z,pe);Ie&&Nt&&(A.rangeCount!==1||A.anchorNode!==Ie.node||A.anchorOffset!==Ie.offset||A.focusNode!==Nt.node||A.focusOffset!==Nt.offset)&&(M=M.createRange(),M.setStart(Ie.node,Ie.offset),A.removeAllRanges(),Ve>pe?(A.addRange(M),A.extend(Nt.node,Nt.offset)):(M.setEnd(Nt.node,Nt.offset),A.addRange(M)))}}for(M=[],A=Z;A=A.parentNode;)A.nodeType===1&&M.push({element:A,left:A.scrollLeft,top:A.scrollTop});for(typeof Z.focus=="function"&&Z.focus(),Z=0;Z<M.length;Z++)A=M[Z],A.element.scrollLeft=A.left,A.element.scrollTop=A.top}}var Ja=l&&"documentMode"in document&&11>=document.documentMode,eo=null,fa=null,ka=null,Go=!1;function Cd(A,M,Z){var pe=Z.window===Z?Z.document:Z.nodeType===9?Z:Z.ownerDocument;Go||eo==null||eo!==ut(pe)||(pe=eo,"selectionStart"in pe&&Zs(pe)?pe={start:pe.selectionStart,end:pe.selectionEnd}:(pe=(pe.ownerDocument&&pe.ownerDocument.defaultView||window).getSelection(),pe={anchorNode:pe.anchorNode,anchorOffset:pe.anchorOffset,focusNode:pe.focusNode,focusOffset:pe.focusOffset}),ka&&jn(ka,pe)||(ka=pe,pe=M5(fa,"onSelect"),0<pe.length&&(M=new vt("onSelect","select",null,M,Z),A.push({event:M,listeners:pe}),M.target=eo)))}function Fi(A,M){var Z={};return Z[A.toLowerCase()]=M.toLowerCase(),Z["Webkit"+A]="webkit"+M,Z["Moz"+A]="moz"+M,Z}var km={animationend:Fi("Animation","AnimationEnd"),animationiteration:Fi("Animation","AnimationIteration"),animationstart:Fi("Animation","AnimationStart"),transitionend:Fi("Transition","TransitionEnd")},F1={},N2={};l&&(N2=document.createElement("div").style,"AnimationEvent"in window||(delete km.animationend.animation,delete km.animationiteration.animation,delete km.animationstart.animation),"TransitionEvent"in window||delete km.transitionend.transition);function T5(A){if(F1[A])return F1[A];if(!km[A])return A;var M=km[A],Z;for(Z in M)if(M.hasOwnProperty(Z)&&Z in N2)return F1[A]=M[Z];return A}var AT=T5("animationend"),jT=T5("animationiteration"),A2=T5("animationstart"),xp=T5("transitionend"),j2=new Map,d8="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 mf(A,M){j2.set(A,M),a(M,[A])}for(var I5=0;I5<d8.length;I5++){var P5=d8[I5],F5=P5.toLowerCase(),ET=P5[0].toUpperCase()+P5.slice(1);mf(F5,"on"+ET)}mf(AT,"onAnimationEnd"),mf(jT,"onAnimationIteration"),mf(A2,"onAnimationStart"),mf("dblclick","onDoubleClick"),mf("focusin","onFocus"),mf("focusout","onBlur"),mf(xp,"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 gp="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(" "),px=new Set("cancel close invalid load scroll toggle".split(" ").concat(gp));function E2(A,M,Z){var pe=A.type||"unknown-event";A.currentTarget=Z,Dt(pe,M,void 0,A),A.currentTarget=null}function _T(A,M){M=(M&4)!==0;for(var Z=0;Z<A.length;Z++){var pe=A[Z],Ie=pe.event;pe=pe.listeners;e:{var Ve=void 0;if(M)for(var Nt=pe.length-1;0<=Nt;Nt--){var fn=pe[Nt],_n=fn.instance,lr=fn.currentTarget;if(fn=fn.listener,_n!==Ve&&Ie.isPropagationStopped())break e;E2(Ie,fn,lr),Ve=_n}else for(Nt=0;Nt<pe.length;Nt++){if(fn=pe[Nt],_n=fn.instance,lr=fn.currentTarget,fn=fn.listener,_n!==Ve&&Ie.isPropagationStopped())break e;E2(Ie,fn,lr),Ve=_n}}}if(sn)throw A=Et,sn=!1,Et=null,A}function qa(A,M){var Z=M[D5];Z===void 0&&(Z=M[D5]=new Set);var pe=A+"__bubble";Z.has(pe)||(O5(M,A,2,!1),Z.add(pe))}function f8(A,M,Z){var pe=0;M&&(pe|=4),O5(Z,A,pe,M)}var mx="_reactListening"+Math.random().toString(36).slice(2);function Tm(A){if(!A[mx]){A[mx]=!0,r.forEach(function(Z){Z!=="selectionchange"&&(px.has(Z)||f8(Z,!1,A),f8(Z,!0,A))});var M=A.nodeType===9?A:A.ownerDocument;M===null||M[mx]||(M[mx]=!0,f8("selectionchange",!1,M))}}function O5(A,M,Z,pe){switch(ls(M)){case 1:var Ie=kr;break;case 4:Ie=Dr;break;default:Ie=Ur}Z=Ie.bind(null,M,Z,A),Ie=void 0,!Yn||M!=="touchstart"&&M!=="touchmove"&&M!=="wheel"||(Ie=!0),pe?Ie!==void 0?A.addEventListener(M,Z,{capture:!0,passive:Ie}):A.addEventListener(M,Z,!0):Ie!==void 0?A.addEventListener(M,Z,{passive:Ie}):A.addEventListener(M,Z,!1)}function h8(A,M,Z,pe,Ie){var Ve=pe;if(!(M&1)&&!(M&2)&&pe!==null)e:for(;;){if(pe===null)return;var Nt=pe.tag;if(Nt===3||Nt===4){var fn=pe.stateNode.containerInfo;if(fn===Ie||fn.nodeType===8&&fn.parentNode===Ie)break;if(Nt===4)for(Nt=pe.return;Nt!==null;){var _n=Nt.tag;if((_n===3||_n===4)&&(_n=Nt.stateNode.containerInfo,_n===Ie||_n.nodeType===8&&_n.parentNode===Ie))return;Nt=Nt.return}for(;fn!==null;){if(Nt=nh(fn),Nt===null)return;if(_n=Nt.tag,_n===5||_n===6){pe=Ve=Nt;continue e}fn=fn.parentNode}}pe=pe.return}Gn(function(){var lr=Ve,$r=mt(Z),Vr=[];e:{var Br=j2.get(A);if(Br!==void 0){var fs=vt,Ns=A;switch(A){case"keypress":if(gr(Z)===0)break e;case"keydown":case"keyup":fs=es;break;case"focusin":Ns="focus",fs=Zn;break;case"focusout":Ns="blur",fs=Zn;break;case"beforeblur":case"afterblur":fs=Zn;break;case"click":if(Z.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":fs=Kr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fs=Ir;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fs=Hn;break;case AT:case jT:case A2:fs=Qs;break;case xp:fs=as;break;case"scroll":fs=pn;break;case"wheel":fs=ms;break;case"copy":case"cut":case"paste":fs=Pr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fs=kt}var Is=(M&4)!==0,jo=!Is&&A==="scroll",Jn=Is?Br!==null?Br+"Capture":null:Br;Is=[];for(var Mn=lr,sr;Mn!==null;){sr=Mn;var Xr=sr.stateNode;if(sr.tag===5&&Xr!==null&&(sr=Xr,Jn!==null&&(Xr=Rn(Mn,Jn),Xr!=null&&Is.push(O1(Mn,Xr,sr)))),jo)break;Mn=Mn.return}0<Is.length&&(Br=new fs(Br,Ns,null,Z,$r),Vr.push({event:Br,listeners:Is}))}}if(!(M&7)){e:{if(Br=A==="mouseover"||A==="pointerover",fs=A==="mouseout"||A==="pointerout",Br&&Z!==nt&&(Ns=Z.relatedTarget||Z.fromElement)&&(nh(Ns)||Ns[zu]))break e;if((fs||Br)&&(Br=$r.window===$r?$r:(Br=$r.ownerDocument)?Br.defaultView||Br.parentWindow:window,fs?(Ns=Z.relatedTarget||Z.toElement,fs=lr,Ns=Ns?nh(Ns):null,Ns!==null&&(jo=en(Ns),Ns!==jo||Ns.tag!==5&&Ns.tag!==6)&&(Ns=null)):(fs=null,Ns=lr),fs!==Ns)){if(Is=Kr,Xr="onMouseLeave",Jn="onMouseEnter",Mn="mouse",(A==="pointerout"||A==="pointerover")&&(Is=kt,Xr="onPointerLeave",Jn="onPointerEnter",Mn="pointer"),jo=fs==null?Br:Si(fs),sr=Ns==null?Br:Si(Ns),Br=new Is(Xr,Mn+"leave",fs,Z,$r),Br.target=jo,Br.relatedTarget=sr,Xr=null,nh($r)===lr&&(Is=new Is(Jn,Mn+"enter",Ns,Z,$r),Is.target=sr,Is.relatedTarget=jo,Xr=Is),jo=Xr,fs&&Ns)t:{for(Is=fs,Jn=Ns,Mn=0,sr=Is;sr;sr=M1(sr))Mn++;for(sr=0,Xr=Jn;Xr;Xr=M1(Xr))sr++;for(;0<Mn-sr;)Is=M1(Is),Mn--;for(;0<sr-Mn;)Jn=M1(Jn),sr--;for(;Mn--;){if(Is===Jn||Jn!==null&&Is===Jn.alternate)break t;Is=M1(Is),Jn=M1(Jn)}Is=null}else Is=null;fs!==null&&Ko(Vr,Br,fs,Is,!1),Ns!==null&&jo!==null&&Ko(Vr,jo,Ns,Is,!0)}}e:{if(Br=lr?Si(lr):window,fs=Br.nodeName&&Br.nodeName.toLowerCase(),fs==="select"||fs==="input"&&Br.type==="file")var Ps=$;else if(bi(Br))if(H)Ps=St;else{Ps=It;var Hs=xt}else(fs=Br.nodeName)&&fs.toLowerCase()==="input"&&(Br.type==="checkbox"||Br.type==="radio")&&(Ps=Qt);if(Ps&&(Ps=Ps(A,lr))){wd(Vr,Ps,Z,$r);break e}Hs&&Hs(A,Br,lr),A==="focusout"&&(Hs=Br._wrapperState)&&Hs.controlled&&Br.type==="number"&&pt(Br,"number",Br.value)}switch(Hs=lr?Si(lr):window,A){case"focusin":(bi(Hs)||Hs.contentEditable==="true")&&(eo=Hs,fa=lr,ka=null);break;case"focusout":ka=fa=eo=null;break;case"mousedown":Go=!0;break;case"contextmenu":case"mouseup":case"dragend":Go=!1,Cd(Vr,Z,$r);break;case"selectionchange":if(Ja)break;case"keydown":case"keyup":Cd(Vr,Z,$r)}var Vs;if(Ui)e:{switch(A){case"compositionstart":var Xs="onCompositionStart";break e;case"compositionend":Xs="onCompositionEnd";break e;case"compositionupdate":Xs="onCompositionUpdate";break e}Xs=void 0}else ba?_a(A,Z)&&(Xs="onCompositionEnd"):A==="keydown"&&Z.keyCode===229&&(Xs="onCompositionStart");Xs&&(Cs&&Z.locale!=="ko"&&(ba||Xs!=="onCompositionStart"?Xs==="onCompositionEnd"&&ba&&(Vs=Es()):(yr=$r,Jr="value"in yr?yr.value:yr.textContent,ba=!0)),Hs=M5(lr,Xs),0<Hs.length&&(Xs=new Fn(Xs,A,null,Z,$r),Vr.push({event:Xs,listeners:Hs}),Vs?Xs.data=Vs:(Vs=$u(Z),Vs!==null&&(Xs.data=Vs)))),(Vs=bs?qo(A,Z):Uu(A,Z))&&(lr=M5(lr,"onBeforeInput"),0<lr.length&&($r=new Fn("onBeforeInput","beforeinput",null,Z,$r),Vr.push({event:$r,listeners:lr}),$r.data=Vs))}_T(Vr,M)})}function O1(A,M,Z){return{instance:A,listener:M,currentTarget:Z}}function M5(A,M){for(var Z=M+"Capture",pe=[];A!==null;){var Ie=A,Ve=Ie.stateNode;Ie.tag===5&&Ve!==null&&(Ie=Ve,Ve=Rn(A,Z),Ve!=null&&pe.unshift(O1(A,Ve,Ie)),Ve=Rn(A,M),Ve!=null&&pe.push(O1(A,Ve,Ie))),A=A.return}return pe}function M1(A){if(A===null)return null;do A=A.return;while(A&&A.tag!==5);return A||null}function Ko(A,M,Z,pe,Ie){for(var Ve=M._reactName,Nt=[];Z!==null&&Z!==pe;){var fn=Z,_n=fn.alternate,lr=fn.stateNode;if(_n!==null&&_n===pe)break;fn.tag===5&&lr!==null&&(fn=lr,Ie?(_n=Rn(Z,Ve),_n!=null&&Nt.unshift(O1(Z,_n,fn))):Ie||(_n=Rn(Z,Ve),_n!=null&&Nt.push(O1(Z,_n,fn)))),Z=Z.return}Nt.length!==0&&A.push({event:M,listeners:Nt})}var hc=/\r\n?/g,TU=/\u0000|\uFFFD/g;function kT(A){return(typeof A=="string"?A:""+A).replace(hc,`
`).replace(TU,"")}function _2(A,M,Z){if(M=kT(M),kT(A)!==M&&Z)throw Error(n(425))}function R5(){}var k2=null,xx=null;function T2(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 Im=typeof setTimeout=="function"?setTimeout:void 0,I2=typeof clearTimeout=="function"?clearTimeout:void 0,R1=typeof Promise=="function"?Promise:void 0,L5=typeof queueMicrotask=="function"?queueMicrotask:typeof R1<"u"?function(A){return R1.resolve(null).then(A).catch(L1)}:Im;function L1(A){setTimeout(function(){throw A})}function p8(A,M){var Z=M,pe=0;do{var Ie=Z.nextSibling;if(A.removeChild(Z),Ie&&Ie.nodeType===8)if(Z=Ie.data,Z==="/$"){if(pe===0){A.removeChild(Ie),bt(M);return}pe--}else Z!=="$"&&Z!=="$?"&&Z!=="$!"||pe++;Z=Ie}while(Z);bt(M)}function Pm(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 TT(A){A=A.previousSibling;for(var M=0;A;){if(A.nodeType===8){var Z=A.data;if(Z==="$"||Z==="$!"||Z==="$?"){if(M===0)return A;M--}else Z==="/$"&&M++}A=A.previousSibling}return null}var D1=Math.random().toString(36).slice(2),th="__reactFiber$"+D1,Fm="__reactProps$"+D1,zu="__reactContainer$"+D1,D5="__reactEvents$"+D1,Mt="__reactListeners$"+D1,B1="__reactHandles$"+D1;function nh(A){var M=A[th];if(M)return M;for(var Z=A.parentNode;Z;){if(M=Z[zu]||Z[th]){if(Z=M.alternate,M.child!==null||Z!==null&&Z.child!==null)for(A=TT(A);A!==null;){if(Z=A[th])return Z;A=TT(A)}return M}A=Z,Z=A.parentNode}return null}function pc(A){return A=A[th]||A[zu],!A||A.tag!==5&&A.tag!==6&&A.tag!==13&&A.tag!==3?null:A}function Si(A){if(A.tag===5||A.tag===6)return A.stateNode;throw Error(n(33))}function B5(A){return A[Fm]||null}var m8=[],$1=-1;function cu(A){return{current:A}}function Ga(A){0>$1||(A.current=m8[$1],m8[$1]=null,$1--)}function Ua(A,M){$1++,m8[$1]=A.current,A.current=M}var Om={},mc=cu(Om),uu=cu(!1),Bc=Om;function U1(A,M){var Z=A.type.contextTypes;if(!Z)return Om;var pe=A.stateNode;if(pe&&pe.__reactInternalMemoizedUnmaskedChildContext===M)return pe.__reactInternalMemoizedMaskedChildContext;var Ie={},Ve;for(Ve in Z)Ie[Ve]=M[Ve];return pe&&(A=A.stateNode,A.__reactInternalMemoizedUnmaskedChildContext=M,A.__reactInternalMemoizedMaskedChildContext=Ie),Ie}function du(A){return A=A.childContextTypes,A!=null}function $5(){Ga(uu),Ga(mc)}function IT(A,M,Z){if(mc.current!==Om)throw Error(n(168));Ua(mc,M),Ua(uu,Z)}function PT(A,M,Z){var pe=A.stateNode;if(M=M.childContextTypes,typeof pe.getChildContext!="function")return Z;pe=pe.getChildContext();for(var Ie in pe)if(!(Ie in M))throw Error(n(108,ye(A)||"Unknown",Ie));return te({},Z,pe)}function Sd(A){return A=(A=A.stateNode)&&A.__reactInternalMemoizedMergedChildContext||Om,Bc=mc.current,Ua(mc,A),Ua(uu,uu.current),!0}function FT(A,M,Z){var pe=A.stateNode;if(!pe)throw Error(n(169));Z?(A=PT(A,M,Bc),pe.__reactInternalMemoizedMergedChildContext=A,Ga(uu),Ga(mc),Ua(mc,A)):Ga(uu),Ua(uu,Z)}var bp=null,U5=!1,x8=!1;function OT(A){bp===null?bp=[A]:bp.push(A)}function gx(A){U5=!0,OT(A)}function Mm(){if(!x8&&bp!==null){x8=!0;var A=0,M=yt;try{var Z=bp;for(yt=1;A<Z.length;A++){var pe=Z[A];do pe=pe(!0);while(pe!==null)}bp=null,U5=!1}catch(Ie){throw bp!==null&&(bp=bp.slice(A+1)),$n(p,Mm),Ie}finally{yt=M,x8=!1}}return null}var z1=[],xc=0,z5=null,H5=0,Nd=[],Ad=0,bx=null,rh=1,sh="";function yx(A,M){z1[xc++]=H5,z1[xc++]=z5,z5=A,H5=M}function MT(A,M,Z){Nd[Ad++]=rh,Nd[Ad++]=sh,Nd[Ad++]=bx,bx=A;var pe=rh;A=sh;var Ie=32-ce(pe)-1;pe&=~(1<<Ie),Z+=1;var Ve=32-ce(M)+Ie;if(30<Ve){var Nt=Ie-Ie%5;Ve=(pe&(1<<Nt)-1).toString(32),pe>>=Nt,Ie-=Nt,rh=1<<32-ce(M)+Ie|Z<<Ie|pe,sh=Ve+A}else rh=1<<Ve|Z<<Ie|pe,sh=A}function P2(A){A.return!==null&&(yx(A,1),MT(A,1,0))}function vx(A){for(;A===z5;)z5=z1[--xc],z1[xc]=null,H5=z1[--xc],z1[xc]=null;for(;A===bx;)bx=Nd[--Ad],Nd[Ad]=null,sh=Nd[--Ad],Nd[Ad]=null,rh=Nd[--Ad],Nd[Ad]=null}var gc=null,Hu=null,Ka=!1,xf=null;function ih(A,M){var Z=Pd(5,null,null,0);Z.elementType="DELETED",Z.stateNode=M,Z.return=A,M=A.deletions,M===null?(A.deletions=[Z],A.flags|=16):M.push(Z)}function V5(A,M){switch(A.tag){case 5:var Z=A.type;return M=M.nodeType!==1||Z.toLowerCase()!==M.nodeName.toLowerCase()?null:M,M!==null?(A.stateNode=M,gc=A,Hu=Pm(M.firstChild),!0):!1;case 6:return M=A.pendingProps===""||M.nodeType!==3?null:M,M!==null?(A.stateNode=M,gc=A,Hu=null,!0):!1;case 13:return M=M.nodeType!==8?null:M,M!==null?(Z=bx!==null?{id:rh,overflow:sh}:null,A.memoizedState={dehydrated:M,treeContext:Z,retryLane:1073741824},Z=Pd(18,null,null,0),Z.stateNode=M,Z.return=A,A.child=Z,gc=A,Hu=null,!0):!1;default:return!1}}function yp(A){return(A.mode&1)!==0&&(A.flags&128)===0}function fu(A){if(Ka){var M=Hu;if(M){var Z=M;if(!V5(A,M)){if(yp(A))throw Error(n(418));M=Pm(Z.nextSibling);var pe=gc;M&&V5(A,M)?ih(pe,Z):(A.flags=A.flags&-4097|2,Ka=!1,gc=A)}}else{if(yp(A))throw Error(n(418));A.flags=A.flags&-4097|2,Ka=!1,gc=A}}}function RT(A){for(A=A.return;A!==null&&A.tag!==5&&A.tag!==3&&A.tag!==13;)A=A.return;gc=A}function F2(A){if(A!==gc)return!1;if(!Ka)return RT(A),Ka=!0,!1;var M;if((M=A.tag!==3)&&!(M=A.tag!==5)&&(M=A.type,M=M!=="head"&&M!=="body"&&!T2(A.type,A.memoizedProps)),M&&(M=Hu)){if(yp(A))throw g8(),Error(n(418));for(;M;)ih(A,M),M=Pm(M.nextSibling)}if(RT(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 Z=A.data;if(Z==="/$"){if(M===0){Hu=Pm(A.nextSibling);break e}M--}else Z!=="$"&&Z!=="$!"&&Z!=="$?"||M++}A=A.nextSibling}Hu=null}}else Hu=gc?Pm(A.stateNode.nextSibling):null;return!0}function g8(){for(var A=Hu;A;)A=Pm(A.nextSibling)}function ah(){Hu=gc=null,Ka=!1}function oh(A){xf===null?xf=[A]:xf.push(A)}var LT=R.ReactCurrentBatchConfig;function O2(A,M,Z){if(A=Z.ref,A!==null&&typeof A!="function"&&typeof A!="object"){if(Z._owner){if(Z=Z._owner,Z){if(Z.tag!==1)throw Error(n(309));var pe=Z.stateNode}if(!pe)throw Error(n(147,A));var Ie=pe,Ve=""+A;return M!==null&&M.ref!==null&&typeof M.ref=="function"&&M.ref._stringRef===Ve?M.ref:(M=function(Nt){var fn=Ie.refs;Nt===null?delete fn[Ve]:fn[Ve]=Nt},M._stringRef=Ve,M)}if(typeof A!="string")throw Error(n(284));if(!Z._owner)throw Error(n(290,A))}return A}function wx(A,M){throw A=Object.prototype.toString.call(M),Error(n(31,A==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":A))}function DT(A){var M=A._init;return M(A._payload)}function b8(A){function M(Jn,Mn){if(A){var sr=Jn.deletions;sr===null?(Jn.deletions=[Mn],Jn.flags|=16):sr.push(Mn)}}function Z(Jn,Mn){if(!A)return null;for(;Mn!==null;)M(Jn,Mn),Mn=Mn.sibling;return null}function pe(Jn,Mn){for(Jn=new Map;Mn!==null;)Mn.key!==null?Jn.set(Mn.key,Mn):Jn.set(Mn.index,Mn),Mn=Mn.sibling;return Jn}function Ie(Jn,Mn){return Jn=Sf(Jn,Mn),Jn.index=0,Jn.sibling=null,Jn}function Ve(Jn,Mn,sr){return Jn.index=sr,A?(sr=Jn.alternate,sr!==null?(sr=sr.index,sr<Mn?(Jn.flags|=2,Mn):sr):(Jn.flags|=2,Mn)):(Jn.flags|=1048576,Mn)}function Nt(Jn){return A&&Jn.alternate===null&&(Jn.flags|=2),Jn}function fn(Jn,Mn,sr,Xr){return Mn===null||Mn.tag!==6?(Mn=s7(sr,Jn.mode,Xr),Mn.return=Jn,Mn):(Mn=Ie(Mn,sr),Mn.return=Jn,Mn)}function _n(Jn,Mn,sr,Xr){var Ps=sr.type;return Ps===L?$r(Jn,Mn,sr.props.children,Xr,sr.key):Mn!==null&&(Mn.elementType===Ps||typeof Ps=="object"&&Ps!==null&&Ps.$$typeof===ie&&DT(Ps)===Mn.type)?(Xr=Ie(Mn,sr.props),Xr.ref=O2(Jn,Mn,sr),Xr.return=Jn,Xr):(Xr=A6(sr.type,sr.key,sr.props,null,Jn.mode,Xr),Xr.ref=O2(Jn,Mn,sr),Xr.return=Jn,Xr)}function lr(Jn,Mn,sr,Xr){return Mn===null||Mn.tag!==4||Mn.stateNode.containerInfo!==sr.containerInfo||Mn.stateNode.implementation!==sr.implementation?(Mn=i7(sr,Jn.mode,Xr),Mn.return=Jn,Mn):(Mn=Ie(Mn,sr.children||[]),Mn.return=Jn,Mn)}function $r(Jn,Mn,sr,Xr,Ps){return Mn===null||Mn.tag!==7?(Mn=Px(sr,Jn.mode,Xr,Ps),Mn.return=Jn,Mn):(Mn=Ie(Mn,sr),Mn.return=Jn,Mn)}function Vr(Jn,Mn,sr){if(typeof Mn=="string"&&Mn!==""||typeof Mn=="number")return Mn=s7(""+Mn,Jn.mode,sr),Mn.return=Jn,Mn;if(typeof Mn=="object"&&Mn!==null){switch(Mn.$$typeof){case O:return sr=A6(Mn.type,Mn.key,Mn.props,null,Jn.mode,sr),sr.ref=O2(Jn,null,Mn),sr.return=Jn,sr;case U:return Mn=i7(Mn,Jn.mode,sr),Mn.return=Jn,Mn;case ie:var Xr=Mn._init;return Vr(Jn,Xr(Mn._payload),sr)}if(Kt(Mn)||V(Mn))return Mn=Px(Mn,Jn.mode,sr,null),Mn.return=Jn,Mn;wx(Jn,Mn)}return null}function Br(Jn,Mn,sr,Xr){var Ps=Mn!==null?Mn.key:null;if(typeof sr=="string"&&sr!==""||typeof sr=="number")return Ps!==null?null:fn(Jn,Mn,""+sr,Xr);if(typeof sr=="object"&&sr!==null){switch(sr.$$typeof){case O:return sr.key===Ps?_n(Jn,Mn,sr,Xr):null;case U:return sr.key===Ps?lr(Jn,Mn,sr,Xr):null;case ie:return Ps=sr._init,Br(Jn,Mn,Ps(sr._payload),Xr)}if(Kt(sr)||V(sr))return Ps!==null?null:$r(Jn,Mn,sr,Xr,null);wx(Jn,sr)}return null}function fs(Jn,Mn,sr,Xr,Ps){if(typeof Xr=="string"&&Xr!==""||typeof Xr=="number")return Jn=Jn.get(sr)||null,fn(Mn,Jn,""+Xr,Ps);if(typeof Xr=="object"&&Xr!==null){switch(Xr.$$typeof){case O:return Jn=Jn.get(Xr.key===null?sr:Xr.key)||null,_n(Mn,Jn,Xr,Ps);case U:return Jn=Jn.get(Xr.key===null?sr:Xr.key)||null,lr(Mn,Jn,Xr,Ps);case ie:var Hs=Xr._init;return fs(Jn,Mn,sr,Hs(Xr._payload),Ps)}if(Kt(Xr)||V(Xr))return Jn=Jn.get(sr)||null,$r(Mn,Jn,Xr,Ps,null);wx(Mn,Xr)}return null}function Ns(Jn,Mn,sr,Xr){for(var Ps=null,Hs=null,Vs=Mn,Xs=Mn=0,fl=null;Vs!==null&&Xs<sr.length;Xs++){Vs.index>Xs?(fl=Vs,Vs=null):fl=Vs.sibling;var aa=Br(Jn,Vs,sr[Xs],Xr);if(aa===null){Vs===null&&(Vs=fl);break}A&&Vs&&aa.alternate===null&&M(Jn,Vs),Mn=Ve(aa,Mn,Xs),Hs===null?Ps=aa:Hs.sibling=aa,Hs=aa,Vs=fl}if(Xs===sr.length)return Z(Jn,Vs),Ka&&yx(Jn,Xs),Ps;if(Vs===null){for(;Xs<sr.length;Xs++)Vs=Vr(Jn,sr[Xs],Xr),Vs!==null&&(Mn=Ve(Vs,Mn,Xs),Hs===null?Ps=Vs:Hs.sibling=Vs,Hs=Vs);return Ka&&yx(Jn,Xs),Ps}for(Vs=pe(Jn,Vs);Xs<sr.length;Xs++)fl=fs(Vs,Jn,Xs,sr[Xs],Xr),fl!==null&&(A&&fl.alternate!==null&&Vs.delete(fl.key===null?Xs:fl.key),Mn=Ve(fl,Mn,Xs),Hs===null?Ps=fl:Hs.sibling=fl,Hs=fl);return A&&Vs.forEach(function(Gm){return M(Jn,Gm)}),Ka&&yx(Jn,Xs),Ps}function Is(Jn,Mn,sr,Xr){var Ps=V(sr);if(typeof Ps!="function")throw Error(n(150));if(sr=Ps.call(sr),sr==null)throw Error(n(151));for(var Hs=Ps=null,Vs=Mn,Xs=Mn=0,fl=null,aa=sr.next();Vs!==null&&!aa.done;Xs++,aa=sr.next()){Vs.index>Xs?(fl=Vs,Vs=null):fl=Vs.sibling;var Gm=Br(Jn,Vs,aa.value,Xr);if(Gm===null){Vs===null&&(Vs=fl);break}A&&Vs&&Gm.alternate===null&&M(Jn,Vs),Mn=Ve(Gm,Mn,Xs),Hs===null?Ps=Gm:Hs.sibling=Gm,Hs=Gm,Vs=fl}if(aa.done)return Z(Jn,Vs),Ka&&yx(Jn,Xs),Ps;if(Vs===null){for(;!aa.done;Xs++,aa=sr.next())aa=Vr(Jn,aa.value,Xr),aa!==null&&(Mn=Ve(aa,Mn,Xs),Hs===null?Ps=aa:Hs.sibling=aa,Hs=aa);return Ka&&yx(Jn,Xs),Ps}for(Vs=pe(Jn,Vs);!aa.done;Xs++,aa=sr.next())aa=fs(Vs,Jn,Xs,aa.value,Xr),aa!==null&&(A&&aa.alternate!==null&&Vs.delete(aa.key===null?Xs:aa.key),Mn=Ve(aa,Mn,Xs),Hs===null?Ps=aa:Hs.sibling=aa,Hs=aa);return A&&Vs.forEach(function(YU){return M(Jn,YU)}),Ka&&yx(Jn,Xs),Ps}function jo(Jn,Mn,sr,Xr){if(typeof sr=="object"&&sr!==null&&sr.type===L&&sr.key===null&&(sr=sr.props.children),typeof sr=="object"&&sr!==null){switch(sr.$$typeof){case O:e:{for(var Ps=sr.key,Hs=Mn;Hs!==null;){if(Hs.key===Ps){if(Ps=sr.type,Ps===L){if(Hs.tag===7){Z(Jn,Hs.sibling),Mn=Ie(Hs,sr.props.children),Mn.return=Jn,Jn=Mn;break e}}else if(Hs.elementType===Ps||typeof Ps=="object"&&Ps!==null&&Ps.$$typeof===ie&&DT(Ps)===Hs.type){Z(Jn,Hs.sibling),Mn=Ie(Hs,sr.props),Mn.ref=O2(Jn,Hs,sr),Mn.return=Jn,Jn=Mn;break e}Z(Jn,Hs);break}else M(Jn,Hs);Hs=Hs.sibling}sr.type===L?(Mn=Px(sr.props.children,Jn.mode,Xr,sr.key),Mn.return=Jn,Jn=Mn):(Xr=A6(sr.type,sr.key,sr.props,null,Jn.mode,Xr),Xr.ref=O2(Jn,Mn,sr),Xr.return=Jn,Jn=Xr)}return Nt(Jn);case U:e:{for(Hs=sr.key;Mn!==null;){if(Mn.key===Hs)if(Mn.tag===4&&Mn.stateNode.containerInfo===sr.containerInfo&&Mn.stateNode.implementation===sr.implementation){Z(Jn,Mn.sibling),Mn=Ie(Mn,sr.children||[]),Mn.return=Jn,Jn=Mn;break e}else{Z(Jn,Mn);break}else M(Jn,Mn);Mn=Mn.sibling}Mn=i7(sr,Jn.mode,Xr),Mn.return=Jn,Jn=Mn}return Nt(Jn);case ie:return Hs=sr._init,jo(Jn,Mn,Hs(sr._payload),Xr)}if(Kt(sr))return Ns(Jn,Mn,sr,Xr);if(V(sr))return Is(Jn,Mn,sr,Xr);wx(Jn,sr)}return typeof sr=="string"&&sr!==""||typeof sr=="number"?(sr=""+sr,Mn!==null&&Mn.tag===6?(Z(Jn,Mn.sibling),Mn=Ie(Mn,sr),Mn.return=Jn,Jn=Mn):(Z(Jn,Mn),Mn=s7(sr,Jn.mode,Xr),Mn.return=Jn,Jn=Mn),Nt(Jn)):Z(Jn,Mn)}return jo}var Ao=b8(!0),W5=b8(!1),M2=cu(null),Vu=null,Rm=null,H1=null;function vp(){H1=Rm=Vu=null}function q5(A){var M=M2.current;Ga(M2),A._currentValue=M}function ql(A,M,Z){for(;A!==null;){var pe=A.alternate;if((A.childLanes&M)!==M?(A.childLanes|=M,pe!==null&&(pe.childLanes|=M)):pe!==null&&(pe.childLanes&M)!==M&&(pe.childLanes|=M),A===Z)break;A=A.return}}function Lm(A,M){Vu=A,H1=Rm=null,A=A.dependencies,A!==null&&A.firstContext!==null&&(A.lanes&M&&(Uc=!0),A.firstContext=null)}function jd(A){var M=A._currentValue;if(H1!==A)if(A={context:A,memoizedValue:M,next:null},Rm===null){if(Vu===null)throw Error(n(308));Rm=A,Vu.dependencies={lanes:0,firstContext:A}}else Rm=Rm.next=A;return M}var Cx=null;function y8(A){Cx===null?Cx=[A]:Cx.push(A)}function G5(A,M,Z,pe){var Ie=M.interleaved;return Ie===null?(Z.next=Z,y8(M)):(Z.next=Ie.next,Ie.next=Z),M.interleaved=Z,wp(A,pe)}function wp(A,M){A.lanes|=M;var Z=A.alternate;for(Z!==null&&(Z.lanes|=M),Z=A,A=A.return;A!==null;)A.childLanes|=M,Z=A.alternate,Z!==null&&(Z.childLanes|=M),Z=A,A=A.return;return Z.tag===3?Z.stateNode:null}var Ed=!1;function K5(A){A.updateQueue={baseState:A.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function BT(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 Cp(A,M){return{eventTime:A,lane:M,tag:0,payload:null,callback:null,next:null}}function _d(A,M,Z){var pe=A.updateQueue;if(pe===null)return null;if(pe=pe.shared,Xi&2){var Ie=pe.pending;return Ie===null?M.next=M:(M.next=Ie.next,Ie.next=M),pe.pending=M,wp(A,Z)}return Ie=pe.interleaved,Ie===null?(M.next=M,y8(pe)):(M.next=Ie.next,Ie.next=M),pe.interleaved=M,wp(A,Z)}function Y5(A,M,Z){if(M=M.updateQueue,M!==null&&(M=M.shared,(Z&4194240)!==0)){var pe=M.lanes;pe&=A.pendingLanes,Z|=pe,M.lanes=Z,ct(A,Z)}}function $T(A,M){var Z=A.updateQueue,pe=A.alternate;if(pe!==null&&(pe=pe.updateQueue,Z===pe)){var Ie=null,Ve=null;if(Z=Z.firstBaseUpdate,Z!==null){do{var Nt={eventTime:Z.eventTime,lane:Z.lane,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null};Ve===null?Ie=Ve=Nt:Ve=Ve.next=Nt,Z=Z.next}while(Z!==null);Ve===null?Ie=Ve=M:Ve=Ve.next=M}else Ie=Ve=M;Z={baseState:pe.baseState,firstBaseUpdate:Ie,lastBaseUpdate:Ve,shared:pe.shared,effects:pe.effects},A.updateQueue=Z;return}A=Z.lastBaseUpdate,A===null?Z.firstBaseUpdate=M:A.next=M,Z.lastBaseUpdate=M}function V1(A,M,Z,pe){var Ie=A.updateQueue;Ed=!1;var Ve=Ie.firstBaseUpdate,Nt=Ie.lastBaseUpdate,fn=Ie.shared.pending;if(fn!==null){Ie.shared.pending=null;var _n=fn,lr=_n.next;_n.next=null,Nt===null?Ve=lr:Nt.next=lr,Nt=_n;var $r=A.alternate;$r!==null&&($r=$r.updateQueue,fn=$r.lastBaseUpdate,fn!==Nt&&(fn===null?$r.firstBaseUpdate=lr:fn.next=lr,$r.lastBaseUpdate=_n))}if(Ve!==null){var Vr=Ie.baseState;Nt=0,$r=lr=_n=null,fn=Ve;do{var Br=fn.lane,fs=fn.eventTime;if((pe&Br)===Br){$r!==null&&($r=$r.next={eventTime:fs,lane:0,tag:fn.tag,payload:fn.payload,callback:fn.callback,next:null});e:{var Ns=A,Is=fn;switch(Br=M,fs=Z,Is.tag){case 1:if(Ns=Is.payload,typeof Ns=="function"){Vr=Ns.call(fs,Vr,Br);break e}Vr=Ns;break e;case 3:Ns.flags=Ns.flags&-65537|128;case 0:if(Ns=Is.payload,Br=typeof Ns=="function"?Ns.call(fs,Vr,Br):Ns,Br==null)break e;Vr=te({},Vr,Br);break e;case 2:Ed=!0}}fn.callback!==null&&fn.lane!==0&&(A.flags|=64,Br=Ie.effects,Br===null?Ie.effects=[fn]:Br.push(fn))}else fs={eventTime:fs,lane:Br,tag:fn.tag,payload:fn.payload,callback:fn.callback,next:null},$r===null?(lr=$r=fs,_n=Vr):$r=$r.next=fs,Nt|=Br;if(fn=fn.next,fn===null){if(fn=Ie.shared.pending,fn===null)break;Br=fn,fn=Br.next,Br.next=null,Ie.lastBaseUpdate=Br,Ie.shared.pending=null}}while(!0);if($r===null&&(_n=Vr),Ie.baseState=_n,Ie.firstBaseUpdate=lr,Ie.lastBaseUpdate=$r,M=Ie.shared.interleaved,M!==null){Ie=M;do Nt|=Ie.lane,Ie=Ie.next;while(Ie!==M)}else Ve===null&&(Ie.shared.lanes=0);zm|=Nt,A.lanes=Nt,A.memoizedState=Vr}}function v8(A,M,Z){if(A=M.effects,M.effects=null,A!==null)for(M=0;M<A.length;M++){var pe=A[M],Ie=pe.callback;if(Ie!==null){if(pe.callback=null,pe=Z,typeof Ie!="function")throw Error(n(191,Ie));Ie.call(pe)}}}var R2={},lh=cu(R2),L2=cu(R2),W1=cu(R2);function Sp(A){if(A===R2)throw Error(n(174));return A}function w8(A,M){switch(Ua(W1,M),Ua(L2,A),Ua(lh,R2),A=M.nodeType,A){case 9:case 11:M=(M=M.documentElement)?M.namespaceURI:Zt(null,"");break;default:A=A===8?M.parentNode:M,M=A.namespaceURI||null,A=A.tagName,M=Zt(M,A)}Ga(lh),Ua(lh,M)}function Dm(){Ga(lh),Ga(L2),Ga(W1)}function C8(A){Sp(W1.current);var M=Sp(lh.current),Z=Zt(M,A.type);M!==Z&&(Ua(L2,A),Ua(lh,Z))}function X5(A){L2.current===A&&(Ga(lh),Ga(L2))}var to=cu(0);function Sx(A){for(var M=A;M!==null;){if(M.tag===13){var Z=M.memoizedState;if(Z!==null&&(Z=Z.dehydrated,Z===null||Z.data==="$?"||Z.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 S8=[];function Q5(){for(var A=0;A<S8.length;A++)S8[A]._workInProgressVersionPrimary=null;S8.length=0}var D2=R.ReactCurrentDispatcher,N8=R.ReactCurrentBatchConfig,Bm=0,ho=null,Do=null,ul=null,q1=!1,B2=!1,Nx=0,Oi=0;function bc(){throw Error(n(321))}function A8(A,M){if(M===null)return!1;for(var Z=0;Z<M.length&&Z<A.length;Z++)if(!Wt(A[Z],M[Z]))return!1;return!0}function Ax(A,M,Z,pe,Ie,Ve){if(Bm=Ve,ho=M,M.memoizedState=null,M.updateQueue=null,M.lanes=0,D2.current=A===null||A.memoizedState===null?PU:s6,A=Z(pe,Ie),B2){Ve=0;do{if(B2=!1,Nx=0,25<=Ve)throw Error(n(301));Ve+=1,ul=Do=null,M.updateQueue=null,D2.current=X1,A=Z(pe,Ie)}while(B2)}if(D2.current=r6,M=Do!==null&&Do.next!==null,Bm=0,ul=Do=ho=null,q1=!1,M)throw Error(n(300));return A}function Z5(){var A=Nx!==0;return Nx=0,A}function ch(){var A={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ul===null?ho.memoizedState=ul=A:ul=ul.next=A,ul}function kd(){if(Do===null){var A=ho.alternate;A=A!==null?A.memoizedState:null}else A=Do.next;var M=ul===null?ho.memoizedState:ul.next;if(M!==null)ul=M,Do=A;else{if(A===null)throw Error(n(310));Do=A,A={memoizedState:Do.memoizedState,baseState:Do.baseState,baseQueue:Do.baseQueue,queue:Do.queue,next:null},ul===null?ho.memoizedState=ul=A:ul=ul.next=A}return ul}function yc(A,M){return typeof M=="function"?M(A):M}function j8(A){var M=kd(),Z=M.queue;if(Z===null)throw Error(n(311));Z.lastRenderedReducer=A;var pe=Do,Ie=pe.baseQueue,Ve=Z.pending;if(Ve!==null){if(Ie!==null){var Nt=Ie.next;Ie.next=Ve.next,Ve.next=Nt}pe.baseQueue=Ie=Ve,Z.pending=null}if(Ie!==null){Ve=Ie.next,pe=pe.baseState;var fn=Nt=null,_n=null,lr=Ve;do{var $r=lr.lane;if((Bm&$r)===$r)_n!==null&&(_n=_n.next={lane:0,action:lr.action,hasEagerState:lr.hasEagerState,eagerState:lr.eagerState,next:null}),pe=lr.hasEagerState?lr.eagerState:A(pe,lr.action);else{var Vr={lane:$r,action:lr.action,hasEagerState:lr.hasEagerState,eagerState:lr.eagerState,next:null};_n===null?(fn=_n=Vr,Nt=pe):_n=_n.next=Vr,ho.lanes|=$r,zm|=$r}lr=lr.next}while(lr!==null&&lr!==Ve);_n===null?Nt=pe:_n.next=fn,Wt(pe,M.memoizedState)||(Uc=!0),M.memoizedState=pe,M.baseState=Nt,M.baseQueue=_n,Z.lastRenderedState=pe}if(A=Z.interleaved,A!==null){Ie=A;do Ve=Ie.lane,ho.lanes|=Ve,zm|=Ve,Ie=Ie.next;while(Ie!==A)}else Ie===null&&(Z.lanes=0);return[M.memoizedState,Z.dispatch]}function G1(A){var M=kd(),Z=M.queue;if(Z===null)throw Error(n(311));Z.lastRenderedReducer=A;var pe=Z.dispatch,Ie=Z.pending,Ve=M.memoizedState;if(Ie!==null){Z.pending=null;var Nt=Ie=Ie.next;do Ve=A(Ve,Nt.action),Nt=Nt.next;while(Nt!==Ie);Wt(Ve,M.memoizedState)||(Uc=!0),M.memoizedState=Ve,M.baseQueue===null&&(M.baseState=Ve),Z.lastRenderedState=Ve}return[Ve,pe]}function J5(){}function E8(A,M){var Z=ho,pe=kd(),Ie=M(),Ve=!Wt(pe.memoizedState,Ie);if(Ve&&(pe.memoizedState=Ie,Uc=!0),pe=pe.queue,uh(Np.bind(null,Z,pe,A),[A]),pe.getSnapshot!==M||Ve||ul!==null&&ul.memoizedState.tag&1){if(Z.flags|=2048,K1(9,hu.bind(null,Z,pe,Ie,M),void 0,null),Tl===null)throw Error(n(349));Bm&30||_8(Z,M,Ie)}return Ie}function _8(A,M,Z){A.flags|=16384,A={getSnapshot:M,value:Z},M=ho.updateQueue,M===null?(M={lastEffect:null,stores:null},ho.updateQueue=M,M.stores=[A]):(Z=M.stores,Z===null?M.stores=[A]:Z.push(A))}function hu(A,M,Z,pe){M.value=Z,M.getSnapshot=pe,e6(M)&&k8(A)}function Np(A,M,Z){return Z(function(){e6(M)&&k8(A)})}function e6(A){var M=A.getSnapshot;A=A.value;try{var Z=M();return!Wt(A,Z)}catch{return!0}}function k8(A){var M=wp(A,1);M!==null&&Cf(M,A,1,-1)}function $2(A){var M=ch();return typeof A=="function"&&(A=A()),M.memoizedState=M.baseState=A,A={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:yc,lastRenderedState:A},M.queue=A,A=A.dispatch=qT.bind(null,ho,A),[M.memoizedState,A]}function K1(A,M,Z,pe){return A={tag:A,create:M,destroy:Z,deps:pe,next:null},M=ho.updateQueue,M===null?(M={lastEffect:null,stores:null},ho.updateQueue=M,M.lastEffect=A.next=A):(Z=M.lastEffect,Z===null?M.lastEffect=A.next=A:(pe=Z.next,Z.next=A,A.next=pe,M.lastEffect=A)),A}function t6(){return kd().memoizedState}function U2(A,M,Z,pe){var Ie=ch();ho.flags|=A,Ie.memoizedState=K1(1|M,Z,void 0,pe===void 0?null:pe)}function Y1(A,M,Z,pe){var Ie=kd();pe=pe===void 0?null:pe;var Ve=void 0;if(Do!==null){var Nt=Do.memoizedState;if(Ve=Nt.destroy,pe!==null&&A8(pe,Nt.deps)){Ie.memoizedState=K1(M,Z,Ve,pe);return}}ho.flags|=A,Ie.memoizedState=K1(1|M,Z,Ve,pe)}function n6(A,M){return U2(8390656,8,A,M)}function uh(A,M){return Y1(2048,8,A,M)}function UT(A,M){return Y1(4,2,A,M)}function Ap(A,M){return Y1(4,4,A,M)}function T8(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 I8(A,M,Z){return Z=Z!=null?Z.concat([A]):null,Y1(4,4,T8.bind(null,M,A),Z)}function z2(){}function zT(A,M){var Z=kd();M=M===void 0?null:M;var pe=Z.memoizedState;return pe!==null&&M!==null&&A8(M,pe[1])?pe[0]:(Z.memoizedState=[A,M],A)}function HT(A,M){var Z=kd();M=M===void 0?null:M;var pe=Z.memoizedState;return pe!==null&&M!==null&&A8(M,pe[1])?pe[0]:(A=A(),Z.memoizedState=[A,M],A)}function VT(A,M,Z){return Bm&21?(Wt(Z,M)||(Z=Ue(),ho.lanes|=Z,zm|=Z,A.baseState=!0),M):(A.baseState&&(A.baseState=!1,Uc=!0),A.memoizedState=Z)}function WT(A,M){var Z=yt;yt=Z!==0&&4>Z?Z:4,A(!0);var pe=N8.transition;N8.transition={};try{A(!1),M()}finally{yt=Z,N8.transition=pe}}function P8(){return kd().memoizedState}function IU(A,M,Z){var pe=Wm(A);if(Z={lane:pe,action:Z,hasEagerState:!1,eagerState:null,next:null},F8(A))$c(M,Z);else if(Z=G5(A,M,Z,pe),Z!==null){var Ie=Vc();Cf(Z,A,pe,Ie),gf(Z,M,pe)}}function qT(A,M,Z){var pe=Wm(A),Ie={lane:pe,action:Z,hasEagerState:!1,eagerState:null,next:null};if(F8(A))$c(M,Ie);else{var Ve=A.alternate;if(A.lanes===0&&(Ve===null||Ve.lanes===0)&&(Ve=M.lastRenderedReducer,Ve!==null))try{var Nt=M.lastRenderedState,fn=Ve(Nt,Z);if(Ie.hasEagerState=!0,Ie.eagerState=fn,Wt(fn,Nt)){var _n=M.interleaved;_n===null?(Ie.next=Ie,y8(M)):(Ie.next=_n.next,_n.next=Ie),M.interleaved=Ie;return}}catch{}finally{}Z=G5(A,M,Ie,pe),Z!==null&&(Ie=Vc(),Cf(Z,A,pe,Ie),gf(Z,M,pe))}}function F8(A){var M=A.alternate;return A===ho||M!==null&&M===ho}function $c(A,M){B2=q1=!0;var Z=A.pending;Z===null?M.next=M:(M.next=Z.next,Z.next=M),A.pending=M}function gf(A,M,Z){if(Z&4194240){var pe=M.lanes;pe&=A.pendingLanes,Z|=pe,M.lanes=Z,ct(A,Z)}}var r6={readContext:jd,useCallback:bc,useContext:bc,useEffect:bc,useImperativeHandle:bc,useInsertionEffect:bc,useLayoutEffect:bc,useMemo:bc,useReducer:bc,useRef:bc,useState:bc,useDebugValue:bc,useDeferredValue:bc,useTransition:bc,useMutableSource:bc,useSyncExternalStore:bc,useId:bc,unstable_isNewReconciler:!1},PU={readContext:jd,useCallback:function(A,M){return ch().memoizedState=[A,M===void 0?null:M],A},useContext:jd,useEffect:n6,useImperativeHandle:function(A,M,Z){return Z=Z!=null?Z.concat([A]):null,U2(4194308,4,T8.bind(null,M,A),Z)},useLayoutEffect:function(A,M){return U2(4194308,4,A,M)},useInsertionEffect:function(A,M){return U2(4,2,A,M)},useMemo:function(A,M){var Z=ch();return M=M===void 0?null:M,A=A(),Z.memoizedState=[A,M],A},useReducer:function(A,M,Z){var pe=ch();return M=Z!==void 0?Z(M):M,pe.memoizedState=pe.baseState=M,A={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:A,lastRenderedState:M},pe.queue=A,A=A.dispatch=IU.bind(null,ho,A),[pe.memoizedState,A]},useRef:function(A){var M=ch();return A={current:A},M.memoizedState=A},useState:$2,useDebugValue:z2,useDeferredValue:function(A){return ch().memoizedState=A},useTransition:function(){var A=$2(!1),M=A[0];return A=WT.bind(null,A[1]),ch().memoizedState=A,[M,A]},useMutableSource:function(){},useSyncExternalStore:function(A,M,Z){var pe=ho,Ie=ch();if(Ka){if(Z===void 0)throw Error(n(407));Z=Z()}else{if(Z=M(),Tl===null)throw Error(n(349));Bm&30||_8(pe,M,Z)}Ie.memoizedState=Z;var Ve={value:Z,getSnapshot:M};return Ie.queue=Ve,n6(Np.bind(null,pe,Ve,A),[A]),pe.flags|=2048,K1(9,hu.bind(null,pe,Ve,Z,M),void 0,null),Z},useId:function(){var A=ch(),M=Tl.identifierPrefix;if(Ka){var Z=sh,pe=rh;Z=(pe&~(1<<32-ce(pe)-1)).toString(32)+Z,M=":"+M+"R"+Z,Z=Nx++,0<Z&&(M+="H"+Z.toString(32)),M+=":"}else Z=Oi++,M=":"+M+"r"+Z.toString(32)+":";return A.memoizedState=M},unstable_isNewReconciler:!1},s6={readContext:jd,useCallback:zT,useContext:jd,useEffect:uh,useImperativeHandle:I8,useInsertionEffect:UT,useLayoutEffect:Ap,useMemo:HT,useReducer:j8,useRef:t6,useState:function(){return j8(yc)},useDebugValue:z2,useDeferredValue:function(A){var M=kd();return VT(M,Do.memoizedState,A)},useTransition:function(){var A=j8(yc)[0],M=kd().memoizedState;return[A,M]},useMutableSource:J5,useSyncExternalStore:E8,useId:P8,unstable_isNewReconciler:!1},X1={readContext:jd,useCallback:zT,useContext:jd,useEffect:uh,useImperativeHandle:I8,useInsertionEffect:UT,useLayoutEffect:Ap,useMemo:HT,useReducer:G1,useRef:t6,useState:function(){return G1(yc)},useDebugValue:z2,useDeferredValue:function(A){var M=kd();return Do===null?M.memoizedState=A:VT(M,Do.memoizedState,A)},useTransition:function(){var A=G1(yc)[0],M=kd().memoizedState;return[A,M]},useMutableSource:J5,useSyncExternalStore:E8,useId:P8,unstable_isNewReconciler:!1};function Td(A,M){if(A&&A.defaultProps){M=te({},M),A=A.defaultProps;for(var Z in A)M[Z]===void 0&&(M[Z]=A[Z]);return M}return M}function i6(A,M,Z,pe){M=A.memoizedState,Z=Z(pe,M),Z=Z==null?M:te({},M,Z),A.memoizedState=Z,A.lanes===0&&(A.updateQueue.baseState=Z)}var a6={isMounted:function(A){return(A=A._reactInternals)?en(A)===A:!1},enqueueSetState:function(A,M,Z){A=A._reactInternals;var pe=Vc(),Ie=Wm(A),Ve=Cp(pe,Ie);Ve.payload=M,Z!=null&&(Ve.callback=Z),M=_d(A,Ve,Ie),M!==null&&(Cf(M,A,Ie,pe),Y5(M,A,Ie))},enqueueReplaceState:function(A,M,Z){A=A._reactInternals;var pe=Vc(),Ie=Wm(A),Ve=Cp(pe,Ie);Ve.tag=1,Ve.payload=M,Z!=null&&(Ve.callback=Z),M=_d(A,Ve,Ie),M!==null&&(Cf(M,A,Ie,pe),Y5(M,A,Ie))},enqueueForceUpdate:function(A,M){A=A._reactInternals;var Z=Vc(),pe=Wm(A),Ie=Cp(Z,pe);Ie.tag=2,M!=null&&(Ie.callback=M),M=_d(A,Ie,pe),M!==null&&(Cf(M,A,pe,Z),Y5(M,A,pe))}};function O8(A,M,Z,pe,Ie,Ve,Nt){return A=A.stateNode,typeof A.shouldComponentUpdate=="function"?A.shouldComponentUpdate(pe,Ve,Nt):M.prototype&&M.prototype.isPureReactComponent?!jn(Z,pe)||!jn(Ie,Ve):!0}function jx(A,M,Z){var pe=!1,Ie=Om,Ve=M.contextType;return typeof Ve=="object"&&Ve!==null?Ve=jd(Ve):(Ie=du(M)?Bc:mc.current,pe=M.contextTypes,Ve=(pe=pe!=null)?U1(A,Ie):Om),M=new M(Z,Ve),A.memoizedState=M.state!==null&&M.state!==void 0?M.state:null,M.updater=a6,A.stateNode=M,M._reactInternals=A,pe&&(A=A.stateNode,A.__reactInternalMemoizedUnmaskedChildContext=Ie,A.__reactInternalMemoizedMaskedChildContext=Ve),M}function Q1(A,M,Z,pe){A=M.state,typeof M.componentWillReceiveProps=="function"&&M.componentWillReceiveProps(Z,pe),typeof M.UNSAFE_componentWillReceiveProps=="function"&&M.UNSAFE_componentWillReceiveProps(Z,pe),M.state!==A&&a6.enqueueReplaceState(M,M.state,null)}function M8(A,M,Z,pe){var Ie=A.stateNode;Ie.props=Z,Ie.state=A.memoizedState,Ie.refs={},K5(A);var Ve=M.contextType;typeof Ve=="object"&&Ve!==null?Ie.context=jd(Ve):(Ve=du(M)?Bc:mc.current,Ie.context=U1(A,Ve)),Ie.state=A.memoizedState,Ve=M.getDerivedStateFromProps,typeof Ve=="function"&&(i6(A,M,Ve,Z),Ie.state=A.memoizedState),typeof M.getDerivedStateFromProps=="function"||typeof Ie.getSnapshotBeforeUpdate=="function"||typeof Ie.UNSAFE_componentWillMount!="function"&&typeof Ie.componentWillMount!="function"||(M=Ie.state,typeof Ie.componentWillMount=="function"&&Ie.componentWillMount(),typeof Ie.UNSAFE_componentWillMount=="function"&&Ie.UNSAFE_componentWillMount(),M!==Ie.state&&a6.enqueueReplaceState(Ie,Ie.state,null),V1(A,Z,Ie,pe),Ie.state=A.memoizedState),typeof Ie.componentDidMount=="function"&&(A.flags|=4194308)}function Ex(A,M){try{var Z="",pe=M;do Z+=we(pe),pe=pe.return;while(pe);var Ie=Z}catch(Ve){Ie=`
Error generating stack: `+Ve.message+`
`+Ve.stack}return{value:A,source:M,stack:Ie,digest:null}}function o6(A,M,Z){return{value:A,source:null,stack:Z??null,digest:M??null}}function Z1(A,M){try{console.error(M.value)}catch(Z){setTimeout(function(){throw Z})}}var GT=typeof WeakMap=="function"?WeakMap:Map;function H2(A,M,Z){Z=Cp(-1,Z),Z.tag=3,Z.payload={element:null};var pe=M.value;return Z.callback=function(){b6||(b6=!0,Q8=pe),Z1(A,M)},Z}function l6(A,M,Z){Z=Cp(-1,Z),Z.tag=3;var pe=A.type.getDerivedStateFromError;if(typeof pe=="function"){var Ie=M.value;Z.payload=function(){return pe(Ie)},Z.callback=function(){Z1(A,M)}}var Ve=A.stateNode;return Ve!==null&&typeof Ve.componentDidCatch=="function"&&(Z.callback=function(){Z1(A,M),typeof pe!="function"&&(Hm===null?Hm=new Set([this]):Hm.add(this));var Nt=M.stack;this.componentDidCatch(M.value,{componentStack:Nt!==null?Nt:""})}),Z}function V2(A,M,Z){var pe=A.pingCache;if(pe===null){pe=A.pingCache=new GT;var Ie=new Set;pe.set(M,Ie)}else Ie=pe.get(M),Ie===void 0&&(Ie=new Set,pe.set(M,Ie));Ie.has(Z)||(Ie.add(Z),A=$U.bind(null,A,M,Z),M.then(A,A))}function KT(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 R8(A,M,Z,pe,Ie){return A.mode&1?(A.flags|=65536,A.lanes=Ie,A):(A===M?A.flags|=65536:(A.flags|=128,Z.flags|=131072,Z.flags&=-52805,Z.tag===1&&(Z.alternate===null?Z.tag=17:(M=Cp(-1,1),M.tag=2,_d(Z,M,1))),Z.lanes|=1),A)}var c6=R.ReactCurrentOwner,Uc=!1;function Gl(A,M,Z,pe){M.child=A===null?W5(M,null,Z,pe):Ao(M,A.child,Z,pe)}function YT(A,M,Z,pe,Ie){Z=Z.render;var Ve=M.ref;return Lm(M,Ie),pe=Ax(A,M,Z,pe,Ve,Ie),Z=Z5(),A!==null&&!Uc?(M.updateQueue=A.updateQueue,M.flags&=-2053,A.lanes&=~Ie,bf(A,M,Ie)):(Ka&&Z&&P2(M),M.flags|=1,Gl(A,M,pe,Ie),M.child)}function L8(A,M,Z,pe,Ie){if(A===null){var Ve=Z.type;return typeof Ve=="function"&&!N6(Ve)&&Ve.defaultProps===void 0&&Z.compare===null&&Z.defaultProps===void 0?(M.tag=15,M.type=Ve,dh(A,M,Ve,pe,Ie)):(A=A6(Z.type,null,pe,M,M.mode,Ie),A.ref=M.ref,A.return=M,M.child=A)}if(Ve=A.child,!(A.lanes&Ie)){var Nt=Ve.memoizedProps;if(Z=Z.compare,Z=Z!==null?Z:jn,Z(Nt,pe)&&A.ref===M.ref)return bf(A,M,Ie)}return M.flags|=1,A=Sf(Ve,pe),A.ref=M.ref,A.return=M,M.child=A}function dh(A,M,Z,pe,Ie){if(A!==null){var Ve=A.memoizedProps;if(jn(Ve,pe)&&A.ref===M.ref)if(Uc=!1,M.pendingProps=pe=Ve,(A.lanes&Ie)!==0)A.flags&131072&&(Uc=!0);else return M.lanes=A.lanes,bf(A,M,Ie)}return $8(A,M,Z,pe,Ie)}function D8(A,M,Z){var pe=M.pendingProps,Ie=pe.children,Ve=A!==null?A.memoizedState:null;if(pe.mode==="hidden")if(!(M.mode&1))M.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ua(nb,qu),qu|=Z;else{if(!(Z&1073741824))return A=Ve!==null?Ve.baseLanes|Z:Z,M.lanes=M.childLanes=1073741824,M.memoizedState={baseLanes:A,cachePool:null,transitions:null},M.updateQueue=null,Ua(nb,qu),qu|=A,null;M.memoizedState={baseLanes:0,cachePool:null,transitions:null},pe=Ve!==null?Ve.baseLanes:Z,Ua(nb,qu),qu|=pe}else Ve!==null?(pe=Ve.baseLanes|Z,M.memoizedState=null):pe=Z,Ua(nb,qu),qu|=pe;return Gl(A,M,Ie,Z),M.child}function B8(A,M){var Z=M.ref;(A===null&&Z!==null||A!==null&&A.ref!==Z)&&(M.flags|=512,M.flags|=2097152)}function $8(A,M,Z,pe,Ie){var Ve=du(Z)?Bc:mc.current;return Ve=U1(M,Ve),Lm(M,Ie),Z=Ax(A,M,Z,pe,Ve,Ie),pe=Z5(),A!==null&&!Uc?(M.updateQueue=A.updateQueue,M.flags&=-2053,A.lanes&=~Ie,bf(A,M,Ie)):(Ka&&pe&&P2(M),M.flags|=1,Gl(A,M,Z,Ie),M.child)}function U8(A,M,Z,pe,Ie){if(du(Z)){var Ve=!0;Sd(M)}else Ve=!1;if(Lm(M,Ie),M.stateNode===null)d6(A,M),jx(M,Z,pe),M8(M,Z,pe,Ie),pe=!0;else if(A===null){var Nt=M.stateNode,fn=M.memoizedProps;Nt.props=fn;var _n=Nt.context,lr=Z.contextType;typeof lr=="object"&&lr!==null?lr=jd(lr):(lr=du(Z)?Bc:mc.current,lr=U1(M,lr));var $r=Z.getDerivedStateFromProps,Vr=typeof $r=="function"||typeof Nt.getSnapshotBeforeUpdate=="function";Vr||typeof Nt.UNSAFE_componentWillReceiveProps!="function"&&typeof Nt.componentWillReceiveProps!="function"||(fn!==pe||_n!==lr)&&Q1(M,Nt,pe,lr),Ed=!1;var Br=M.memoizedState;Nt.state=Br,V1(M,pe,Nt,Ie),_n=M.memoizedState,fn!==pe||Br!==_n||uu.current||Ed?(typeof $r=="function"&&(i6(M,Z,$r,pe),_n=M.memoizedState),(fn=Ed||O8(M,Z,fn,pe,Br,_n,lr))?(Vr||typeof Nt.UNSAFE_componentWillMount!="function"&&typeof Nt.componentWillMount!="function"||(typeof Nt.componentWillMount=="function"&&Nt.componentWillMount(),typeof Nt.UNSAFE_componentWillMount=="function"&&Nt.UNSAFE_componentWillMount()),typeof Nt.componentDidMount=="function"&&(M.flags|=4194308)):(typeof Nt.componentDidMount=="function"&&(M.flags|=4194308),M.memoizedProps=pe,M.memoizedState=_n),Nt.props=pe,Nt.state=_n,Nt.context=lr,pe=fn):(typeof Nt.componentDidMount=="function"&&(M.flags|=4194308),pe=!1)}else{Nt=M.stateNode,BT(A,M),fn=M.memoizedProps,lr=M.type===M.elementType?fn:Td(M.type,fn),Nt.props=lr,Vr=M.pendingProps,Br=Nt.context,_n=Z.contextType,typeof _n=="object"&&_n!==null?_n=jd(_n):(_n=du(Z)?Bc:mc.current,_n=U1(M,_n));var fs=Z.getDerivedStateFromProps;($r=typeof fs=="function"||typeof Nt.getSnapshotBeforeUpdate=="function")||typeof Nt.UNSAFE_componentWillReceiveProps!="function"&&typeof Nt.componentWillReceiveProps!="function"||(fn!==Vr||Br!==_n)&&Q1(M,Nt,pe,_n),Ed=!1,Br=M.memoizedState,Nt.state=Br,V1(M,pe,Nt,Ie);var Ns=M.memoizedState;fn!==Vr||Br!==Ns||uu.current||Ed?(typeof fs=="function"&&(i6(M,Z,fs,pe),Ns=M.memoizedState),(lr=Ed||O8(M,Z,lr,pe,Br,Ns,_n)||!1)?($r||typeof Nt.UNSAFE_componentWillUpdate!="function"&&typeof Nt.componentWillUpdate!="function"||(typeof Nt.componentWillUpdate=="function"&&Nt.componentWillUpdate(pe,Ns,_n),typeof Nt.UNSAFE_componentWillUpdate=="function"&&Nt.UNSAFE_componentWillUpdate(pe,Ns,_n)),typeof Nt.componentDidUpdate=="function"&&(M.flags|=4),typeof Nt.getSnapshotBeforeUpdate=="function"&&(M.flags|=1024)):(typeof Nt.componentDidUpdate!="function"||fn===A.memoizedProps&&Br===A.memoizedState||(M.flags|=4),typeof Nt.getSnapshotBeforeUpdate!="function"||fn===A.memoizedProps&&Br===A.memoizedState||(M.flags|=1024),M.memoizedProps=pe,M.memoizedState=Ns),Nt.props=pe,Nt.state=Ns,Nt.context=_n,pe=lr):(typeof Nt.componentDidUpdate!="function"||fn===A.memoizedProps&&Br===A.memoizedState||(M.flags|=4),typeof Nt.getSnapshotBeforeUpdate!="function"||fn===A.memoizedProps&&Br===A.memoizedState||(M.flags|=1024),pe=!1)}return z8(A,M,Z,pe,Ve,Ie)}function z8(A,M,Z,pe,Ie,Ve){B8(A,M);var Nt=(M.flags&128)!==0;if(!pe&&!Nt)return Ie&&FT(M,Z,!1),bf(A,M,Ve);pe=M.stateNode,c6.current=M;var fn=Nt&&typeof Z.getDerivedStateFromError!="function"?null:pe.render();return M.flags|=1,A!==null&&Nt?(M.child=Ao(M,A.child,null,Ve),M.child=Ao(M,null,fn,Ve)):Gl(A,M,fn,Ve),M.memoizedState=pe.state,Ie&&FT(M,Z,!0),M.child}function XT(A){var M=A.stateNode;M.pendingContext?IT(A,M.pendingContext,M.pendingContext!==M.context):M.context&&IT(A,M.context,!1),w8(A,M.containerInfo)}function fh(A,M,Z,pe,Ie){return ah(),oh(Ie),M.flags|=256,Gl(A,M,Z,pe),M.child}var W2={dehydrated:null,treeContext:null,retryLane:0};function q2(A){return{baseLanes:A,cachePool:null,transitions:null}}function u6(A,M,Z){var pe=M.pendingProps,Ie=to.current,Ve=!1,Nt=(M.flags&128)!==0,fn;if((fn=Nt)||(fn=A!==null&&A.memoizedState===null?!1:(Ie&2)!==0),fn?(Ve=!0,M.flags&=-129):(A===null||A.memoizedState!==null)&&(Ie|=1),Ua(to,Ie&1),A===null)return fu(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):(Nt=pe.children,A=pe.fallback,Ve?(pe=M.mode,Ve=M.child,Nt={mode:"hidden",children:Nt},!(pe&1)&&Ve!==null?(Ve.childLanes=0,Ve.pendingProps=Nt):Ve=j6(Nt,pe,0,null),A=Px(A,pe,Z,null),Ve.return=M,A.return=M,Ve.sibling=A,M.child=Ve,M.child.memoizedState=q2(Z),M.memoizedState=W2,A):J1(M,Nt));if(Ie=A.memoizedState,Ie!==null&&(fn=Ie.dehydrated,fn!==null))return qs(A,M,Nt,pe,fn,Ie,Z);if(Ve){Ve=pe.fallback,Nt=M.mode,Ie=A.child,fn=Ie.sibling;var _n={mode:"hidden",children:pe.children};return!(Nt&1)&&M.child!==Ie?(pe=M.child,pe.childLanes=0,pe.pendingProps=_n,M.deletions=null):(pe=Sf(Ie,_n),pe.subtreeFlags=Ie.subtreeFlags&14680064),fn!==null?Ve=Sf(fn,Ve):(Ve=Px(Ve,Nt,Z,null),Ve.flags|=2),Ve.return=M,pe.return=M,pe.sibling=Ve,M.child=pe,pe=Ve,Ve=M.child,Nt=A.child.memoizedState,Nt=Nt===null?q2(Z):{baseLanes:Nt.baseLanes|Z,cachePool:null,transitions:Nt.transitions},Ve.memoizedState=Nt,Ve.childLanes=A.childLanes&~Z,M.memoizedState=W2,pe}return Ve=A.child,A=Ve.sibling,pe=Sf(Ve,{mode:"visible",children:pe.children}),!(M.mode&1)&&(pe.lanes=Z),pe.return=M,pe.sibling=null,A!==null&&(Z=M.deletions,Z===null?(M.deletions=[A],M.flags|=16):Z.push(A)),M.child=pe,M.memoizedState=null,pe}function J1(A,M){return M=j6({mode:"visible",children:M},A.mode,0,null),M.return=A,A.child=M}function jp(A,M,Z,pe){return pe!==null&&oh(pe),Ao(M,A.child,null,Z),A=J1(M,M.pendingProps.children),A.flags|=2,M.memoizedState=null,A}function qs(A,M,Z,pe,Ie,Ve,Nt){if(Z)return M.flags&256?(M.flags&=-257,pe=o6(Error(n(422))),jp(A,M,Nt,pe)):M.memoizedState!==null?(M.child=A.child,M.flags|=128,null):(Ve=pe.fallback,Ie=M.mode,pe=j6({mode:"visible",children:pe.children},Ie,0,null),Ve=Px(Ve,Ie,Nt,null),Ve.flags|=2,pe.return=M,Ve.return=M,pe.sibling=Ve,M.child=pe,M.mode&1&&Ao(M,A.child,null,Nt),M.child.memoizedState=q2(Nt),M.memoizedState=W2,Ve);if(!(M.mode&1))return jp(A,M,Nt,null);if(Ie.data==="$!"){if(pe=Ie.nextSibling&&Ie.nextSibling.dataset,pe)var fn=pe.dgst;return pe=fn,Ve=Error(n(419)),pe=o6(Ve,pe,void 0),jp(A,M,Nt,pe)}if(fn=(Nt&A.childLanes)!==0,Uc||fn){if(pe=Tl,pe!==null){switch(Nt&-Nt){case 4:Ie=2;break;case 16:Ie=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:Ie=32;break;case 536870912:Ie=268435456;break;default:Ie=0}Ie=Ie&(pe.suspendedLanes|Nt)?0:Ie,Ie!==0&&Ie!==Ve.retryLane&&(Ve.retryLane=Ie,wp(A,Ie),Cf(pe,A,Ie,-1))}return r7(),pe=o6(Error(n(421))),jp(A,M,Nt,pe)}return Ie.data==="$?"?(M.flags|=128,M.child=A.child,M=UU.bind(null,A),Ie._reactRetry=M,null):(A=Ve.treeContext,Hu=Pm(Ie.nextSibling),gc=M,Ka=!0,xf=null,A!==null&&(Nd[Ad++]=rh,Nd[Ad++]=sh,Nd[Ad++]=bx,rh=A.id,sh=A.overflow,bx=M),M=J1(M,pe.children),M.flags|=4096,M)}function G2(A,M,Z){A.lanes|=M;var pe=A.alternate;pe!==null&&(pe.lanes|=M),ql(A.return,M,Z)}function K2(A,M,Z,pe,Ie){var Ve=A.memoizedState;Ve===null?A.memoizedState={isBackwards:M,rendering:null,renderingStartTime:0,last:pe,tail:Z,tailMode:Ie}:(Ve.isBackwards=M,Ve.rendering=null,Ve.renderingStartTime=0,Ve.last=pe,Ve.tail=Z,Ve.tailMode=Ie)}function $m(A,M,Z){var pe=M.pendingProps,Ie=pe.revealOrder,Ve=pe.tail;if(Gl(A,M,pe.children,Z),pe=to.current,pe&2)pe=pe&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&&G2(A,Z,M);else if(A.tag===19)G2(A,Z,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}pe&=1}if(Ua(to,pe),!(M.mode&1))M.memoizedState=null;else switch(Ie){case"forwards":for(Z=M.child,Ie=null;Z!==null;)A=Z.alternate,A!==null&&Sx(A)===null&&(Ie=Z),Z=Z.sibling;Z=Ie,Z===null?(Ie=M.child,M.child=null):(Ie=Z.sibling,Z.sibling=null),K2(M,!1,Ie,Z,Ve);break;case"backwards":for(Z=null,Ie=M.child,M.child=null;Ie!==null;){if(A=Ie.alternate,A!==null&&Sx(A)===null){M.child=Ie;break}A=Ie.sibling,Ie.sibling=Z,Z=Ie,Ie=A}K2(M,!0,Z,null,Ve);break;case"together":K2(M,!1,null,null,void 0);break;default:M.memoizedState=null}return M.child}function d6(A,M){!(M.mode&1)&&A!==null&&(A.alternate=null,M.alternate=null,M.flags|=2)}function bf(A,M,Z){if(A!==null&&(M.dependencies=A.dependencies),zm|=M.lanes,!(Z&M.childLanes))return null;if(A!==null&&M.child!==A.child)throw Error(n(153));if(M.child!==null){for(A=M.child,Z=Sf(A,A.pendingProps),M.child=Z,Z.return=M;A.sibling!==null;)A=A.sibling,Z=Z.sibling=Sf(A,A.pendingProps),Z.return=M;Z.sibling=null}return M.child}function QT(A,M,Z){switch(M.tag){case 3:XT(M),ah();break;case 5:C8(M);break;case 1:du(M.type)&&Sd(M);break;case 4:w8(M,M.stateNode.containerInfo);break;case 10:var pe=M.type._context,Ie=M.memoizedProps.value;Ua(M2,pe._currentValue),pe._currentValue=Ie;break;case 13:if(pe=M.memoizedState,pe!==null)return pe.dehydrated!==null?(Ua(to,to.current&1),M.flags|=128,null):Z&M.child.childLanes?u6(A,M,Z):(Ua(to,to.current&1),A=bf(A,M,Z),A!==null?A.sibling:null);Ua(to,to.current&1);break;case 19:if(pe=(Z&M.childLanes)!==0,A.flags&128){if(pe)return $m(A,M,Z);M.flags|=128}if(Ie=M.memoizedState,Ie!==null&&(Ie.rendering=null,Ie.tail=null,Ie.lastEffect=null),Ua(to,to.current),pe)break;return null;case 22:case 23:return M.lanes=0,D8(A,M,Z)}return bf(A,M,Z)}var Kl,H8,ZT,V8;Kl=function(A,M){for(var Z=M.child;Z!==null;){if(Z.tag===5||Z.tag===6)A.appendChild(Z.stateNode);else if(Z.tag!==4&&Z.child!==null){Z.child.return=Z,Z=Z.child;continue}if(Z===M)break;for(;Z.sibling===null;){if(Z.return===null||Z.return===M)return;Z=Z.return}Z.sibling.return=Z.return,Z=Z.sibling}},H8=function(){},ZT=function(A,M,Z,pe){var Ie=A.memoizedProps;if(Ie!==pe){A=M.stateNode,Sp(lh.current);var Ve=null;switch(Z){case"input":Ie=et(A,Ie),pe=et(A,pe),Ve=[];break;case"select":Ie=te({},Ie,{value:void 0}),pe=te({},pe,{value:void 0}),Ve=[];break;case"textarea":Ie=nn(A,Ie),pe=nn(A,pe),Ve=[];break;default:typeof Ie.onClick!="function"&&typeof pe.onClick=="function"&&(A.onclick=R5)}_t(Z,pe);var Nt;Z=null;for(lr in Ie)if(!pe.hasOwnProperty(lr)&&Ie.hasOwnProperty(lr)&&Ie[lr]!=null)if(lr==="style"){var fn=Ie[lr];for(Nt in fn)fn.hasOwnProperty(Nt)&&(Z||(Z={}),Z[Nt]="")}else lr!=="dangerouslySetInnerHTML"&&lr!=="children"&&lr!=="suppressContentEditableWarning"&&lr!=="suppressHydrationWarning"&&lr!=="autoFocus"&&(s.hasOwnProperty(lr)?Ve||(Ve=[]):(Ve=Ve||[]).push(lr,null));for(lr in pe){var _n=pe[lr];if(fn=Ie!=null?Ie[lr]:void 0,pe.hasOwnProperty(lr)&&_n!==fn&&(_n!=null||fn!=null))if(lr==="style")if(fn){for(Nt in fn)!fn.hasOwnProperty(Nt)||_n&&_n.hasOwnProperty(Nt)||(Z||(Z={}),Z[Nt]="");for(Nt in _n)_n.hasOwnProperty(Nt)&&fn[Nt]!==_n[Nt]&&(Z||(Z={}),Z[Nt]=_n[Nt])}else Z||(Ve||(Ve=[]),Ve.push(lr,Z)),Z=_n;else lr==="dangerouslySetInnerHTML"?(_n=_n?_n.__html:void 0,fn=fn?fn.__html:void 0,_n!=null&&fn!==_n&&(Ve=Ve||[]).push(lr,_n)):lr==="children"?typeof _n!="string"&&typeof _n!="number"||(Ve=Ve||[]).push(lr,""+_n):lr!=="suppressContentEditableWarning"&&lr!=="suppressHydrationWarning"&&(s.hasOwnProperty(lr)?(_n!=null&&lr==="onScroll"&&qa("scroll",A),Ve||fn===_n||(Ve=[])):(Ve=Ve||[]).push(lr,_n))}Z&&(Ve=Ve||[]).push("style",Z);var lr=Ve;(M.updateQueue=lr)&&(M.flags|=4)}},V8=function(A,M,Z,pe){Z!==pe&&(M.flags|=4)};function Y2(A,M){if(!Ka)switch(A.tailMode){case"hidden":M=A.tail;for(var Z=null;M!==null;)M.alternate!==null&&(Z=M),M=M.sibling;Z===null?A.tail=null:Z.sibling=null;break;case"collapsed":Z=A.tail;for(var pe=null;Z!==null;)Z.alternate!==null&&(pe=Z),Z=Z.sibling;pe===null?M||A.tail===null?A.tail=null:A.tail.sibling=null:pe.sibling=null}}function Yl(A){var M=A.alternate!==null&&A.alternate.child===A.child,Z=0,pe=0;if(M)for(var Ie=A.child;Ie!==null;)Z|=Ie.lanes|Ie.childLanes,pe|=Ie.subtreeFlags&14680064,pe|=Ie.flags&14680064,Ie.return=A,Ie=Ie.sibling;else for(Ie=A.child;Ie!==null;)Z|=Ie.lanes|Ie.childLanes,pe|=Ie.subtreeFlags,pe|=Ie.flags,Ie.return=A,Ie=Ie.sibling;return A.subtreeFlags|=pe,A.childLanes=Z,M}function FU(A,M,Z){var pe=M.pendingProps;switch(vx(M),M.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Yl(M),null;case 1:return du(M.type)&&$5(),Yl(M),null;case 3:return pe=M.stateNode,Dm(),Ga(uu),Ga(mc),Q5(),pe.pendingContext&&(pe.context=pe.pendingContext,pe.pendingContext=null),(A===null||A.child===null)&&(F2(M)?M.flags|=4:A===null||A.memoizedState.isDehydrated&&!(M.flags&256)||(M.flags|=1024,xf!==null&&(e7(xf),xf=null))),H8(A,M),Yl(M),null;case 5:X5(M);var Ie=Sp(W1.current);if(Z=M.type,A!==null&&M.stateNode!=null)ZT(A,M,Z,pe,Ie),A.ref!==M.ref&&(M.flags|=512,M.flags|=2097152);else{if(!pe){if(M.stateNode===null)throw Error(n(166));return Yl(M),null}if(A=Sp(lh.current),F2(M)){pe=M.stateNode,Z=M.type;var Ve=M.memoizedProps;switch(pe[th]=M,pe[Fm]=Ve,A=(M.mode&1)!==0,Z){case"dialog":qa("cancel",pe),qa("close",pe);break;case"iframe":case"object":case"embed":qa("load",pe);break;case"video":case"audio":for(Ie=0;Ie<gp.length;Ie++)qa(gp[Ie],pe);break;case"source":qa("error",pe);break;case"img":case"image":case"link":qa("error",pe),qa("load",pe);break;case"details":qa("toggle",pe);break;case"input":tt(pe,Ve),qa("invalid",pe);break;case"select":pe._wrapperState={wasMultiple:!!Ve.multiple},qa("invalid",pe);break;case"textarea":cn(pe,Ve),qa("invalid",pe)}_t(Z,Ve),Ie=null;for(var Nt in Ve)if(Ve.hasOwnProperty(Nt)){var fn=Ve[Nt];Nt==="children"?typeof fn=="string"?pe.textContent!==fn&&(Ve.suppressHydrationWarning!==!0&&_2(pe.textContent,fn,A),Ie=["children",fn]):typeof fn=="number"&&pe.textContent!==""+fn&&(Ve.suppressHydrationWarning!==!0&&_2(pe.textContent,fn,A),Ie=["children",""+fn]):s.hasOwnProperty(Nt)&&fn!=null&&Nt==="onScroll"&&qa("scroll",pe)}switch(Z){case"input":Xe(pe),ht(pe,Ve,!0);break;case"textarea":Xe(pe),Xt(pe);break;case"select":case"option":break;default:typeof Ve.onClick=="function"&&(pe.onclick=R5)}pe=Ie,M.updateQueue=pe,pe!==null&&(M.flags|=4)}else{Nt=Ie.nodeType===9?Ie:Ie.ownerDocument,A==="http://www.w3.org/1999/xhtml"&&(A=on(Z)),A==="http://www.w3.org/1999/xhtml"?Z==="script"?(A=Nt.createElement("div"),A.innerHTML="<script><\/script>",A=A.removeChild(A.firstChild)):typeof pe.is=="string"?A=Nt.createElement(Z,{is:pe.is}):(A=Nt.createElement(Z),Z==="select"&&(Nt=A,pe.multiple?Nt.multiple=!0:pe.size&&(Nt.size=pe.size))):A=Nt.createElementNS(A,Z),A[th]=M,A[Fm]=pe,Kl(A,M,!1,!1),M.stateNode=A;e:{switch(Nt=ze(Z,pe),Z){case"dialog":qa("cancel",A),qa("close",A),Ie=pe;break;case"iframe":case"object":case"embed":qa("load",A),Ie=pe;break;case"video":case"audio":for(Ie=0;Ie<gp.length;Ie++)qa(gp[Ie],A);Ie=pe;break;case"source":qa("error",A),Ie=pe;break;case"img":case"image":case"link":qa("error",A),qa("load",A),Ie=pe;break;case"details":qa("toggle",A),Ie=pe;break;case"input":tt(A,pe),Ie=et(A,pe),qa("invalid",A);break;case"option":Ie=pe;break;case"select":A._wrapperState={wasMultiple:!!pe.multiple},Ie=te({},pe,{value:void 0}),qa("invalid",A);break;case"textarea":cn(A,pe),Ie=nn(A,pe),qa("invalid",A);break;default:Ie=pe}_t(Z,Ie),fn=Ie;for(Ve in fn)if(fn.hasOwnProperty(Ve)){var _n=fn[Ve];Ve==="style"?ot(A,_n):Ve==="dangerouslySetInnerHTML"?(_n=_n?_n.__html:void 0,_n!=null&&Ze(A,_n)):Ve==="children"?typeof _n=="string"?(Z!=="textarea"||_n!=="")&&Ft(A,_n):typeof _n=="number"&&Ft(A,""+_n):Ve!=="suppressContentEditableWarning"&&Ve!=="suppressHydrationWarning"&&Ve!=="autoFocus"&&(s.hasOwnProperty(Ve)?_n!=null&&Ve==="onScroll"&&qa("scroll",A):_n!=null&&I(A,Ve,_n,Nt))}switch(Z){case"input":Xe(A),ht(A,pe,!1);break;case"textarea":Xe(A),Xt(A);break;case"option":pe.value!=null&&A.setAttribute("value",""+je(pe.value));break;case"select":A.multiple=!!pe.multiple,Ve=pe.value,Ve!=null?wt(A,!!pe.multiple,Ve,!1):pe.defaultValue!=null&&wt(A,!!pe.multiple,pe.defaultValue,!0);break;default:typeof Ie.onClick=="function"&&(A.onclick=R5)}switch(Z){case"button":case"input":case"select":case"textarea":pe=!!pe.autoFocus;break e;case"img":pe=!0;break e;default:pe=!1}}pe&&(M.flags|=4)}M.ref!==null&&(M.flags|=512,M.flags|=2097152)}return Yl(M),null;case 6:if(A&&M.stateNode!=null)V8(A,M,A.memoizedProps,pe);else{if(typeof pe!="string"&&M.stateNode===null)throw Error(n(166));if(Z=Sp(W1.current),Sp(lh.current),F2(M)){if(pe=M.stateNode,Z=M.memoizedProps,pe[th]=M,(Ve=pe.nodeValue!==Z)&&(A=gc,A!==null))switch(A.tag){case 3:_2(pe.nodeValue,Z,(A.mode&1)!==0);break;case 5:A.memoizedProps.suppressHydrationWarning!==!0&&_2(pe.nodeValue,Z,(A.mode&1)!==0)}Ve&&(M.flags|=4)}else pe=(Z.nodeType===9?Z:Z.ownerDocument).createTextNode(pe),pe[th]=M,M.stateNode=pe}return Yl(M),null;case 13:if(Ga(to),pe=M.memoizedState,A===null||A.memoizedState!==null&&A.memoizedState.dehydrated!==null){if(Ka&&Hu!==null&&M.mode&1&&!(M.flags&128))g8(),ah(),M.flags|=98560,Ve=!1;else if(Ve=F2(M),pe!==null&&pe.dehydrated!==null){if(A===null){if(!Ve)throw Error(n(318));if(Ve=M.memoizedState,Ve=Ve!==null?Ve.dehydrated:null,!Ve)throw Error(n(317));Ve[th]=M}else ah(),!(M.flags&128)&&(M.memoizedState=null),M.flags|=4;Yl(M),Ve=!1}else xf!==null&&(e7(xf),xf=null),Ve=!0;if(!Ve)return M.flags&65536?M:null}return M.flags&128?(M.lanes=Z,M):(pe=pe!==null,pe!==(A!==null&&A.memoizedState!==null)&&pe&&(M.child.flags|=8192,M.mode&1&&(A===null||to.current&1?dl===0&&(dl=3):r7())),M.updateQueue!==null&&(M.flags|=4),Yl(M),null);case 4:return Dm(),H8(A,M),A===null&&Tm(M.stateNode.containerInfo),Yl(M),null;case 10:return q5(M.type._context),Yl(M),null;case 17:return du(M.type)&&$5(),Yl(M),null;case 19:if(Ga(to),Ve=M.memoizedState,Ve===null)return Yl(M),null;if(pe=(M.flags&128)!==0,Nt=Ve.rendering,Nt===null)if(pe)Y2(Ve,!1);else{if(dl!==0||A!==null&&A.flags&128)for(A=M.child;A!==null;){if(Nt=Sx(A),Nt!==null){for(M.flags|=128,Y2(Ve,!1),pe=Nt.updateQueue,pe!==null&&(M.updateQueue=pe,M.flags|=4),M.subtreeFlags=0,pe=Z,Z=M.child;Z!==null;)Ve=Z,A=pe,Ve.flags&=14680066,Nt=Ve.alternate,Nt===null?(Ve.childLanes=0,Ve.lanes=A,Ve.child=null,Ve.subtreeFlags=0,Ve.memoizedProps=null,Ve.memoizedState=null,Ve.updateQueue=null,Ve.dependencies=null,Ve.stateNode=null):(Ve.childLanes=Nt.childLanes,Ve.lanes=Nt.lanes,Ve.child=Nt.child,Ve.subtreeFlags=0,Ve.deletions=null,Ve.memoizedProps=Nt.memoizedProps,Ve.memoizedState=Nt.memoizedState,Ve.updateQueue=Nt.updateQueue,Ve.type=Nt.type,A=Nt.dependencies,Ve.dependencies=A===null?null:{lanes:A.lanes,firstContext:A.firstContext}),Z=Z.sibling;return Ua(to,to.current&1|2),M.child}A=A.sibling}Ve.tail!==null&&Ee()>_x&&(M.flags|=128,pe=!0,Y2(Ve,!1),M.lanes=4194304)}else{if(!pe)if(A=Sx(Nt),A!==null){if(M.flags|=128,pe=!0,Z=A.updateQueue,Z!==null&&(M.updateQueue=Z,M.flags|=4),Y2(Ve,!0),Ve.tail===null&&Ve.tailMode==="hidden"&&!Nt.alternate&&!Ka)return Yl(M),null}else 2*Ee()-Ve.renderingStartTime>_x&&Z!==1073741824&&(M.flags|=128,pe=!0,Y2(Ve,!1),M.lanes=4194304);Ve.isBackwards?(Nt.sibling=M.child,M.child=Nt):(Z=Ve.last,Z!==null?Z.sibling=Nt:M.child=Nt,Ve.last=Nt)}return Ve.tail!==null?(M=Ve.tail,Ve.rendering=M,Ve.tail=M.sibling,Ve.renderingStartTime=Ee(),M.sibling=null,Z=to.current,Ua(to,pe?Z&1|2:Z&1),M):(Yl(M),null);case 22:case 23:return n7(),pe=M.memoizedState!==null,A!==null&&A.memoizedState!==null!==pe&&(M.flags|=8192),pe&&M.mode&1?qu&1073741824&&(Yl(M),M.subtreeFlags&6&&(M.flags|=8192)):Yl(M),null;case 24:return null;case 25:return null}throw Error(n(156,M.tag))}function OU(A,M){switch(vx(M),M.tag){case 1:return du(M.type)&&$5(),A=M.flags,A&65536?(M.flags=A&-65537|128,M):null;case 3:return Dm(),Ga(uu),Ga(mc),Q5(),A=M.flags,A&65536&&!(A&128)?(M.flags=A&-65537|128,M):null;case 5:return X5(M),null;case 13:if(Ga(to),A=M.memoizedState,A!==null&&A.dehydrated!==null){if(M.alternate===null)throw Error(n(340));ah()}return A=M.flags,A&65536?(M.flags=A&-65537|128,M):null;case 19:return Ga(to),null;case 4:return Dm(),null;case 10:return q5(M.type._context),null;case 22:case 23:return n7(),null;case 24:return null;default:return null}}var f6=!1,no=!1,zc=typeof WeakSet=="function"?WeakSet:Set,ys=null;function eb(A,M){var Z=A.ref;if(Z!==null)if(typeof Z=="function")try{Z(null)}catch(pe){po(A,M,pe)}else Z.current=null}function X2(A,M,Z){try{Z()}catch(pe){po(A,M,pe)}}var JT=!1;function MU(A,M){if(k2=er,A=Ss(),Zs(A)){if("selectionStart"in A)var Z={start:A.selectionStart,end:A.selectionEnd};else e:{Z=(Z=A.ownerDocument)&&Z.defaultView||window;var pe=Z.getSelection&&Z.getSelection();if(pe&&pe.rangeCount!==0){Z=pe.anchorNode;var Ie=pe.anchorOffset,Ve=pe.focusNode;pe=pe.focusOffset;try{Z.nodeType,Ve.nodeType}catch{Z=null;break e}var Nt=0,fn=-1,_n=-1,lr=0,$r=0,Vr=A,Br=null;t:for(;;){for(var fs;Vr!==Z||Ie!==0&&Vr.nodeType!==3||(fn=Nt+Ie),Vr!==Ve||pe!==0&&Vr.nodeType!==3||(_n=Nt+pe),Vr.nodeType===3&&(Nt+=Vr.nodeValue.length),(fs=Vr.firstChild)!==null;)Br=Vr,Vr=fs;for(;;){if(Vr===A)break t;if(Br===Z&&++lr===Ie&&(fn=Nt),Br===Ve&&++$r===pe&&(_n=Nt),(fs=Vr.nextSibling)!==null)break;Vr=Br,Br=Vr.parentNode}Vr=fs}Z=fn===-1||_n===-1?null:{start:fn,end:_n}}else Z=null}Z=Z||{start:0,end:0}}else Z=null;for(xx={focusedElem:A,selectionRange:Z},er=!1,ys=M;ys!==null;)if(M=ys,A=M.child,(M.subtreeFlags&1028)!==0&&A!==null)A.return=M,ys=A;else for(;ys!==null;){M=ys;try{var Ns=M.alternate;if(M.flags&1024)switch(M.tag){case 0:case 11:case 15:break;case 1:if(Ns!==null){var Is=Ns.memoizedProps,jo=Ns.memoizedState,Jn=M.stateNode,Mn=Jn.getSnapshotBeforeUpdate(M.elementType===M.type?Is:Td(M.type,Is),jo);Jn.__reactInternalSnapshotBeforeUpdate=Mn}break;case 3:var sr=M.stateNode.containerInfo;sr.nodeType===1?sr.textContent="":sr.nodeType===9&&sr.documentElement&&sr.removeChild(sr.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Xr){po(M,M.return,Xr)}if(A=M.sibling,A!==null){A.return=M.return,ys=A;break}ys=M.return}return Ns=JT,JT=!1,Ns}function Ep(A,M,Z){var pe=M.updateQueue;if(pe=pe!==null?pe.lastEffect:null,pe!==null){var Ie=pe=pe.next;do{if((Ie.tag&A)===A){var Ve=Ie.destroy;Ie.destroy=void 0,Ve!==void 0&&X2(M,Z,Ve)}Ie=Ie.next}while(Ie!==pe)}}function Q2(A,M){if(M=M.updateQueue,M=M!==null?M.lastEffect:null,M!==null){var Z=M=M.next;do{if((Z.tag&A)===A){var pe=Z.create;Z.destroy=pe()}Z=Z.next}while(Z!==M)}}function h6(A){var M=A.ref;if(M!==null){var Z=A.stateNode;switch(A.tag){case 5:A=Z;break;default:A=Z}typeof M=="function"?M(A):M.current=A}}function eI(A){var M=A.alternate;M!==null&&(A.alternate=null,eI(M)),A.child=null,A.deletions=null,A.sibling=null,A.tag===5&&(M=A.stateNode,M!==null&&(delete M[th],delete M[Fm],delete M[D5],delete M[Mt],delete M[B1])),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 tI(A){return A.tag===5||A.tag===3||A.tag===4}function nI(A){e:for(;;){for(;A.sibling===null;){if(A.return===null||tI(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 W8(A,M,Z){var pe=A.tag;if(pe===5||pe===6)A=A.stateNode,M?Z.nodeType===8?Z.parentNode.insertBefore(A,M):Z.insertBefore(A,M):(Z.nodeType===8?(M=Z.parentNode,M.insertBefore(A,Z)):(M=Z,M.appendChild(A)),Z=Z._reactRootContainer,Z!=null||M.onclick!==null||(M.onclick=R5));else if(pe!==4&&(A=A.child,A!==null))for(W8(A,M,Z),A=A.sibling;A!==null;)W8(A,M,Z),A=A.sibling}function p6(A,M,Z){var pe=A.tag;if(pe===5||pe===6)A=A.stateNode,M?Z.insertBefore(A,M):Z.appendChild(A);else if(pe!==4&&(A=A.child,A!==null))for(p6(A,M,Z),A=A.sibling;A!==null;)p6(A,M,Z),A=A.sibling}var kl=null,yf=!1;function hh(A,M,Z){for(Z=Z.child;Z!==null;)q8(A,M,Z),Z=Z.sibling}function q8(A,M,Z){if(W&&typeof W.onCommitFiberUnmount=="function")try{W.onCommitFiberUnmount(B,Z)}catch{}switch(Z.tag){case 5:no||eb(Z,M);case 6:var pe=kl,Ie=yf;kl=null,hh(A,M,Z),kl=pe,yf=Ie,kl!==null&&(yf?(A=kl,Z=Z.stateNode,A.nodeType===8?A.parentNode.removeChild(Z):A.removeChild(Z)):kl.removeChild(Z.stateNode));break;case 18:kl!==null&&(yf?(A=kl,Z=Z.stateNode,A.nodeType===8?p8(A.parentNode,Z):A.nodeType===1&&p8(A,Z),bt(A)):p8(kl,Z.stateNode));break;case 4:pe=kl,Ie=yf,kl=Z.stateNode.containerInfo,yf=!0,hh(A,M,Z),kl=pe,yf=Ie;break;case 0:case 11:case 14:case 15:if(!no&&(pe=Z.updateQueue,pe!==null&&(pe=pe.lastEffect,pe!==null))){Ie=pe=pe.next;do{var Ve=Ie,Nt=Ve.destroy;Ve=Ve.tag,Nt!==void 0&&(Ve&2||Ve&4)&&X2(Z,M,Nt),Ie=Ie.next}while(Ie!==pe)}hh(A,M,Z);break;case 1:if(!no&&(eb(Z,M),pe=Z.stateNode,typeof pe.componentWillUnmount=="function"))try{pe.props=Z.memoizedProps,pe.state=Z.memoizedState,pe.componentWillUnmount()}catch(fn){po(Z,M,fn)}hh(A,M,Z);break;case 21:hh(A,M,Z);break;case 22:Z.mode&1?(no=(pe=no)||Z.memoizedState!==null,hh(A,M,Z),no=pe):hh(A,M,Z);break;default:hh(A,M,Z)}}function tb(A){var M=A.updateQueue;if(M!==null){A.updateQueue=null;var Z=A.stateNode;Z===null&&(Z=A.stateNode=new zc),M.forEach(function(pe){var Ie=zU.bind(null,A,pe);Z.has(pe)||(Z.add(pe),pe.then(Ie,Ie))})}}function Wu(A,M){var Z=M.deletions;if(Z!==null)for(var pe=0;pe<Z.length;pe++){var Ie=Z[pe];try{var Ve=A,Nt=M,fn=Nt;e:for(;fn!==null;){switch(fn.tag){case 5:kl=fn.stateNode,yf=!1;break e;case 3:kl=fn.stateNode.containerInfo,yf=!0;break e;case 4:kl=fn.stateNode.containerInfo,yf=!0;break e}fn=fn.return}if(kl===null)throw Error(n(160));q8(Ve,Nt,Ie),kl=null,yf=!1;var _n=Ie.alternate;_n!==null&&(_n.return=null),Ie.return=null}catch(lr){po(Ie,M,lr)}}if(M.subtreeFlags&12854)for(M=M.child;M!==null;)G8(M,A),M=M.sibling}function G8(A,M){var Z=A.alternate,pe=A.flags;switch(A.tag){case 0:case 11:case 14:case 15:if(Wu(M,A),vf(A),pe&4){try{Ep(3,A,A.return),Q2(3,A)}catch(Is){po(A,A.return,Is)}try{Ep(5,A,A.return)}catch(Is){po(A,A.return,Is)}}break;case 1:Wu(M,A),vf(A),pe&512&&Z!==null&&eb(Z,Z.return);break;case 5:if(Wu(M,A),vf(A),pe&512&&Z!==null&&eb(Z,Z.return),A.flags&32){var Ie=A.stateNode;try{Ft(Ie,"")}catch(Is){po(A,A.return,Is)}}if(pe&4&&(Ie=A.stateNode,Ie!=null)){var Ve=A.memoizedProps,Nt=Z!==null?Z.memoizedProps:Ve,fn=A.type,_n=A.updateQueue;if(A.updateQueue=null,_n!==null)try{fn==="input"&&Ve.type==="radio"&&Ve.name!=null&&Le(Ie,Ve),ze(fn,Nt);var lr=ze(fn,Ve);for(Nt=0;Nt<_n.length;Nt+=2){var $r=_n[Nt],Vr=_n[Nt+1];$r==="style"?ot(Ie,Vr):$r==="dangerouslySetInnerHTML"?Ze(Ie,Vr):$r==="children"?Ft(Ie,Vr):I(Ie,$r,Vr,lr)}switch(fn){case"input":$e(Ie,Ve);break;case"textarea":zn(Ie,Ve);break;case"select":var Br=Ie._wrapperState.wasMultiple;Ie._wrapperState.wasMultiple=!!Ve.multiple;var fs=Ve.value;fs!=null?wt(Ie,!!Ve.multiple,fs,!1):Br!==!!Ve.multiple&&(Ve.defaultValue!=null?wt(Ie,!!Ve.multiple,Ve.defaultValue,!0):wt(Ie,!!Ve.multiple,Ve.multiple?[]:"",!1))}Ie[Fm]=Ve}catch(Is){po(A,A.return,Is)}}break;case 6:if(Wu(M,A),vf(A),pe&4){if(A.stateNode===null)throw Error(n(162));Ie=A.stateNode,Ve=A.memoizedProps;try{Ie.nodeValue=Ve}catch(Is){po(A,A.return,Is)}}break;case 3:if(Wu(M,A),vf(A),pe&4&&Z!==null&&Z.memoizedState.isDehydrated)try{bt(M.containerInfo)}catch(Is){po(A,A.return,Is)}break;case 4:Wu(M,A),vf(A);break;case 13:Wu(M,A),vf(A),Ie=A.child,Ie.flags&8192&&(Ve=Ie.memoizedState!==null,Ie.stateNode.isHidden=Ve,!Ve||Ie.alternate!==null&&Ie.alternate.memoizedState!==null||(X8=Ee())),pe&4&&tb(A);break;case 22:if($r=Z!==null&&Z.memoizedState!==null,A.mode&1?(no=(lr=no)||$r,Wu(M,A),no=lr):Wu(M,A),vf(A),pe&8192){if(lr=A.memoizedState!==null,(A.stateNode.isHidden=lr)&&!$r&&A.mode&1)for(ys=A,$r=A.child;$r!==null;){for(Vr=ys=$r;ys!==null;){switch(Br=ys,fs=Br.child,Br.tag){case 0:case 11:case 14:case 15:Ep(4,Br,Br.return);break;case 1:eb(Br,Br.return);var Ns=Br.stateNode;if(typeof Ns.componentWillUnmount=="function"){pe=Br,Z=Br.return;try{M=pe,Ns.props=M.memoizedProps,Ns.state=M.memoizedState,Ns.componentWillUnmount()}catch(Is){po(pe,Z,Is)}}break;case 5:eb(Br,Br.return);break;case 22:if(Br.memoizedState!==null){Um(Vr);continue}}fs!==null?(fs.return=Br,ys=fs):Um(Vr)}$r=$r.sibling}e:for($r=null,Vr=A;;){if(Vr.tag===5){if($r===null){$r=Vr;try{Ie=Vr.stateNode,lr?(Ve=Ie.style,typeof Ve.setProperty=="function"?Ve.setProperty("display","none","important"):Ve.display="none"):(fn=Vr.stateNode,_n=Vr.memoizedProps.style,Nt=_n!=null&&_n.hasOwnProperty("display")?_n.display:null,fn.style.display=Bt("display",Nt))}catch(Is){po(A,A.return,Is)}}}else if(Vr.tag===6){if($r===null)try{Vr.stateNode.nodeValue=lr?"":Vr.memoizedProps}catch(Is){po(A,A.return,Is)}}else if((Vr.tag!==22&&Vr.tag!==23||Vr.memoizedState===null||Vr===A)&&Vr.child!==null){Vr.child.return=Vr,Vr=Vr.child;continue}if(Vr===A)break e;for(;Vr.sibling===null;){if(Vr.return===null||Vr.return===A)break e;$r===Vr&&($r=null),Vr=Vr.return}$r===Vr&&($r=null),Vr.sibling.return=Vr.return,Vr=Vr.sibling}}break;case 19:Wu(M,A),vf(A),pe&4&&tb(A);break;case 21:break;default:Wu(M,A),vf(A)}}function vf(A){var M=A.flags;if(M&2){try{e:{for(var Z=A.return;Z!==null;){if(tI(Z)){var pe=Z;break e}Z=Z.return}throw Error(n(160))}switch(pe.tag){case 5:var Ie=pe.stateNode;pe.flags&32&&(Ft(Ie,""),pe.flags&=-33);var Ve=nI(A);p6(A,Ve,Ie);break;case 3:case 4:var Nt=pe.stateNode.containerInfo,fn=nI(A);W8(A,fn,Nt);break;default:throw Error(n(161))}}catch(_n){po(A,A.return,_n)}A.flags&=-3}M&4096&&(A.flags&=-4097)}function m6(A,M,Z){ys=A,K8(A)}function K8(A,M,Z){for(var pe=(A.mode&1)!==0;ys!==null;){var Ie=ys,Ve=Ie.child;if(Ie.tag===22&&pe){var Nt=Ie.memoizedState!==null||f6;if(!Nt){var fn=Ie.alternate,_n=fn!==null&&fn.memoizedState!==null||no;fn=f6;var lr=no;if(f6=Nt,(no=_n)&&!lr)for(ys=Ie;ys!==null;)Nt=ys,_n=Nt.child,Nt.tag===22&&Nt.memoizedState!==null?rI(Ie):_n!==null?(_n.return=Nt,ys=_n):rI(Ie);for(;Ve!==null;)ys=Ve,K8(Ve),Ve=Ve.sibling;ys=Ie,f6=fn,no=lr}wf(A)}else Ie.subtreeFlags&8772&&Ve!==null?(Ve.return=Ie,ys=Ve):wf(A)}}function wf(A){for(;ys!==null;){var M=ys;if(M.flags&8772){var Z=M.alternate;try{if(M.flags&8772)switch(M.tag){case 0:case 11:case 15:no||Q2(5,M);break;case 1:var pe=M.stateNode;if(M.flags&4&&!no)if(Z===null)pe.componentDidMount();else{var Ie=M.elementType===M.type?Z.memoizedProps:Td(M.type,Z.memoizedProps);pe.componentDidUpdate(Ie,Z.memoizedState,pe.__reactInternalSnapshotBeforeUpdate)}var Ve=M.updateQueue;Ve!==null&&v8(M,Ve,pe);break;case 3:var Nt=M.updateQueue;if(Nt!==null){if(Z=null,M.child!==null)switch(M.child.tag){case 5:Z=M.child.stateNode;break;case 1:Z=M.child.stateNode}v8(M,Nt,Z)}break;case 5:var fn=M.stateNode;if(Z===null&&M.flags&4){Z=fn;var _n=M.memoizedProps;switch(M.type){case"button":case"input":case"select":case"textarea":_n.autoFocus&&Z.focus();break;case"img":_n.src&&(Z.src=_n.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(M.memoizedState===null){var lr=M.alternate;if(lr!==null){var $r=lr.memoizedState;if($r!==null){var Vr=$r.dehydrated;Vr!==null&&bt(Vr)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}no||M.flags&512&&h6(M)}catch(Br){po(M,M.return,Br)}}if(M===A){ys=null;break}if(Z=M.sibling,Z!==null){Z.return=M.return,ys=Z;break}ys=M.return}}function Um(A){for(;ys!==null;){var M=ys;if(M===A){ys=null;break}var Z=M.sibling;if(Z!==null){Z.return=M.return,ys=Z;break}ys=M.return}}function rI(A){for(;ys!==null;){var M=ys;try{switch(M.tag){case 0:case 11:case 15:var Z=M.return;try{Q2(4,M)}catch(_n){po(M,Z,_n)}break;case 1:var pe=M.stateNode;if(typeof pe.componentDidMount=="function"){var Ie=M.return;try{pe.componentDidMount()}catch(_n){po(M,Ie,_n)}}var Ve=M.return;try{h6(M)}catch(_n){po(M,Ve,_n)}break;case 5:var Nt=M.return;try{h6(M)}catch(_n){po(M,Nt,_n)}}}catch(_n){po(M,M.return,_n)}if(M===A){ys=null;break}var fn=M.sibling;if(fn!==null){fn.return=M.return,ys=fn;break}ys=M.return}}var sI=Math.ceil,x6=R.ReactCurrentDispatcher,Y8=R.ReactCurrentOwner,Id=R.ReactCurrentBatchConfig,Xi=0,Tl=null,Yo=null,Xl=0,qu=0,nb=cu(0),dl=0,Z2=null,zm=0,J2=0,g6=0,ev=null,pu=null,X8=0,_x=1/0,_p=null,b6=!1,Q8=null,Hm=null,y6=!1,Vm=null,Hc=0,tv=0,Z8=null,v6=-1,nv=0;function Vc(){return Xi&6?Ee():v6!==-1?v6:v6=Ee()}function Wm(A){return A.mode&1?Xi&2&&Xl!==0?Xl&-Xl:LT.transition!==null?(nv===0&&(nv=Ue()),nv):(A=yt,A!==0||(A=window.event,A=A===void 0?16:ls(A.type)),A):1}function Cf(A,M,Z,pe){if(50<tv)throw tv=0,Z8=null,Error(n(185));_e(A,Z,pe),(!(Xi&2)||A!==Tl)&&(A===Tl&&(!(Xi&2)&&(J2|=Z),dl===4&&qm(A,Xl)),mu(A,pe),Z===1&&Xi===0&&!(M.mode&1)&&(_x=Ee()+500,U5&&Mm()))}function mu(A,M){var Z=A.callbackNode;se(A,M);var pe=Fe(A,A===Tl?Xl:0);if(pe===0)Z!==null&&nr(Z),A.callbackNode=null,A.callbackPriority=0;else if(M=pe&-pe,A.callbackPriority!==M){if(Z!=null&&nr(Z),M===1)A.tag===0?gx(iI.bind(null,A)):OT(iI.bind(null,A)),L5(function(){!(Xi&6)&&Mm()}),Z=null;else{switch(Lt(pe)){case 1:Z=p;break;case 4:Z=S;break;case 16:Z=_;break;case 536870912:Z=T;break;default:Z=_}Z=fI(Z,w6.bind(null,A))}A.callbackPriority=M,A.callbackNode=Z}}function w6(A,M){if(v6=-1,nv=0,Xi&6)throw Error(n(327));var Z=A.callbackNode;if(rb()&&A.callbackNode!==Z)return null;var pe=Fe(A,A===Tl?Xl:0);if(pe===0)return null;if(pe&30||pe&A.expiredLanes||M)M=C6(A,pe);else{M=pe;var Ie=Xi;Xi|=2;var Ve=oI();(Tl!==A||Xl!==M)&&(_p=null,_x=Ee()+500,Tx(A,M));do try{DU();break}catch(fn){aI(A,fn)}while(!0);vp(),x6.current=Ve,Xi=Ie,Yo!==null?M=0:(Tl=null,Xl=0,M=dl)}if(M!==0){if(M===2&&(Ie=Ce(A),Ie!==0&&(pe=Ie,M=J8(A,Ie))),M===1)throw Z=Z2,Tx(A,0),qm(A,pe),mu(A,Ee()),Z;if(M===6)qm(A,pe);else{if(Ie=A.current.alternate,!(pe&30)&&!RU(Ie)&&(M=C6(A,pe),M===2&&(Ve=Ce(A),Ve!==0&&(pe=Ve,M=J8(A,Ve))),M===1))throw Z=Z2,Tx(A,0),qm(A,pe),mu(A,Ee()),Z;switch(A.finishedWork=Ie,A.finishedLanes=pe,M){case 0:case 1:throw Error(n(345));case 2:Ix(A,pu,_p);break;case 3:if(qm(A,pe),(pe&130023424)===pe&&(M=X8+500-Ee(),10<M)){if(Fe(A,0)!==0)break;if(Ie=A.suspendedLanes,(Ie&pe)!==pe){Vc(),A.pingedLanes|=A.suspendedLanes&Ie;break}A.timeoutHandle=Im(Ix.bind(null,A,pu,_p),M);break}Ix(A,pu,_p);break;case 4:if(qm(A,pe),(pe&4194240)===pe)break;for(M=A.eventTimes,Ie=-1;0<pe;){var Nt=31-ce(pe);Ve=1<<Nt,Nt=M[Nt],Nt>Ie&&(Ie=Nt),pe&=~Ve}if(pe=Ie,pe=Ee()-pe,pe=(120>pe?120:480>pe?480:1080>pe?1080:1920>pe?1920:3e3>pe?3e3:4320>pe?4320:1960*sI(pe/1960))-pe,10<pe){A.timeoutHandle=Im(Ix.bind(null,A,pu,_p),pe);break}Ix(A,pu,_p);break;case 5:Ix(A,pu,_p);break;default:throw Error(n(329))}}}return mu(A,Ee()),A.callbackNode===Z?w6.bind(null,A):null}function J8(A,M){var Z=ev;return A.current.memoizedState.isDehydrated&&(Tx(A,M).flags|=256),A=C6(A,M),A!==2&&(M=pu,pu=Z,M!==null&&e7(M)),A}function e7(A){pu===null?pu=A:pu.push.apply(pu,A)}function RU(A){for(var M=A;;){if(M.flags&16384){var Z=M.updateQueue;if(Z!==null&&(Z=Z.stores,Z!==null))for(var pe=0;pe<Z.length;pe++){var Ie=Z[pe],Ve=Ie.getSnapshot;Ie=Ie.value;try{if(!Wt(Ve(),Ie))return!1}catch{return!1}}}if(Z=M.child,M.subtreeFlags&16384&&Z!==null)Z.return=M,M=Z;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 qm(A,M){for(M&=~g6,M&=~J2,A.suspendedLanes|=M,A.pingedLanes&=~M,A=A.expirationTimes;0<M;){var Z=31-ce(M),pe=1<<Z;A[Z]=-1,M&=~pe}}function iI(A){if(Xi&6)throw Error(n(327));rb();var M=Fe(A,0);if(!(M&1))return mu(A,Ee()),null;var Z=C6(A,M);if(A.tag!==0&&Z===2){var pe=Ce(A);pe!==0&&(M=pe,Z=J8(A,pe))}if(Z===1)throw Z=Z2,Tx(A,0),qm(A,M),mu(A,Ee()),Z;if(Z===6)throw Error(n(345));return A.finishedWork=A.current.alternate,A.finishedLanes=M,Ix(A,pu,_p),mu(A,Ee()),null}function t7(A,M){var Z=Xi;Xi|=1;try{return A(M)}finally{Xi=Z,Xi===0&&(_x=Ee()+500,U5&&Mm())}}function kx(A){Vm!==null&&Vm.tag===0&&!(Xi&6)&&rb();var M=Xi;Xi|=1;var Z=Id.transition,pe=yt;try{if(Id.transition=null,yt=1,A)return A()}finally{yt=pe,Id.transition=Z,Xi=M,!(Xi&6)&&Mm()}}function n7(){qu=nb.current,Ga(nb)}function Tx(A,M){A.finishedWork=null,A.finishedLanes=0;var Z=A.timeoutHandle;if(Z!==-1&&(A.timeoutHandle=-1,I2(Z)),Yo!==null)for(Z=Yo.return;Z!==null;){var pe=Z;switch(vx(pe),pe.tag){case 1:pe=pe.type.childContextTypes,pe!=null&&$5();break;case 3:Dm(),Ga(uu),Ga(mc),Q5();break;case 5:X5(pe);break;case 4:Dm();break;case 13:Ga(to);break;case 19:Ga(to);break;case 10:q5(pe.type._context);break;case 22:case 23:n7()}Z=Z.return}if(Tl=A,Yo=A=Sf(A.current,null),Xl=qu=M,dl=0,Z2=null,g6=J2=zm=0,pu=ev=null,Cx!==null){for(M=0;M<Cx.length;M++)if(Z=Cx[M],pe=Z.interleaved,pe!==null){Z.interleaved=null;var Ie=pe.next,Ve=Z.pending;if(Ve!==null){var Nt=Ve.next;Ve.next=Ie,pe.next=Nt}Z.pending=pe}Cx=null}return A}function aI(A,M){do{var Z=Yo;try{if(vp(),D2.current=r6,q1){for(var pe=ho.memoizedState;pe!==null;){var Ie=pe.queue;Ie!==null&&(Ie.pending=null),pe=pe.next}q1=!1}if(Bm=0,ul=Do=ho=null,B2=!1,Nx=0,Y8.current=null,Z===null||Z.return===null){dl=1,Z2=M,Yo=null;break}e:{var Ve=A,Nt=Z.return,fn=Z,_n=M;if(M=Xl,fn.flags|=32768,_n!==null&&typeof _n=="object"&&typeof _n.then=="function"){var lr=_n,$r=fn,Vr=$r.tag;if(!($r.mode&1)&&(Vr===0||Vr===11||Vr===15)){var Br=$r.alternate;Br?($r.updateQueue=Br.updateQueue,$r.memoizedState=Br.memoizedState,$r.lanes=Br.lanes):($r.updateQueue=null,$r.memoizedState=null)}var fs=KT(Nt);if(fs!==null){fs.flags&=-257,R8(fs,Nt,fn,Ve,M),fs.mode&1&&V2(Ve,lr,M),M=fs,_n=lr;var Ns=M.updateQueue;if(Ns===null){var Is=new Set;Is.add(_n),M.updateQueue=Is}else Ns.add(_n);break e}else{if(!(M&1)){V2(Ve,lr,M),r7();break e}_n=Error(n(426))}}else if(Ka&&fn.mode&1){var jo=KT(Nt);if(jo!==null){!(jo.flags&65536)&&(jo.flags|=256),R8(jo,Nt,fn,Ve,M),oh(Ex(_n,fn));break e}}Ve=_n=Ex(_n,fn),dl!==4&&(dl=2),ev===null?ev=[Ve]:ev.push(Ve),Ve=Nt;do{switch(Ve.tag){case 3:Ve.flags|=65536,M&=-M,Ve.lanes|=M;var Jn=H2(Ve,_n,M);$T(Ve,Jn);break e;case 1:fn=_n;var Mn=Ve.type,sr=Ve.stateNode;if(!(Ve.flags&128)&&(typeof Mn.getDerivedStateFromError=="function"||sr!==null&&typeof sr.componentDidCatch=="function"&&(Hm===null||!Hm.has(sr)))){Ve.flags|=65536,M&=-M,Ve.lanes|=M;var Xr=l6(Ve,fn,M);$T(Ve,Xr);break e}}Ve=Ve.return}while(Ve!==null)}cI(Z)}catch(Ps){M=Ps,Yo===Z&&Z!==null&&(Yo=Z=Z.return);continue}break}while(!0)}function oI(){var A=x6.current;return x6.current=r6,A===null?r6:A}function r7(){(dl===0||dl===3||dl===2)&&(dl=4),Tl===null||!(zm&268435455)&&!(J2&268435455)||qm(Tl,Xl)}function C6(A,M){var Z=Xi;Xi|=2;var pe=oI();(Tl!==A||Xl!==M)&&(_p=null,Tx(A,M));do try{LU();break}catch(Ie){aI(A,Ie)}while(!0);if(vp(),Xi=Z,x6.current=pe,Yo!==null)throw Error(n(261));return Tl=null,Xl=0,dl}function LU(){for(;Yo!==null;)lI(Yo)}function DU(){for(;Yo!==null&&!Rt();)lI(Yo)}function lI(A){var M=dI(A.alternate,A,qu);A.memoizedProps=A.pendingProps,M===null?cI(A):Yo=M,Y8.current=null}function cI(A){var M=A;do{var Z=M.alternate;if(A=M.return,M.flags&32768){if(Z=OU(Z,M),Z!==null){Z.flags&=32767,Yo=Z;return}if(A!==null)A.flags|=32768,A.subtreeFlags=0,A.deletions=null;else{dl=6,Yo=null;return}}else if(Z=FU(Z,M,qu),Z!==null){Yo=Z;return}if(M=M.sibling,M!==null){Yo=M;return}Yo=M=A}while(M!==null);dl===0&&(dl=5)}function Ix(A,M,Z){var pe=yt,Ie=Id.transition;try{Id.transition=null,yt=1,BU(A,M,Z,pe)}finally{Id.transition=Ie,yt=pe}return null}function BU(A,M,Z,pe){do rb();while(Vm!==null);if(Xi&6)throw Error(n(327));Z=A.finishedWork;var Ie=A.finishedLanes;if(Z===null)return null;if(A.finishedWork=null,A.finishedLanes=0,Z===A.current)throw Error(n(177));A.callbackNode=null,A.callbackPriority=0;var Ve=Z.lanes|Z.childLanes;if(rt(A,Ve),A===Tl&&(Yo=Tl=null,Xl=0),!(Z.subtreeFlags&2064)&&!(Z.flags&2064)||y6||(y6=!0,fI(_,function(){return rb(),null})),Ve=(Z.flags&15990)!==0,Z.subtreeFlags&15990||Ve){Ve=Id.transition,Id.transition=null;var Nt=yt;yt=1;var fn=Xi;Xi|=4,Y8.current=null,MU(A,Z),G8(Z,A),fc(xx),er=!!k2,xx=k2=null,A.current=Z,m6(Z),En(),Xi=fn,yt=Nt,Id.transition=Ve}else A.current=Z;if(y6&&(y6=!1,Vm=A,Hc=Ie),Ve=A.pendingLanes,Ve===0&&(Hm=null),ee(Z.stateNode),mu(A,Ee()),M!==null)for(pe=A.onRecoverableError,Z=0;Z<M.length;Z++)Ie=M[Z],pe(Ie.value,{componentStack:Ie.stack,digest:Ie.digest});if(b6)throw b6=!1,A=Q8,Q8=null,A;return Hc&1&&A.tag!==0&&rb(),Ve=A.pendingLanes,Ve&1?A===Z8?tv++:(tv=0,Z8=A):tv=0,Mm(),null}function rb(){if(Vm!==null){var A=Lt(Hc),M=Id.transition,Z=yt;try{if(Id.transition=null,yt=16>A?16:A,Vm===null)var pe=!1;else{if(A=Vm,Vm=null,Hc=0,Xi&6)throw Error(n(331));var Ie=Xi;for(Xi|=4,ys=A.current;ys!==null;){var Ve=ys,Nt=Ve.child;if(ys.flags&16){var fn=Ve.deletions;if(fn!==null){for(var _n=0;_n<fn.length;_n++){var lr=fn[_n];for(ys=lr;ys!==null;){var $r=ys;switch($r.tag){case 0:case 11:case 15:Ep(8,$r,Ve)}var Vr=$r.child;if(Vr!==null)Vr.return=$r,ys=Vr;else for(;ys!==null;){$r=ys;var Br=$r.sibling,fs=$r.return;if(eI($r),$r===lr){ys=null;break}if(Br!==null){Br.return=fs,ys=Br;break}ys=fs}}}var Ns=Ve.alternate;if(Ns!==null){var Is=Ns.child;if(Is!==null){Ns.child=null;do{var jo=Is.sibling;Is.sibling=null,Is=jo}while(Is!==null)}}ys=Ve}}if(Ve.subtreeFlags&2064&&Nt!==null)Nt.return=Ve,ys=Nt;else e:for(;ys!==null;){if(Ve=ys,Ve.flags&2048)switch(Ve.tag){case 0:case 11:case 15:Ep(9,Ve,Ve.return)}var Jn=Ve.sibling;if(Jn!==null){Jn.return=Ve.return,ys=Jn;break e}ys=Ve.return}}var Mn=A.current;for(ys=Mn;ys!==null;){Nt=ys;var sr=Nt.child;if(Nt.subtreeFlags&2064&&sr!==null)sr.return=Nt,ys=sr;else e:for(Nt=Mn;ys!==null;){if(fn=ys,fn.flags&2048)try{switch(fn.tag){case 0:case 11:case 15:Q2(9,fn)}}catch(Ps){po(fn,fn.return,Ps)}if(fn===Nt){ys=null;break e}var Xr=fn.sibling;if(Xr!==null){Xr.return=fn.return,ys=Xr;break e}ys=fn.return}}if(Xi=Ie,Mm(),W&&typeof W.onPostCommitFiberRoot=="function")try{W.onPostCommitFiberRoot(B,A)}catch{}pe=!0}return pe}finally{yt=Z,Id.transition=M}}return!1}function S6(A,M,Z){M=Ex(Z,M),M=H2(A,M,1),A=_d(A,M,1),M=Vc(),A!==null&&(_e(A,1,M),mu(A,M))}function po(A,M,Z){if(A.tag===3)S6(A,A,Z);else for(;M!==null;){if(M.tag===3){S6(M,A,Z);break}else if(M.tag===1){var pe=M.stateNode;if(typeof M.type.getDerivedStateFromError=="function"||typeof pe.componentDidCatch=="function"&&(Hm===null||!Hm.has(pe))){A=Ex(Z,A),A=l6(M,A,1),M=_d(M,A,1),A=Vc(),M!==null&&(_e(M,1,A),mu(M,A));break}}M=M.return}}function $U(A,M,Z){var pe=A.pingCache;pe!==null&&pe.delete(M),M=Vc(),A.pingedLanes|=A.suspendedLanes&Z,Tl===A&&(Xl&Z)===Z&&(dl===4||dl===3&&(Xl&130023424)===Xl&&500>Ee()-X8?Tx(A,0):g6|=Z),mu(A,M)}function uI(A,M){M===0&&(A.mode&1?(M=Me,Me<<=1,!(Me&130023424)&&(Me=4194304)):M=1);var Z=Vc();A=wp(A,M),A!==null&&(_e(A,M,Z),mu(A,Z))}function UU(A){var M=A.memoizedState,Z=0;M!==null&&(Z=M.retryLane),uI(A,Z)}function zU(A,M){var Z=0;switch(A.tag){case 13:var pe=A.stateNode,Ie=A.memoizedState;Ie!==null&&(Z=Ie.retryLane);break;case 19:pe=A.stateNode;break;default:throw Error(n(314))}pe!==null&&pe.delete(M),uI(A,Z)}var dI;dI=function(A,M,Z){if(A!==null)if(A.memoizedProps!==M.pendingProps||uu.current)Uc=!0;else{if(!(A.lanes&Z)&&!(M.flags&128))return Uc=!1,QT(A,M,Z);Uc=!!(A.flags&131072)}else Uc=!1,Ka&&M.flags&1048576&&MT(M,H5,M.index);switch(M.lanes=0,M.tag){case 2:var pe=M.type;d6(A,M),A=M.pendingProps;var Ie=U1(M,mc.current);Lm(M,Z),Ie=Ax(null,M,pe,A,Ie,Z);var Ve=Z5();return M.flags|=1,typeof Ie=="object"&&Ie!==null&&typeof Ie.render=="function"&&Ie.$$typeof===void 0?(M.tag=1,M.memoizedState=null,M.updateQueue=null,du(pe)?(Ve=!0,Sd(M)):Ve=!1,M.memoizedState=Ie.state!==null&&Ie.state!==void 0?Ie.state:null,K5(M),Ie.updater=a6,M.stateNode=Ie,Ie._reactInternals=M,M8(M,pe,A,Z),M=z8(null,M,pe,!0,Ve,Z)):(M.tag=0,Ka&&Ve&&P2(M),Gl(null,M,Ie,Z),M=M.child),M;case 16:pe=M.elementType;e:{switch(d6(A,M),A=M.pendingProps,Ie=pe._init,pe=Ie(pe._payload),M.type=pe,Ie=M.tag=VU(pe),A=Td(pe,A),Ie){case 0:M=$8(null,M,pe,A,Z);break e;case 1:M=U8(null,M,pe,A,Z);break e;case 11:M=YT(null,M,pe,A,Z);break e;case 14:M=L8(null,M,pe,Td(pe.type,A),Z);break e}throw Error(n(306,pe,""))}return M;case 0:return pe=M.type,Ie=M.pendingProps,Ie=M.elementType===pe?Ie:Td(pe,Ie),$8(A,M,pe,Ie,Z);case 1:return pe=M.type,Ie=M.pendingProps,Ie=M.elementType===pe?Ie:Td(pe,Ie),U8(A,M,pe,Ie,Z);case 3:e:{if(XT(M),A===null)throw Error(n(387));pe=M.pendingProps,Ve=M.memoizedState,Ie=Ve.element,BT(A,M),V1(M,pe,null,Z);var Nt=M.memoizedState;if(pe=Nt.element,Ve.isDehydrated)if(Ve={element:pe,isDehydrated:!1,cache:Nt.cache,pendingSuspenseBoundaries:Nt.pendingSuspenseBoundaries,transitions:Nt.transitions},M.updateQueue.baseState=Ve,M.memoizedState=Ve,M.flags&256){Ie=Ex(Error(n(423)),M),M=fh(A,M,pe,Z,Ie);break e}else if(pe!==Ie){Ie=Ex(Error(n(424)),M),M=fh(A,M,pe,Z,Ie);break e}else for(Hu=Pm(M.stateNode.containerInfo.firstChild),gc=M,Ka=!0,xf=null,Z=W5(M,null,pe,Z),M.child=Z;Z;)Z.flags=Z.flags&-3|4096,Z=Z.sibling;else{if(ah(),pe===Ie){M=bf(A,M,Z);break e}Gl(A,M,pe,Z)}M=M.child}return M;case 5:return C8(M),A===null&&fu(M),pe=M.type,Ie=M.pendingProps,Ve=A!==null?A.memoizedProps:null,Nt=Ie.children,T2(pe,Ie)?Nt=null:Ve!==null&&T2(pe,Ve)&&(M.flags|=32),B8(A,M),Gl(A,M,Nt,Z),M.child;case 6:return A===null&&fu(M),null;case 13:return u6(A,M,Z);case 4:return w8(M,M.stateNode.containerInfo),pe=M.pendingProps,A===null?M.child=Ao(M,null,pe,Z):Gl(A,M,pe,Z),M.child;case 11:return pe=M.type,Ie=M.pendingProps,Ie=M.elementType===pe?Ie:Td(pe,Ie),YT(A,M,pe,Ie,Z);case 7:return Gl(A,M,M.pendingProps,Z),M.child;case 8:return Gl(A,M,M.pendingProps.children,Z),M.child;case 12:return Gl(A,M,M.pendingProps.children,Z),M.child;case 10:e:{if(pe=M.type._context,Ie=M.pendingProps,Ve=M.memoizedProps,Nt=Ie.value,Ua(M2,pe._currentValue),pe._currentValue=Nt,Ve!==null)if(Wt(Ve.value,Nt)){if(Ve.children===Ie.children&&!uu.current){M=bf(A,M,Z);break e}}else for(Ve=M.child,Ve!==null&&(Ve.return=M);Ve!==null;){var fn=Ve.dependencies;if(fn!==null){Nt=Ve.child;for(var _n=fn.firstContext;_n!==null;){if(_n.context===pe){if(Ve.tag===1){_n=Cp(-1,Z&-Z),_n.tag=2;var lr=Ve.updateQueue;if(lr!==null){lr=lr.shared;var $r=lr.pending;$r===null?_n.next=_n:(_n.next=$r.next,$r.next=_n),lr.pending=_n}}Ve.lanes|=Z,_n=Ve.alternate,_n!==null&&(_n.lanes|=Z),ql(Ve.return,Z,M),fn.lanes|=Z;break}_n=_n.next}}else if(Ve.tag===10)Nt=Ve.type===M.type?null:Ve.child;else if(Ve.tag===18){if(Nt=Ve.return,Nt===null)throw Error(n(341));Nt.lanes|=Z,fn=Nt.alternate,fn!==null&&(fn.lanes|=Z),ql(Nt,Z,M),Nt=Ve.sibling}else Nt=Ve.child;if(Nt!==null)Nt.return=Ve;else for(Nt=Ve;Nt!==null;){if(Nt===M){Nt=null;break}if(Ve=Nt.sibling,Ve!==null){Ve.return=Nt.return,Nt=Ve;break}Nt=Nt.return}Ve=Nt}Gl(A,M,Ie.children,Z),M=M.child}return M;case 9:return Ie=M.type,pe=M.pendingProps.children,Lm(M,Z),Ie=jd(Ie),pe=pe(Ie),M.flags|=1,Gl(A,M,pe,Z),M.child;case 14:return pe=M.type,Ie=Td(pe,M.pendingProps),Ie=Td(pe.type,Ie),L8(A,M,pe,Ie,Z);case 15:return dh(A,M,M.type,M.pendingProps,Z);case 17:return pe=M.type,Ie=M.pendingProps,Ie=M.elementType===pe?Ie:Td(pe,Ie),d6(A,M),M.tag=1,du(pe)?(A=!0,Sd(M)):A=!1,Lm(M,Z),jx(M,pe,Ie),M8(M,pe,Ie,Z),z8(null,M,pe,!0,A,Z);case 19:return $m(A,M,Z);case 22:return D8(A,M,Z)}throw Error(n(156,M.tag))};function fI(A,M){return $n(A,M)}function HU(A,M,Z,pe){this.tag=A,this.key=Z,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=pe,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Pd(A,M,Z,pe){return new HU(A,M,Z,pe)}function N6(A){return A=A.prototype,!(!A||!A.isReactComponent)}function VU(A){if(typeof A=="function")return N6(A)?1:0;if(A!=null){if(A=A.$$typeof,A===K)return 11;if(A===Q)return 14}return 2}function Sf(A,M){var Z=A.alternate;return Z===null?(Z=Pd(A.tag,M,A.key,A.mode),Z.elementType=A.elementType,Z.type=A.type,Z.stateNode=A.stateNode,Z.alternate=A,A.alternate=Z):(Z.pendingProps=M,Z.type=A.type,Z.flags=0,Z.subtreeFlags=0,Z.deletions=null),Z.flags=A.flags&14680064,Z.childLanes=A.childLanes,Z.lanes=A.lanes,Z.child=A.child,Z.memoizedProps=A.memoizedProps,Z.memoizedState=A.memoizedState,Z.updateQueue=A.updateQueue,M=A.dependencies,Z.dependencies=M===null?null:{lanes:M.lanes,firstContext:M.firstContext},Z.sibling=A.sibling,Z.index=A.index,Z.ref=A.ref,Z}function A6(A,M,Z,pe,Ie,Ve){var Nt=2;if(pe=A,typeof A=="function")N6(A)&&(Nt=1);else if(typeof A=="string")Nt=5;else e:switch(A){case L:return Px(Z.children,Ie,Ve,M);case z:Nt=8,Ie|=8;break;case X:return A=Pd(12,Z,M,Ie|2),A.elementType=X,A.lanes=Ve,A;case re:return A=Pd(13,Z,M,Ie),A.elementType=re,A.lanes=Ve,A;case he:return A=Pd(19,Z,M,Ie),A.elementType=he,A.lanes=Ve,A;case oe:return j6(Z,Ie,Ve,M);default:if(typeof A=="object"&&A!==null)switch(A.$$typeof){case ne:Nt=10;break e;case J:Nt=9;break e;case K:Nt=11;break e;case Q:Nt=14;break e;case ie:Nt=16,pe=null;break e}throw Error(n(130,A==null?A:typeof A,""))}return M=Pd(Nt,Z,M,Ie),M.elementType=A,M.type=pe,M.lanes=Ve,M}function Px(A,M,Z,pe){return A=Pd(7,A,pe,M),A.lanes=Z,A}function j6(A,M,Z,pe){return A=Pd(22,A,pe,M),A.elementType=oe,A.lanes=Z,A.stateNode={isHidden:!1},A}function s7(A,M,Z){return A=Pd(6,A,null,M),A.lanes=Z,A}function i7(A,M,Z){return M=Pd(4,A.children!==null?A.children:[],A.key,M),M.lanes=Z,M.stateNode={containerInfo:A.containerInfo,pendingChildren:null,implementation:A.implementation},M}function WU(A,M,Z,pe,Ie){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=Be(0),this.expirationTimes=Be(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Be(0),this.identifierPrefix=pe,this.onRecoverableError=Ie,this.mutableSourceEagerHydrationData=null}function a7(A,M,Z,pe,Ie,Ve,Nt,fn,_n){return A=new WU(A,M,Z,fn,_n),M===1?(M=1,Ve===!0&&(M|=8)):M=0,Ve=Pd(3,null,null,M),A.current=Ve,Ve.stateNode=A,Ve.memoizedState={element:pe,isDehydrated:Z,cache:null,transitions:null,pendingSuspenseBoundaries:null},K5(Ve),A}function qU(A,M,Z){var pe=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:U,key:pe==null?null:""+pe,children:A,containerInfo:M,implementation:Z}}function hI(A){if(!A)return Om;A=A._reactInternals;e:{if(en(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(du(M.type)){M=M.stateNode.__reactInternalMemoizedMergedChildContext;break e}}M=M.return}while(M!==null);throw Error(n(171))}if(A.tag===1){var Z=A.type;if(du(Z))return PT(A,Z,M)}return M}function pI(A,M,Z,pe,Ie,Ve,Nt,fn,_n){return A=a7(Z,pe,!0,A,Ie,Ve,Nt,fn,_n),A.context=hI(null),Z=A.current,pe=Vc(),Ie=Wm(Z),Ve=Cp(pe,Ie),Ve.callback=M??null,_d(Z,Ve,Ie),A.current.lanes=Ie,_e(A,Ie,pe),mu(A,pe),A}function E6(A,M,Z,pe){var Ie=M.current,Ve=Vc(),Nt=Wm(Ie);return Z=hI(Z),M.context===null?M.context=Z:M.pendingContext=Z,M=Cp(Ve,Nt),M.payload={element:A},pe=pe===void 0?null:pe,pe!==null&&(M.callback=pe),A=_d(Ie,M,Nt),A!==null&&(Cf(A,Ie,Nt,Ve),Y5(A,Ie,Nt)),Nt}function _6(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 mI(A,M){if(A=A.memoizedState,A!==null&&A.dehydrated!==null){var Z=A.retryLane;A.retryLane=Z!==0&&Z<M?Z:M}}function o7(A,M){mI(A,M),(A=A.alternate)&&mI(A,M)}var xI=typeof reportError=="function"?reportError:function(A){console.error(A)};function l7(A){this._internalRoot=A}rv.prototype.render=l7.prototype.render=function(A){var M=this._internalRoot;if(M===null)throw Error(n(409));E6(A,M,null,null)},rv.prototype.unmount=l7.prototype.unmount=function(){var A=this._internalRoot;if(A!==null){this._internalRoot=null;var M=A.containerInfo;kx(function(){E6(null,A,null,null)}),M[zu]=null}};function rv(A){this._internalRoot=A}rv.prototype.unstable_scheduleHydration=function(A){if(A){var M=At();A={blockedOn:null,target:A,priority:M};for(var Z=0;Z<rr.length&&M!==0&&M<rr[Z].priority;Z++);rr.splice(Z,0,A),Z===0&&Kn(A)}};function k6(A){return!(!A||A.nodeType!==1&&A.nodeType!==9&&A.nodeType!==11)}function T6(A){return!(!A||A.nodeType!==1&&A.nodeType!==9&&A.nodeType!==11&&(A.nodeType!==8||A.nodeValue!==" react-mount-point-unstable "))}function gI(){}function GU(A,M,Z,pe,Ie){if(Ie){if(typeof pe=="function"){var Ve=pe;pe=function(){var lr=_6(Nt);Ve.call(lr)}}var Nt=pI(M,pe,A,0,null,!1,!1,"",gI);return A._reactRootContainer=Nt,A[zu]=Nt.current,Tm(A.nodeType===8?A.parentNode:A),kx(),Nt}for(;Ie=A.lastChild;)A.removeChild(Ie);if(typeof pe=="function"){var fn=pe;pe=function(){var lr=_6(_n);fn.call(lr)}}var _n=a7(A,0,!1,null,null,!1,!1,"",gI);return A._reactRootContainer=_n,A[zu]=_n.current,Tm(A.nodeType===8?A.parentNode:A),kx(function(){E6(M,_n,Z,pe)}),_n}function I6(A,M,Z,pe,Ie){var Ve=Z._reactRootContainer;if(Ve){var Nt=Ve;if(typeof Ie=="function"){var fn=Ie;Ie=function(){var _n=_6(Nt);fn.call(_n)}}E6(M,Nt,A,Ie)}else Nt=GU(Z,M,A,Ie,pe);return _6(Nt)}ft=function(A){switch(A.tag){case 3:var M=A.stateNode;if(M.current.memoizedState.isDehydrated){var Z=qe(M.pendingLanes);Z!==0&&(ct(M,Z|1),mu(M,Ee()),!(Xi&6)&&(_x=Ee()+500,Mm()))}break;case 13:kx(function(){var pe=wp(A,1);if(pe!==null){var Ie=Vc();Cf(pe,A,1,Ie)}}),o7(A,1)}},Tt=function(A){if(A.tag===13){var M=wp(A,134217728);if(M!==null){var Z=Vc();Cf(M,A,134217728,Z)}o7(A,134217728)}},Ge=function(A){if(A.tag===13){var M=Wm(A),Z=wp(A,M);if(Z!==null){var pe=Vc();Cf(Z,A,M,pe)}o7(A,M)}},At=function(){return yt},Ot=function(A,M){var Z=yt;try{return yt=A,M()}finally{yt=Z}},$t=function(A,M,Z){switch(M){case"input":if($e(A,Z),M=Z.name,Z.type==="radio"&&M!=null){for(Z=A;Z.parentNode;)Z=Z.parentNode;for(Z=Z.querySelectorAll("input[name="+JSON.stringify(""+M)+'][type="radio"]'),M=0;M<Z.length;M++){var pe=Z[M];if(pe!==A&&pe.form===A.form){var Ie=B5(pe);if(!Ie)throw Error(n(90));Ke(pe),$e(pe,Ie)}}}break;case"textarea":zn(A,Z);break;case"select":M=Z.value,M!=null&&wt(A,!!Z.multiple,M,!1)}},kn=t7,yn=kx;var P6={usingClientEntryPoint:!1,Events:[pc,Si,B5,xn,An,t7]},sv={findFiberByHostInstance:nh,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},KU={bundleType:sv.bundleType,version:sv.version,rendererPackageName:sv.rendererPackageName,rendererConfig:sv.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=hr(A),A===null?null:A.stateNode},findFiberByHostInstance:sv.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 F6=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!F6.isDisabled&&F6.supportsFiber)try{B=F6.inject(KU),W=F6}catch{}}return Rd.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=P6,Rd.createPortal=function(A,M){var Z=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!k6(M))throw Error(n(200));return qU(A,M,null,Z)},Rd.createRoot=function(A,M){if(!k6(A))throw Error(n(299));var Z=!1,pe="",Ie=xI;return M!=null&&(M.unstable_strictMode===!0&&(Z=!0),M.identifierPrefix!==void 0&&(pe=M.identifierPrefix),M.onRecoverableError!==void 0&&(Ie=M.onRecoverableError)),M=a7(A,1,!1,null,null,Z,!1,pe,Ie),A[zu]=M.current,Tm(A.nodeType===8?A.parentNode:A),new l7(M)},Rd.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=hr(M),A=A===null?null:A.stateNode,A},Rd.flushSync=function(A){return kx(A)},Rd.hydrate=function(A,M,Z){if(!T6(M))throw Error(n(200));return I6(null,A,M,!0,Z)},Rd.hydrateRoot=function(A,M,Z){if(!k6(A))throw Error(n(405));var pe=Z!=null&&Z.hydratedSources||null,Ie=!1,Ve="",Nt=xI;if(Z!=null&&(Z.unstable_strictMode===!0&&(Ie=!0),Z.identifierPrefix!==void 0&&(Ve=Z.identifierPrefix),Z.onRecoverableError!==void 0&&(Nt=Z.onRecoverableError)),M=pI(M,null,A,1,Z??null,Ie,!1,Ve,Nt),A[zu]=M.current,Tm(A),pe)for(A=0;A<pe.length;A++)Z=pe[A],Ie=Z._getVersion,Ie=Ie(Z._source),M.mutableSourceEagerHydrationData==null?M.mutableSourceEagerHydrationData=[Z,Ie]:M.mutableSourceEagerHydrationData.push(Z,Ie);return new rv(M)},Rd.render=function(A,M,Z){if(!T6(M))throw Error(n(200));return I6(null,A,M,!1,Z)},Rd.unmountComponentAtNode=function(A){if(!T6(A))throw Error(n(40));return A._reactRootContainer?(kx(function(){I6(null,null,A,!1,function(){A._reactRootContainer=null,A[zu]=null})}),!0):!1},Rd.unstable_batchedUpdates=t7,Rd.unstable_renderSubtreeIntoContainer=function(A,M,Z,pe){if(!T6(Z))throw Error(n(200));if(A==null||A._reactInternals===void 0)throw Error(n(38));return I6(A,M,Z,!1,pe)},Rd.version="18.3.1-next-f1338f8080-20240426",Rd}var vde;function FNe(){if(vde)return uz.exports;vde=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(),uz.exports=tKe(),uz.exports}var wde;function nKe(){if(wde)return wI;wde=1;var e=FNe();return wI.createRoot=e.createRoot,wI.hydrateRoot=e.hydrateRoot,wI}var ONe=nKe(),m=ox();const Ae=Ii(m),Iy=PNe({__proto__:null,default:Ae},[m]);var Na=FNe();const bre=Ii(Na);/**
 * @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 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)}var uy;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(uy||(uy={}));const Cde="popstate";function rKe(e){e===void 0&&(e={});function t(r,s){let{pathname:a,search:o,hash:l}=r.location;return aQ("",{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:OO(s)}return iKe(t,n,null,e)}function Vo(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function MNe(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function sKe(){return Math.random().toString(36).substr(2,8)}function Sde(e,t){return{usr:e.state,key:e.key,idx:t}}function aQ(e,t,n,r){return n===void 0&&(n=null),b9({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?JN(t):t,{state:n,key:t&&t.key||r||sKe()})}function OO(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 JN(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 iKe(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:a=!1}=r,o=s.history,l=uy.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(b9({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function f(){l=uy.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=uy.Push;let P=aQ(w.location,C,N);u=d()+1;let I=Sde(P,u),R=w.createHref(P);try{o.pushState(I,"",R)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;s.location.assign(R)}a&&c&&c({action:l,location:w.location,delta:1})}function g(C,N){l=uy.Replace;let P=aQ(w.location,C,N);u=d();let I=Sde(P,u),R=w.createHref(P);o.replaceState(I,"",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,P=typeof C=="string"?C:OO(C);return P=P.replace(/ $/,"%20"),Vo(N,"No window.location.(origin|href) available to create URL for href: "+P),new URL(P,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(Cde,f),c=C,()=>{s.removeEventListener(Cde,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 Nde;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Nde||(Nde={}));function aKe(e,t,n){return n===void 0&&(n="/"),oKe(e,t,n)}function oKe(e,t,n,r){let s=typeof t=="string"?JN(t):t,a=CS(s.pathname||"/",n);if(a==null)return null;let o=RNe(e);lKe(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let u=yKe(a);l=gKe(o[c],u)}return l}function RNe(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("/")&&(Vo(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=vy([r,c.relativePath]),d=n.concat(c);a.children&&a.children.length>0&&(Vo(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),RNe(a.children,t,d,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:mKe(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 LNe(a.path))s(a,o,c)}),t}function LNe(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=LNe(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 lKe(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:xKe(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const cKe=/^:[\w-]+$/,uKe=3,dKe=2,fKe=1,hKe=10,pKe=-2,Ade=e=>e==="*";function mKe(e,t){let n=e.split("/"),r=n.length;return n.some(Ade)&&(r+=pKe),t&&(r+=dKe),n.filter(s=>!Ade(s)).reduce((s,a)=>s+(cKe.test(a)?uKe:a===""?fKe:hKe),r)}function xKe(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 gKe(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=oQ({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:vy([a,f.pathname]),pathnameBase:SKe(vy([a,f.pathnameBase])),route:x}),f.pathnameBase!=="/"&&(a=vy([a,f.pathnameBase]))}return o}function oQ(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=bKe(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 bKe(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),MNe(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 yKe(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return MNe(!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 CS(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 vKe(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?JN(e):e;return{pathname:n?n.startsWith("/")?n:wKe(n,t):t,search:NKe(r),hash:AKe(s)}}function wKe(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 hz(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 CKe(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function yre(e,t){let n=CKe(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function vre(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=JN(e):(s=b9({},e),Vo(!s.pathname||!s.pathname.includes("?"),hz("?","pathname","search",s)),Vo(!s.pathname||!s.pathname.includes("#"),hz("#","pathname","hash",s)),Vo(!s.search||!s.search.includes("#"),hz("#","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=vKe(s,l),u=o&&o!=="/"&&o.endsWith("/"),d=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const vy=e=>e.join("/").replace(/\/\/+/g,"/"),SKe=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),NKe=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,AKe=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function jKe(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const DNe=["post","put","patch","delete"];new Set(DNe);const EKe=["get",...DNe];new Set(EKe);/**
 * 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 y9(){return y9=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},y9.apply(this,arguments)}const gD=m.createContext(null),BNe=m.createContext(null),y1=m.createContext(null),bD=m.createContext(null),lx=m.createContext({outlet:null,matches:[],isDataRoute:!1}),$Ne=m.createContext(null);function _Ke(e,t){let{relative:n}=t===void 0?{}:t;eA()||Vo(!1);let{basename:r,navigator:s}=m.useContext(y1),{hash:a,pathname:o,search:l}=yD(e,{relative:n}),c=o;return r!=="/"&&(c=o==="/"?r:vy([r,o])),s.createHref({pathname:c,search:l,hash:a})}function eA(){return m.useContext(bD)!=null}function oc(){return eA()||Vo(!1),m.useContext(bD).location}function UNe(e){m.useContext(y1).static||m.useLayoutEffect(e)}function Wo(){let{isDataRoute:e}=m.useContext(lx);return e?HKe():kKe()}function kKe(){eA()||Vo(!1);let e=m.useContext(gD),{basename:t,future:n,navigator:r}=m.useContext(y1),{matches:s}=m.useContext(lx),{pathname:a}=oc(),o=JSON.stringify(yre(s,n.v7_relativeSplatPath)),l=m.useRef(!1);return UNe(()=>{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=vre(u,JSON.parse(o),a,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:vy([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,o,a,e])}const TKe=m.createContext(null);function IKe(e){let t=m.useContext(lx).outlet;return t&&m.createElement(TKe.Provider,{value:e},t)}function t5(){let{matches:e}=m.useContext(lx),t=e[e.length-1];return t?t.params:{}}function yD(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=m.useContext(y1),{matches:s}=m.useContext(lx),{pathname:a}=oc(),o=JSON.stringify(yre(s,r.v7_relativeSplatPath));return m.useMemo(()=>vre(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function PKe(e,t){return FKe(e,t)}function FKe(e,t,n,r){eA()||Vo(!1);let{navigator:s}=m.useContext(y1),{matches:a}=m.useContext(lx),o=a[a.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=oc(),d;if(t){var f;let C=typeof t=="string"?JN(t):t;c==="/"||(f=C.pathname)!=null&&f.startsWith(c)||Vo(!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=aKe(e,{pathname:g}),w=DKe(v&&v.map(C=>Object.assign({},C,{params:Object.assign({},l,C.params),pathname:vy([c,s.encodeLocation?s.encodeLocation(C.pathname).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?c:vy([c,s.encodeLocation?s.encodeLocation(C.pathnameBase).pathname:C.pathnameBase])})),a,n,r);return t&&w?m.createElement(bD.Provider,{value:{location:y9({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:uy.Pop}},w):w}function OKe(){let e=zKe(),t=jKe(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 MKe=m.createElement(OKe,null);class RKe 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(lx.Provider,{value:this.props.routeContext},m.createElement($Ne.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function LKe(e){let{routeContext:t,match:n,children:r}=e,s=m.useContext(gD);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement(lx.Provider,{value:t},r)}function DKe(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||Vo(!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||MKe,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)),P=()=>{let I;return g?I=w:v?I=C:f.route.Component?I=m.createElement(f.route.Component,null):f.route.element?I=f.route.element:I=d,m.createElement(LKe,{match:f,routeContext:{outlet:d,matches:N,isDataRoute:n!=null},children:I})};return n&&(f.route.ErrorBoundary||f.route.errorElement||x===0)?m.createElement(RKe,{location:n.location,revalidation:n.revalidation,component:w,error:g,children:P(),routeContext:{outlet:null,matches:N,isDataRoute:!0}}):P()},null)}var zNe=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(zNe||{}),MO=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}(MO||{});function BKe(e){let t=m.useContext(gD);return t||Vo(!1),t}function $Ke(e){let t=m.useContext(BNe);return t||Vo(!1),t}function UKe(e){let t=m.useContext(lx);return t||Vo(!1),t}function HNe(e){let t=UKe(),n=t.matches[t.matches.length-1];return n.route.id||Vo(!1),n.route.id}function zKe(){var e;let t=m.useContext($Ne),n=$Ke(MO.UseRouteError),r=HNe(MO.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function HKe(){let{router:e}=BKe(zNe.UseNavigateStable),t=HNe(MO.UseNavigateStable),n=m.useRef(!1);return UNe(()=>{n.current=!0}),m.useCallback(function(s,a){a===void 0&&(a={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,y9({fromRouteId:t},a)))},[e,t])}function jde(e){let{to:t,replace:n,state:r,relative:s}=e;eA()||Vo(!1);let{future:a,static:o}=m.useContext(y1),{matches:l}=m.useContext(lx),{pathname:c}=oc(),u=Wo(),d=vre(t,yre(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 VKe(e){return IKe(e.context)}function ya(e){Vo(!1)}function WKe(e){let{basename:t="/",children:n=null,location:r,navigationType:s=uy.Pop,navigator:a,static:o=!1,future:l}=e;eA()&&Vo(!1);let c=t.replace(/^\/*/,"/"),u=m.useMemo(()=>({basename:c,navigator:a,static:o,future:y9({v7_relativeSplatPath:!1},l)}),[c,l,a,o]);typeof r=="string"&&(r=JN(r));let{pathname:d="/",search:f="",hash:x="",state:g=null,key:v="default"}=r,w=m.useMemo(()=>{let C=CS(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(y1.Provider,{value:u},m.createElement(bD.Provider,{children:n,value:w}))}function qKe(e){let{children:t,location:n}=e;return PKe(lQ(t),n)}new Promise(()=>{});function lQ(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,lQ(r.props.children,a));return}r.type!==ya&&Vo(!1),!r.props.index||!r.props.children||Vo(!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=lQ(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 RO(){return RO=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},RO.apply(this,arguments)}function VNe(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 GKe(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function KKe(e,t){return e.button===0&&(!t||t==="_self")&&!GKe(e)}function cQ(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 YKe(e,t){let n=cQ(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(a=>{n.append(s,a)})}),n}const XKe=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],QKe=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],ZKe="6";try{window.__reactRouterVersion=ZKe}catch{}const JKe=m.createContext({isTransitioning:!1}),eYe="startTransition",Ede=Iy[eYe];function tYe(e){let{basename:t,children:n,future:r,window:s}=e,a=m.useRef();a.current==null&&(a.current=rKe({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&&Ede?Ede(()=>c(f)):c(f)},[c,u]);return m.useLayoutEffect(()=>o.listen(d),[o,d]),m.createElement(WKe,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const nYe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",rYe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ml=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=VNe(t,XKe),{basename:g}=m.useContext(y1),v,w=!1;if(typeof u=="string"&&rYe.test(u)&&(v=u,nYe))try{let I=new URL(window.location.href),R=u.startsWith("//")?new URL(I.protocol+u):new URL(u),O=CS(R.pathname,g);R.origin===I.origin&&O!=null?u=O+R.search+R.hash:w=!0}catch{}let C=_Ke(u,{relative:s}),N=iYe(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:s,unstable_viewTransition:f});function P(I){r&&r(I),I.defaultPrevented||N(I)}return m.createElement("a",RO({},x,{href:v||C,onClick:w||a?r:P,ref:n,target:c}))}),_de=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=VNe(t,QKe),x=yD(c,{relative:f.relative}),g=oc(),v=m.useContext(BNe),{navigator:w,basename:C}=m.useContext(y1),N=v!=null&&aYe(x)&&u===!0,P=w.encodeLocation?w.encodeLocation(x).pathname:x.pathname,I=g.pathname,R=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;s||(I=I.toLowerCase(),R=R?R.toLowerCase():null,P=P.toLowerCase()),R&&C&&(R=CS(R,C)||R);const O=P!=="/"&&P.endsWith("/")?P.length-1:P.length;let U=I===P||!o&&I.startsWith(P)&&I.charAt(O)==="/",L=R!=null&&(R===P||!o&&R.startsWith(P)&&R.charAt(P.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(ml,RO({},f,{"aria-current":X,className:ne,ref:n,style:J,to:c,unstable_viewTransition:u}),typeof d=="function"?d(z):d)});var uQ;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(uQ||(uQ={}));var kde;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(kde||(kde={}));function sYe(e){let t=m.useContext(gD);return t||Vo(!1),t}function iYe(e,t){let{target:n,replace:r,state:s,preventScrollReset:a,relative:o,unstable_viewTransition:l}=t===void 0?{}:t,c=Wo(),u=oc(),d=yD(e,{relative:o});return m.useCallback(f=>{if(KKe(f,n)){f.preventDefault();let x=r!==void 0?r:OO(u)===OO(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 WNe(e){let t=m.useRef(cQ(e)),n=m.useRef(!1),r=oc(),s=m.useMemo(()=>YKe(r.search,n.current?null:t.current),[r.search]),a=Wo(),o=m.useCallback((l,c)=>{const u=cQ(typeof l=="function"?l(s):l);n.current=!0,a("?"+u,c)},[a,s]);return[s,o]}function aYe(e,t){t===void 0&&(t={});let n=m.useContext(JKe);n==null&&Vo(!1);let{basename:r}=sYe(uQ.useViewTransitionState),s=yD(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=CS(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=CS(n.nextLocation.pathname,r)||n.nextLocation.pathname;return oQ(s.pathname,o)!=null||oQ(s.pathname,a)!=null}let oYe={data:""},lYe=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||oYe,cYe=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,uYe=/\/\*[^]*?\*\/|  +/g,Tde=/\n+/g,Pb=(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"?Pb(o,a):a+"{"+Pb(o,a[1]=="k"?"":t)+"}":typeof o=="object"?r+=Pb(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+=Pb.p?Pb.p(a,o):a+":"+o+";")}return n+(t&&s?t+"{"+s+"}":s)+r},Rx={},qNe=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+qNe(e[n]);return t}return e},dYe=(e,t,n,r,s)=>{let a=qNe(e),o=Rx[a]||(Rx[a]=(c=>{let u=0,d=11;for(;u<c.length;)d=101*d+c.charCodeAt(u++)>>>0;return"go"+d})(a));if(!Rx[o]){let c=a!==e?e:(u=>{let d,f,x=[{}];for(;d=cYe.exec(u.replace(uYe,""));)d[4]?x.shift():d[3]?(f=d[3].replace(Tde," ").trim(),x.unshift(x[0][f]=x[0][f]||{})):x[0][d[1]]=d[2].replace(Tde," ").trim();return x[0]})(e);Rx[o]=Pb(s?{["@keyframes "+o]:c}:c,n?"":"."+o)}let l=n&&Rx.g?Rx.g:null;return n&&(Rx.g=Rx[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)})(Rx[o],t,r,l),o},fYe=(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?"":Pb(l,""):l===!1?"":l}return r+s+(o??"")},"");function vD(e){let t=this||{},n=e.call?e(t.p):e;return dYe(n.unshift?n.raw?fYe(n,[].slice.call(arguments,1),t.p):n.reduce((r,s)=>Object.assign(r,s&&s.call?s(t.p):s),{}):n,lYe(t.target),t.g,t.o,t.k)}let GNe,dQ,fQ;vD.bind({g:1});let e1=vD.bind({k:1});function hYe(e,t,n,r){Pb.p=t,GNe=e,dQ=n,fQ=r}function e2(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:dQ&&dQ()},l),n.o=/ *go\d+/.test(c),l.className=vD.apply(n,r)+(c?" "+c:"");let u=e;return e[0]&&(u=l.as||e,delete l.as),fQ&&u[0]&&fQ(l),GNe(u,l)}return s}}var pYe=e=>typeof e=="function",LO=(e,t)=>pYe(e)?e(t):e,mYe=(()=>{let e=0;return()=>(++e).toString()})(),KNe=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),xYe=20,NF=new Map,gYe=1e3,Ide=e=>{if(NF.has(e))return;let t=setTimeout(()=>{NF.delete(e),n5({type:4,toastId:e})},gYe);NF.set(e,t)},bYe=e=>{let t=NF.get(e);t&&clearTimeout(t)},hQ=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,xYe)};case 1:return t.toast.id&&bYe(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)?hQ(e,{type:1,toast:n}):hQ(e,{type:0,toast:n});case 3:let{toastId:r}=t;return r?Ide(r):e.toasts.forEach(a=>{Ide(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}))}}},AF=[],jF={toasts:[],pausedAt:void 0},n5=e=>{jF=hQ(jF,e),AF.forEach(t=>{t(jF)})},yYe={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},vYe=(e={})=>{let[t,n]=m.useState(jF);m.useEffect(()=>(AF.push(n),()=>{let s=AF.indexOf(n);s>-1&&AF.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)||yYe[s.type],style:{...e.style,...(o=e[s.type])==null?void 0:o.style,...s.style}}});return{...t,toasts:r}},wYe=(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)||mYe()}),pk=e=>(t,n)=>{let r=wYe(t,e,n);return n5({type:2,toast:r}),r.id},Uf=(e,t)=>pk("blank")(e,t);Uf.error=pk("error");Uf.success=pk("success");Uf.loading=pk("loading");Uf.custom=pk("custom");Uf.dismiss=e=>{n5({type:3,toastId:e})};Uf.remove=e=>n5({type:4,toastId:e});Uf.promise=(e,t,n)=>{let r=Uf.loading(t.loading,{...n,...n==null?void 0:n.loading});return e.then(s=>(Uf.success(LO(t.success,s),{id:r,...n,...n==null?void 0:n.success}),s)).catch(s=>{Uf.error(LO(t.error,s),{id:r,...n,...n==null?void 0:n.error})}),e};var CYe=(e,t)=>{n5({type:1,toast:{id:e,height:t}})},SYe=()=>{n5({type:5,time:Date.now()})},NYe=e=>{let{toasts:t,pausedAt:n}=vYe(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&&Uf.dismiss(l.id);return}return setTimeout(()=>Uf.dismiss(l.id),c)});return()=>{o.forEach(l=>l&&clearTimeout(l))}},[t,n]);let r=m.useCallback(()=>{n&&n5({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:CYe,startPause:SYe,endPause:r,calculateOffset:s}}},AYe=e1`
from {
  transform: scale(0) rotate(45deg);
	opacity: 0;
}
to {
 transform: scale(1) rotate(45deg);
  opacity: 1;
}`,jYe=e1`
from {
  transform: scale(0);
  opacity: 0;
}
to {
  transform: scale(1);
  opacity: 1;
}`,EYe=e1`
from {
  transform: scale(0) rotate(90deg);
	opacity: 0;
}
to {
  transform: scale(1) rotate(90deg);
	opacity: 1;
}`,_Ye=e2("div")`
  width: 20px;
  opacity: 0;
  height: 20px;
  border-radius: 10px;
  background: ${e=>e.primary||"#ff4b4b"};
  position: relative;
  transform: rotate(45deg);

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

  &:after,
  &:before {
    content: '';
    animation: ${jYe} 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: ${EYe} 0.15s ease-out forwards;
    animation-delay: 180ms;
    transform: rotate(90deg);
  }
`,kYe=e1`
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
`,YNe=e2("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: ${kYe} 1s linear infinite;
`,TYe=e1`
from {
  transform: scale(0) rotate(45deg);
	opacity: 0;
}
to {
  transform: scale(1) rotate(45deg);
	opacity: 1;
}`,IYe=e1`
0% {
	height: 0;
	width: 0;
	opacity: 0;
}
40% {
  height: 0;
	width: 6px;
	opacity: 1;
}
100% {
  opacity: 1;
  height: 10px;
}`,PYe=e2("div")`
  width: 20px;
  opacity: 0;
  height: 20px;
  border-radius: 10px;
  background: ${e=>e.primary||"#61d345"};
  position: relative;
  transform: rotate(45deg);

  animation: ${TYe} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
  animation-delay: 100ms;
  &:after {
    content: '';
    box-sizing: border-box;
    animation: ${IYe} 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;
  }
`,FYe=e2("div")`
  position: absolute;
`,OYe=e2("div")`
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 20px;
  min-height: 20px;
`,MYe=e1`
from {
  transform: scale(0.6);
  opacity: 0.4;
}
to {
  transform: scale(1);
  opacity: 1;
}`,RYe=e2("div")`
  position: relative;
  transform: scale(0.6);
  opacity: 0.4;
  min-width: 20px;
  animation: ${MYe} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
`,LYe=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?m.createElement(RYe,null,t):t:n==="blank"?null:m.createElement(OYe,null,m.createElement(YNe,{...r}),n!=="loading"&&m.createElement(FYe,null,n==="error"?m.createElement(_Ye,{...r}):m.createElement(PYe,{...r})))},DYe=e=>`
0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
`,BYe=e=>`
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
`,$Ye="0%{opacity:0;} 100%{opacity:1;}",UYe="0%{opacity:1;} 100%{opacity:0;}",zYe=e2("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;
`,HYe=e2("div")`
  display: flex;
  justify-content: center;
  margin: 4px 10px;
  color: inherit;
  flex: 1 1 auto;
  white-space: pre-line;
`,VYe=(e,t)=>{let n=e.includes("top")?1:-1,[r,s]=KNe()?[$Ye,UYe]:[DYe(n),BYe(n)];return{animation:t?`${e1(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${e1(s)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},WYe=m.memo(({toast:e,position:t,style:n,children:r})=>{let s=e.height?VYe(e.position||t||"top-center",e.visible):{opacity:0},a=m.createElement(LYe,{toast:e}),o=m.createElement(HYe,{...e.ariaProps},LO(e.message,e));return m.createElement(zYe,{className:e.className,style:{...s,...n,...e.style}},typeof r=="function"?r({icon:a,message:o}):m.createElement(m.Fragment,null,a,o))});hYe(m.createElement);var qYe=({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)},GYe=(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:KNe()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...s}},KYe=vD`
  z-index: 9999;
  > * {
    pointer-events: auto;
  }
`,CI=16,YYe=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:s,containerStyle:a,containerClassName:o})=>{let{toasts:l,handlers:c}=NYe(n);return m.createElement("div",{style:{position:"fixed",zIndex:9999,top:CI,left:CI,right:CI,bottom:CI,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=GYe(d,f);return m.createElement(qYe,{id:u.id,key:u.id,onHeightUpdate:c.updateHeight,className:u.visible?KYe:"",style:x},u.type==="custom"?LO(u.message,u):s?s(u):m.createElement(WYe,{toast:u,position:d}))}))},tn=Uf;const XNe=typeof document<"u"?Ae.useLayoutEffect:()=>{};function XYe(e){const t=m.useRef(null);return XNe(()=>{t.current=e},[e]),m.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const mk=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},Uv=e=>e&&"window"in e&&e.window===e?e:mk(e).defaultView||window;function QYe(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 ZYe(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 QNe(e){let t=null;return()=>(t==null&&(t=e()),t)}const JYe=QNe(function(){return ZYe(/^Mac/i)}),eXe=QNe(function(){return QYe(/Android/i)});function tXe(e){return e.mozInputSource===0&&e.isTrusted?!0:eXe()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}class nXe{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 ZNe(e){let t=m.useRef({isFocused:!1,observer:null});XNe(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=XYe(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 nXe("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 rXe(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=ZNe(a),l=m.useCallback(c=>{const u=mk(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 xk=null,pQ=new Set,Rj=new Map,d3=!1,mQ=!1;const sXe={Tab:!0,Escape:!0};function wre(e,t){for(let n of pQ)n(e,t)}function iXe(e){return!(e.metaKey||!JYe()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function DO(e){d3=!0,iXe(e)&&(xk="keyboard",wre("keyboard",e))}function Wh(e){xk="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(d3=!0,wre("pointer",e))}function JNe(e){tXe(e)&&(d3=!0,xk="virtual")}function eAe(e){e.target===window||e.target===document||(!d3&&!mQ&&(xk="virtual",wre("virtual",e)),d3=!1,mQ=!1)}function tAe(){d3=!1,mQ=!0}function xQ(e){if(typeof window>"u"||Rj.get(Uv(e)))return;const t=Uv(e),n=mk(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){d3=!0,r.apply(this,arguments)},n.addEventListener("keydown",DO,!0),n.addEventListener("keyup",DO,!0),n.addEventListener("click",JNe,!0),t.addEventListener("focus",eAe,!0),t.addEventListener("blur",tAe,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",Wh,!0),n.addEventListener("pointermove",Wh,!0),n.addEventListener("pointerup",Wh,!0)):(n.addEventListener("mousedown",Wh,!0),n.addEventListener("mousemove",Wh,!0),n.addEventListener("mouseup",Wh,!0)),t.addEventListener("beforeunload",()=>{nAe(e)},{once:!0}),Rj.set(t,{focus:r})}const nAe=(e,t)=>{const n=Uv(e),r=mk(e);t&&r.removeEventListener("DOMContentLoaded",t),Rj.has(n)&&(n.HTMLElement.prototype.focus=Rj.get(n).focus,r.removeEventListener("keydown",DO,!0),r.removeEventListener("keyup",DO,!0),r.removeEventListener("click",JNe,!0),n.removeEventListener("focus",eAe,!0),n.removeEventListener("blur",tAe,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",Wh,!0),r.removeEventListener("pointermove",Wh,!0),r.removeEventListener("pointerup",Wh,!0)):(r.removeEventListener("mousedown",Wh,!0),r.removeEventListener("mousemove",Wh,!0),r.removeEventListener("mouseup",Wh,!0)),Rj.delete(n))};function aXe(e){const t=mk(e);let n;return t.readyState!=="loading"?xQ(e):(n=()=>{xQ(e)},t.addEventListener("DOMContentLoaded",n)),()=>nAe(e,n)}typeof document<"u"&&aXe();function rAe(){return xk!=="pointer"}const oXe=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function lXe(e,t,n){var r;const s=typeof window<"u"?Uv(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,a=typeof window<"u"?Uv(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,o=typeof window<"u"?Uv(n==null?void 0:n.target).HTMLElement:HTMLElement,l=typeof window<"u"?Uv(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||(n==null?void 0:n.target)instanceof s&&!oXe.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&&!sXe[n.key])}function cXe(e,t,n){xQ(),m.useEffect(()=>{let r=(s,a)=>{lXe(!!(n!=null&&n.isTextInput),s,a)&&e(rAe())};return pQ.add(r),()=>{pQ.delete(r)}},t)}function uXe(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=ZNe(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 BO=!1,pz=0;function gQ(){BO=!0,setTimeout(()=>{BO=!1},50)}function Pde(e){e.pointerType==="touch"&&gQ()}function dXe(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",Pde):document.addEventListener("touchend",gQ),pz++,()=>{pz--,!(pz>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",Pde):document.removeEventListener("touchend",gQ))}}function Cre(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(dXe,[]);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=>{BO&&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&&!BO&&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 Sre(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,s=m.useRef({isFocused:!1,isFocusVisible:t||rAe()}),[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]);cXe(g=>{s.current.isFocusVisible=g,u()},[],{isTextInput:n});let{focusProps:f}=rXe({isDisabled:r,onFocusChange:d}),{focusWithinProps:x}=uXe({isDisabled:!r,onFocusWithinChange:d});return{isFocused:a,isFocusVisible:l,focusProps:r?x:f}}var fXe=Object.defineProperty,hXe=(e,t,n)=>t in e?fXe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mz=(e,t,n)=>(hXe(e,typeof t!="symbol"?t+"":t,n),n);let pXe=class{constructor(){mz(this,"current",this.detect()),mz(this,"handoffState","pending"),mz(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"}},zw=new pXe;function t2(e){return zw.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function wD(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function cx(){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 wD(()=>{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=cx();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 n2(){let[e]=m.useState(cx);return m.useEffect(()=>()=>e.dispose(),[e]),e}let Za=(e,t)=>{zw.isServer?m.useEffect(e,t):m.useLayoutEffect(e,t)};function r5(e){let t=m.useRef(e);return Za(()=>{t.current=e},[e]),t}let zs=function(e){let t=r5(e);return Ae.useCallback((...n)=>t.current(...n),[t])};function mXe(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 xXe(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function Nre({disabled:e=!1}={}){let t=m.useRef(null),[n,r]=m.useState(!1),s=n2(),a=zs(()=>{t.current=null,r(!1),s.dispose()}),o=zs(l=>{if(s.dispose(),t.current===null){t.current=l.currentTarget,r(!0);{let c=t2(l.currentTarget);s.addEventListener(c,"pointerup",a,!1),s.addEventListener(c,"pointermove",u=>{if(t.current){let d=mXe(u);r(xXe(d,t.current.getBoundingClientRect()))}},!1),s.addEventListener(c,"pointercancel",a,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:o,onPointerUp:a,onClick:a}}}let gXe=m.createContext(void 0);function Are(){return m.useContext(gXe)}function bQ(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function Kf(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,Kf),r}var Py=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Py||{}),dy=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(dy||{});function So(){let e=yXe();return m.useCallback(t=>bXe({mergeRefs:e,...t}),[e])}function bXe({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:s,visible:a=!0,name:o,mergeRefs:l}){l=l??vXe;let c=sAe(t,e);if(a)return SI(c,n,r,o,l);let u=s??0;if(u&2){let{static:d=!1,...f}=c;if(d)return SI(f,n,r,o,l)}if(u&1){let{unmount:d=!0,...f}=c;return Kf(d?0:1,{0(){return null},1(){return SI({...f,hidden:!0,style:{display:"none"}},n,r,o,l)}})}return SI(c,n,r,o,l)}function SI(e,t={},n,r,s){let{as:a=n,children:o,refName:l="ref",...c}=xz(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(Tb(c)).length>0||Object.keys(Tb(f)).length>0))if(!m.isValidElement(d)||Array.isArray(d)&&d.length>1){if(Object.keys(Tb(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(Tb(c)).concat(Object.keys(Tb(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)=>bQ(g(...N),c.className):bQ(g,c.className),w=v?{className:v}:{},C=sAe(d.props,Tb(xz(c,["ref"])));for(let N in f)N in C&&delete f[N];return m.cloneElement(d,Object.assign({},C,f,u,{ref:s(wXe(d),u.ref)},w))}return m.createElement(a,Object.assign({},xz(c,["ref"]),a!==m.Fragment&&u,a!==m.Fragment&&f),d)}function yXe(){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 vXe(...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 sAe(...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 v9(...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 fo(e){var t;return Object.assign(m.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Tb(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function xz(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function wXe(e){return Ae.version.split(".")[0]>="19"?e.props.ref:e.ref}function CXe(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,zs(u=>(a||s(u),t==null?void 0:t(u)))]}function SXe(e){let[t]=m.useState(e);return t}function iAe(e={},t=null,n=[]){for(let[r,s]of Object.entries(e))oAe(n,aAe(t,r),s);return n}function aAe(e,t){return e?e+"["+t+"]":t}function oAe(e,t,n){if(Array.isArray(n))for(let[r,s]of n.entries())oAe(e,aAe(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,""]):iAe(n,t,e)}function NXe(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 AXe="span";var SS=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(SS||{});function jXe(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 So()({ourProps:a,theirProps:s,slot:{},defaultTag:AXe,name:"Hidden"})}let w9=fo(jXe),EXe=m.createContext(null);function _Xe({children:e}){let t=m.useContext(EXe);if(!t)return Ae.createElement(Ae.Fragment,null,e);let{target:n}=t;return n?Na.createPortal(Ae.createElement(Ae.Fragment,null,e),n):null}function kXe({data:e,form:t,disabled:n,onReset:r,overrides:s}){let[a,o]=m.useState(null),l=n2();return m.useEffect(()=>{if(r&&a)return l.addEventListener(a,"reset",r)},[a,t,r]),Ae.createElement(_Xe,null,Ae.createElement(TXe,{setForm:o,formId:t}),iAe(e).map(([c,u])=>Ae.createElement(w9,{features:SS.Hidden,...Tb({key:c,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:c,value:u,...s})})))}function TXe({setForm:e,formId:t}){return m.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:Ae.createElement(w9,{features:SS.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let IXe=m.createContext(void 0);function lAe(){return m.useContext(IXe)}function jre(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&&PXe(n)?!1:r}function PXe(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let cAe=Symbol();function uAe(e,t=!0){return Object.assign(e,{[cAe]:t})}function lc(...e){let t=m.useRef(e);m.useEffect(()=>{t.current=e},[e]);let n=zs(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[cAe]))?void 0:n}let CD=m.createContext(null);CD.displayName="DescriptionContext";function dAe(){let e=m.useContext(CD);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,dAe),t}return e}function FXe(){var e,t;return(t=(e=m.useContext(CD))==null?void 0:e.value)!=null?t:void 0}function Ere(){let[e,t]=m.useState([]);return[e.length>0?e.join(" "):void 0,m.useMemo(()=>function(n){let r=zs(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 Ae.createElement(CD.Provider,{value:s},n.children)},[t])]}let OXe="p";function MXe(e,t){let n=m.useId(),r=Are(),{id:s=`headlessui-description-${n}`,...a}=e,o=dAe(),l=lc(t);Za(()=>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 So()({ourProps:d,theirProps:a,slot:u,defaultTag:OXe,name:o.name||"Description"})}let RXe=fo(MXe),fAe=Object.assign(RXe,{});var go=(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))(go||{});let SD=m.createContext(null);SD.displayName="LabelContext";function _re(){let e=m.useContext(SD);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,_re),t}return e}function hAe(e){var t,n,r;let s=(n=(t=m.useContext(SD))==null?void 0:t.value)!=null?n:void 0;return((r=void 0)!=null?r:0)>0?[s,...e].filter(Boolean).join(" "):s}function kre({inherit:e=!1}={}){let t=hAe(),[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=zs(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 Ae.createElement(SD.Provider,{value:l},a.children)},[r])]}let LXe="label";function DXe(e,t){var n;let r=m.useId(),s=_re(),a=lAe(),o=Are(),{id:l=`headlessui-label-${r}`,htmlFor:c=a??((n=s.props)==null?void 0:n.htmlFor),passive:u=!1,...d}=e,f=lc(t);Za(()=>s.register(l),[l,s.register]);let x=zs(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 P=document.getElementById(N.htmlFor);if(P){let I=P.getAttribute("disabled");if(I==="true"||I==="")return;let R=P.getAttribute("aria-disabled");if(R==="true"||R==="")return;(P instanceof HTMLInputElement&&(P.type==="radio"||P.type==="checkbox")||P.role==="radio"||P.role==="checkbox"||P.role==="switch")&&P.click(),P.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),So()({ourProps:w,theirProps:d,slot:v,defaultTag:c?LXe:"div",name:s.name||"Label"})}let BXe=fo(DXe),$Xe=Object.assign(BXe,{}),UXe=m.createContext(()=>{});function pAe({value:e,children:t}){return Ae.createElement(UXe.Provider,{value:e},t)}function zXe(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function HXe(e,t=!1){let[n,r]=m.useReducer(()=>({}),{}),s=m.useMemo(()=>zXe(e),[e,n]);return Za(()=>{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 VXe=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 mAe(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 xAe(e){return m.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}let WXe=new VXe(()=>mAe(()=>[],{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 tA(e,t){let n=WXe.get(t),r=m.useId(),s=xAe(n);if(Za(()=>{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 yQ=new Map,Lj=new Map;function Fde(e){var t;let n=(t=Lj.get(e))!=null?t:0;return Lj.set(e,n+1),n!==0?()=>Ode(e):(yQ.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Ode(e))}function Ode(e){var t;let n=(t=Lj.get(e))!=null?t:1;if(n===1?Lj.delete(e):Lj.set(e,n-1),n!==1)return;let r=yQ.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,yQ.delete(e))}function gAe(e,{allowed:t,disallowed:n}={}){let r=tA(e,"inert-others");Za(()=>{var s,a;if(!r)return;let o=cx();for(let c of(s=n==null?void 0:n())!=null?s:[])c&&o.add(Fde(c));let l=(a=t==null?void 0:t())!=null?a:[];for(let c of l){if(!c)continue;let u=t2(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(Fde(f));d=d.parentElement}}return o.dispose},[r,t,n])}function bAe(e,t,n){let r=r5(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=cx();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 $O=["[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(","),qXe=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var nm=(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))(nm||{}),vQ=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(vQ||{}),GXe=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(GXe||{});function yAe(e=document.body){return e==null?[]:Array.from(e.querySelectorAll($O)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function KXe(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(qXe)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Tre=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Tre||{});function Ire(e,t=0){var n;return e===((n=t2(e))==null?void 0:n.body)?!1:Kf(t,{0(){return e.matches($O)},1(){let r=e;for(;r!==null;){if(r.matches($O))return!0;r=r.parentElement}return!1}})}function vAe(e){let t=t2(e);cx().nextFrame(()=>{t&&!Ire(t.activeElement,0)&&M0(e)})}var YXe=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(YXe||{});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 M0(e){e==null||e.focus({preventScroll:!0})}let XXe=["textarea","input"].join(",");function QXe(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,XXe))!=null?n:!1}function wAe(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 ZXe(e,t){return KC(yAe(),t,{relativeTo:e})}function KC(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?wAe(e):e:t&64?KXe(e):yAe(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&&QXe(x)&&x.select(),2}function CAe(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function JXe(){return/Android/gi.test(window.navigator.userAgent)}function eQe(){return CAe()||JXe()}function d7(e,t,n,r){let s=r5(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 SAe(e,t,n,r){let s=r5(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 Mde=30;function NAe(e,t,n){let r=tA(e,"outside-click"),s=r5(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!Ire(d,Tre.Loose)&&d.tabIndex!==-1&&c.preventDefault(),s.current(c,d)},[s,t]),o=m.useRef(null);d7(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),d7(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),d7(r,"click",c=>{eQe()||o.current&&(a(c,()=>o.current),o.current=null)},!0);let l=m.useRef({x:0,y:0});d7(r,"touchstart",c=>{l.current.x=c.touches[0].clientX,l.current.y=c.touches[0].clientY},!0),d7(r,"touchend",c=>{let u={x:c.changedTouches[0].clientX,y:c.changedTouches[0].clientY};if(!(Math.abs(u.x-l.current.x)>=Mde||Math.abs(u.y-l.current.y)>=Mde))return a(c,()=>c.target instanceof HTMLElement?c.target:null)},!0),SAe(r,"blur",c=>a(c,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function nA(...e){return m.useMemo(()=>t2(...e),[...e])}function AAe(e,t,n,r){let s=r5(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 Pre(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 tQe(){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 nQe(){return CAe()?{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=cx();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 rQe(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function sQe(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let zv=mAe(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:cx(),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:sQe(n)},s=[nQe(),tQe(),rQe()];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)}});zv.subscribe(()=>{let e=zv.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)&&zv.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&zv.dispatch("TEARDOWN",n)}});function iQe(e,t,n=()=>({containers:[]})){let r=xAe(zv),s=t?r.get(t):void 0,a=s?s.count>0:!1;return Za(()=>{if(!(!t||!e))return zv.dispatch("PUSH",t,n),()=>zv.dispatch("POP",t,n)},[e,t]),a}function jAe(e,t,n=()=>[document.body]){let r=tA(e,"scroll-lock");iQe(r,t,s=>{var a;return{containers:[...(a=s.containers)!=null?a:[],n]}})}function Rde(e){return[e.screenX,e.screenY]}function aQe(){let e=m.useRef([-1,-1]);return{wasMoved(t){let n=Rde(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=Rde(t)}}}function oQe(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 lQe={},Lde,Dde;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((Lde=process==null?void 0:lQe)==null?void 0:Lde.NODE_ENV)==="test"&&typeof((Dde=Element==null?void 0:Element.prototype)==null?void 0:Dde.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 cQe=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(cQe||{});function Fre(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function Ore(e,t,n,r){let[s,a]=m.useState(n),{hasFlag:o,addFlag:l,removeFlag:c}=oQe(e&&s?3:0),u=m.useRef(!1),d=m.useRef(!1),f=n2();return Za(()=>{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),uQe(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 uQe(e,{prepare:t,run:n,done:r,inFlight:s}){let a=cx();return fQe(e,{prepare:t,inFlight:s}),a.nextFrame(()=>{n(),a.requestAnimationFrame(()=>{a.add(dQe(e,r))})}),a.dispose}function dQe(e,t){var n,r;let s=cx();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 fQe(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 hQe(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]),Za(()=>{if(!t||!e)return;let o=t2(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 Mre(e,t){let n=m.useRef([]),r=zs(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 ND(){return typeof window<"u"}function rA(e){return EAe(e)?(e.nodeName||"").toLowerCase():"#document"}function Hf(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ux(e){var t;return(t=(EAe(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function EAe(e){return ND()?e instanceof Node||e instanceof Hf(e).Node:!1}function id(e){return ND()?e instanceof Element||e instanceof Hf(e).Element:!1}function G0(e){return ND()?e instanceof HTMLElement||e instanceof Hf(e).HTMLElement:!1}function Bde(e){return!ND()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Hf(e).ShadowRoot}function gk(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=xm(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(s)}function pQe(e){return["table","td","th"].includes(rA(e))}function AD(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Rre(e){const t=Lre(),n=id(e)?xm(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 mQe(e){let t=Fy(e);for(;G0(t)&&!NS(t);){if(Rre(t))return t;if(AD(t))return null;t=Fy(t)}return null}function Lre(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function NS(e){return["html","body","#document"].includes(rA(e))}function xm(e){return Hf(e).getComputedStyle(e)}function jD(e){return id(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Fy(e){if(rA(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Bde(e)&&e.host||ux(e);return Bde(t)?t.host:t}function _Ae(e){const t=Fy(e);return NS(t)?e.ownerDocument?e.ownerDocument.body:e.body:G0(t)&&gk(t)?t:_Ae(t)}function C9(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=_Ae(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),o=Hf(s);if(a){const l=wQ(o);return t.concat(o,o.visualViewport||[],gk(s)?s:[],l&&n?C9(l):[])}return t.concat(s,C9(s,[],n))}function wQ(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function xQe(){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 gQe=["top","right","bottom","left"],Oy=Math.min,ju=Math.max,S9=Math.round,NI=Math.floor,My=e=>({x:e,y:e}),bQe={left:"right",right:"left",bottom:"top",top:"bottom"},yQe={start:"end",end:"start"};function CQ(e,t,n){return ju(e,Oy(t,n))}function K0(e,t){return typeof e=="function"?e(t):e}function t1(e){return e.split("-")[0]}function sA(e){return e.split("-")[1]}function Dre(e){return e==="x"?"y":"x"}function Bre(e){return e==="y"?"height":"width"}function Ry(e){return["top","bottom"].includes(t1(e))?"y":"x"}function $re(e){return Dre(Ry(e))}function vQe(e,t,n){n===void 0&&(n=!1);const r=sA(e),s=$re(e),a=Bre(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=UO(o)),[o,UO(o)]}function wQe(e){const t=UO(e);return[SQ(e),t,SQ(t)]}function SQ(e){return e.replace(/start|end/g,t=>yQe[t])}function CQe(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 SQe(e,t,n,r){const s=sA(e);let a=CQe(t1(e),n==="start",r);return s&&(a=a.map(o=>o+"-"+s),t&&(a=a.concat(a.map(SQ)))),a}function UO(e){return e.replace(/left|right|bottom|top/g,t=>bQe[t])}function NQe(e){return{top:0,right:0,bottom:0,left:0,...e}}function kAe(e){return typeof e!="number"?NQe(e):{top:e,right:e,bottom:e,left:e}}function N9(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 $de(e,t,n){let{reference:r,floating:s}=e;const a=Ry(t),o=$re(t),l=Bre(o),c=t1(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(sA(t)){case"start":g[o]-=x*(n&&u?-1:1);break;case"end":g[o]+=x*(n&&u?-1:1);break}return g}const AQe=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}=$de(u,r,c),x=r,g={},v=0;for(let w=0;w<l.length;w++){const{name:C,fn:N}=l[w],{x:P,y:I,data:R,reset:O}=await N({x:d,y:f,initialPlacement:r,placement:x,strategy:s,middlewareData:g,rects:u,platform:o,elements:{reference:e,floating:t}});d=P??d,f=I??f,g={...g,[C]:{...g[C],...R}},O&&v<=50&&(v++,typeof O=="object"&&(O.placement&&(x=O.placement),O.rects&&(u=O.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:s}):O.rects),{x:d,y:f}=$de(u,x,c)),w=-1)}return{x:d,y:f,placement:x,strategy:s,middlewareData:g}};async function AS(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}=K0(t,e),v=kAe(g),C=l[x?f==="floating"?"reference":"floating":f],N=N9(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})),P=f==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,I=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),R=await(a.isElement==null?void 0:a.isElement(I))?await(a.getScale==null?void 0:a.getScale(I))||{x:1,y:1}:{x:1,y:1},O=N9(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:P,offsetParent:I,strategy:c}):P);return{top:(N.top-O.top+v.top)/R.y,bottom:(O.bottom-N.bottom+v.bottom)/R.y,left:(N.left-O.left+v.left)/R.x,right:(O.right-N.right+v.right)/R.x}}const jQe=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}=K0(e,t)||{};if(u==null)return{};const f=kAe(d),x={x:n,y:r},g=$re(s),v=Bre(g),w=await o.getDimensions(u),C=g==="y",N=C?"top":"left",P=C?"bottom":"right",I=C?"clientHeight":"clientWidth",R=a.reference[v]+a.reference[g]-x[g]-a.floating[v],O=x[g]-a.reference[g],U=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let L=U?U[I]:0;(!L||!await(o.isElement==null?void 0:o.isElement(U)))&&(L=l.floating[I]||a.floating[v]);const z=R/2-O/2,X=L/2-w[v]/2-1,ne=Oy(f[N],X),J=Oy(f[P],X),K=ne,re=L-w[v]-J,he=L/2-w[v]/2+z,Q=CQ(K,he,re),ie=!c.arrow&&sA(s)!=null&&he!==Q&&a.reference[v]/2-(he<K?ne:J)-w[v]/2<0,oe=ie?he<K?he-K:he-re:0;return{[g]:x[g]+oe,data:{[g]:Q,centerOffset:he-Q-oe,...ie&&{alignmentOffset:oe}},reset:ie}}}),EQe=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}=K0(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const N=t1(s),P=Ry(l),I=t1(l)===l,R=await(c.isRTL==null?void 0:c.isRTL(u.floating)),O=x||(I||!w?[UO(l)]:wQe(l)),U=v!=="none";!x&&U&&O.push(...SQe(l,w,v,R));const L=[l,...O],z=await AS(t,C),X=[];let ne=((r=a.flip)==null?void 0:r.overflows)||[];if(d&&X.push(z[N]),f){const he=vQe(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,K;const he=(((J=a.flip)==null?void 0:J.index)||0)+1,Q=L[he];if(Q)return{data:{index:he,overflows:ne},reset:{placement:Q}};let ie=(K=ne.filter(oe=>oe.overflows[0]<=0).sort((oe,G)=>oe.overflows[1]-G.overflows[1])[0])==null?void 0:K.placement;if(!ie)switch(g){case"bestFit":{var re;const oe=(re=ne.filter(G=>{if(U){const V=Ry(G.placement);return V===P||V==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(V=>V>0).reduce((V,te)=>V+te,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 Ude(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function zde(e){return gQe.some(t=>e[t]>=0)}const _Qe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=K0(e,t);switch(r){case"referenceHidden":{const a=await AS(t,{...s,elementContext:"reference"}),o=Ude(a,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:zde(o)}}}case"escaped":{const a=await AS(t,{...s,altBoundary:!0}),o=Ude(a,n.floating);return{data:{escapedOffsets:o,escaped:zde(o)}}}default:return{}}}}};async function kQe(e,t){const{placement:n,platform:r,elements:s}=e,a=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=t1(n),l=sA(n),c=Ry(n)==="y",u=["left","top"].includes(o)?-1:1,d=a&&c?-1:1,f=K0(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 TQe=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 kQe(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}}}}},IQe=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:P}=C;return{x:N,y:P}}},...c}=K0(e,t),u={x:n,y:r},d=await AS(t,c),f=Ry(t1(s)),x=Dre(f);let g=u[x],v=u[f];if(a){const C=x==="y"?"top":"left",N=x==="y"?"bottom":"right",P=g+d[C],I=g-d[N];g=CQ(P,g,I)}if(o){const C=f==="y"?"top":"left",N=f==="y"?"bottom":"right",P=v+d[C],I=v-d[N];v=CQ(P,v,I)}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}}}}}},PQe=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}=K0(e,t),d={x:n,y:r},f=Ry(s),x=Dre(f);let g=d[x],v=d[f];const w=K0(l,t),C=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(c){const I=x==="y"?"height":"width",R=a.reference[x]-a.floating[I]+C.mainAxis,O=a.reference[x]+a.reference[I]-C.mainAxis;g<R?g=R:g>O&&(g=O)}if(u){var N,P;const I=x==="y"?"width":"height",R=["top","left"].includes(t1(s)),O=a.reference[f]-a.floating[I]+(R&&((N=o.offset)==null?void 0:N[f])||0)+(R?0:C.crossAxis),U=a.reference[f]+a.reference[I]+(R?0:((P=o.offset)==null?void 0:P[f])||0)-(R?C.crossAxis:0);v<O?v=O:v>U&&(v=U)}return{[x]:g,[f]:v}}}},FQe=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}=K0(e,t),d=await AS(t,u),f=t1(s),x=sA(s),g=Ry(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 P=w-d.top-d.bottom,I=v-d.left-d.right,R=Oy(w-d[C],P),O=Oy(v-d[N],I),U=!t.middlewareData.shift;let L=R,z=O;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(z=I),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(L=P),U&&!x){const ne=ju(d.left,0),J=ju(d.right,0),K=ju(d.top,0),re=ju(d.bottom,0);g?z=v-2*(ne!==0||J!==0?ne+J:ju(d.left,d.right)):L=w-2*(K!==0||re!==0?K+re:ju(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 TAe(e){const t=xm(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=G0(e),a=s?e.offsetWidth:n,o=s?e.offsetHeight:r,l=S9(n)!==a||S9(r)!==o;return l&&(n=a,r=o),{width:n,height:r,$:l}}function Ure(e){return id(e)?e:e.contextElement}function YC(e){const t=Ure(e);if(!G0(t))return My(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=TAe(t);let o=(a?S9(n.width):n.width)/r,l=(a?S9(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const OQe=My(0);function IAe(e){const t=Hf(e);return!Lre()||!t.visualViewport?OQe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function MQe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Hf(e)?!1:t}function f3(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=Ure(e);let o=My(1);t&&(r?id(r)&&(o=YC(r)):o=YC(e));const l=MQe(a,n,r)?IAe(a):My(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=Hf(a),g=r&&id(r)?Hf(r):r;let v=x,w=wQ(v);for(;w&&r&&g!==v;){const C=YC(w),N=w.getBoundingClientRect(),P=xm(w),I=N.left+(w.clientLeft+parseFloat(P.paddingLeft))*C.x,R=N.top+(w.clientTop+parseFloat(P.paddingTop))*C.y;c*=C.x,u*=C.y,d*=C.x,f*=C.y,c+=I,u+=R,v=Hf(w),w=wQ(v)}}return N9({width:d,height:f,x:c,y:u})}function RQe(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const a=s==="fixed",o=ux(r),l=t?AD(t.floating):!1;if(r===o||l&&a)return n;let c={scrollLeft:0,scrollTop:0},u=My(1);const d=My(0),f=G0(r);if((f||!f&&!a)&&((rA(r)!=="body"||gk(o))&&(c=jD(r)),G0(r))){const x=f3(r);u=YC(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 LQe(e){return Array.from(e.getClientRects())}function NQ(e,t){const n=jD(e).scrollLeft;return t?t.left+n:f3(ux(e)).left+n}function DQe(e){const t=ux(e),n=jD(e),r=e.ownerDocument.body,s=ju(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=ju(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+NQ(e);const l=-n.scrollTop;return xm(r).direction==="rtl"&&(o+=ju(t.clientWidth,r.clientWidth)-s),{width:s,height:a,x:o,y:l}}function BQe(e,t){const n=Hf(e),r=ux(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=Lre();(!u||u&&t==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}return{width:a,height:o,x:l,y:c}}function $Qe(e,t){const n=f3(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,a=G0(e)?YC(e):My(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 Hde(e,t,n){let r;if(t==="viewport")r=BQe(e,n);else if(t==="document")r=DQe(ux(e));else if(id(t))r=$Qe(t,n);else{const s=IAe(e);r={...t,x:t.x-s.x,y:t.y-s.y}}return N9(r)}function PAe(e,t){const n=Fy(e);return n===t||!id(n)||NS(n)?!1:xm(n).position==="fixed"||PAe(n,t)}function UQe(e,t){const n=t.get(e);if(n)return n;let r=C9(e,[],!1).filter(l=>id(l)&&rA(l)!=="body"),s=null;const a=xm(e).position==="fixed";let o=a?Fy(e):e;for(;id(o)&&!NS(o);){const l=xm(o),c=Rre(o);!c&&l.position==="fixed"&&(s=null),(a?!c&&!s:!c&&l.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||gk(o)&&!c&&PAe(e,o))?r=r.filter(d=>d!==o):s=l,o=Fy(o)}return t.set(e,r),r}function zQe(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const o=[...n==="clippingAncestors"?AD(t)?[]:UQe(t,this._c):[].concat(n),r],l=o[0],c=o.reduce((u,d)=>{const f=Hde(t,d,s);return u.top=ju(f.top,u.top),u.right=Oy(f.right,u.right),u.bottom=Oy(f.bottom,u.bottom),u.left=ju(f.left,u.left),u},Hde(t,l,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function HQe(e){const{width:t,height:n}=TAe(e);return{width:t,height:n}}function VQe(e,t,n){const r=G0(t),s=ux(t),a=n==="fixed",o=f3(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const c=My(0);if(r||!r&&!a)if((rA(t)!=="body"||gk(s))&&(l=jD(t)),r){const g=f3(t,!0,a,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else s&&(c.x=NQ(s));let u=0,d=0;if(s&&!r&&!a){const g=s.getBoundingClientRect();d=g.top+l.scrollTop,u=g.left+l.scrollLeft-NQ(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 gz(e){return xm(e).position==="static"}function Vde(e,t){if(!G0(e)||xm(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ux(e)===n&&(n=n.ownerDocument.body),n}function FAe(e,t){const n=Hf(e);if(AD(e))return n;if(!G0(e)){let s=Fy(e);for(;s&&!NS(s);){if(id(s)&&!gz(s))return s;s=Fy(s)}return n}let r=Vde(e,t);for(;r&&pQe(r)&&gz(r);)r=Vde(r,t);return r&&NS(r)&&gz(r)&&!Rre(r)?n:r||mQe(e)||n}const WQe=async function(e){const t=this.getOffsetParent||FAe,n=this.getDimensions,r=await n(e.floating);return{reference:VQe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function qQe(e){return xm(e).direction==="rtl"}const GQe={convertOffsetParentRelativeRectToViewportRelativeRect:RQe,getDocumentElement:ux,getClippingRect:zQe,getOffsetParent:FAe,getElementRects:WQe,getClientRects:LQe,getDimensions:HQe,getScale:YC,isElement:id,isRTL:qQe};function KQe(e,t){let n=null,r;const s=ux(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=NI(d),v=NI(s.clientWidth-(u+f)),w=NI(s.clientHeight-(d+x)),C=NI(u),P={rootMargin:-g+"px "+-v+"px "+-w+"px "+-C+"px",threshold:ju(0,Oy(1,c))||1};let I=!0;function R(O){const U=O[0].intersectionRatio;if(U!==c){if(!I)return o();U?o(!1,U):r=setTimeout(()=>{o(!1,1e-7)},1e3)}I=!1}try{n=new IntersectionObserver(R,{...P,root:s.ownerDocument})}catch{n=new IntersectionObserver(R,P)}n.observe(e)}return o(!0),a}function OAe(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=Ure(e),d=s||a?[...u?C9(u):[],...C9(t)]:[];d.forEach(N=>{s&&N.addEventListener("scroll",n,{passive:!0}),a&&N.addEventListener("resize",n)});const f=u&&l?KQe(u,n):null;let x=-1,g=null;o&&(g=new ResizeObserver(N=>{let[P]=N;P&&P.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var I;(I=g)==null||I.observe(t)})),n()}),u&&!c&&g.observe(u),g.observe(t));let v,w=c?f3(e):null;c&&C();function C(){const N=f3(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(P=>{s&&P.removeEventListener("scroll",n),a&&P.removeEventListener("resize",n)}),f==null||f(),(N=g)==null||N.disconnect(),g=null,c&&cancelAnimationFrame(v)}}const bz=AS,MAe=TQe,RAe=IQe,LAe=EQe,DAe=FQe,YQe=_Qe,Wde=jQe,XQe=PQe,BAe=(e,t,n)=>{const r=new Map,s={platform:GQe,...n},a={...s.platform,_c:r};return AQe(e,t,{...s,platform:a})};var EF=typeof document<"u"?m.useLayoutEffect:m.useEffect;function zO(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(!zO(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)&&!zO(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function $Ae(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qde(e,t){const n=$Ae(e);return Math.round(t*n)/n}function yz(e){const t=m.useRef(e);return EF(()=>{t.current=e}),t}function QQe(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);zO(x,r)||g(r);const[v,w]=m.useState(null),[C,N]=m.useState(null),P=m.useCallback(G=>{G!==U.current&&(U.current=G,w(G))},[]),I=m.useCallback(G=>{G!==L.current&&(L.current=G,N(G))},[]),R=a||v,O=o||C,U=m.useRef(null),L=m.useRef(null),z=m.useRef(d),X=c!=null,ne=yz(c),J=yz(s),K=yz(u),re=m.useCallback(()=>{if(!U.current||!L.current)return;const G={placement:t,strategy:n,middleware:x};J.current&&(G.platform=J.current),BAe(U.current,L.current,G).then(V=>{const te={...V,isPositioned:K.current!==!1};he.current&&!zO(z.current,te)&&(z.current=te,Na.flushSync(()=>{f(te)}))})},[x,t,n,J,K]);EF(()=>{u===!1&&z.current.isPositioned&&(z.current.isPositioned=!1,f(G=>({...G,isPositioned:!1})))},[u]);const he=m.useRef(!1);EF(()=>(he.current=!0,()=>{he.current=!1}),[]),EF(()=>{if(R&&(U.current=R),O&&(L.current=O),R&&O){if(ne.current)return ne.current(R,O,re);re()}},[R,O,re,ne,X]);const Q=m.useMemo(()=>({reference:U,floating:L,setReference:P,setFloating:I}),[P,I]),ie=m.useMemo(()=>({reference:R,floating:O}),[R,O]),oe=m.useMemo(()=>{const G={position:n,left:0,top:0};if(!ie.floating)return G;const V=qde(ie.floating,d.x),te=qde(ie.floating,d.y);return l?{...G,transform:"translate("+V+"px, "+te+"px)",...$Ae(ie.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:te}},[n,l,ie.floating,d.x,d.y]);return m.useMemo(()=>({...d,update:re,refs:Q,elements:ie,floatingStyles:oe}),[d,re,Q,ie,oe])}const UAe=(e,t)=>({...MAe(e),options:[e,t]}),ZQe=(e,t)=>({...RAe(e),options:[e,t]}),JQe=(e,t)=>({...LAe(e),options:[e,t]}),eZe=(e,t)=>({...DAe(e),options:[e,t]}),zAe={...Iy},tZe=zAe.useInsertionEffect,nZe=tZe||(e=>e());function HAe(e){const t=m.useRef(()=>{});return nZe(()=>{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 AQ=typeof document<"u"?m.useLayoutEffect:m.useEffect;let Gde=!1,rZe=0;const Kde=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+rZe++;function sZe(){const[e,t]=m.useState(()=>Gde?Kde():void 0);return AQ(()=>{e==null&&t(Kde())},[]),m.useEffect(()=>{Gde=!0},[]),e}const iZe=zAe.useId,aZe=iZe||sZe;function oZe(){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 lZe=m.createContext(null),cZe=m.createContext(null),uZe=()=>{var e;return((e=m.useContext(lZe))==null?void 0:e.id)||null},dZe=()=>m.useContext(cZe),fZe="data-floating-ui-focusable";function hZe(e){const{open:t=!1,onOpenChange:n,elements:r}=e,s=aZe(),a=m.useRef({}),[o]=m.useState(()=>oZe()),l=uZe()!=null,[c,u]=m.useState(r.reference),d=HAe((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 pZe(e){e===void 0&&(e={});const{nodeId:t}=e,n=hZe({...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=dZe();AQ(()=>{d&&(f.current=d)},[d]);const g=QQe({...e,elements:{...s,...l&&{reference:l}}}),v=m.useCallback(I=>{const R=id(I)?{getBoundingClientRect:()=>I.getBoundingClientRect(),contextElement:I}:I;c(R),g.refs.setReference(R)},[g.refs]),w=m.useCallback(I=>{(id(I)||I===null)&&(f.current=I,o(I)),(id(g.refs.reference.current)||g.refs.reference.current===null||I!==null&&!id(I))&&g.refs.setReference(I)},[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]),P=m.useMemo(()=>({...g,...r,refs:C,elements:N,nodeId:t}),[g,C,N,t,r]);return AQ(()=>{r.dataRef.current.floatingContext=P;const I=x==null?void 0:x.nodesRef.current.find(R=>R.id===t);I&&(I.context=P)}),m.useMemo(()=>({...g,context:P,refs:C,elements:N}),[g,C,N,P])}const Yde="active",Xde="selected";function vz(e,t,n){const r=new Map,s=n==="item";let a=e;if(s&&e){const{[Yde]:o,[Xde]:l,...c}=e;a=c}return{...n==="floating"&&{tabIndex:-1,[fZe]:""},...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&&[Yde,Xde].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 mZe(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=>vz(l,e,"reference"),t),a=m.useCallback(l=>vz(l,e,"floating"),n),o=m.useCallback(l=>vz(l,e,"item"),r);return m.useMemo(()=>({getReferenceProps:s,getFloatingProps:a,getItemProps:o}),[s,a,o])}function Qde(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const xZe=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}=K0(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,P=x===v;if(!g)return{};const I={...t,...await UAe(-g.offsetTop-x.clientTop-f.reference.height/2-g.offsetHeight/2-a).fn(t)},R=await bz(Qde(I,v.scrollHeight+w+x.clientTop),d),O=await bz(I,{...d,elementContext:"reference"}),U=ju(0,R.top),L=I.y+U,z=v.scrollHeight>v.clientHeight,ne=(z?J=>J:S9)(ju(0,v.scrollHeight+(C&&P||N?w*2:0)-U-ju(0,R.bottom)));if(v.style.maxHeight=ne+"px",v.scrollTop=U,s){const J=z&&v.offsetHeight<g.offsetHeight*l-1||O.top>=-c||O.bottom>=-c;Na.flushSync(()=>s(J))}return r&&(r.current=await bz(Qde({...I,y:L},v.offsetHeight+w+x.clientTop),d)),{y:L}}});function gZe(e,t){const{open:n,elements:r}=e,{enabled:s=!0,overflowRef:a,scrollRef:o,onChange:l}=t,c=HAe(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,P=a.current.bottom>=-.5,I=v.scrollHeight-v.clientHeight,R=C<0?-1:1,O=C<0?"max":"min";v.scrollHeight<=v.clientHeight||(!N&&C>0||!P&&C<0?(w.preventDefault(),Na.flushSync(()=>{c(U=>U+Math[O](C,I*R))})):/firefox/i.test(xQe())&&(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)&&Na.flushSync(()=>c(w=>w+v))}requestAnimationFrame(()=>{d.current=g.scrollTop})}}}),[r.floating,c,a,o]);return m.useMemo(()=>s?{floating:x}:{},[s,x])}let iA=m.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});iA.displayName="FloatingContext";let zre=m.createContext(null);zre.displayName="PlacementContext";function bZe(e){return m.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function yZe(){return m.useContext(iA).setReference}function vZe(){return m.useContext(iA).getReferenceProps}function wZe(){let{getFloatingProps:e,slot:t}=m.useContext(iA);return m.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function CZe(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=m.useContext(zre),n=m.useMemo(()=>e,[JSON.stringify(e,(s,a)=>{var o;return(o=a==null?void 0:a.outerHTML)!=null?o:a})]);Za(()=>{t==null||t(n??null)},[t,n]);let r=m.useContext(iA);return m.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let Zde=4;function SZe({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);NZe(l);let u=t&&n!==null&&l!==null,{to:d="bottom",gap:f=0,offset:x=0,padding:g=0,inner:v}=AZe(n,l),[w,C="center"]=d.split(" ");Za(()=>{u&&a(0)},[u]);let{refs:N,floatingStyles:P,context:I}=pZe({open:u,placement:w==="selection"?C==="center"?"bottom":`bottom-${C}`:C==="center"?`${w}`:`${w}-${C}`,strategy:"absolute",transform:!1,middleware:[UAe({mainAxis:w==="selection"?0:f,crossAxis:x}),ZQe({padding:g}),w!=="selection"&&JQe({padding:g}),w==="selection"&&v?xZe({...v,padding:g,overflowRef:o,offset:s,minItemsVisible:Zde,referenceOverflowThreshold:g,onFallbackChange(J){var K,re;if(!J)return;let he=I.elements.floating;if(!he)return;let Q=parseFloat(getComputedStyle(he).scrollPaddingBottom)||0,ie=Math.min(Zde,he.childElementCount),oe=0,G=0;for(let V of(re=(K=I.elements.floating)==null?void 0:K.childNodes)!=null?re:[])if(V instanceof HTMLElement){let te=V.offsetTop,ae=te+V.clientHeight+Q,fe=he.scrollTop,Ne=fe+he.clientHeight;if(te>=fe&&ae<=Ne)ie--;else{G=Math.max(0,Math.min(ae,Ne)-Math.max(te,fe)),oe=V.clientHeight;break}}ie>=1&&a(V=>{let te=oe*ie-G+Q;return V>=te?V:te})}}):null,eZe({padding:g,apply({availableWidth:J,availableHeight:K,elements:re}){Object.assign(re.floating.style,{overflow:"auto",maxWidth:`${J}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${K}px)`})}})].filter(Boolean),whileElementsMounted:OAe}),[R=w,O=C]=I.placement.split("-");w==="selection"&&(R="selection");let U=m.useMemo(()=>({anchor:[R,O].filter(Boolean).join(" ")}),[R,O]),L=gZe(I,{overflowRef:o,onChange:a}),{getReferenceProps:z,getFloatingProps:X}=mZe([L]),ne=zs(J=>{c(J),N.setFloating(J)});return m.createElement(zre.Provider,{value:r},m.createElement(iA.Provider,{value:{setFloating:ne,setReference:N.setReference,styles:P,getReferenceProps:z,getFloatingProps:X,slot:U}},e))}function NZe(e){Za(()=>{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 AZe(e,t){var n,r,s;let a=wz((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),o=wz((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),l=wz((s=e==null?void 0:e.padding)!=null?s:"var(--anchor-padding, 0)",t);return{...e,gap:a,offset:o,padding:l}}function wz(e,t,n=void 0){let r=n2(),s=zs((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=Jde(c,u);return[d,f=>{let x=VAe(c);{let g=x.map(v=>window.getComputedStyle(u).getPropertyValue(v));r.requestAnimationFrame(function v(){r.nextFrame(v);let w=!1;for(let[N,P]of x.entries()){let I=window.getComputedStyle(u).getPropertyValue(P);if(g[N]!==I){g[N]=I,w=!0;break}}if(!w)return;let C=Jde(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 Za(()=>{let[c,u]=s(e,t);if(l(c),!!u)return u(l)},[e,t]),o}function VAe(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,...VAe(s)]:[r]}return[]}function Jde(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 ED=m.createContext(null);ED.displayName="OpenClosedContext";var tc=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(tc||{});function aA(){return m.useContext(ED)}function Hre({value:e,children:t}){return Ae.createElement(ED.Provider,{value:e},t)}function WAe({children:e}){return Ae.createElement(ED.Provider,{value:null},e)}function jZe(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let Fb=[];jZe(()=>{function e(t){if(!(t.target instanceof HTMLElement)||t.target===document.body||Fb[0]===t.target)return;let n=t.target;n=n.closest($O),Fb.unshift(n??t.target),Fb=Fb.filter(r=>r!=null&&r.isConnected),Fb.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 EZe(e){throw new Error("Unexpected object: "+e)}var ku=(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))(ku||{});function Cz(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:EZe(e)}}function qAe(e){let t=zs(e),n=m.useRef(!1);m.useEffect(()=>(n.current=!1,()=>{n.current=!0,wD(()=>{n.current&&t()})}),[t])}function _Ze(){let e=typeof document>"u";return"useSyncExternalStore"in Iy?(t=>t.useSyncExternalStore)(Iy)(()=>()=>{},()=>!1,()=>!e):!1}function bk(){let e=_Ze(),[t,n]=m.useState(zw.isHandoffComplete);return t&&zw.isHandoffComplete===!1&&n(!1),m.useEffect(()=>{t!==!0&&n(!0)},[t]),m.useEffect(()=>zw.handoff(),[]),e?!1:t}let GAe=m.createContext(!1);function kZe(){return m.useContext(GAe)}function efe(e){return Ae.createElement(GAe.Provider,{value:e.force},e.children)}function TZe(e){let t=kZe(),n=m.useContext(YAe),r=nA(e),[s,a]=m.useState(()=>{var o;if(!t&&n!==null)return(o=n.current)!=null?o:null;if(zw.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 KAe=m.Fragment,IZe=fo(function(e,t){let n=e,r=m.useRef(null),s=lc(uAe(f=>{r.current=f}),t),a=nA(r),o=TZe(r),[l]=m.useState(()=>{var f;return zw.isServer?null:(f=a==null?void 0:a.createElement("div"))!=null?f:null}),c=m.useContext(jQ),u=bk();Za(()=>{!o||!l||o.contains(l)||(l.setAttribute("data-headlessui-portal",""),o.appendChild(l))},[o,l]),Za(()=>{if(l&&c)return c.register(l)},[c,l]),qAe(()=>{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=So();return u?!o||!l?null:Na.createPortal(d({ourProps:{ref:s},theirProps:n,slot:{},defaultTag:KAe,name:"Portal"}),l):null});function PZe(e,t){let n=lc(t),{enabled:r=!0,...s}=e,a=So();return r?Ae.createElement(IZe,{...s,ref:n}):a({ourProps:{ref:n},theirProps:s,slot:{},defaultTag:KAe,name:"Portal"})}let FZe=m.Fragment,YAe=m.createContext(null);function OZe(e,t){let{target:n,...r}=e,s={ref:lc(t)},a=So();return Ae.createElement(YAe.Provider,{value:n},a({ourProps:s,theirProps:r,defaultTag:FZe,name:"Popover.Group"}))}let jQ=m.createContext(null);function MZe(){let e=m.useContext(jQ),t=m.useRef([]),n=zs(a=>(t.current.push(a),e&&e.register(a),()=>r(a))),r=zs(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 Ae.createElement(jQ.Provider,{value:s},a)},[s])]}let RZe=fo(PZe),XAe=fo(OZe),QAe=Object.assign(RZe,{Group:XAe});function LZe(e,t=typeof document<"u"?document.defaultView:null,n){let r=tA(e,"escape");AAe(t,"keydown",s=>{r&&(s.defaultPrevented||s.key===go.Escape&&n(s))})}function DZe(){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 Za(()=>{if(!t)return;function s(a){r(a.matches)}return t.addEventListener("change",s),()=>t.removeEventListener("change",s)},[t]),n}function BZe({defaultContainers:e=[],portals:t,mainTreeNode:n}={}){let r=nA(n),s=zs(()=>{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:zs(a=>s().some(o=>o.contains(a)))}}let ZAe=m.createContext(null);function tfe({children:e,node:t}){let[n,r]=m.useState(null),s=JAe(t??n);return Ae.createElement(ZAe.Provider,{value:s},e,s===null&&Ae.createElement(w9,{features:SS.Hidden,ref:a=>{var o,l;if(a){for(let c of(l=(o=t2(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 JAe(e=null){var t;return(t=m.useContext(ZAe))!=null?t:e}function Vre(){let e=m.useRef(!1);return Za(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var oj=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(oj||{});function $Ze(){let e=m.useRef(0);return SAe(!0,"keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function e8e(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 UZe="div";var Fv=(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))(Fv||{});function zZe(e,t){let n=m.useRef(null),r=lc(n,t),{initialFocus:s,initialFocusFallback:a,containers:o,features:l=15,...c}=e;bk()||(l=0);let u=nA(n);qZe(l,{ownerDocument:u});let d=GZe(l,{ownerDocument:u,container:n,initialFocus:s,initialFocusFallback:a});KZe(l,{ownerDocument:u,container:n,containers:o,previousActiveElement:d});let f=$Ze(),x=zs(P=>{let I=n.current;I&&(R=>R())(()=>{Kf(f.current,{[oj.Forwards]:()=>{KC(I,nm.First,{skipElements:[P.relatedTarget,a]})},[oj.Backwards]:()=>{KC(I,nm.Last,{skipElements:[P.relatedTarget,a]})}})})}),g=tA(!!(l&2),"focus-trap#tab-lock"),v=n2(),w=m.useRef(!1),C={ref:r,onKeyDown(P){P.key=="Tab"&&(w.current=!0,v.requestAnimationFrame(()=>{w.current=!1}))},onBlur(P){if(!(l&4))return;let I=e8e(o);n.current instanceof HTMLElement&&I.add(n.current);let R=P.relatedTarget;R instanceof HTMLElement&&R.dataset.headlessuiFocusGuard!=="true"&&(t8e(I,R)||(w.current?KC(n.current,Kf(f.current,{[oj.Forwards]:()=>nm.Next,[oj.Backwards]:()=>nm.Previous})|nm.WrapAround,{relativeTo:P.target}):P.target instanceof HTMLElement&&M0(P.target)))}},N=So();return Ae.createElement(Ae.Fragment,null,g&&Ae.createElement(w9,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:x,features:SS.Focusable}),N({ourProps:C,theirProps:c,defaultTag:UZe,name:"FocusTrap"}),g&&Ae.createElement(w9,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:x,features:SS.Focusable}))}let HZe=fo(zZe),VZe=Object.assign(HZe,{features:Fv});function WZe(e=!0){let t=m.useRef(Fb.slice());return Mre(([n],[r])=>{r===!0&&n===!1&&wD(()=>{t.current.splice(0)}),r===!1&&n===!0&&(t.current=Fb.slice())},[e,Fb,t]),zs(()=>{var n;return(n=t.current.find(r=>r!=null&&r.isConnected))!=null?n:null})}function qZe(e,{ownerDocument:t}){let n=!!(e&8),r=WZe(n);Mre(()=>{n||(t==null?void 0:t.activeElement)===(t==null?void 0:t.body)&&M0(r())},[n]),qAe(()=>{n&&M0(r())})}function GZe(e,{ownerDocument:t,container:n,initialFocus:r,initialFocusFallback:s}){let a=m.useRef(null),o=tA(!!(e&1),"focus-trap#initial-focus"),l=Vre();return Mre(()=>{if(e===0)return;if(!o){s!=null&&s.current&&M0(s.current);return}let c=n.current;c&&wD(()=>{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)M0(r.current);else{if(e&16){if(KC(c,nm.First|nm.AutoFocus)!==vQ.Error)return}else if(KC(c,nm.First)!==vQ.Error)return;if(s!=null&&s.current&&(M0(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 KZe(e,{ownerDocument:t,container:n,containers:r,previousActiveElement:s}){let a=Vre(),o=!!(e&4);AAe(t==null?void 0:t.defaultView,"focus",l=>{if(!o||!a.current)return;let c=e8e(r);n.current instanceof HTMLElement&&c.add(n.current);let u=s.current;if(!u)return;let d=l.target;d&&d instanceof HTMLElement?t8e(c,d)?(s.current=d,M0(d)):(l.preventDefault(),l.stopPropagation(),M0(u)):M0(s.current)},!0)}function t8e(e,t){for(let n of e)if(n.contains(t))return!0;return!1}function n8e(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:s8e)!==m.Fragment||Ae.Children.count(e.children)===1}let _D=m.createContext(null);_D.displayName="TransitionContext";var YZe=(e=>(e.Visible="visible",e.Hidden="hidden",e))(YZe||{});function XZe(){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}function QZe(){let e=m.useContext(kD);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let kD=m.createContext(null);kD.displayName="NestingContext";function TD(e){return"children"in e?TD(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function r8e(e,t){let n=r5(e),r=m.useRef([]),s=Vre(),a=n2(),o=zs((g,v=dy.Hidden)=>{let w=r.current.findIndex(({el:C})=>C===g);w!==-1&&(Kf(v,{[dy.Unmount](){r.current.splice(w,1)},[dy.Hidden](){r.current[w].state="hidden"}}),a.microTask(()=>{var C;!TD(r)&&s.current&&((C=n.current)==null||C.call(n))}))}),l=zs(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,dy.Unmount)}),c=m.useRef([]),u=m.useRef(Promise.resolve()),d=m.useRef({enter:[],leave:[]}),f=zs((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,P])=>P)).then(()=>C())})]),v==="enter"?u.current=u.current.then(()=>t==null?void 0:t.wait.current).then(()=>w(v)):w(v)}),x=zs((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 s8e=m.Fragment,i8e=Py.RenderStrategy;function ZZe(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,P]=m.useState(null),I=m.useRef(null),R=n8e(e),O=lc(...R?[I,t,P]:t===null?[]:[t]),U=(n=C.unmount)==null||n?dy.Unmount:dy.Hidden,{show:L,appear:z,initial:X}=XZe(),[ne,J]=m.useState(L?"visible":"hidden"),K=QZe(),{register:re,unregister:he}=K;Za(()=>re(I),[re,I]),Za(()=>{if(U===dy.Hidden&&I.current){if(L&&ne!=="visible"){J("visible");return}return Kf(ne,{hidden:()=>he(I),visible:()=>re(I)})}},[ne,I,re,he,L,U]);let Q=bk();Za(()=>{if(R&&Q&&ne==="visible"&&I.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[I,ne,Q,R]);let ie=X&&!z,oe=z&&L&&X,G=m.useRef(!1),V=r8e(()=>{G.current||(J("hidden"),he(I))},K),te=zs(ye=>{G.current=!0;let je=ye?"enter":"leave";V.onStart(I,je,Pe=>{Pe==="enter"?a==null||a():Pe==="leave"&&(l==null||l())})}),ae=zs(ye=>{let je=ye?"enter":"leave";G.current=!1,V.onStop(I,je,Pe=>{Pe==="enter"?o==null||o():Pe==="leave"&&(c==null||c())}),je==="leave"&&!TD(V)&&(J("hidden"),he(I))});m.useEffect(()=>{R&&s||(te(L),ae(L))},[L,R,s]);let fe=!(!s||!R||!Q||ie),[,Ne]=Ore(fe,N,L,{start:te,end:ae}),me=Tb({ref:O,className:((r=bQ(C.className,oe&&u,oe&&d,Ne.enter&&u,Ne.enter&&Ne.closed&&d,Ne.enter&&!Ne.closed&&f,Ne.leave&&g,Ne.leave&&!Ne.closed&&v,Ne.leave&&Ne.closed&&w,!Ne.transition&&L&&x))==null?void 0:r.trim())||void 0,...Fre(Ne)}),we=0;ne==="visible"&&(we|=tc.Open),ne==="hidden"&&(we|=tc.Closed),Ne.enter&&(we|=tc.Opening),Ne.leave&&(we|=tc.Closing);let xe=So();return Ae.createElement(kD.Provider,{value:V},Ae.createElement(Hre,{value:we},xe({ourProps:me,theirProps:C,defaultTag:s8e,features:i8e,visible:ne==="visible",name:"Transition.Child"})))}function JZe(e,t){let{show:n,appear:r=!1,unmount:s=!0,...a}=e,o=m.useRef(null),l=n8e(e),c=lc(...l?[o,t]:t===null?[]:[t]);bk();let u=aA();if(n===void 0&&u!==null&&(n=(u&tc.Open)===tc.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=r8e(()=>{n||f("hidden")}),[g,v]=m.useState(!0),w=m.useRef([n]);Za(()=>{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]);Za(()=>{n?f("visible"):!TD(x)&&o.current!==null&&f("hidden")},[n,x]);let N={unmount:s},P=zs(()=>{var O;g&&v(!1),(O=e.beforeEnter)==null||O.call(e)}),I=zs(()=>{var O;g&&v(!1),(O=e.beforeLeave)==null||O.call(e)}),R=So();return Ae.createElement(kD.Provider,{value:x},Ae.createElement(_D.Provider,{value:C},R({ourProps:{...N,as:m.Fragment,children:Ae.createElement(a8e,{ref:c,...N,...a,beforeEnter:P,beforeLeave:I})},theirProps:{},defaultTag:m.Fragment,features:i8e,visible:d==="visible",name:"Transition"})))}function eJe(e,t){let n=m.useContext(_D)!==null,r=aA()!==null;return Ae.createElement(Ae.Fragment,null,!n&&r?Ae.createElement(EQ,{ref:t,...e}):Ae.createElement(a8e,{ref:t,...e}))}let EQ=fo(JZe),a8e=fo(ZZe),Wre=fo(eJe),o8e=Object.assign(EQ,{Child:Wre,Root:EQ});var tJe=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(tJe||{}),nJe=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(nJe||{});let rJe={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},qre=m.createContext(null);qre.displayName="DialogContext";function ID(e){let t=m.useContext(qre);if(t===null){let n=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ID),n}return t}function sJe(e,t){return Kf(t.type,rJe,e,t)}let nfe=fo(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=aA();s===void 0&&g!==null&&(s=(g&tc.Open)===tc.Open);let v=m.useRef(null),w=lc(v,t),C=nA(v),N=s?0:1,[P,I]=m.useReducer(sJe,{titleId:null,descriptionId:null,panelRef:m.createRef()}),R=zs(()=>a(!1)),O=zs(ae=>I({type:0,id:ae})),U=bk()?N===0:!1,[L,z]=MZe(),X={get current(){var ae;return(ae=P.panelRef.current)!=null?ae:v.current}},ne=JAe(),{resolveContainers:J}=BZe({mainTreeNode:ne,portals:L,defaultContainers:[X]}),K=g!==null?(g&tc.Closing)===tc.Closing:!1;gAe(u||K?!1:U,{allowed:zs(()=>{var ae,fe;return[(fe=(ae=v.current)==null?void 0:ae.closest("[data-headlessui-portal]"))!=null?fe:null]}),disallowed:zs(()=>{var ae;return[(ae=ne==null?void 0:ne.closest("body > *:not(#headlessui-portal-root)"))!=null?ae:null]})}),NAe(U,J,ae=>{ae.preventDefault(),R()}),LZe(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()}),jAe(u||K?!1:U,C,J),bAe(U,v,R);let[re,he]=Ere(),Q=m.useMemo(()=>[{dialogState:N,close:R,setTitleId:O,unmount:d},P],[N,P,R,O,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":P.titleId,"aria-describedby":re,unmount:d},G=!DZe(),V=Fv.None;U&&!u&&(V|=Fv.RestoreFocus,V|=Fv.TabLock,c&&(V|=Fv.AutoFocus),G&&(V|=Fv.InitialFocus));let te=So();return Ae.createElement(WAe,null,Ae.createElement(efe,{force:!0},Ae.createElement(QAe,null,Ae.createElement(qre.Provider,{value:Q},Ae.createElement(XAe,{target:v},Ae.createElement(efe,{force:!1},Ae.createElement(he,{slot:ie},Ae.createElement(z,null,Ae.createElement(VZe,{initialFocus:o,initialFocusFallback:v,containers:J,features:V},Ae.createElement(pAe,{value:R},te({ourProps:oe,theirProps:f,slot:ie,defaultTag:iJe,features:aJe,visible:N===0,name:"Dialog"})))))))))))}),iJe="div",aJe=Py.RenderStrategy|Py.Static;function oJe(e,t){let{transition:n=!1,open:r,...s}=e,a=aA(),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?Ae.createElement(tfe,null,Ae.createElement(o8e,{show:r,transition:n,unmount:s.unmount},Ae.createElement(nfe,{ref:t,...s}))):Ae.createElement(tfe,null,Ae.createElement(nfe,{ref:t,open:r,...s}))}let lJe="div";function cJe(e,t){let n=m.useId(),{id:r=`headlessui-dialog-panel-${n}`,transition:s=!1,...a}=e,[{dialogState:o,unmount:l},c]=ID("Dialog.Panel"),u=lc(t,c.panelRef),d=m.useMemo(()=>({open:o===0}),[o]),f=zs(C=>{C.stopPropagation()}),x={ref:u,id:r,onClick:f},g=s?Wre:m.Fragment,v=s?{unmount:l}:{},w=So();return Ae.createElement(g,{...v},w({ourProps:x,theirProps:a,slot:d,defaultTag:lJe,name:"Dialog.Panel"}))}let uJe="div";function dJe(e,t){let{transition:n=!1,...r}=e,[{dialogState:s,unmount:a}]=ID("Dialog.Backdrop"),o=m.useMemo(()=>({open:s===0}),[s]),l={ref:t,"aria-hidden":!0},c=n?Wre:m.Fragment,u=n?{unmount:a}:{},d=So();return Ae.createElement(c,{...u},d({ourProps:l,theirProps:r,slot:o,defaultTag:uJe,name:"Dialog.Backdrop"}))}let fJe="h2";function hJe(e,t){let n=m.useId(),{id:r=`headlessui-dialog-title-${n}`,...s}=e,[{dialogState:a,setTitleId:o}]=ID("Dialog.Title"),l=lc(t);m.useEffect(()=>(o(r),()=>o(null)),[r,o]);let c=m.useMemo(()=>({open:a===0}),[a]),u={ref:l,id:r};return So()({ourProps:u,theirProps:s,slot:c,defaultTag:fJe,name:"Dialog.Title"})}let pJe=fo(oJe),ga=fo(cJe),ja=fo(dJe),mJe=fo(hJe),Ea=Object.assign(pJe,{Panel:ga,Title:mJe,Description:fAe});var rfe;let xJe=(rfe=Ae.startTransition)!=null?rfe:function(e){e()};var gJe=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(gJe||{}),bJe=(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))(bJe||{});let yJe={0:e=>({...e,disclosureState:Kf(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}}},Gre=m.createContext(null);Gre.displayName="DisclosureContext";function Kre(e){let t=m.useContext(Gre);if(t===null){let n=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Kre),n}return t}let Yre=m.createContext(null);Yre.displayName="DisclosureAPIContext";function l8e(e){let t=m.useContext(Yre);if(t===null){let n=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,l8e),n}return t}let Xre=m.createContext(null);Xre.displayName="DisclosurePanelContext";function vJe(){return m.useContext(Xre)}function wJe(e,t){return Kf(t.type,yJe,e,t)}let CJe=m.Fragment;function SJe(e,t){let{defaultOpen:n=!1,...r}=e,s=m.useRef(null),a=lc(t,uAe(w=>{s.current=w},e.as===void 0||e.as===m.Fragment)),o=m.useReducer(wJe,{disclosureState:n?0:1,buttonElement:null,panelElement:null,buttonId:null,panelId:null}),[{disclosureState:l,buttonId:c},u]=o,d=zs(w=>{u({type:1});let C=t2(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=So();return Ae.createElement(Gre.Provider,{value:o},Ae.createElement(Yre.Provider,{value:f},Ae.createElement(pAe,{value:d},Ae.createElement(Hre,{value:Kf(l,{0:tc.Open,1:tc.Closed})},v({ourProps:g,theirProps:r,slot:x,defaultTag:CJe,name:"Disclosure"})))))}let NJe="button";function AJe(e,t){let n=m.useId(),{id:r=`headlessui-disclosure-button-${n}`,disabled:s=!1,autoFocus:a=!1,...o}=e,[l,c]=Kre("Disclosure.Button"),u=vJe(),d=u===null?!1:u===l.panelId,f=m.useRef(null),x=lc(f,t,zs(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=zs(X=>{var ne;if(d){if(l.disclosureState===1)return;switch(X.key){case go.Space:case go.Enter:X.preventDefault(),X.stopPropagation(),c({type:0}),(ne=l.buttonElement)==null||ne.focus();break}}else switch(X.key){case go.Space:case go.Enter:X.preventDefault(),X.stopPropagation(),c({type:0});break}}),v=zs(X=>{switch(X.key){case go.Space:X.preventDefault();break}}),w=zs(X=>{var ne;jre(X.currentTarget)||s||(d?(c({type:0}),(ne=l.buttonElement)==null||ne.focus()):c({type:0}))}),{isFocusVisible:C,focusProps:N}=Sre({autoFocus:a}),{isHovered:P,hoverProps:I}=Cre({isDisabled:s}),{pressed:R,pressProps:O}=Nre({disabled:s}),U=m.useMemo(()=>({open:l.disclosureState===0,hover:P,active:R,disabled:s,focus:C,autofocus:a}),[l,P,R,C,s,a]),L=Pre(e,l.buttonElement),z=v9(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,I,O);return So()({ourProps:z,theirProps:o,slot:U,defaultTag:NJe,name:"Disclosure.Button"})}let jJe="div",EJe=Py.RenderStrategy|Py.Static;function _Je(e,t){let n=m.useId(),{id:r=`headlessui-disclosure-panel-${n}`,transition:s=!1,...a}=e,[o,l]=Kre("Disclosure.Panel"),{close:c}=l8e("Disclosure.Panel"),[u,d]=m.useState(null),f=lc(t,zs(P=>{xJe(()=>l({type:5,element:P}))}),d);m.useEffect(()=>(l({type:3,panelId:r}),()=>{l({type:3,panelId:null})}),[r,l]);let x=aA(),[g,v]=Ore(s,u,x!==null?(x&tc.Open)===tc.Open:o.disclosureState===0),w=m.useMemo(()=>({open:o.disclosureState===0,close:c}),[o.disclosureState,c]),C={ref:f,id:r,...Fre(v)},N=So();return Ae.createElement(WAe,null,Ae.createElement(Xre.Provider,{value:o.panelId},N({ourProps:C,theirProps:a,slot:w,defaultTag:jJe,features:EJe,visible:g,name:"Disclosure.Panel"})))}let kJe=fo(SJe),Qre=fo(AJe),Zre=fo(_Je),c8e=Object.assign(kJe,{Button:Qre,Panel:Zre});function TJe(e,t){let n=m.useRef({left:0,top:0});if(Za(()=>{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 sfe=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function ife(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 sfe.test(o)&&(o=o.replace(sfe,"")),o}function IJe(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():ife(a).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return ife(e).trim()}function PJe(e){let t=m.useRef(""),n=m.useRef("");return zs(()=>{let r=e.current;if(!r)return"";let s=r.innerText;if(t.current===s)return n.current;let a=IJe(r).trim().toLowerCase();return t.current=s,n.current=a,a})}var FJe=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(FJe||{}),OJe=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(OJe||{}),MJe=(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))(MJe||{});function Sz(e,t=n=>n){let n=e.activeItemIndex!==null?e.items[e.activeItemIndex]:null,r=wAe(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 RJe={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===ku.Nothing)return{...l,activeItemIndex:null};if(t.focus===ku.Specific)return{...l,activeItemIndex:e.items.findIndex(d=>d.id===t.id)};if(t.focus===ku.Previous){let d=e.activeItemIndex;if(d!==null){let f=e.items[d].dataRef.current.domRef,x=Cz(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===ku.Next){let d=e.activeItemIndex;if(d!==null){let f=e.items[d].dataRef.current.domRef,x=Cz(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=Sz(e),u=Cz(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=Sz(e,r=>[...r,{id:t.id,dataRef:t.dataRef}]);return{...e,...n}},6:(e,t)=>{let n=Sz(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}},Jre=m.createContext(null);Jre.displayName="MenuContext";function PD(e){let t=m.useContext(Jre);if(t===null){let n=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,PD),n}return t}function LJe(e,t){return Kf(t.type,RJe,e,t)}let DJe=m.Fragment;function BJe(e,t){let{__demoMode:n=!1,...r}=e,s=m.useReducer(LJe,{__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=lc(t);NAe(a===0,[l,o],(v,w)=>{c({type:1}),Ire(w,Tre.Loose)||(v.preventDefault(),l==null||l.focus())});let d=zs(()=>{c({type:1})}),f=m.useMemo(()=>({open:a===0,close:d}),[a,d]),x={ref:u},g=So();return Ae.createElement(SZe,null,Ae.createElement(Jre.Provider,{value:s},Ae.createElement(Hre,{value:Kf(a,{0:tc.Open,1:tc.Closed})},g({ourProps:x,theirProps:r,slot:f,defaultTag:DJe,name:"Menu"}))))}let $Je="button";function UJe(e,t){var n;let r=m.useId(),{id:s=`headlessui-menu-button-${r}`,disabled:a=!1,autoFocus:o=!1,...l}=e,[c,u]=PD("Menu.Button"),d=vZe(),f=lc(t,yZe(),zs(L=>u({type:7,element:L}))),x=zs(L=>{switch(L.key){case go.Space:case go.Enter:case go.ArrowDown:L.preventDefault(),L.stopPropagation(),Na.flushSync(()=>u({type:0})),u({type:2,focus:ku.First});break;case go.ArrowUp:L.preventDefault(),L.stopPropagation(),Na.flushSync(()=>u({type:0})),u({type:2,focus:ku.Last});break}}),g=zs(L=>{switch(L.key){case go.Space:L.preventDefault();break}}),v=zs(L=>{var z;if(jre(L.currentTarget))return L.preventDefault();a||(c.menuState===0?(Na.flushSync(()=>u({type:1})),(z=c.buttonElement)==null||z.focus({preventScroll:!0})):(L.preventDefault(),u({type:0})))}),{isFocusVisible:w,focusProps:C}=Sre({autoFocus:o}),{isHovered:N,hoverProps:P}=Cre({isDisabled:a}),{pressed:I,pressProps:R}=Nre({disabled:a}),O=m.useMemo(()=>({open:c.menuState===0,active:I||c.menuState===0,disabled:a,hover:N,focus:w,autofocus:o}),[c,N,w,I,a,o]),U=v9(d(),{ref:f,id:s,type:Pre(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,P,R);return So()({ourProps:U,theirProps:l,slot:O,defaultTag:$Je,name:"Menu.Button"})}let zJe="div",HJe=Py.RenderStrategy|Py.Static;function VJe(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=bZe(o),[x,g]=PD("Menu.Items"),[v,w]=CZe(f),C=wZe(),[N,P]=m.useState(null),I=lc(t,f?v:null,zs(G=>g({type:8,element:G})),P),R=nA(x.itemsElement);f&&(l=!0);let O=aA(),[U,L]=Ore(u,N,O!==null?(O&tc.Open)===tc.Open:x.menuState===0);bAe(U,x.buttonElement,()=>{g({type:1})});let z=x.__demoMode?!1:c&&x.menuState===0;jAe(z,R);let X=x.__demoMode?!1:c&&x.menuState===0;gAe(X,{allowed:m.useCallback(()=>[x.buttonElement,x.itemsElement],[x.buttonElement,x.itemsElement])});let ne=x.menuState!==0,J=TJe(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]),hQe(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 K=n2(),re=zs(G=>{var V,te,ae;switch(K.dispose(),G.key){case go.Space:if(x.searchQuery!=="")return G.preventDefault(),G.stopPropagation(),g({type:3,value:G.key});case go.Enter:if(G.preventDefault(),G.stopPropagation(),g({type:1}),x.activeItemIndex!==null){let{dataRef:fe}=x.items[x.activeItemIndex];(te=(V=fe.current)==null?void 0:V.domRef.current)==null||te.click()}vAe(x.buttonElement);break;case go.ArrowDown:return G.preventDefault(),G.stopPropagation(),g({type:2,focus:ku.Next});case go.ArrowUp:return G.preventDefault(),G.stopPropagation(),g({type:2,focus:ku.Previous});case go.Home:case go.PageUp:return G.preventDefault(),G.stopPropagation(),g({type:2,focus:ku.First});case go.End:case go.PageDown:return G.preventDefault(),G.stopPropagation(),g({type:2,focus:ku.Last});case go.Escape:G.preventDefault(),G.stopPropagation(),Na.flushSync(()=>g({type:1})),(ae=x.buttonElement)==null||ae.focus({preventScroll:!0});break;case go.Tab:G.preventDefault(),G.stopPropagation(),Na.flushSync(()=>g({type:1})),ZXe(x.buttonElement,G.shiftKey?nm.Previous:nm.Next);break;default:G.key.length===1&&(g({type:3,value:G.key}),K.setTimeout(()=>g({type:4}),350));break}}),he=zs(G=>{switch(G.key){case go.Space:G.preventDefault();break}}),Q=m.useMemo(()=>({open:x.menuState===0}),[x.menuState]),ie=v9(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:I,style:{...d.style,...w,"--button-width":HXe(x.buttonElement,!0).width},...Fre(L)}),oe=So();return Ae.createElement(QAe,{enabled:l?e.static||U:!1},oe({ourProps:ie,theirProps:d,slot:Q,defaultTag:zJe,features:HJe,visible:J,name:"Menu.Items"}))}let WJe=m.Fragment;function qJe(e,t){let n=m.useId(),{id:r=`headlessui-menu-item-${n}`,disabled:s=!1,...a}=e,[o,l]=PD("Menu.Item"),c=o.activeItemIndex!==null?o.items[o.activeItemIndex].id===r:!1,u=m.useRef(null),d=lc(t,u);Za(()=>{if(!o.__demoMode&&o.menuState===0&&c&&o.activationTrigger!==0)return cx().requestAnimationFrame(()=>{var J,K;(K=(J=u.current)==null?void 0:J.scrollIntoView)==null||K.call(J,{block:"nearest"})})},[o.__demoMode,u,c,o.menuState,o.activationTrigger,o.activeItemIndex]);let f=PJe(u),x=m.useRef({disabled:s,domRef:u,get textValue(){return f()}});Za(()=>{x.current.disabled=s},[x,s]),Za(()=>(l({type:5,id:r,dataRef:x}),()=>l({type:6,id:r})),[x,r]);let g=zs(()=>{l({type:1})}),v=zs(J=>{if(s)return J.preventDefault();l({type:1}),vAe(o.buttonElement)}),w=zs(()=>{if(s)return l({type:2,focus:ku.Nothing});l({type:2,focus:ku.Specific,id:r})}),C=aQe(),N=zs(J=>{C.update(J),!s&&(c||l({type:2,focus:ku.Specific,id:r,trigger:0}))}),P=zs(J=>{C.wasMoved(J)&&(s||c||l({type:2,focus:ku.Specific,id:r,trigger:0}))}),I=zs(J=>{C.wasMoved(J)&&(s||c&&l({type:2,focus:ku.Nothing}))}),[R,O]=kre(),[U,L]=Ere(),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:P,onMouseMove:P,onPointerLeave:I,onMouseLeave:I},ne=So();return Ae.createElement(O,null,Ae.createElement(L,null,ne({ourProps:X,theirProps:a,slot:z,defaultTag:WJe,name:"Menu.Item"})))}let GJe="div";function KJe(e,t){let[n,r]=kre(),s=e,a={ref:t,"aria-labelledby":n,role:"group"},o=So();return Ae.createElement(r,null,o({ourProps:a,theirProps:s,slot:{},defaultTag:GJe,name:"Menu.Section"}))}let YJe="header";function XJe(e,t){let n=m.useId(),{id:r=`headlessui-menu-heading-${n}`,...s}=e,a=_re();Za(()=>a.register(r),[r,a.register]);let o={id:r,ref:t,role:"presentation",...a.props};return So()({ourProps:o,theirProps:s,slot:{},defaultTag:YJe,name:"Menu.Heading"})}let QJe="div";function ZJe(e,t){let n=e,r={ref:t,role:"separator"};return So()({ourProps:r,theirProps:n,slot:{},defaultTag:QJe,name:"Menu.Separator"})}let JJe=fo(BJe),FD=fo(UJe),OD=fo(VJe),EC=fo(qJe),eet=fo(KJe),tet=fo(XJe),net=fo(ZJe),MD=Object.assign(JJe,{Button:FD,Items:OD,Item:EC,Section:eet,Heading:tet,Separator:net}),ese=m.createContext(null);ese.displayName="GroupContext";let ret=m.Fragment;function set(e){var t;let[n,r]=m.useState(null),[s,a]=kre(),[o,l]=Ere(),c=m.useMemo(()=>({switch:n,setSwitch:r}),[n,r]),u={},d=e,f=So();return Ae.createElement(l,{name:"Switch.Description",value:o},Ae.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}))}}},Ae.createElement(ese.Provider,{value:c},f({ourProps:u,theirProps:d,slot:{},defaultTag:ret,name:"Switch.Group"}))))}let iet="button";function aet(e,t){var n;let r=m.useId(),s=lAe(),a=Are(),{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(ese),[N,P]=m.useState(null),I=m.useRef(null),R=lc(I,t,C===null?null:C.setSwitch,P),O=SXe(u),[U,L]=CXe(c,d,O??!1),z=n2(),[X,ne]=m.useState(!1),J=zs(()=>{ne(!0),L==null||L(!U),z.nextFrame(()=>{ne(!1)})}),K=zs(ye=>{if(jre(ye.currentTarget))return ye.preventDefault();ye.preventDefault(),J()}),re=zs(ye=>{ye.key===go.Space?(ye.preventDefault(),J()):ye.key===go.Enter&&NXe(ye.currentTarget)}),he=zs(ye=>ye.preventDefault()),Q=hAe(),ie=FXe(),{isFocusVisible:oe,focusProps:G}=Sre({autoFocus:v}),{isHovered:V,hoverProps:te}=Cre({isDisabled:l}),{pressed:ae,pressProps:fe}=Nre({disabled:l}),Ne=m.useMemo(()=>({checked:U,disabled:l,hover:V,focus:oe,active:ae,autofocus:v,changing:X}),[U,V,oe,ae,l,X,v]),me=v9({id:o,ref:R,role:"switch",type:Pre(e,N),tabIndex:e.tabIndex===-1?0:(n=e.tabIndex)!=null?n:0,"aria-checked":U,"aria-labelledby":Q,"aria-describedby":ie,disabled:l||void 0,autoFocus:v,onClick:K,onKeyUp:re,onKeyPress:he},G,te,fe),we=m.useCallback(()=>{if(O!==void 0)return L==null?void 0:L(O)},[L,O]),xe=So();return Ae.createElement(Ae.Fragment,null,f!=null&&Ae.createElement(kXe,{disabled:l,data:{[f]:x||"on"},overrides:{type:"checkbox",checked:U},form:g,onReset:we}),xe({ourProps:me,theirProps:w,slot:Ne,defaultTag:iet,name:"Switch"}))}let oet=fo(aet),cet=set,uet=$Xe,det=fAe,_o=Object.assign(oet,{Group:cet,Label:uet,Description:det});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 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 Dl=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:"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 jS=m.forwardRef(het);function pet({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 met=m.forwardRef(pet);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:"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 tse=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:"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 bet=m.forwardRef(get);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:"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 u8e=m.forwardRef(yet);function vet({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 A9=m.forwardRef(vet);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",{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 nse=m.forwardRef(wet);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:"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 s5=m.forwardRef(Cet);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:"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 Aet=m.forwardRef(Net);function jet({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 Eet=m.forwardRef(jet);function _et({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 d8e=m.forwardRef(_et);function ket({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 Tet=m.forwardRef(ket);function Iet({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 f8e=m.forwardRef(Iet),h8e=m.createContext({});function Pet(e){const t=m.useRef(null);return t.current===null&&(t.current=e()),t.current}const rse=typeof window<"u",Fet=rse?m.useLayoutEffect:m.useEffect,sse=m.createContext(null);function yk(e,t){e.indexOf(t)===-1&&e.push(t)}function vk(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Oc=(e,t,n)=>n>t?t:n<e?e:n;let ES=()=>{};const Mc={},RD=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function LD(e){return typeof e=="object"&&e!==null}const DD=e=>/^0[^.\s]+$/u.test(e);function oA(e){let t;return()=>(t===void 0&&(t=e()),t)}const ll=e=>e,Oet=(e,t)=>n=>t(e(n)),dx=(...e)=>e.reduce(Oet),Y0=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class lA{constructor(){this.subscriptions=[]}add(t){return yk(this.subscriptions,t),()=>vk(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 zl=e=>e*1e3,il=e=>e/1e3;function BD(e,t){return t?e*(1e3/t):0}const p8e=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Met=1e-7,Ret=12;function Let(e,t,n,r,s){let a,o,l=0;do o=t+(n-t)/2,a=p8e(o,r,s)-e,a>0?n=o:t=o;while(Math.abs(a)>Met&&++l<Ret);return o}function wk(e,t,n,r){if(e===t&&n===r)return ll;const s=a=>Let(a,0,1,e,n);return a=>a===0||a===1?a:p8e(s(a),t,r)}const m8e=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,x8e=e=>t=>1-e(1-t),g8e=wk(.33,1.53,.69,.99),ise=x8e(g8e),ase=m8e(ise),ose=e=>(e*=2)<1?.5*ise(e):.5*(2-Math.pow(2,-10*(e-1))),lse=e=>1-Math.sin(Math.acos(e)),cse=x8e(lse),use=m8e(lse),Det=wk(.42,0,1,1),Bet=wk(0,0,.58,1),dse=wk(.42,0,.58,1),b8e=e=>Array.isArray(e)&&typeof e[0]!="number",fse=e=>Array.isArray(e)&&typeof e[0]=="number",afe={linear:ll,easeIn:Det,easeInOut:dse,easeOut:Bet,circIn:lse,circInOut:use,circOut:cse,backIn:ise,backInOut:ase,backOut:g8e,anticipate:ose},$et=e=>typeof e=="string",HO=e=>{if(fse(e)){ES(e.length===4);const[t,n,r,s]=e;return wk(t,n,r,s)}else if($et(e))return ES(afe[e]!==void 0),afe[e];return e},AI=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Uet(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 zet=40;function y8e(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=AI.reduce((I,R)=>(I[R]=Uet(a),I),{}),{setup:l,read:c,resolveKeyframes:u,preUpdate:d,update:f,preRender:x,render:g,postRender:v}=o,w=()=>{const I=Mc.useManualTiming?s.timestamp:performance.now();n=!1,Mc.useManualTiming||(s.delta=r?1e3/60:Math.max(Math.min(I-s.timestamp,zet),1)),s.timestamp=I,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:AI.reduce((I,R)=>{const O=o[R];return I[R]=(U,L=!1,z=!1)=>(n||C(),O.schedule(U,L,z)),I},{}),cancel:I=>{for(let R=0;R<AI.length;R++)o[AI[R]].cancel(I)},state:s,steps:o}}const{schedule:Fo,cancel:Ly,state:Kc,steps:Nz}=y8e(typeof requestAnimationFrame<"u"?requestAnimationFrame:ll,!0);let _F;function Het(){_F=void 0}const Qd={now:()=>(_F===void 0&&Qd.set(Kc.isProcessing||Mc.useManualTiming?Kc.timestamp:performance.now()),_F),set:e=>{_F=e,queueMicrotask(Het)}},v8e=e=>t=>typeof t=="string"&&t.startsWith(e),hse=v8e("--"),Vet=v8e("var(--"),pse=e=>Vet(e)?Wet.test(e.split("/*")[0].trim()):!1,Wet=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,cA={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},j9={...cA,transform:e=>Oc(0,1,e)},jI={...cA,default:1},Dj=e=>Math.round(e*1e5)/1e5,mse=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function qet(e){return e==null}const Get=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,xse=(e,t)=>n=>!!(typeof n=="string"&&Get.test(n)&&n.startsWith(e)||t&&!qet(n)&&Object.prototype.hasOwnProperty.call(n,t)),w8e=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,a,o,l]=r.match(mse);return{[e]:parseFloat(s),[t]:parseFloat(a),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},Ket=e=>Oc(0,255,e),Az={...cA,transform:e=>Math.round(Ket(e))},Hv={test:xse("rgb","red"),parse:w8e("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Az.transform(e)+", "+Az.transform(t)+", "+Az.transform(n)+", "+Dj(j9.transform(r))+")"};function Yet(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 _Q={test:xse("#"),parse:Yet,transform:Hv.transform},Ck=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Sb=Ck("deg"),R0=Ck("%"),li=Ck("px"),Xet=Ck("vh"),Qet=Ck("vw"),ofe={...R0,parse:e=>R0.parse(e)/100,transform:e=>R0.transform(e*100)},_C={test:xse("hsl","hue"),parse:w8e("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+R0.transform(Dj(t))+", "+R0.transform(Dj(n))+", "+Dj(j9.transform(r))+")"},Rl={test:e=>Hv.test(e)||_Q.test(e)||_C.test(e),parse:e=>Hv.test(e)?Hv.parse(e):_C.test(e)?_C.parse(e):_Q.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Hv.transform(e):_C.transform(e),getAnimatableNone:e=>{const t=Rl.parse(e);return t.alpha=0,Rl.transform(t)}},Zet=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Jet(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(mse))==null?void 0:t.length)||0)+(((n=e.match(Zet))==null?void 0:n.length)||0)>0}const C8e="number",S8e="color",ett="var",ttt="var(",lfe="${}",ntt=/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 E9(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let a=0;const l=t.replace(ntt,c=>(Rl.test(c)?(r.color.push(a),s.push(S8e),n.push(Rl.parse(c))):c.startsWith(ttt)?(r.var.push(a),s.push(ett),n.push(c)):(r.number.push(a),s.push(C8e),n.push(parseFloat(c))),++a,lfe)).split(lfe);return{values:n,split:l,indexes:r,types:s}}function N8e(e){return E9(e).values}function A8e(e){const{split:t,types:n}=E9(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===C8e?a+=Dj(s[o]):l===S8e?a+=Rl.transform(s[o]):a+=s[o]}return a}}const rtt=e=>typeof e=="number"?0:Rl.test(e)?Rl.getAnimatableNone(e):e;function stt(e){const t=N8e(e);return A8e(e)(t.map(rtt))}const Dy={test:Jet,parse:N8e,createTransformer:A8e,getAnimatableNone:stt};function jz(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 itt({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=jz(c,l,e+1/3),a=jz(c,l,e),o=jz(c,l,e-1/3)}return{red:Math.round(s*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function VO(e,t){return n=>n>0?t:e}const zo=(e,t,n)=>e+(t-e)*n,Ez=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},att=[_Q,Hv,_C],ott=e=>att.find(t=>t.test(e));function cfe(e){const t=ott(e);if(!t)return!1;let n=t.parse(e);return t===_C&&(n=itt(n)),n}const ufe=(e,t)=>{const n=cfe(e),r=cfe(t);if(!n||!r)return VO(e,t);const s={...n};return a=>(s.red=Ez(n.red,r.red,a),s.green=Ez(n.green,r.green,a),s.blue=Ez(n.blue,r.blue,a),s.alpha=zo(n.alpha,r.alpha,a),Hv.transform(s))},kQ=new Set(["none","hidden"]);function ltt(e,t){return kQ.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function ctt(e,t){return n=>zo(e,t,n)}function gse(e){return typeof e=="number"?ctt:typeof e=="string"?pse(e)?VO:Rl.test(e)?ufe:ftt:Array.isArray(e)?j8e:typeof e=="object"?Rl.test(e)?ufe:utt:VO}function j8e(e,t){const n=[...e],r=n.length,s=e.map((a,o)=>gse(a)(a,t[o]));return a=>{for(let o=0;o<r;o++)n[o]=s[o](a);return n}}function utt(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=gse(e[s])(e[s],t[s]));return s=>{for(const a in r)n[a]=r[a](s);return n}}function dtt(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 ftt=(e,t)=>{const n=Dy.createTransformer(t),r=E9(e),s=E9(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?kQ.has(e)&&!s.values.length||kQ.has(t)&&!r.values.length?ltt(e,t):dx(j8e(dtt(r,s),s.values),n):VO(e,t)};function E8e(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?zo(e,t,n):gse(e)(e,t)}const htt=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Fo.update(t,n),stop:()=>Ly(t),now:()=>Kc.isProcessing?Kc.timestamp:Qd.now()}},_8e=(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)})`},WO=2e4;function bse(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<WO;)t+=n,r=e.next(t);return t>=WO?1/0:t}function ptt(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(bse(r),WO);return{type:"keyframes",ease:a=>r.next(s*a).value/t,duration:il(s)}}const mtt=5;function k8e(e,t,n){const r=Math.max(t-mtt,0);return BD(n-e(r),t-r)}const tl={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},dfe=.001;function xtt({duration:e=tl.duration,bounce:t=tl.bounce,velocity:n=tl.velocity,mass:r=tl.mass}){let s,a,o=1-t;o=Oc(tl.minDamping,tl.maxDamping,o),e=Oc(tl.minDuration,tl.maxDuration,il(e)),o<1?(s=u=>{const d=u*o,f=d*e,x=d-n,g=TQ(u,o),v=Math.exp(-f);return dfe-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=TQ(Math.pow(u,2),o);return(-s(u)+dfe>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=btt(s,a,l);if(e=zl(e),isNaN(c))return{stiffness:tl.stiffness,damping:tl.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:e}}}const gtt=12;function btt(e,t,n){let r=n;for(let s=1;s<gtt;s++)r=r-e(r)/t(r);return r}function TQ(e,t){return e*Math.sqrt(1-t*t)}const ytt=["duration","bounce"],vtt=["stiffness","damping","mass"];function ffe(e,t){return t.some(n=>e[n]!==void 0)}function wtt(e){let t={velocity:tl.velocity,stiffness:tl.stiffness,damping:tl.damping,mass:tl.mass,isResolvedFromDuration:!1,...e};if(!ffe(e,vtt)&&ffe(e,ytt))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,a=2*Oc(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:tl.mass,stiffness:s,damping:a}}else{const n=xtt(e);t={...t,...n,mass:tl.mass},t.isResolvedFromDuration=!0}return t}function qO(e=tl.visualDuration,t=tl.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}=wtt({...n,velocity:-il(n.velocity||0)}),v=x||0,w=u/(2*Math.sqrt(c*d)),C=o-a,N=il(Math.sqrt(c/d)),P=Math.abs(C)<5;r||(r=P?tl.restSpeed.granular:tl.restSpeed.default),s||(s=P?tl.restDelta.granular:tl.restDelta.default);let I;if(w<1){const O=TQ(N,w);I=U=>{const L=Math.exp(-w*N*U);return o-L*((v+w*N*C)/O*Math.sin(O*U)+C*Math.cos(O*U))}}else if(w===1)I=O=>o-Math.exp(-N*O)*(C+(v+N*C)*O);else{const O=N*Math.sqrt(w*w-1);I=U=>{const L=Math.exp(-w*N*U),z=Math.min(O*U,300);return o-L*((v+w*N*C)*Math.sinh(z)+O*C*Math.cosh(z))/O}}const R={calculatedDuration:g&&f||null,next:O=>{const U=I(O);if(g)l.done=O>=f;else{let L=O===0?v:0;w<1&&(L=O===0?zl(v):k8e(I,O,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 O=Math.min(bse(R),WO),U=_8e(L=>R.next(O*L).value,O,30);return O+"ms "+U},toTransition:()=>{}};return R}qO.applyToOptions=e=>{const t=ptt(e,100,qO);return e.ease=t.ease,e.duration=zl(t.duration),e.type="keyframes",e};function IQ({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 P=z=>-w*Math.exp(-z/r),I=z=>N+P(z),R=z=>{const X=P(z),ne=I(z);x.done=Math.abs(X)<=u,x.value=x.done?N:ne};let O,U;const L=z=>{g(x.value)&&(O=z,U=qO({keyframes:[x.value,v(x.value)],velocity:k8e(I,z,x.value),damping:s,stiffness:a,restDelta:u,restSpeed:d}))};return L(0),{calculatedDuration:null,next:z=>{let X=!1;return!U&&O===void 0&&(X=!0,R(z),L(z)),O!==void 0&&z>=O?U.next(z-O):(!X&&R(z),x)}}}function Ctt(e,t,n){const r=[],s=n||Mc.mix||E8e,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]||ll:t;l=dx(c,l)}r.push(l)}return r}function Stt(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const a=e.length;if(ES(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=Ctt(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=Y0(e[f],e[f+1],d);return l[f](x)};return n?d=>u(Oc(e[0],e[a-1],d)):u}function Ntt(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Y0(0,t,r);e.push(zo(n,1,s))}}function Att(e){const t=[0];return Ntt(t,e.length-1),t}function jtt(e,t){return e.map(n=>n*t)}function Ett(e,t){return e.map(()=>t||dse).splice(0,e.length-1)}function Bj({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=b8e(r)?r.map(HO):HO(r),a={done:!1,value:t[0]},o=jtt(n&&n.length===t.length?n:Att(t),e),l=Stt(o,t,{ease:Array.isArray(s)?s:Ett(t,s)});return{calculatedDuration:e,next:c=>(a.value=l(c),a.done=c>=e,a)}}const _tt=e=>e!==null;function yse(e,{repeat:t,repeatType:n="loop"},r,s=1){const a=e.filter(_tt),l=s<0||t&&n!=="loop"&&t%2===1?0:a.length-1;return!l||r===void 0?a[l]:r}const ktt={decay:IQ,inertia:IQ,tween:Bj,keyframes:Bj,spring:qO};function T8e(e){typeof e.type=="string"&&(e.type=ktt[e.type])}let vse=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 Ttt=e=>e/100;let wse=class extends vse{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;T8e(t);const{type:n=Bj,repeat:r=0,repeatDelay:s=0,repeatType:a,velocity:o=0}=t;let{keyframes:l}=t;const c=n||Bj;c!==Bj&&typeof l[0]!="number"&&(this.mixKeyframes=dx(Ttt,E8e(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=bse(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),P=this.playbackSpeed>=0?N<0:N>s;this.currentTime=Math.max(N,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let I=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)),I=Oc(0,1,ne)*l}const O=P?{done:!1,value:d[0]}:R.next(I);a&&(O.value=a(O.value));let{done:U}=O;!P&&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!==IQ&&(O.value=yse(d,this.options,C,this.speed)),w&&w(O.value),L&&this.finish(),O}then(t,n){return this.finished.then(t,n)}get duration(){return il(this.calculatedDuration)}get time(){return il(this.currentTime)}set time(t){var n;t=zl(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=il(this.currentTime))}play(){var s,a;if(this.isStopped)return;const{driver:t=htt,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 Itt(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Vv=e=>e*180/Math.PI,PQ=e=>{const t=Vv(Math.atan2(e[1],e[0]));return FQ(t)},Ptt={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:PQ,rotateZ:PQ,skewX:e=>Vv(Math.atan(e[1])),skewY:e=>Vv(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},FQ=e=>(e=e%360,e<0&&(e+=360),e),hfe=PQ,pfe=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),mfe=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Ftt={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:pfe,scaleY:mfe,scale:e=>(pfe(e)+mfe(e))/2,rotateX:e=>FQ(Vv(Math.atan2(e[6],e[5]))),rotateY:e=>FQ(Vv(Math.atan2(-e[2],e[0]))),rotateZ:hfe,rotate:hfe,skewX:e=>Vv(Math.atan(e[4])),skewY:e=>Vv(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function OQ(e){return e.includes("scale")?1:0}function MQ(e,t){if(!e||e==="none")return OQ(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=Ftt,s=n;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Ptt,s=l}if(!s)return OQ(t);const a=r[t],o=s[1].split(",").map(Mtt);return typeof a=="function"?a(o):o[a]}const Ott=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return MQ(n,t)};function Mtt(e){return parseFloat(e.trim())}const uA=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],dA=new Set(uA),xfe=e=>e===cA||e===li,Rtt=new Set(["x","y","z"]),Ltt=uA.filter(e=>!Rtt.has(e));function Dtt(e){const t=[];return Ltt.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Hw={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})=>MQ(t,"x"),y:(e,{transform:t})=>MQ(t,"y")};Hw.translateX=Hw.x;Hw.translateY=Hw.y;const Vw=new Set;let RQ=!1,LQ=!1,DQ=!1;function I8e(){if(LQ){const e=Array.from(Vw).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=Dtt(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)})}LQ=!1,RQ=!1,Vw.forEach(e=>e.complete(DQ)),Vw.clear()}function P8e(){Vw.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(LQ=!0)})}function Btt(){DQ=!0,P8e(),I8e(),DQ=!1}let Cse=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?(Vw.add(this),RQ||(RQ=!0,Fo.read(P8e),Fo.resolveKeyframes(I8e))):(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])}Itt(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Vw.delete(this)}cancel(){this.state==="scheduled"&&(Vw.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}};const $tt=e=>e.startsWith("--");function Utt(e,t,n){$tt(t)?e.style.setProperty(t,n):e.style[t]=n}const ztt=oA(()=>window.ScrollTimeline!==void 0),Htt={};function Vtt(e,t){const n=oA(e);return()=>Htt[t]??n()}const F8e=Vtt(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),lj=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,gfe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:lj([0,.65,.55,1]),circOut:lj([.55,0,1,.45]),backIn:lj([.31,.01,.66,-.59]),backOut:lj([.33,1.53,.69,.99])};function O8e(e,t){if(e)return typeof e=="function"?F8e()?_8e(e,t):"ease-out":fse(e)?lj(e):Array.isArray(e)?e.map(n=>O8e(n,t)||gfe.easeOut):gfe[e]}function Wtt(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=O8e(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 M8e(e){return typeof e=="function"&&"applyToOptions"in e}function qtt({type:e,...t}){return M8e(e)&&F8e()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}let Gtt=class extends vse{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,ES(typeof t.type!="string");const u=qtt(t);this.animation=Wtt(n,r,s,u,a),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const d=yse(s,this.options,l,this.speed);this.updateMotionValue?this.updateMotionValue(d):Utt(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 il(Number(t))}get time(){return il(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=zl(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&&ztt()?(this.animation.timeline=t,ll):n(this)}};const R8e={anticipate:ose,backInOut:ase,circInOut:use};function Ktt(e){return e in R8e}function Ytt(e){typeof e.ease=="string"&&Ktt(e.ease)&&(e.ease=R8e[e.ease])}const bfe=10;let Xtt=class extends Gtt{constructor(t){Ytt(t),T8e(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 wse({...o,autoplay:!1}),c=zl(this.finishedTime??this.time);n.setWithVelocity(l.sample(c-bfe).value,l.sample(c).value,bfe),l.stop()}};const yfe=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Dy.test(e)||e==="0")&&!e.startsWith("url("));function Qtt(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 Ztt(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=yfe(s,t),l=yfe(a,t);return!o||!l?!1:Qtt(e)||(n==="spring"||M8e(n))&&r}function BQ(e){e.duration=0,e.type}const Jtt=new Set(["opacity","clipPath","filter","transform"]),ent=oA(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function tnt(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 ent()&&n&&Jtt.has(n)&&(n!=="transform"||!u)&&!c&&!r&&s!=="mirror"&&a!==0&&o!=="inertia"}const nnt=40;let rnt=class extends vse{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)||Cse;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(),Ztt(t,a,o,l)||((Mc.instantAnimations||!c)&&(d==null||d(yse(t,r,n))),t[0]=t[t.length-1],BQ(r),r.repeat=0);const x={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>nnt?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},g=!u&&tnt(x)?new Xtt({...x,element:x.motionValue.owner.current}):new wse(x);g.finished.then(()=>this.notifyFinished()).catch(ll),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(),Btt()),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 snt=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function int(e){const t=snt.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function L8e(e,t,n=1){const[r,s]=int(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const o=a.trim();return RD(o)?parseFloat(o):o}return pse(s)?L8e(s,t,n+1):s}function Sse(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const D8e=new Set(["width","height","top","left","right","bottom",...uA]),ant={test:e=>e==="auto",parse:e=>e},B8e=e=>t=>t.test(e),$8e=[cA,li,R0,Sb,Qet,Xet,ant],vfe=e=>$8e.find(B8e(e));function ont(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||DD(e):!0}const lnt=new Set(["brightness","contrast","saturate","opacity"]);function cnt(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(mse)||[];if(!r)return e;const s=n.replace(r,"");let a=lnt.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+s+")"}const unt=/\b([a-z-]*)\(.*?\)/gu,$Q={...Dy,getAnimatableNone:e=>{const t=e.match(unt);return t?t.map(cnt).join(" "):e}},wfe={...cA,transform:Math.round},dnt={rotate:Sb,rotateX:Sb,rotateY:Sb,rotateZ:Sb,scale:jI,scaleX:jI,scaleY:jI,scaleZ:jI,skew:Sb,skewX:Sb,skewY:Sb,distance:li,translateX:li,translateY:li,translateZ:li,x:li,y:li,z:li,perspective:li,transformPerspective:li,opacity:j9,originX:ofe,originY:ofe,originZ:li},Nse={borderWidth:li,borderTopWidth:li,borderRightWidth:li,borderBottomWidth:li,borderLeftWidth:li,borderRadius:li,radius:li,borderTopLeftRadius:li,borderTopRightRadius:li,borderBottomRightRadius:li,borderBottomLeftRadius:li,width:li,maxWidth:li,height:li,maxHeight:li,top:li,right:li,bottom:li,left:li,padding:li,paddingTop:li,paddingRight:li,paddingBottom:li,paddingLeft:li,margin:li,marginTop:li,marginRight:li,marginBottom:li,marginLeft:li,backgroundPositionX:li,backgroundPositionY:li,...dnt,zIndex:wfe,fillOpacity:j9,strokeOpacity:j9,numOctaves:wfe},fnt={...Nse,color:Rl,backgroundColor:Rl,outlineColor:Rl,fill:Rl,stroke:Rl,borderColor:Rl,borderTopColor:Rl,borderRightColor:Rl,borderBottomColor:Rl,borderLeftColor:Rl,filter:$Q,WebkitFilter:$Q},U8e=e=>fnt[e];function z8e(e,t){let n=U8e(e);return n!==$Q&&(n=Dy),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const hnt=new Set(["auto","none","0"]);function pnt(e,t,n){let r=0,s;for(;r<e.length&&!s;){const a=e[r];typeof a=="string"&&!hnt.has(a)&&E9(a).values.length&&(s=e[r]),r++}if(s&&n)for(const a of t)e[a]=z8e(n,s)}let mnt=class extends Cse{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(),pse(u))){const d=L8e(u,n.current);d!==void 0&&(t[c]=d),c===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!D8e.has(r)||t.length!==2)return;const[s,a]=t,o=vfe(s),l=vfe(a);if(o!==l)if(xfe(o)&&xfe(l))for(let c=0;c<t.length;c++){const u=t[c];typeof u=="string"&&(t[c]=parseFloat(u))}else Hw[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||ont(t[s]))&&r.push(s);r.length&&pnt(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=Hw[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]=Hw[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 xnt(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 H8e=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function gnt(e){return LD(e)&&"offsetHeight"in e}const Cfe=30,bnt=e=>!isNaN(parseFloat(e));let ynt=class{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=bnt(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 lA);const r=this.events[t].add(n);return t==="change"?()=>{r(),Fo.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>Cfe)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Cfe);return BD(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 _S(e,t){return new ynt(e,t)}const{schedule:Ase,cancel:x2n}=y8e(queueMicrotask,!1),Mp={x:!1,y:!1};function V8e(){return Mp.x||Mp.y}function vnt(e){return e==="x"||e==="y"?Mp[e]?null:(Mp[e]=!0,()=>{Mp[e]=!1}):Mp.x||Mp.y?null:(Mp.x=Mp.y=!0,()=>{Mp.x=Mp.y=!1})}function W8e(e,t){const n=xnt(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function Sfe(e){return!(e.pointerType==="touch"||V8e())}function wnt(e,t,n={}){const[r,s,a]=W8e(e,n),o=l=>{if(!Sfe(l))return;const{target:c}=l,u=t(c,l);if(typeof u!="function"||!c)return;const d=f=>{Sfe(f)&&(u(f),c.removeEventListener("pointerleave",d))};c.addEventListener("pointerleave",d,s)};return r.forEach(l=>{l.addEventListener("pointerenter",o,s)}),a}const q8e=(e,t)=>t?e===t?!0:q8e(e,t.parentElement):!1,jse=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Cnt=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Snt(e){return Cnt.has(e.tagName)||e.tabIndex!==-1}const kF=new WeakSet;function Nfe(e){return t=>{t.key==="Enter"&&e(t)}}function _z(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Nnt=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Nfe(()=>{if(kF.has(n))return;_z(n,"down");const s=Nfe(()=>{_z(n,"up")}),a=()=>_z(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 Afe(e){return jse(e)&&!V8e()}function Ant(e,t,n={}){const[r,s,a]=W8e(e,n),o=l=>{const c=l.currentTarget;if(!Afe(l))return;kF.add(c);const u=t(c,l),d=(g,v)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",x),kF.has(c)&&kF.delete(c),Afe(g)&&typeof u=="function"&&u(g,{success:v})},f=g=>{d(g,c===window||c===document||n.useGlobalTarget||q8e(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),gnt(l)&&(l.addEventListener("focus",u=>Nnt(u,s)),!Snt(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),a}function G8e(e){return LD(e)&&"ownerSVGElement"in e}function jnt(e){return G8e(e)&&e.tagName==="svg"}const Pu=e=>!!(e&&e.getVelocity),Ent=[...$8e,Rl,Dy],_nt=e=>Ent.find(B8e(e)),K8e=m.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function knt(e=!0){const t=m.useContext(sse);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 Y8e=m.createContext({strict:!1}),jfe={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"]},kS={};for(const e in jfe)kS[e]={isEnabled:t=>jfe[e].some(n=>!!t[n])};function Tnt(e){for(const t in e)kS[t]={...kS[t],...e[t]}}const Int=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 GO(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Int.has(e)}let X8e=e=>!GO(e);function Pnt(e){typeof e=="function"&&(X8e=t=>t.startsWith("on")?!GO(t):e(t))}try{Pnt(require("@emotion/is-prop-valid").default)}catch{}function Fnt(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(X8e(s)||n===!0&&GO(s)||!t&&!GO(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const $D=m.createContext({});function UD(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function _9(e){return typeof e=="string"||Array.isArray(e)}const Ese=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],_se=["initial",...Ese];function zD(e){return UD(e.animate)||_se.some(t=>_9(e[t]))}function Q8e(e){return!!(zD(e)||e.variants)}function Ont(e,t){if(zD(e)){const{initial:n,animate:r}=e;return{initial:n===!1||_9(n)?n:void 0,animate:_9(r)?r:void 0}}return e.inherit!==!1?t:{}}function Mnt(e){const{initial:t,animate:n}=Ont(e,m.useContext($D));return m.useMemo(()=>({initial:t,animate:n}),[Efe(t),Efe(n)])}function Efe(e){return Array.isArray(e)?e.join(" "):e}const k9={};function Rnt(e){for(const t in e)k9[t]=e[t],hse(t)&&(k9[t].isCSSVariable=!0)}function Z8e(e,{layout:t,layoutId:n}){return dA.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!k9[e]||e==="opacity")}const Lnt={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Dnt=uA.length;function Bnt(e,t,n){let r="",s=!0;for(let a=0;a<Dnt;a++){const o=uA[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=H8e(l,Nse[o]);if(!c){s=!1;const d=Lnt[o]||o;r+=`${d}(${u}) `}n&&(t[o]=u)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function kse(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(dA.has(c)){o=!0;continue}else if(hse(c)){s[c]=u;continue}else{const d=H8e(u,Nse[c]);c.startsWith("origin")?(l=!0,a[c]=d):r[c]=d}}if(t.transform||(o||n?r.transform=Bnt(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 Tse=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function J8e(e,t,n){for(const r in t)!Pu(t[r])&&!Z8e(r,n)&&(e[r]=t[r])}function $nt({transformTemplate:e},t){return m.useMemo(()=>{const n=Tse();return kse(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Unt(e,t){const n=e.style||{},r={};return J8e(r,n,e),Object.assign(r,$nt(e,t)),r}function znt(e,t){const n={},r=Unt(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 Hnt={offset:"stroke-dashoffset",array:"stroke-dasharray"},Vnt={offset:"strokeDashoffset",array:"strokeDasharray"};function Wnt(e,t,n=1,r=0,s=!0){e.pathLength=1;const a=s?Hnt:Vnt;e[a.offset]=li.transform(-r);const o=li.transform(t),l=li.transform(n);e[a.array]=`${o} ${l}`}function e7e(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:a=1,pathOffset:o=0,...l},c,u,d){if(kse(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&&Wnt(f,s,a,o,!1)}const t7e=()=>({...Tse(),attrs:{}}),n7e=e=>typeof e=="string"&&e.toLowerCase()==="svg";function qnt(e,t,n,r){const s=m.useMemo(()=>{const a=t7e();return e7e(a,t,n7e(r),e.transformTemplate,e.style),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};J8e(a,e.style,e),s.style={...a,...s.style}}return s}const Gnt=["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 Ise(e){return typeof e!="string"||e.includes("-")?!1:!!(Gnt.indexOf(e)>-1||/[A-Z]/u.test(e))}function Knt(e,t,n,{latestValues:r},s,a=!1){const l=(Ise(e)?qnt:znt)(t,r,s,e),c=Fnt(t,typeof e=="string",a),u=e!==m.Fragment?{...c,...l,ref:n}:{},{children:d}=t,f=m.useMemo(()=>Pu(d)?d.get():d,[d]);return m.createElement(e,{...u,children:f})}function _fe(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Pse(e,t,n,r){if(typeof t=="function"){const[s,a]=_fe(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]=_fe(r);t=t(n!==void 0?n:e.custom,s,a)}return t}function TF(e){return Pu(e)?e.get():e}function Ynt({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:Xnt(n,r,s,e),renderState:t()}}function Xnt(e,t,n,r){const s={},a=r(e,{});for(const x in a)s[x]=TF(a[x]);let{initial:o,animate:l}=e;const c=zD(e),u=Q8e(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"&&!UD(f)){const x=Array.isArray(f)?f:[f];for(let g=0;g<x.length;g++){const v=Pse(e,x[g]);if(v){const{transitionEnd:w,transition:C,...N}=v;for(const P in N){let I=N[P];if(Array.isArray(I)){const R=d?I.length-1:0;I=I[R]}I!==null&&(s[P]=I)}for(const P in w)s[P]=w[P]}}}return s}const r7e=e=>(t,n)=>{const r=m.useContext($D),s=m.useContext(sse),a=()=>Ynt(e,t,r,s);return n?a():Pet(a)};function Fse(e,t,n){var a;const{style:r}=e,s={};for(const o in r)(Pu(r[o])||t.style&&Pu(t.style[o])||Z8e(o,e)||((a=n==null?void 0:n.getValue(o))==null?void 0:a.liveStyle)!==void 0)&&(s[o]=r[o]);return s}const Qnt=r7e({scrapeMotionValuesFromProps:Fse,createRenderState:Tse});function s7e(e,t,n){const r=Fse(e,t,n);for(const s in e)if(Pu(e[s])||Pu(t[s])){const a=uA.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[a]=e[s]}return r}const Znt=r7e({scrapeMotionValuesFromProps:s7e,createRenderState:t7e}),Jnt=Symbol.for("motionComponentSymbol");function kC(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function ert(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):kC(n)&&(n.current=r))},[t])}const Ose=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),trt="framerAppearId",i7e="data-"+Ose(trt),a7e=m.createContext({});function nrt(e,t,n,r,s){var w,C;const{visualElement:a}=m.useContext($D),o=m.useContext(Y8e),l=m.useContext(sse),c=m.useContext(K8e).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(a7e);d&&!d.projection&&s&&(d.type==="html"||d.type==="svg")&&rrt(u.current,n,s,f);const x=m.useRef(!1);m.useInsertionEffect(()=>{d&&x.current&&d.update(n,l)});const g=n[i7e],v=m.useRef(!!g&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,g))&&((C=window.MotionHasOptimisedAnimation)==null?void 0:C.call(window,g)));return Fet(()=>{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 rrt(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:o7e(e.parent)),e.projection.setOptions({layoutId:s,layout:a,alwaysMeasureLayout:!!o||l&&kC(l),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:u})}function o7e(e){if(e)return e.options.allowProjection!==!1?e.projection:o7e(e.parent)}function kz(e,{forwardMotionProps:t=!1}={},n,r){n&&Tnt(n);const s=Ise(e)?Znt:Qnt;function a(l,c){let u;const d={...m.useContext(K8e),...l,layoutId:srt(l)},{isStatic:f}=d,x=Mnt(l),g=s(l,f);if(!f&&rse){irt();const v=art(d);u=v.MeasureLayout,x.visualElement=nrt(e,g,d,r,v.ProjectionNode)}return i.jsxs($D.Provider,{value:x,children:[u&&x.visualElement?i.jsx(u,{visualElement:x.visualElement,...d}):null,Knt(e,l,ert(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[Jnt]=e,o}function srt({layoutId:e}){const t=m.useContext(h8e).id;return t&&e!==void 0?t+"-"+e:e}function irt(e,t){m.useContext(Y8e).strict}function art(e){const{drag:t,layout:n}=kS;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 ort(e,t){if(typeof Proxy>"u")return kz;const n=new Map,r=(a,o)=>kz(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,kz(o,void 0,e,t)),n.get(o))})}function l7e({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function lrt({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function crt(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 Tz(e){return e===void 0||e===1}function UQ({scale:e,scaleX:t,scaleY:n}){return!Tz(e)||!Tz(t)||!Tz(n)}function Cv(e){return UQ(e)||c7e(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function c7e(e){return kfe(e.x)||kfe(e.y)}function kfe(e){return e&&e!=="0%"}function KO(e,t,n){const r=e-n,s=t*r;return n+s}function Tfe(e,t,n,r,s){return s!==void 0&&(e=KO(e,s,r)),KO(e,n,r)+t}function zQ(e,t=0,n=1,r,s){e.min=Tfe(e.min,t,n,r,s),e.max=Tfe(e.max,t,n,r,s)}function u7e(e,{x:t,y:n}){zQ(e.x,t.translate,t.scale,t.originPoint),zQ(e.y,n.translate,n.scale,n.originPoint)}const Ife=.999999999999,Pfe=1.0000000000001;function urt(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&&IC(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,u7e(e,o)),r&&Cv(a.latestValues)&&IC(e,a.latestValues))}t.x<Pfe&&t.x>Ife&&(t.x=1),t.y<Pfe&&t.y>Ife&&(t.y=1)}function TC(e,t){e.min=e.min+t,e.max=e.max+t}function Ffe(e,t,n,r,s=.5){const a=zo(e.min,e.max,s);zQ(e,t,n,a,r)}function IC(e,t){Ffe(e.x,t.x,t.scaleX,t.scale,t.originX),Ffe(e.y,t.y,t.scaleY,t.scale,t.originY)}function d7e(e,t){return l7e(crt(e.getBoundingClientRect(),t))}function drt(e,t,n){const r=d7e(e,n),{scroll:s}=t;return s&&(TC(r.x,s.offset.x),TC(r.y,s.offset.y)),r}const Ofe=()=>({translate:0,scale:1,origin:0,originPoint:0}),PC=()=>({x:Ofe(),y:Ofe()}),Mfe=()=>({min:0,max:0}),xl=()=>({x:Mfe(),y:Mfe()}),HQ={current:null},f7e={current:!1};function frt(){if(f7e.current=!0,!!rse)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>HQ.current=e.matches;e.addEventListener("change",t),t()}else HQ.current=!1}const hrt=new WeakMap;function prt(e,t,n){for(const r in t){const s=t[r],a=n[r];if(Pu(s))e.addValue(r,s);else if(Pu(a))e.addValue(r,_S(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,_S(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Rfe=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let mrt=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=Cse,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,Fo.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=zD(n),this.isVariantNode=Q8e(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&&Pu(g)&&g.set(c[x])}}mount(t){var n;this.current=t,hrt.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)),f7e.current||frt(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:HQ.current,(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),Ly(this.notifyUpdate),Ly(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=dA.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&Fo.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 kS){const n=kS[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):xl()}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<Rfe.length;r++){const s=Rfe[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=prt(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=_S(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"&&(RD(r)||DD(r))?r=parseFloat(r):!_nt(r)&&Dy.test(n)&&(r=z8e(t,n)),this.setBaseTarget(t,Pu(r)?r.get():r)),Pu(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=Pse(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&&!Pu(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 lA),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Ase.render(this.render)}},h7e=class extends mrt{constructor(){super(...arguments),this.KeyframeResolver=mnt}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;Pu(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}};function p7e(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 xrt(e){return window.getComputedStyle(e)}let grt=class extends h7e{constructor(){super(...arguments),this.type="html",this.renderInstance=p7e}readValueFromInstance(t,n){var r;if(dA.has(n))return(r=this.projection)!=null&&r.isProjecting?OQ(n):Ott(t,n);{const s=xrt(t),a=(hse(n)?s.getPropertyValue(n):s[n])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(t,{transformPagePoint:n}){return d7e(t,n)}build(t,n,r){kse(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Fse(t,n,r)}};const m7e=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 brt(e,t,n,r){p7e(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(m7e.has(s)?s:Ose(s),t.attrs[s])}let yrt=class extends h7e{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=xl}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(dA.has(n)){const r=U8e(n);return r&&r.default||0}return n=m7e.has(n)?n:Ose(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return s7e(t,n,r)}build(t,n,r){e7e(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){brt(t,n,r,s)}mount(t){this.isSVGTag=n7e(t.tagName),super.mount(t)}};const vrt=(e,t)=>Ise(e)?new yrt(t):new grt(t,{allowProjection:e!==m.Fragment});function XC(e,t,n){const r=e.getProps();return Pse(r,t,n!==void 0?n:r.custom,e)}const VQ=e=>Array.isArray(e);function wrt(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,_S(n))}function Crt(e){return VQ(e)?e[e.length-1]||0:e}function Srt(e,t){const n=XC(e,t);let{transitionEnd:r={},transition:s={},...a}=n||{};a={...a,...r};for(const o in a){const l=Crt(a[o]);wrt(e,o,l)}}function Nrt(e){return!!(Pu(e)&&e.add)}function WQ(e,t){const n=e.getValue("willChange");if(Nrt(n))return n.add(t);if(!n&&Mc.WillChange){const r=new Mc.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function x7e(e){return e.props[i7e]}const Art=e=>e!==null;function jrt(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(Art),a=t&&n!=="loop"&&t%2===1?0:s.length-1;return s[a]}const Ert={type:"spring",stiffness:500,damping:25,restSpeed:10},_rt=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),krt={type:"keyframes",duration:.8},Trt={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Irt=(e,{keyframes:t})=>t.length>2?krt:dA.has(e)?e.startsWith("scale")?_rt(t[1]):Ert:Trt;function Prt({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 Mse=(e,t,n,r={},s,a)=>o=>{const l=Sse(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u=u-zl(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};Prt(l)||Object.assign(d,Irt(e,d)),d.duration&&(d.duration=zl(d.duration)),d.repeatDelay&&(d.repeatDelay=zl(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(BQ(d),d.delay===0&&(f=!0)),(Mc.instantAnimations||Mc.skipAnimations)&&(f=!0,BQ(d),d.delay=0),d.allowFlatten=!l.type&&!l.ease,f&&!a&&t.get()!==void 0){const x=jrt(d.keyframes,l);if(x!==void 0){Fo.update(()=>{d.onUpdate(x),d.onComplete()});return}}return l.isSync?new wse(d):new rnt(d)};function Frt({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function g7e(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&&Frt(u,d))continue;const g={delay:n,...Sse(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=x7e(e);if(N){const P=window.MotionHandoffAnimation(N,d,Fo);P!==null&&(g.startTime=P,w=!0)}}WQ(e,d),f.start(Mse(d,f,x,e.shouldReduceMotion&&D8e.has(d)?{type:!1}:g,e,w));const C=f.animation;C&&c.push(C)}return o&&Promise.all(c).then(()=>{Fo.update(()=>{o&&Srt(e,o)})}),c}function b7e(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 qQ(e,t,n={}){var c;const r=XC(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(g7e(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:x}=s;return Ort(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 Ort(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(qQ(c,t,{...o,delay:n+(typeof r=="function"?0:r)+b7e(e.variantChildren,c,r,s,a)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(l)}function Mrt(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(a=>qQ(e,a,n));r=Promise.all(s)}else if(typeof t=="string")r=qQ(e,t,n);else{const s=typeof t=="function"?XC(e,t,n.custom):t;r=Promise.all(g7e(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function y7e(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 Rrt=_se.length;function v7e(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?v7e(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Rrt;n++){const r=_se[n],s=e.props[r];(_9(s)||s===!1)&&(t[r]=s)}return t}const Lrt=[...Ese].reverse(),Drt=Ese.length;function Brt(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Mrt(e,n,r)))}function $rt(e){let t=Brt(e),n=Lfe(),r=!0;const s=c=>(u,d)=>{var x;const f=XC(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=v7e(e.parent)||{},f=[],x=new Set;let g={},v=1/0;for(let C=0;C<Drt;C++){const N=Lrt[C],P=n[N],I=u[N]!==void 0?u[N]:d[N],R=_9(I),O=N===c?P.isActive:null;O===!1&&(v=C);let U=I===d[N]&&I!==u[N]&&R;if(U&&r&&e.manuallyAnimateOnMount&&(U=!1),P.protectedKeys={...g},!P.isActive&&O===null||!I&&!P.prevProp||UD(I)||typeof I=="boolean")continue;const L=Urt(P.prevProp,I);let z=L||N===c&&P.isActive&&!U&&R||C>v&&R,X=!1;const ne=Array.isArray(I)?I:[I];let J=ne.reduce(s(N),{});O===!1&&(J={});const{prevResolvedValues:K={}}=P,re={...K,...J},he=oe=>{z=!0,x.has(oe)&&(X=!0,x.delete(oe)),P.needsAnimating[oe]=!0;const G=e.getValue(oe);G&&(G.liveStyle=!1)};for(const oe in re){const G=J[oe],V=K[oe];if(g.hasOwnProperty(oe))continue;let te=!1;VQ(G)&&VQ(V)?te=!y7e(G,V):te=G!==V,te?G!=null?he(oe):x.add(oe):G!==void 0&&x.has(oe)?he(oe):P.protectedKeys[oe]=!0}P.prevProp=I,P.prevResolvedValues=J,P.isActive&&(g={...g,...J}),r&&e.blockInitialAnimation&&(z=!1);const Q=U&&L;z&&(!Q||X)&&f.push(...ne.map(oe=>{const G={type:N};if(typeof oe=="string"&&r&&!Q&&e.manuallyAnimateOnMount&&e.parent){const{parent:V}=e,te=XC(V,oe);if(V.enteringChildren&&te){const{delayChildren:ae}=te.transition||{};G.delay=b7e(V.enteringChildren,e,ae)}}return{animation:oe,options:G}}))}if(x.size){const C={};if(typeof u.initial!="boolean"){const N=XC(e,Array.isArray(u.initial)?u.initial[0]:u.initial);N&&N.transition&&(C.transition=N.transition)}x.forEach(N=>{const P=e.getBaseTarget(N),I=e.getValue(N);I&&(I.liveStyle=!0),C[N]=P??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=Lfe(),r=!0}}}function Urt(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!y7e(t,e):!1}function av(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Lfe(){return{animate:av(!0),whileInView:av(),whileHover:av(),whileTap:av(),whileDrag:av(),whileFocus:av(),exit:av()}}let r2=class{constructor(t){this.isMounted=!1,this.node=t}update(){}},zrt=class extends r2{constructor(t){super(t),t.animationState||(t.animationState=$rt(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();UD(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)}},Hrt=0,Vrt=class extends r2{constructor(){super(...arguments),this.id=Hrt++}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 Wrt={animation:{Feature:zrt},exit:{Feature:Vrt}};function T9(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Sk(e){return{point:{x:e.pageX,y:e.pageY}}}const qrt=e=>t=>jse(t)&&e(t,Sk(t));function $j(e,t,n,r){return T9(e,t,qrt(n),r)}const w7e=1e-4,Grt=1-w7e,Krt=1+w7e,C7e=.01,Yrt=0-C7e,Xrt=0+C7e;function ad(e){return e.max-e.min}function Qrt(e,t,n){return Math.abs(e-t)<=n}function Dfe(e,t,n,r=.5){e.origin=r,e.originPoint=zo(t.min,t.max,e.origin),e.scale=ad(n)/ad(t),e.translate=zo(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Grt&&e.scale<=Krt||isNaN(e.scale))&&(e.scale=1),(e.translate>=Yrt&&e.translate<=Xrt||isNaN(e.translate))&&(e.translate=0)}function Uj(e,t,n,r){Dfe(e.x,t.x,n.x,r?r.originX:void 0),Dfe(e.y,t.y,n.y,r?r.originY:void 0)}function Bfe(e,t,n){e.min=n.min+t.min,e.max=e.min+ad(t)}function Zrt(e,t,n){Bfe(e.x,t.x,n.x),Bfe(e.y,t.y,n.y)}function $fe(e,t,n){e.min=t.min-n.min,e.max=e.min+ad(t)}function zj(e,t,n){$fe(e.x,t.x,n.x),$fe(e.y,t.y,n.y)}function Th(e){return[e("x"),e("y")]}const S7e=({current:e})=>e?e.ownerDocument.defaultView:null,Ufe=(e,t)=>Math.abs(e-t);function Jrt(e,t){const n=Ufe(e.x,t.x),r=Ufe(e.y,t.y);return Math.sqrt(n**2+r**2)}let N7e=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=Pz(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,v=Jrt(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!v)return;const{point:w}=x,{timestamp:C}=Kc;this.history.push({...w,timestamp:C});const{onStart:N,onMove:P}=this.handlers;g||(N&&N(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),P&&P(this.lastMoveEvent,x)},this.handlePointerMove=(x,g)=>{this.lastMoveEvent=x,this.lastMoveEventInfo=Iz(g,this.transformPagePoint),Fo.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=Pz(x.type==="pointercancel"?this.lastMoveEventInfo:Iz(g,this.transformPagePoint),this.history);this.startEvent&&v&&v(x,N),w&&w(x,N)},!jse(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const l=Sk(t),c=Iz(l,this.transformPagePoint),{point:u}=c,{timestamp:d}=Kc;this.history=[{...u,timestamp:d}];const{onSessionStart:f}=n;f&&f(t,Pz(c,this.history)),this.removeListeners=dx($j(this.contextWindow,"pointermove",this.handlePointerMove),$j(this.contextWindow,"pointerup",this.handlePointerUp),$j(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Ly(this.updatePoint)}};function Iz(e,t){return t?{point:t(e.point)}:e}function zfe(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Pz({point:e},t){return{point:e,delta:zfe(e,A7e(t)),offset:zfe(e,est(t)),velocity:tst(t,.1)}}function est(e){return e[0]}function A7e(e){return e[e.length-1]}function tst(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=A7e(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>zl(t)));)n--;if(!r)return{x:0,y:0};const a=il(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 nst(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?zo(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?zo(n,e,r.max):Math.min(e,n)),e}function Hfe(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 rst(e,{top:t,left:n,bottom:r,right:s}){return{x:Hfe(e.x,n,s),y:Hfe(e.y,t,r)}}function Vfe(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 sst(e,t){return{x:Vfe(e.x,t.x),y:Vfe(e.y,t.y)}}function ist(e,t){let n=.5;const r=ad(e),s=ad(t);return s>r?n=Y0(t.min,t.max-r,e.min):r>s&&(n=Y0(e.min,e.max-s,t.min)),Oc(0,1,n)}function ast(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 GQ=.35;function ost(e=GQ){return e===!1?e=0:e===!0&&(e=GQ),{x:Wfe(e,"left","right"),y:Wfe(e,"top","bottom")}}function Wfe(e,t,n){return{min:qfe(e,t),max:qfe(e,n)}}function qfe(e,t){return typeof e=="number"?e:e[t]||0}const lst=new WeakMap;let cst=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=xl(),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(Sk(f).point)},o=(f,x)=>{const{drag:g,dragPropagation:v,onDragStart:w}=this.getProps();if(g&&!v&&(this.openDragLock&&this.openDragLock(),this.openDragLock=vnt(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),Th(N=>{let P=this.getAxisMotionValue(N).get()||0;if(R0.test(P)){const{projection:I}=this.visualElement;if(I&&I.layout){const R=I.layout.layoutBox[N];R&&(P=ad(R)*(parseFloat(P)/100))}}this.originPoint[N]=P}),w&&Fo.postRender(()=>w(f,x)),WQ(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=ust(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=()=>Th(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 N7e(t,{onSessionStart:a,onStart:o,onMove:l,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:S7e(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&&Fo.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||!EI(t,s,this.currentDirection))return;const a=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=nst(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&&kC(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=rst(r.layoutBox,t):this.constraints=!1,this.elastic=ost(n),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Th(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=ast(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!kC(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const a=drt(r,s.root,this.visualElement.getTransformPagePoint());let o=sst(s.layout.layoutBox,a);if(n){const l=n(lrt(o));this.hasMutatedConstraints=!!l,l&&(o=l7e(l))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Th(d=>{if(!EI(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 WQ(this.visualElement,t),r.start(Mse(t,r,0,n,this.visualElement,!1))}stopAnimation(){Th(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Th(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){Th(n=>{const{drag:r}=this.getProps();if(!EI(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]-zo(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!kC(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Th(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();s[o]=ist({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(),Th(o=>{if(!EI(o,t,null))return;const l=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];l.set(zo(c,u,s[o]))})}addListeners(){if(!this.visualElement.current)return;lst.set(this.visualElement,this);const t=this.visualElement.current,n=$j(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();kC(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()),Fo.read(r);const o=T9(window,"resize",()=>this.scalePositionWithinConstraints()),l=s.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Th(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=GQ,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:a,dragElastic:o,dragMomentum:l}}};function EI(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function ust(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}let dst=class extends r2{constructor(t){super(t),this.removeGroupControls=ll,this.removeListeners=ll,this.controls=new cst(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ll}unmount(){this.removeGroupControls(),this.removeListeners()}};const Gfe=e=>(t,n)=>{e&&Fo.postRender(()=>e(t,n))};let fst=class extends r2{constructor(){super(...arguments),this.removePointerDownListener=ll}onPointerDown(t){this.session=new N7e(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:S7e(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Gfe(t),onStart:Gfe(n),onMove:r,onEnd:(a,o)=>{delete this.session,s&&Fo.postRender(()=>s(a,o))}}}mount(){this.removePointerDownListener=$j(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 IF={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Kfe(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const f7={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(li.test(e))e=parseFloat(e);else return e;const n=Kfe(e,t.target.x),r=Kfe(e,t.target.y);return`${n}% ${r}%`}},hst={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Dy.parse(e);if(s.length>5)return r;const a=Dy.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=zo(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 Fz=!1,pst=class extends m.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:a}=t;Rnt(mst),a&&(n.group&&n.group.add(a),r&&r.register&&s&&r.register(a),Fz&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),IF.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:a}=this.props,{projection:o}=r;return o&&(o.isPresent=a,Fz=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==a?o.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?o.promote():o.relegate()||Fo.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Ase.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;Fz=!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 j7e(e){const[t,n]=knt(),r=m.useContext(h8e);return i.jsx(pst,{...e,layoutGroup:r,switchLayoutGroup:m.useContext(a7e),isPresent:t,safeToRemove:n})}const mst={borderRadius:{...f7,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:f7,borderTopRightRadius:f7,borderBottomLeftRadius:f7,borderBottomRightRadius:f7,boxShadow:hst};function xst(e,t,n){const r=Pu(e)?e:_S(e);return r.start(Mse("",r,t,n)),r.animation}const gst=(e,t)=>e.depth-t.depth;let bst=class{constructor(){this.children=[],this.isDirty=!1}add(t){yk(this.children,t),this.isDirty=!0}remove(t){vk(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(gst),this.isDirty=!1,this.children.forEach(t)}};function yst(e,t){const n=Qd.now(),r=({timestamp:s})=>{const a=s-n;a>=t&&(Ly(r),e(a-t))};return Fo.setup(r,!0),()=>Ly(r)}const E7e=["TopLeft","TopRight","BottomLeft","BottomRight"],vst=E7e.length,Yfe=e=>typeof e=="string"?parseFloat(e):e,Xfe=e=>typeof e=="number"||li.test(e);function wst(e,t,n,r,s,a){s?(e.opacity=zo(0,n.opacity??1,Cst(r)),e.opacityExit=zo(t.opacity??1,0,Sst(r))):a&&(e.opacity=zo(t.opacity??1,n.opacity??1,r));for(let o=0;o<vst;o++){const l=`border${E7e[o]}Radius`;let c=Qfe(t,l),u=Qfe(n,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||Xfe(c)===Xfe(u)?(e[l]=Math.max(zo(Yfe(c),Yfe(u),r),0),(R0.test(u)||R0.test(c))&&(e[l]+="%")):e[l]=u}(t.rotate||n.rotate)&&(e.rotate=zo(t.rotate||0,n.rotate||0,r))}function Qfe(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Cst=_7e(0,.5,cse),Sst=_7e(.5,.95,ll);function _7e(e,t,n){return r=>r<e?0:r>t?1:n(Y0(e,t,r))}function Zfe(e,t){e.min=t.min,e.max=t.max}function mh(e,t){Zfe(e.x,t.x),Zfe(e.y,t.y)}function Jfe(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function ehe(e,t,n,r,s){return e-=t,e=KO(e,1/n,r),s!==void 0&&(e=KO(e,1/s,r)),e}function Nst(e,t=0,n=1,r=.5,s,a=e,o=e){if(R0.test(t)&&(t=parseFloat(t),t=zo(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=zo(a.min,a.max,r);e===a&&(l-=t),e.min=ehe(e.min,t,n,l,s),e.max=ehe(e.max,t,n,l,s)}function the(e,t,[n,r,s],a,o){Nst(e,t[n],t[r],t[s],t.scale,a,o)}const Ast=["x","scaleX","originX"],jst=["y","scaleY","originY"];function nhe(e,t,n,r){the(e.x,t,Ast,n?n.x:void 0,r?r.x:void 0),the(e.y,t,jst,n?n.y:void 0,r?r.y:void 0)}function rhe(e){return e.translate===0&&e.scale===1}function k7e(e){return rhe(e.x)&&rhe(e.y)}function she(e,t){return e.min===t.min&&e.max===t.max}function Est(e,t){return she(e.x,t.x)&&she(e.y,t.y)}function ihe(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function T7e(e,t){return ihe(e.x,t.x)&&ihe(e.y,t.y)}function ahe(e){return ad(e.x)/ad(e.y)}function ohe(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}let _st=class{constructor(){this.members=[]}add(t){yk(this.members,t),t.scheduleRender()}remove(t){if(vk(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 kst(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 Oz=["","X","Y","Z"],Tst=1e3;let Ist=0;function Mz(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function I7e(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=x7e(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Fo,!(s||a))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&I7e(r)}function P7e({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=t==null?void 0:t()){this.id=Ist++,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(Ost),this.nodes.forEach(Dst),this.nodes.forEach(Bst),this.nodes.forEach(Mst)},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 bst)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new lA),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=G8e(o)&&!jnt(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;Fo.read(()=>{f=window.innerWidth}),e(o,()=>{const g=window.innerWidth;g!==f&&(f=g,this.root.updateBlockedByResize=!0,d&&d(),d=yst(x,250),IF.hasAnimatedSinceResize&&(IF.hasAnimatedSinceResize=!1,this.nodes.forEach(uhe)))})}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()||Vst,{onLayoutAnimationStart:w,onLayoutAnimationComplete:C}=u.getProps(),N=!this.targetLayout||!T7e(this.targetLayout,g),P=!f&&x;if(this.options.layoutRoot||this.resumeFrom||P||f&&(N||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const I={...Sse(v,"layout"),onPlay:w,onComplete:C};(u.shouldReduceMotion||this.options.layoutRoot)&&(I.delay=0,I.type=!1),this.startAnimation(I),this.setAnimationOrigin(d,P)}else f||uhe(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(),Ly(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($st),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&&I7e(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(lhe);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(che);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Lst),this.nodes.forEach(Pst),this.nodes.forEach(Fst)):this.nodes.forEach(che),this.clearAllSnapshots();const l=Qd.now();Kc.delta=Oc(0,1e3/60,l-Kc.timestamp),Kc.timestamp=l,Kc.isProcessing=!0,Nz.update.process(Kc),Nz.preRender.process(Kc),Nz.render.process(Kc),Kc.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ase.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Rst),this.sharedNodes.forEach(Ust)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Fo.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Fo.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ad(this.snapshot.measuredBox.x)&&!ad(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=xl(),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&&!k7e(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;o&&this.instance&&(l||Cv(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)),Wst(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:o}=this.options;if(!o)return xl();const l=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(qst))){const{scroll:d}=this.root;d&&(TC(l.x,d.offset.x),TC(l.y,d.offset.y))}return l}removeElementScroll(o){var c;const l=xl();if(mh(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&&mh(l,o),TC(l.x,f.offset.x),TC(l.y,f.offset.y))}return l}applyTransform(o,l=!1){const c=xl();mh(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&&IC(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),Cv(d.latestValues)&&IC(c,d.latestValues)}return Cv(this.latestValues)&&IC(c,this.latestValues),c}removeTransform(o){const l=xl();mh(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!Cv(u.latestValues))continue;UQ(u.latestValues)&&u.updateSnapshot();const d=xl(),f=u.measurePageBox();mh(d,f),nhe(l,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return Cv(this.latestValues)&&nhe(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!==Kc.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=Kc.timestamp,!this.targetDelta&&!this.relativeTarget){const g=this.getClosestProjectingParent();g&&g.layout&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=xl(),this.relativeTargetOrigin=xl(),zj(this.relativeTargetOrigin,this.layout.layoutBox,g.layout.layoutBox),mh(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=xl(),this.targetWithTransforms=xl()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Zrt(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):mh(this.target,this.layout.layoutBox),u7e(this.target,this.targetDelta)):mh(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=xl(),this.relativeTargetOrigin=xl(),zj(this.relativeTargetOrigin,this.target,g.target),mh(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||UQ(this.parent.latestValues)||c7e(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===Kc.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;mh(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,x=this.treeScale.y;urt(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=xl());const{target:g}=o;if(!g){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Jfe(this.prevProjectionDelta.x,this.projectionDelta.x),Jfe(this.prevProjectionDelta.y,this.projectionDelta.y)),Uj(this.projectionDelta,this.layoutCorrected,g,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==x||!ohe(this.projectionDelta.x,this.prevProjectionDelta.x)||!ohe(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=PC(),this.projectionDelta=PC(),this.projectionDeltaWithTransform=PC()}setAnimationOrigin(o,l=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},f=PC();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const x=xl(),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,P=!!(w&&!N&&this.options.crossfade===!0&&!this.path.some(Hst));this.animationProgress=0;let I;this.mixTargetDelta=R=>{const O=R/1e3;dhe(f.x,o.x,O),dhe(f.y,o.y,O),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(zj(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox),zst(this.relativeTarget,this.relativeTargetOrigin,x,O),I&&Est(this.relativeTarget,I)&&(this.isProjectionDirty=!1),I||(I=xl()),mh(I,this.relativeTarget)),w&&(this.animationValues=d,wst(d,u,this.latestValues,O,P,N)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=O},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&&(Ly(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Fo.update(()=>{IF.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=_S(0)),this.currentAnimation=xst(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(Tst),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&&F7e(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||xl();const f=ad(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+f;const x=ad(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+x}mh(l,c),IC(l,d),Uj(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new _st),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&&Mz("z",o,u,this.animationValues);for(let d=0;d<Oz.length;d++)Mz(`rotate${Oz[d]}`,o,u,this.animationValues),Mz(`skew${Oz[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=TF(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=TF(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!Cv(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=kst(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 k9){if(d[v]===void 0)continue;const{correct:w,applyTo:C,isCSSVariable:N}=k9[v],P=f==="none"?d[v]:w(d[v],u);if(C){const I=C.length;for(let R=0;R<I;R++)o[C[R]]=P}else N?this.options.visualElement.renderState.vars[v]=P:o[v]=P}this.options.layoutId&&(o.pointerEvents=u===this?TF(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(lhe),this.root.sharedNodes.clear()}}}function Pst(e){e.updateLayout()}function Fst(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"?Th(f=>{const x=o?t.measuredBox[f]:t.layoutBox[f],g=ad(x);x.min=r[f].min,x.max=x.min+g}):F7e(a,t.layoutBox,r)&&Th(f=>{const x=o?t.measuredBox[f]:t.layoutBox[f],g=ad(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=PC();Uj(l,r,t.layoutBox);const c=PC();o?Uj(c,e.applyTransform(s,!0),t.measuredBox):Uj(c,r,t.layoutBox);const u=!k7e(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=xl();zj(v,t.layoutBox,x.layoutBox);const w=xl();zj(w,r,g.layoutBox),T7e(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 Ost(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 Mst(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Rst(e){e.clearSnapshot()}function lhe(e){e.clearMeasurements()}function che(e){e.isLayoutDirty=!1}function Lst(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function uhe(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Dst(e){e.resolveTargetDelta()}function Bst(e){e.calcProjection()}function $st(e){e.resetSkewAndRotation()}function Ust(e){e.removeLeadSnapshot()}function dhe(e,t,n){e.translate=zo(t.translate,0,n),e.scale=zo(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function fhe(e,t,n,r){e.min=zo(t.min,n.min,r),e.max=zo(t.max,n.max,r)}function zst(e,t,n,r){fhe(e.x,t.x,n.x,r),fhe(e.y,t.y,n.y,r)}function Hst(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Vst={duration:.45,ease:[.4,0,.1,1]},hhe=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),phe=hhe("applewebkit/")&&!hhe("chrome/")?Math.round:ll;function mhe(e){e.min=phe(e.min),e.max=phe(e.max)}function Wst(e){mhe(e.x),mhe(e.y)}function F7e(e,t,n){return e==="position"||e==="preserve-aspect"&&!Qrt(ahe(t),ahe(n),.2)}function qst(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const Gst=P7e({attachResizeListener:(e,t)=>T9(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Rz={current:void 0},O7e=P7e({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Rz.current){const e=new Gst({});e.mount(window),e.setOptions({layoutScroll:!0}),Rz.current=e}return Rz.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Kst={pan:{Feature:fst},drag:{Feature:dst,ProjectionNode:O7e,MeasureLayout:j7e}};function xhe(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&&Fo.postRender(()=>a(t,Sk(t)))}let Yst=class extends r2{mount(){const{current:t}=this.node;t&&(this.unmount=wnt(t,(n,r)=>(xhe(this.node,r,"Start"),s=>xhe(this.node,s,"End"))))}unmount(){}},Xst=class extends r2{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=dx(T9(this.node.current,"focus",()=>this.onFocus()),T9(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function ghe(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&&Fo.postRender(()=>a(t,Sk(t)))}let Qst=class extends r2{mount(){const{current:t}=this.node;t&&(this.unmount=Ant(t,(n,r)=>(ghe(this.node,r,"Start"),(s,{success:a})=>ghe(this.node,s,a?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}};const KQ=new WeakMap,Lz=new WeakMap,Zst=e=>{const t=KQ.get(e.target);t&&t(e)},Jst=e=>{e.forEach(Zst)};function eit({root:e,...t}){const n=e||document;Lz.has(n)||Lz.set(n,{});const r=Lz.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(Jst,{root:e,...t})),r[s]}function tit(e,t,n){const r=eit(t);return KQ.set(e,n),r.observe(e),()=>{KQ.delete(e),r.unobserve(e)}}const nit={some:0,all:1};let rit=class extends r2{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:nit[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 tit(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(sit(t,n))&&this.startObserver()}unmount(){}};function sit({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const iit={inView:{Feature:rit},tap:{Feature:Qst},focus:{Feature:Xst},hover:{Feature:Yst}},ait={layout:{ProjectionNode:O7e,MeasureLayout:j7e}},oit={...Wrt,...iit,...Kst,...ait},am=ort(oit,vrt),bhe={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 w0({label:e="NEW",tone:t="yellow"}){const n=bhe[t]??bhe.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(am.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 lit({label:e,items:t=[],activePaths:n=[],badgeLabel:r,badgeTone:s="yellow",align:a="left"}){var d;const{pathname:o}=oc(),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(Ae.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(MD,{as:"div",className:"relative hidden sm:inline-block text-left",children:[i.jsxs(FD,{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(w0,{label:r,tone:s}):null,i.jsx(A9,{"aria-hidden":"true",className:"-mr-1 size-5 text-gray-400"})]}),i.jsx(OD,{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(EC,{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(A9,{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(_de,{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(w0,{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(w0,{tone:"emerald",label:f.badge})]})});return f.to?i.jsx(EC,{children:i.jsx(_de,{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(EC,{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(EC,{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 Og=({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"})]}),cit=[{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:Og},{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 h3(e){"@babel/helpers - typeof";return h3=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},h3(e)}function uit(e,t){if(h3(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(h3(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function M7e(e){var t=uit(e,"string");return h3(t)=="symbol"?t:t+""}function cj(e,t,n){return(t=M7e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yhe(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 Ys(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yhe(Object(n),!0).forEach(function(r){cj(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yhe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dit(e){if(Array.isArray(e))return e}function fit(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 YQ(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 R7e(e,t){if(e){if(typeof e=="string")return YQ(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)?YQ(e,t):void 0}}function hit(){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 zg(e,t){return dit(e)||fit(e,t)||R7e(e,t)||hit()}function pit(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 v1(e,t){if(e==null)return{};var n,r,s=pit(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 mit=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function xit(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=v1(e,mit),w=m.useState(l!==void 0?l:n),C=zg(w,2),N=C[0],P=C[1],I=m.useState(c!==void 0?c:s),R=zg(I,2),O=R[0],U=R[1],L=m.useState(g!==void 0?g:o),z=zg(L,2),X=z[0],ne=z[1],J=m.useCallback(function(G,V){typeof u=="function"&&u(G,V),ne(G)},[u]),K=m.useCallback(function(G,V){var te;typeof d=="function"&&(te=d(G,V)),P(te!==void 0?te:G)},[d]),re=m.useCallback(function(){typeof x=="function"&&x(),U(!0)},[x]),he=m.useCallback(function(){typeof f=="function"&&f(),U(!1)},[f]),Q=l!==void 0?l:N,ie=c!==void 0?c:O,oe=g!==void 0?g:X;return Ys(Ys({},v),{},{inputValue:Q,menuIsOpen:ie,onChange:J,onInputChange:K,onMenuClose:he,onMenuOpen:re,value:oe})}function ni(){return ni=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},ni.apply(null,arguments)}function git(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vhe(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,M7e(r.key),r)}}function bit(e,t,n){return vhe(e.prototype,t),vhe(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function XQ(e,t){return XQ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},XQ(e,t)}function yit(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&&XQ(e,t)}function YO(e){return YO=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},YO(e)}function L7e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(L7e=function(){return!!e})()}function vit(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wit(e,t){if(t&&(h3(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vit(e)}function Cit(e){var t=L7e();return function(){var n,r=YO(e);if(t){var s=YO(this).constructor;n=Reflect.construct(r,arguments,s)}else n=r.apply(this,arguments);return wit(this,n)}}function Sit(e){if(Array.isArray(e))return YQ(e)}function Nit(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ait(){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 Rse(e){return Sit(e)||Nit(e)||R7e(e)||Ait()}function jit(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 Eit(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 _it=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(Eit(this));var s=this.tags[this.tags.length-1];if(this.isSpeedy){var a=jit(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}(),xu="-ms-",XO="-moz-",va="-webkit-",D7e="comm",Lse="rule",Dse="decl",kit="@import",B7e="@keyframes",Tit="@layer",Iit=Math.abs,HD=String.fromCharCode,Pit=Object.assign;function Fit(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 $7e(e){return e.trim()}function Oit(e,t){return(e=t.exec(e))?e[0]:e}function wa(e,t,n){return e.replace(t,n)}function QQ(e,t){return e.indexOf(t)}function Qc(e,t){return e.charCodeAt(t)|0}function I9(e,t,n){return e.slice(t,n)}function g0(e){return e.length}function Bse(e){return e.length}function _I(e,t){return t.push(e),e}function Mit(e,t){return e.map(t).join("")}var VD=1,TS=1,U7e=0,cf=0,Bl=0,fA="";function WD(e,t,n,r,s,a,o){return{value:e,root:t,parent:n,type:r,props:s,children:a,line:VD,column:TS,length:o,return:""}}function h7(e,t){return Pit(WD("",null,null,"",null,null,0),e,{length:-e.length},t)}function Rit(){return Bl}function Lit(){return Bl=cf>0?Qc(fA,--cf):0,TS--,Bl===10&&(TS=1,VD--),Bl}function Vf(){return Bl=cf<U7e?Qc(fA,cf++):0,TS++,Bl===10&&(TS=1,VD++),Bl}function L0(){return Qc(fA,cf)}function PF(){return cf}function Nk(e,t){return I9(fA,e,t)}function P9(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 z7e(e){return VD=TS=1,U7e=g0(fA=e),cf=0,[]}function H7e(e){return fA="",e}function FF(e){return $7e(Nk(cf-1,ZQ(e===91?e+2:e===40?e+1:e)))}function Dit(e){for(;(Bl=L0())&&Bl<33;)Vf();return P9(e)>2||P9(Bl)>3?"":" "}function Bit(e,t){for(;--t&&Vf()&&!(Bl<48||Bl>102||Bl>57&&Bl<65||Bl>70&&Bl<97););return Nk(e,PF()+(t<6&&L0()==32&&Vf()==32))}function ZQ(e){for(;Vf();)switch(Bl){case e:return cf;case 34:case 39:e!==34&&e!==39&&ZQ(Bl);break;case 40:e===41&&ZQ(e);break;case 92:Vf();break}return cf}function $it(e,t){for(;Vf()&&e+Bl!==57;)if(e+Bl===84&&L0()===47)break;return"/*"+Nk(t,cf-1)+"*"+HD(e===47?e:Vf())}function Uit(e){for(;!P9(L0());)Vf();return Nk(e,cf)}function zit(e){return H7e(OF("",null,null,null,[""],e=z7e(e),0,[0],e))}function OF(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,P=0,I="",R=s,O=a,U=r,L=I;C;)switch(v=P,P=Vf()){case 40:if(v!=108&&Qc(L,f-1)==58){QQ(L+=wa(FF(P),"&","&\f"),"&\f")!=-1&&(N=-1);break}case 34:case 39:case 91:L+=FF(P);break;case 9:case 10:case 13:case 32:L+=Dit(v);break;case 92:L+=Bit(PF()-1,7);continue;case 47:switch(L0()){case 42:case 47:_I(Hit($it(Vf(),PF()),t,n),c);break;default:L+="/"}break;case 123*w:l[u++]=g0(L)*N;case 125*w:case 59:case 0:switch(P){case 0:case 125:C=0;case 59+d:N==-1&&(L=wa(L,/\f/g,"")),g>0&&g0(L)-f&&_I(g>32?Che(L+";",r,n,f-1):Che(wa(L," ","")+";",r,n,f-2),c);break;case 59:L+=";";default:if(_I(U=whe(L,t,n,u,d,s,l,I,R=[],O=[],f),a),P===123)if(d===0)OF(L,t,U,U,R,a,f,l,O);else switch(x===99&&Qc(L,3)===110?100:x){case 100:case 108:case 109:case 115:OF(e,U,U,r&&_I(whe(e,U,U,0,0,s,l,I,s,R=[],f),O),s,O,f,l,r?R:O);break;default:OF(L,U,U,U,[""],O,0,l,O)}}u=d=g=0,w=N=1,I=L="",f=o;break;case 58:f=1+g0(L),g=v;default:if(w<1){if(P==123)--w;else if(P==125&&w++==0&&Lit()==125)continue}switch(L+=HD(P),P*w){case 38:N=d>0?1:(L+="\f",-1);break;case 44:l[u++]=(g0(L)-1)*N,N=1;break;case 64:L0()===45&&(L+=FF(Vf())),x=L0(),d=f=g0(I=L+=Uit(PF())),P++;break;case 45:v===45&&g0(L)==2&&(w=0)}}return a}function whe(e,t,n,r,s,a,o,l,c,u,d){for(var f=s-1,x=s===0?a:[""],g=Bse(x),v=0,w=0,C=0;v<r;++v)for(var N=0,P=I9(e,f+1,f=Iit(w=o[v])),I=e;N<g;++N)(I=$7e(w>0?x[N]+" "+P:wa(P,/&\f/g,x[N])))&&(c[C++]=I);return WD(e,t,n,s===0?Lse:l,c,u,d)}function Hit(e,t,n){return WD(e,t,n,D7e,HD(Rit()),I9(e,2,-2),0)}function Che(e,t,n,r){return WD(e,t,n,Dse,I9(e,0,r),I9(e,r+1,-1),r)}function QC(e,t){for(var n="",r=Bse(e),s=0;s<r;s++)n+=t(e[s],s,e,t)||"";return n}function Vit(e,t,n,r){switch(e.type){case Tit:if(e.children.length)break;case kit:case Dse:return e.return=e.return||e.value;case D7e:return"";case B7e:return e.return=e.value+"{"+QC(e.children,r)+"}";case Lse:e.value=e.props.join(",")}return g0(n=QC(e.children,r))?e.return=e.value+"{"+n+"}":""}function Wit(e){var t=Bse(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 qit(e){return function(t){t.root||(t=t.return)&&e(t)}}function Git(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Kit=function(t,n,r){for(var s=0,a=0;s=a,a=L0(),s===38&&a===12&&(n[r]=1),!P9(a);)Vf();return Nk(t,cf)},Yit=function(t,n){var r=-1,s=44;do switch(P9(s)){case 0:s===38&&L0()===12&&(n[r]=1),t[r]+=Kit(cf-1,n,r);break;case 2:t[r]+=FF(s);break;case 4:if(s===44){t[++r]=L0()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=HD(s)}while(s=Vf());return t},Xit=function(t,n){return H7e(Yit(z7e(t),n))},She=new WeakMap,Qit=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&&!She.get(r))&&!s){She.set(t,!0);for(var a=[],o=Xit(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]}}},Zit=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function V7e(e,t){switch(Fit(e,t)){case 5103:return va+"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 va+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return va+e+XO+e+xu+e+e;case 6828:case 4268:return va+e+xu+e+e;case 6165:return va+e+xu+"flex-"+e+e;case 5187:return va+e+wa(e,/(\w+).+(:[^]+)/,va+"box-$1$2"+xu+"flex-$1$2")+e;case 5443:return va+e+xu+"flex-item-"+wa(e,/flex-|-self/,"")+e;case 4675:return va+e+xu+"flex-line-pack"+wa(e,/align-content|flex-|-self/,"")+e;case 5548:return va+e+xu+wa(e,"shrink","negative")+e;case 5292:return va+e+xu+wa(e,"basis","preferred-size")+e;case 6060:return va+"box-"+wa(e,"-grow","")+va+e+xu+wa(e,"grow","positive")+e;case 4554:return va+wa(e,/([^-])(transform)/g,"$1"+va+"$2")+e;case 6187:return wa(wa(wa(e,/(zoom-|grab)/,va+"$1"),/(image-set)/,va+"$1"),e,"")+e;case 5495:case 3959:return wa(e,/(image-set\([^]*)/,va+"$1$`$1");case 4968:return wa(wa(e,/(.+:)(flex-)?(.*)/,va+"box-pack:$3"+xu+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+va+e+e;case 4095:case 3583:case 4068:case 2532:return wa(e,/(.+)-inline(.+)/,va+"$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(g0(e)-1-t>6)switch(Qc(e,t+1)){case 109:if(Qc(e,t+4)!==45)break;case 102:return wa(e,/(.+:)(.+)-([^]+)/,"$1"+va+"$2-$3$1"+XO+(Qc(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~QQ(e,"stretch")?V7e(wa(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Qc(e,t+1)!==115)break;case 6444:switch(Qc(e,g0(e)-3-(~QQ(e,"!important")&&10))){case 107:return wa(e,":",":"+va)+e;case 101:return wa(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+va+(Qc(e,14)===45?"inline-":"")+"box$3$1"+va+"$2$3$1"+xu+"$2box$3")+e}break;case 5936:switch(Qc(e,t+11)){case 114:return va+e+xu+wa(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return va+e+xu+wa(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return va+e+xu+wa(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return va+e+xu+e+e}return e}var Jit=function(t,n,r,s){if(t.length>-1&&!t.return)switch(t.type){case Dse:t.return=V7e(t.value,t.length);break;case B7e:return QC([h7(t,{value:wa(t.value,"@","@"+va)})],s);case Lse:if(t.length)return Mit(t.props,function(a){switch(Oit(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return QC([h7(t,{props:[wa(a,/:(read-\w+)/,":"+XO+"$1")]})],s);case"::placeholder":return QC([h7(t,{props:[wa(a,/:(plac\w+)/,":"+va+"input-$1")]}),h7(t,{props:[wa(a,/:(plac\w+)/,":"+XO+"$1")]}),h7(t,{props:[wa(a,/:(plac\w+)/,xu+"input-$1")]})],s)}return""})}},eat=[Jit],tat=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||eat,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=[Qit,Zit];{var d,f=[Vit,qit(function(w){d.insert(w)})],x=Wit(u.concat(s,f)),g=function(C){return QC(zit(C),x)};c=function(C,N,P,I){d=P,g(C?C+"{"+N.styles+"}":N.styles),I&&(v.inserted[N.name]=!0)}}var v={key:n,sheet:new _it({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},Dz={exports:{}},Ia={};/** @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 Nhe;function nat(){if(Nhe)return Ia;Nhe=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,P=e?Symbol.for("react.scope"):60119;function I(O){if(typeof O=="object"&&O!==null){var U=O.$$typeof;switch(U){case t:switch(O=O.type,O){case c:case u:case r:case a:case s:case f:return O;default:switch(O=O&&O.$$typeof,O){case l:case d:case v:case g:case o:return O;default:return U}}case n:return U}}}function R(O){return I(O)===u}return Ia.AsyncMode=c,Ia.ConcurrentMode=u,Ia.ContextConsumer=l,Ia.ContextProvider=o,Ia.Element=t,Ia.ForwardRef=d,Ia.Fragment=r,Ia.Lazy=v,Ia.Memo=g,Ia.Portal=n,Ia.Profiler=a,Ia.StrictMode=s,Ia.Suspense=f,Ia.isAsyncMode=function(O){return R(O)||I(O)===c},Ia.isConcurrentMode=R,Ia.isContextConsumer=function(O){return I(O)===l},Ia.isContextProvider=function(O){return I(O)===o},Ia.isElement=function(O){return typeof O=="object"&&O!==null&&O.$$typeof===t},Ia.isForwardRef=function(O){return I(O)===d},Ia.isFragment=function(O){return I(O)===r},Ia.isLazy=function(O){return I(O)===v},Ia.isMemo=function(O){return I(O)===g},Ia.isPortal=function(O){return I(O)===n},Ia.isProfiler=function(O){return I(O)===a},Ia.isStrictMode=function(O){return I(O)===s},Ia.isSuspense=function(O){return I(O)===f},Ia.isValidElementType=function(O){return typeof O=="string"||typeof O=="function"||O===r||O===u||O===a||O===s||O===f||O===x||typeof O=="object"&&O!==null&&(O.$$typeof===v||O.$$typeof===g||O.$$typeof===o||O.$$typeof===l||O.$$typeof===d||O.$$typeof===C||O.$$typeof===N||O.$$typeof===P||O.$$typeof===w)},Ia.typeOf=I,Ia}var Ahe;function rat(){return Ahe||(Ahe=1,Dz.exports=nat()),Dz.exports}var Bz,jhe;function sat(){if(jhe)return Bz;jhe=1;var e=rat(),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 P=c(w);u&&(P=P.concat(u(w)));for(var I=o(v),R=o(w),O=0;O<P.length;++O){var U=P[O];if(!n[U]&&!(C&&C[U])&&!(R&&R[U])&&!(I&&I[U])){var L=d(w,U);try{l(v,U,L)}catch{}}}}return v}return Bz=g,Bz}sat();var iat=!0;function aat(e,t,n){var r="";return n.split(" ").forEach(function(s){e[s]!==void 0?t.push(e[s]+";"):s&&(r+=s+" ")}),r}var W7e=function(t,n,r){var s=t.key+"-"+n.name;(r===!1||iat===!1)&&t.registered[s]===void 0&&(t.registered[s]=n.styles)},oat=function(t,n,r){W7e(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 lat(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 cat={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},uat=/[A-Z]|^ms/g,dat=/_EMO_([^_]+?)_([^]*?)_EMO_/g,q7e=function(t){return t.charCodeAt(1)===45},Ehe=function(t){return t!=null&&typeof t!="boolean"},$z=Git(function(e){return q7e(e)?e:e.replace(uat,"-$&").toLowerCase()}),_he=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(dat,function(r,s,a){return b0={name:s,styles:a,next:b0},s})}return cat[t]!==1&&!q7e(t)&&typeof n=="number"&&n!==0?n+"px":n};function F9(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 b0={name:s.name,styles:s.styles,next:b0},s.name;var a=n;if(a.styles!==void 0){var o=a.next;if(o!==void 0)for(;o!==void 0;)b0={name:o.name,styles:o.styles,next:b0},o=o.next;var l=a.styles+";";return l}return fat(e,t,n)}case"function":{if(e!==void 0){var c=b0,u=n(e);return b0=c,F9(e,t,u)}break}}var d=n;return d}function fat(e,t,n){var r="";if(Array.isArray(n))for(var s=0;s<n.length;s++)r+=F9(e,t,n[s])+";";else for(var a in n){var o=n[a];if(typeof o!="object"){var l=o;Ehe(l)&&(r+=$z(a)+":"+_he(a,l)+";")}else if(Array.isArray(o)&&typeof o[0]=="string"&&t==null)for(var c=0;c<o.length;c++)Ehe(o[c])&&(r+=$z(a)+":"+_he(a,o[c])+";");else{var u=F9(e,t,o);switch(a){case"animation":case"animationName":{r+=$z(a)+":"+u+";";break}default:r+=a+"{"+u+"}"}}}return r}var khe=/label:\s*([^\s;{]+)\s*(;|$)/g,b0;function G7e(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="";b0=void 0;var a=e[0];if(a==null||a.raw===void 0)r=!1,s+=F9(n,t,a);else{var o=a;s+=o[0]}for(var l=1;l<e.length;l++)if(s+=F9(n,t,e[l]),r){var c=a;s+=c[l]}khe.lastIndex=0;for(var u="",d;(d=khe.exec(s))!==null;)u+="-"+d[1];var f=lat(s)+u;return{name:f,styles:s,next:b0}}var hat=function(t){return t()},pat=Iy.useInsertionEffect?Iy.useInsertionEffect:!1,mat=pat||hat,K7e=m.createContext(typeof HTMLElement<"u"?tat({key:"css"}):null);K7e.Provider;var xat=function(t){return m.forwardRef(function(n,r){var s=m.useContext(K7e);return t(n,s,r)})},gat=m.createContext({}),$se={}.hasOwnProperty,JQ="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",bat=function(t,n){var r={};for(var s in n)$se.call(n,s)&&(r[s]=n[s]);return r[JQ]=t,r},yat=function(t){var n=t.cache,r=t.serialized,s=t.isStringTag;return W7e(n,r,s),mat(function(){return oat(n,r,s)}),null},vat=xat(function(e,t,n){var r=e.css;typeof r=="string"&&t.registered[r]!==void 0&&(r=t.registered[r]);var s=e[JQ],a=[r],o="";typeof e.className=="string"?o=aat(t.registered,a,e.className):e.className!=null&&(o=e.className+" ");var l=G7e(a,void 0,m.useContext(gat));o+=t.key+"-"+l.name;var c={};for(var u in e)$se.call(e,u)&&u!=="css"&&u!==JQ&&(c[u]=e[u]);return c.className=o,n&&(c.ref=n),m.createElement(m.Fragment,null,m.createElement(yat,{cache:t,serialized:l,isStringTag:typeof s=="string"}),m.createElement(s,c))}),wat=vat,Ws=function(t,n){var r=arguments;if(n==null||!$se.call(n,"css"))return m.createElement.apply(void 0,r);var s=r.length,a=new Array(s);a[0]=wat,a[1]=bat(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={}))})(Ws);function Use(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return G7e(t)}function Cat(){var e=Use.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 Sat(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const Nat=Math.min,Aat=Math.max,QO=Math.round,kI=Math.floor,ZO=e=>({x:e,y:e});function qD(){return typeof window<"u"}function Y7e(e){return Q7e(e)?(e.nodeName||"").toLowerCase():"#document"}function n1(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function X7e(e){var t;return(t=(Q7e(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Q7e(e){return qD()?e instanceof Node||e instanceof n1(e).Node:!1}function jat(e){return qD()?e instanceof Element||e instanceof n1(e).Element:!1}function zse(e){return qD()?e instanceof HTMLElement||e instanceof n1(e).HTMLElement:!1}function The(e){return!qD()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof n1(e).ShadowRoot}function Z7e(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Hse(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(s)}function Eat(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function _at(e){return["html","body","#document"].includes(Y7e(e))}function Hse(e){return n1(e).getComputedStyle(e)}function kat(e){if(Y7e(e)==="html")return e;const t=e.assignedSlot||e.parentNode||The(e)&&e.host||X7e(e);return The(t)?t.host:t}function J7e(e){const t=kat(e);return _at(t)?e.ownerDocument?e.ownerDocument.body:e.body:zse(t)&&Z7e(t)?t:J7e(t)}function JO(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=J7e(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),o=n1(s);if(a){const l=eZ(o);return t.concat(o,o.visualViewport||[],Z7e(s)?s:[],l&&n?JO(l):[])}return t.concat(s,JO(s,[],n))}function eZ(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Tat(e){const t=Hse(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=zse(e),a=s?e.offsetWidth:n,o=s?e.offsetHeight:r,l=QO(n)!==a||QO(r)!==o;return l&&(n=a,r=o),{width:n,height:r,$:l}}function Vse(e){return jat(e)?e:e.contextElement}function Ihe(e){const t=Vse(e);if(!zse(t))return ZO(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=Tat(t);let o=(a?QO(n.width):n.width)/r,l=(a?QO(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const Iat=ZO(0);function Pat(e){const t=n1(e);return!Eat()||!t.visualViewport?Iat:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Fat(e,t,n){return!1}function Phe(e,t,n,r){t===void 0&&(t=!1);const s=e.getBoundingClientRect(),a=Vse(e);let o=ZO(1);t&&(o=Ihe(e));const l=Fat()?Pat(a):ZO(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=n1(a),g=r;let v=x,w=eZ(v);for(;w&&r&&g!==v;){const C=Ihe(w),N=w.getBoundingClientRect(),P=Hse(w),I=N.left+(w.clientLeft+parseFloat(P.paddingLeft))*C.x,R=N.top+(w.clientTop+parseFloat(P.paddingTop))*C.y;c*=C.x,u*=C.y,d*=C.x,f*=C.y,c+=I,u+=R,v=n1(w),w=eZ(v)}}return N9({width:d,height:f,x:c,y:u})}function eje(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Oat(e,t){let n=null,r;const s=X7e(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=kI(f),w=kI(s.clientWidth-(d+x)),C=kI(s.clientHeight-(f+g)),N=kI(d),I={rootMargin:-v+"px "+-w+"px "+-C+"px "+-N+"px",threshold:Aat(0,Nat(1,c))||1};let R=!0;function O(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&&!eje(u,e.getBoundingClientRect())&&o(),R=!1}try{n=new IntersectionObserver(O,{...I,root:s.ownerDocument})}catch{n=new IntersectionObserver(O,I)}n.observe(e)}return o(!0),a}function Mat(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=Vse(e),d=s||a?[...u?JO(u):[],...JO(t)]:[];d.forEach(N=>{s&&N.addEventListener("scroll",n,{passive:!0}),a&&N.addEventListener("resize",n)});const f=u&&l?Oat(u,n):null;let x=-1,g=null;o&&(g=new ResizeObserver(N=>{let[P]=N;P&&P.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var I;(I=g)==null||I.observe(t)})),n()}),u&&!c&&g.observe(u),g.observe(t));let v,w=c?Phe(e):null;c&&C();function C(){const N=Phe(e);w&&!eje(w,N)&&n(),w=N,v=requestAnimationFrame(C)}return n(),()=>{var N;d.forEach(P=>{s&&P.removeEventListener("scroll",n),a&&P.removeEventListener("resize",n)}),f==null||f(),(N=g)==null||N.disconnect(),g=null,c&&cancelAnimationFrame(v)}}var tZ=m.useLayoutEffect,Rat=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],eM=function(){};function Lat(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function Dat(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(Lat(e,o)));return a.filter(function(l){return l}).map(function(l){return String(l).trim()}).join(" ")}var Fhe=function(t){return Gat(t)?t.filter(Boolean):h3(t)==="object"&&t!==null?[t]:[]},tje=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=v1(t,Rat);return Ys({},n)},cl=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 GD(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function Bat(e){return GD(e)?window.innerHeight:e.clientHeight}function nje(e){return GD(e)?window.pageYOffset:e.scrollTop}function tM(e,t){if(GD(e)){window.scrollTo(0,t);return}e.scrollTop=t}function $at(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 Uat(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function TI(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:eM,s=nje(e),a=t-s,o=10,l=0;function c(){l+=o;var u=Uat(l,s,a,n);tM(e,u),l<n?window.requestAnimationFrame(c):r(e)}c()}function Ohe(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),s=t.offsetHeight/3;r.bottom+s>n.bottom?tM(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+s,e.scrollHeight)):r.top-s<n.top&&tM(e,Math.max(t.offsetTop-s,0))}function zat(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 Mhe(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function Hat(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var rje=!1,Vat={get passive(){return rje=!0}},II=typeof window<"u"?window:{};II.addEventListener&&II.removeEventListener&&(II.addEventListener("p",eM,Vat),II.removeEventListener("p",eM,!1));var Wat=rje;function qat(e){return e!=null}function Gat(e){return Array.isArray(e)}function PI(e,t,n){return e?t:n}var Kat=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=zg(o,1),c=l[0];return!r.includes(c)});return a.reduce(function(o,l){var c=zg(l,2),u=c[0],d=c[1];return o[u]=d,o},{})},Yat=["children","innerProps"],Xat=["children","innerProps"];function Qat(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,s=e.placement,a=e.shouldScroll,o=e.isFixedPosition,l=e.controlHeight,c=$at(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,P=o?window.innerHeight:Bat(c),I=nje(c),R=parseInt(getComputedStyle(n).marginBottom,10),O=parseInt(getComputedStyle(n).marginTop,10),U=N-O,L=P-w,z=U+I,X=f-I-w,ne=g-P+I+R,J=I+w-O,K=160;switch(s){case"auto":case"bottom":if(L>=v)return{placement:"bottom",maxHeight:t};if(X>=v&&!o)return a&&TI(c,ne,K),{placement:"bottom",maxHeight:t};if(!o&&X>=r||o&&L>=r){a&&TI(c,ne,K);var re=o?L-R:X-R;return{placement:"bottom",maxHeight:re}}if(s==="auto"||o){var he=t,Q=o?U:z;return Q>=r&&(he=Math.min(Q-R-l,t)),{placement:"top",maxHeight:he}}if(s==="bottom")return a&&tM(c,ne),{placement:"bottom",maxHeight:t};break;case"top":if(U>=v)return{placement:"top",maxHeight:t};if(z>=v&&!o)return a&&TI(c,J,K),{placement:"top",maxHeight:t};if(!o&&z>=r||o&&U>=r){var ie=t;return(!o&&z>=r||o&&U>=r)&&(ie=o?U-O:z-O),a&&TI(c,J,K),{placement:"top",maxHeight:ie}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(s,'".'))}return u}function Zat(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var sje=function(t){return t==="auto"?"bottom":t},Jat=function(t,n){var r,s=t.placement,a=t.theme,o=a.borderRadius,l=a.spacing,c=a.colors;return Ys((r={label:"menu"},cj(r,Zat(s),"100%"),cj(r,"position","absolute"),cj(r,"width","100%"),cj(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})},ije=m.createContext(null),eot=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(ije)||{},d=u.setPortalPlacement,f=m.useRef(null),x=m.useState(s),g=zg(x,2),v=g[0],w=g[1],C=m.useState(null),N=zg(C,2),P=N[0],I=N[1],R=c.spacing.controlHeight;return tZ(function(){var O=f.current;if(O){var U=o==="fixed",L=l&&!U,z=Qat({maxHeight:s,menuEl:O,minHeight:r,placement:a,shouldScroll:L,isFixedPosition:U,controlHeight:R});w(z.maxHeight),I(z.placement),d==null||d(z.placement)}},[s,a,o,l,r,d,R]),n({ref:f,placerProps:Ys(Ys({},t),{},{placement:P||sje(a),maxHeight:v})})},tot=function(t){var n=t.children,r=t.innerRef,s=t.innerProps;return Ws("div",ni({},cl(t,"menu",{menu:!0}),{ref:r},s),n)},not=tot,rot=function(t,n){var r=t.maxHeight,s=t.theme.spacing.baseUnit;return Ys({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:s,paddingTop:s})},sot=function(t){var n=t.children,r=t.innerProps,s=t.innerRef,a=t.isMulti;return Ws("div",ni({},cl(t,"menuList",{"menu-list":!0,"menu-list--is-multi":a}),{ref:s},r),n)},aje=function(t,n){var r=t.theme,s=r.spacing.baseUnit,a=r.colors;return Ys({textAlign:"center"},n?{}:{color:a.neutral40,padding:"".concat(s*2,"px ").concat(s*3,"px")})},iot=aje,aot=aje,oot=function(t){var n=t.children,r=n===void 0?"No options":n,s=t.innerProps,a=v1(t,Yat);return Ws("div",ni({},cl(Ys(Ys({},a),{},{children:r,innerProps:s}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),s),r)},lot=function(t){var n=t.children,r=n===void 0?"Loading...":n,s=t.innerProps,a=v1(t,Xat);return Ws("div",ni({},cl(Ys(Ys({},a),{},{children:r,innerProps:s}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),s),r)},cot=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}},uot=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(sje(o)),f=zg(d,2),x=f[0],g=f[1],v=m.useMemo(function(){return{setPortalPlacement:g}},[]),w=m.useState(null),C=zg(w,2),N=C[0],P=C[1],I=m.useCallback(function(){if(s){var L=zat(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))&&P({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]);tZ(function(){I()},[I]);var R=m.useCallback(function(){typeof u.current=="function"&&(u.current(),u.current=null),s&&c.current&&(u.current=Mat(s,c.current,I,{elementResize:"ResizeObserver"in window}))},[s,I]);tZ(function(){R()},[R]);var O=m.useCallback(function(L){c.current=L,R()},[R]);if(!n&&l!=="fixed"||!N)return null;var U=Ws("div",ni({ref:O},cl(Ys(Ys({},t),{},{offset:N.offset,position:l,rect:N.rect}),"menuPortal",{"menu-portal":!0}),a),r);return Ws(ije.Provider,{value:v},n?Na.createPortal(U,n):U)},dot=function(t){var n=t.isDisabled,r=t.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},fot=function(t){var n=t.children,r=t.innerProps,s=t.isDisabled,a=t.isRtl;return Ws("div",ni({},cl(t,"container",{"--is-disabled":s,"--is-rtl":a}),r),n)},hot=function(t,n){var r=t.theme.spacing,s=t.isMulti,a=t.hasValue,o=t.selectProps.controlShouldRenderValue;return Ys({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")})},pot=function(t){var n=t.children,r=t.innerProps,s=t.isMulti,a=t.hasValue;return Ws("div",ni({},cl(t,"valueContainer",{"value-container":!0,"value-container--is-multi":s,"value-container--has-value":a}),r),n)},mot=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},xot=function(t){var n=t.children,r=t.innerProps;return Ws("div",ni({},cl(t,"indicatorsContainer",{indicators:!0}),r),n)},Rhe,got=["size"],bot=["innerProps","isRtl","size"],yot={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},oje=function(t){var n=t.size,r=v1(t,got);return Ws("svg",ni({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:yot},r))},Wse=function(t){return Ws(oje,ni({size:20},t),Ws("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"}))},lje=function(t){return Ws(oje,ni({size:20},t),Ws("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"}))},cje=function(t,n){var r=t.isFocused,s=t.theme,a=s.spacing.baseUnit,o=s.colors;return Ys({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?o.neutral60:o.neutral20,padding:a*2,":hover":{color:r?o.neutral80:o.neutral40}})},vot=cje,wot=function(t){var n=t.children,r=t.innerProps;return Ws("div",ni({},cl(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||Ws(lje,null))},Cot=cje,Sot=function(t){var n=t.children,r=t.innerProps;return Ws("div",ni({},cl(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||Ws(Wse,null))},Not=function(t,n){var r=t.isDisabled,s=t.theme,a=s.spacing.baseUnit,o=s.colors;return Ys({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?o.neutral10:o.neutral20,marginBottom:a*2,marginTop:a*2})},Aot=function(t){var n=t.innerProps;return Ws("span",ni({},n,cl(t,"indicatorSeparator",{"indicator-separator":!0})))},jot=Cat(Rhe||(Rhe=Sat([`
  0%, 80%, 100% { opacity: 0; }
  40% { opacity: 1; }
`]))),Eot=function(t,n){var r=t.isFocused,s=t.size,a=t.theme,o=a.colors,l=a.spacing.baseUnit;return Ys({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})},Uz=function(t){var n=t.delay,r=t.offset;return Ws("span",{css:Use({animation:"".concat(jot," 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"},"","")})},_ot=function(t){var n=t.innerProps,r=t.isRtl,s=t.size,a=s===void 0?4:s,o=v1(t,bot);return Ws("div",ni({},cl(Ys(Ys({},o),{},{innerProps:n,isRtl:r,size:a}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),Ws(Uz,{delay:0,offset:r}),Ws(Uz,{delay:160,offset:!0}),Ws(Uz,{delay:320,offset:!r}))},kot=function(t,n){var r=t.isDisabled,s=t.isFocused,a=t.theme,o=a.colors,l=a.borderRadius,c=a.spacing;return Ys({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}})},Tot=function(t){var n=t.children,r=t.isDisabled,s=t.isFocused,a=t.innerRef,o=t.innerProps,l=t.menuIsOpen;return Ws("div",ni({ref:a},cl(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":s,"control--menu-is-open":l}),o,{"aria-disabled":r||void 0}),n)},Iot=Tot,Pot=["data"],Fot=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},Oot=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 Ws("div",ni({},cl(t,"group",{group:!0}),c),Ws(o,ni({},l,{selectProps:f,theme:d,getStyles:s,getClassNames:a,cx:r}),u),Ws("div",null,n))},Mot=function(t,n){var r=t.theme,s=r.colors,a=r.spacing;return Ys({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"})},Rot=function(t){var n=tje(t);n.data;var r=v1(n,Pot);return Ws("div",ni({},cl(t,"groupHeading",{"group-heading":!0}),r))},Lot=Oot,Dot=["innerRef","isDisabled","isHidden","inputClassName"],Bot=function(t,n){var r=t.isDisabled,s=t.value,a=t.theme,o=a.spacing,l=a.colors;return Ys(Ys({visibility:r?"hidden":"visible",transform:s?"translateZ(0)":""},$ot),n?{}:{margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,color:l.neutral80})},uje={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},$ot={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Ys({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},uje)},Uot=function(t){return Ys({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},uje)},zot=function(t){var n=t.cx,r=t.value,s=tje(t),a=s.innerRef,o=s.isDisabled,l=s.isHidden,c=s.inputClassName,u=v1(s,Dot);return Ws("div",ni({},cl(t,"input",{"input-container":!0}),{"data-value":r||""}),Ws("input",ni({className:n({input:!0},c),ref:a,style:Uot(l),disabled:o},u)))},Hot=zot,Vot=function(t,n){var r=t.theme,s=r.spacing,a=r.borderRadius,o=r.colors;return Ys({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:o.neutral10,borderRadius:a/2,margin:s.baseUnit/2})},Wot=function(t,n){var r=t.theme,s=r.borderRadius,a=r.colors,o=t.cropWithEllipsis;return Ys({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})},qot=function(t,n){var r=t.theme,s=r.spacing,a=r.borderRadius,o=r.colors,l=t.isFocused;return Ys({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}})},dje=function(t){var n=t.children,r=t.innerProps;return Ws("div",r,n)},Got=dje,Kot=dje;function Yot(e){var t=e.children,n=e.innerProps;return Ws("div",ni({role:"button"},n),t||Ws(Wse,{size:14}))}var Xot=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 Ws(u,{data:s,innerProps:Ys(Ys({},cl(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":o})),a),selectProps:c},Ws(d,{data:s,innerProps:Ys({},cl(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:c},n),Ws(f,{data:s,innerProps:Ys(Ys({},cl(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},l),selectProps:c}))},Qot=Xot,Zot=function(t,n){var r=t.isDisabled,s=t.isFocused,a=t.isSelected,o=t.theme,l=o.spacing,c=o.colors;return Ys({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}})},Jot=function(t){var n=t.children,r=t.isDisabled,s=t.isFocused,a=t.isSelected,o=t.innerRef,l=t.innerProps;return Ws("div",ni({},cl(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":s,"option--is-selected":a}),{ref:o,"aria-disabled":r},l),n)},elt=Jot,tlt=function(t,n){var r=t.theme,s=r.spacing,a=r.colors;return Ys({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:a.neutral50,marginLeft:s.baseUnit/2,marginRight:s.baseUnit/2})},nlt=function(t){var n=t.children,r=t.innerProps;return Ws("div",ni({},cl(t,"placeholder",{placeholder:!0}),r),n)},rlt=nlt,slt=function(t,n){var r=t.isDisabled,s=t.theme,a=s.spacing,o=s.colors;return Ys({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})},ilt=function(t){var n=t.children,r=t.isDisabled,s=t.innerProps;return Ws("div",ni({},cl(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),s),n)},alt=ilt,Ca={ClearIndicator:Sot,Control:Iot,DropdownIndicator:wot,DownChevron:lje,CrossIcon:Wse,Group:Lot,GroupHeading:Rot,IndicatorsContainer:xot,IndicatorSeparator:Aot,Input:Hot,LoadingIndicator:_ot,Menu:not,MenuList:sot,MenuPortal:uot,LoadingMessage:lot,NoOptionsMessage:oot,MultiValue:Qot,MultiValueContainer:Got,MultiValueLabel:Kot,MultiValueRemove:Yot,Option:elt,Placeholder:rlt,SelectContainer:fot,SingleValue:alt,ValueContainer:pot},olt=function(t){return Ys(Ys({},Ca),t.components)},Lhe=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function llt(e,t){return!!(e===t||Lhe(e)&&Lhe(t))}function clt(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!llt(e[n],t[n]))return!1;return!0}function ult(e,t){t===void 0&&(t=clt);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 dlt={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"},flt=function(t){return Ws("span",ni({css:dlt},t))},Dhe=flt,hlt={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:"",".")}},plt=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,P=c.options,I=c.screenReaderStatus,R=c.tabSelectsValue,O=c.isLoading,U=c["aria-label"],L=c["aria-live"],z=m.useMemo(function(){return Ys(Ys({},hlt),f||{})},[f]),X=m.useMemo(function(){var Q="";if(n&&z.onChange){var ie=n.option,oe=n.options,G=n.removedValue,V=n.removedValues,te=n.value,ae=function(je){return Array.isArray(je)?null:je},fe=G||ie||ae(te),Ne=fe?x(fe):"",me=oe||V||void 0,we=me?me.map(x):[],xe=Ys({isDisabled:fe&&w(fe,l),label:Ne,labels:we},n);Q=z.onChange(xe)}return Q},[n,z,w,l,x]),ne=m.useMemo(function(){var Q="",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};Q=z.onFocus(G)}return Q},[r,s,x,w,z,a,l,d]),J=m.useMemo(function(){var Q="";if(N&&P.length&&!O&&z.onFilter){var ie=I({count:a.length});Q=z.onFilter({inputValue:g,resultsMessage:ie})}return Q},[a,g,N,z,P,I,O]),K=(n==null?void 0:n.action)==="initial-input-focus",re=m.useMemo(function(){var Q="";if(z.guidance){var ie=s?"value":N?"menu":"input";Q=z.guidance({"aria-label":U,context:ie,isDisabled:r&&w(r,l),isMulti:v,isSearchable:C,tabSelectsValue:R,isInitialFocus:K})}return Q},[U,r,s,v,w,C,N,z,l,R,K]),he=Ws(m.Fragment,null,Ws("span",{id:"aria-selection"},X),Ws("span",{id:"aria-focused"},ne),Ws("span",{id:"aria-results"},J),Ws("span",{id:"aria-guidance"},re));return Ws(m.Fragment,null,Ws(Dhe,{id:u},K&&he),Ws(Dhe,{"aria-live":L,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},o&&!K&&he))},mlt=plt,nZ=[{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źẑżžẓẕƶȥɀⱬꝣ"}],xlt=new RegExp("["+nZ.map(function(e){return e.letters}).join("")+"]","g"),fje={};for(var zz=0;zz<nZ.length;zz++)for(var Hz=nZ[zz],Vz=0;Vz<Hz.letters.length;Vz++)fje[Hz.letters[Vz]]=Hz.base;var hje=function(t){return t.replace(xlt,function(n){return fje[n]})},glt=ult(hje),Bhe=function(t){return t.replace(/^\s+|\s+$/g,"")},blt=function(t){return"".concat(t.label," ").concat(t.value)},ylt=function(t){return function(n,r){if(n.data.__isNew__)return!0;var s=Ys({ignoreCase:!0,ignoreAccents:!0,stringify:blt,trim:!0,matchFrom:"any"},t),a=s.ignoreCase,o=s.ignoreAccents,l=s.stringify,c=s.trim,u=s.matchFrom,d=c?Bhe(r):r,f=c?Bhe(l(n)):l(n);return a&&(d=d.toLowerCase(),f=f.toLowerCase()),o&&(d=glt(d),f=hje(f)),u==="start"?f.substr(0,d.length)===d:f.indexOf(d)>-1}},vlt=["innerRef"];function wlt(e){var t=e.innerRef,n=v1(e,vlt),r=Kat(n,"onExited","in","enter","exit","appear");return Ws("input",ni({ref:t},r,{css:Use({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 Clt=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function Slt(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 P=u.current,I=P.scrollTop,R=P.scrollHeight,O=P.clientHeight,U=u.current,L=N>0,z=R-O-I,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>I&&(s&&!l.current&&s(C),U.scrollTop=0,X=!0,l.current=!0),X&&Clt(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=Wat?{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 $he=["boxSizing","height","overflow","paddingRight","position"],Uhe={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function zhe(e){e.cancelable&&e.preventDefault()}function Hhe(e){e.stopPropagation()}function Vhe(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Whe(){return"ontouchstart"in window||navigator.maxTouchPoints}var qhe=!!(typeof window<"u"&&window.document&&window.document.createElement),p7=0,R6={capture:!1,passive:!1};function Nlt(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(qhe){var u=document.body,d=u&&u.style;if(r&&$he.forEach(function(v){var w=d&&d[v];s.current[v]=w}),r&&p7<1){var f=parseInt(s.current.paddingRight,10)||0,x=document.body?document.body.clientWidth:0,g=window.innerWidth-x+f||0;Object.keys(Uhe).forEach(function(v){var w=Uhe[v];d&&(d[v]=w)}),d&&(d.paddingRight="".concat(g,"px"))}u&&Whe()&&(u.addEventListener("touchmove",zhe,R6),c&&(c.addEventListener("touchstart",Vhe,R6),c.addEventListener("touchmove",Hhe,R6))),p7+=1}},[r]),l=m.useCallback(function(c){if(qhe){var u=document.body,d=u&&u.style;p7=Math.max(p7-1,0),r&&p7<1&&$he.forEach(function(f){var x=s.current[f];d&&(d[f]=x)}),u&&Whe()&&(u.removeEventListener("touchmove",zhe,R6),c&&(c.removeEventListener("touchstart",Vhe,R6),c.removeEventListener("touchmove",Hhe,R6)))}},[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 Alt=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},jlt={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function Elt(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=Slt({isEnabled:s,onBottomArrive:a,onBottomLeave:o,onTopArrive:l,onTopLeave:c}),d=Nlt({isEnabled:n}),f=function(g){u(g),d(g)};return Ws(m.Fragment,null,n&&Ws("div",{onClick:Alt,css:jlt}),t(f))}var _lt={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},klt=function(t){var n=t.name,r=t.onFocus;return Ws("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:_lt,value:"",onChange:function(){}})},Tlt=klt;function qse(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 Ilt(){return qse(/^iPhone/i)}function pje(){return qse(/^Mac/i)}function Plt(){return qse(/^iPad/i)||pje()&&navigator.maxTouchPoints>1}function Flt(){return Ilt()||Plt()}function Olt(){return pje()||Flt()}var Mlt=function(t){return t.label},Rlt=function(t){return t.label},Llt=function(t){return t.value},Dlt=function(t){return!!t.isDisabled},Blt={clearIndicator:Cot,container:dot,control:kot,dropdownIndicator:vot,group:Fot,groupHeading:Mot,indicatorsContainer:mot,indicatorSeparator:Not,input:Bot,loadingIndicator:Eot,loadingMessage:aot,menu:Jat,menuList:rot,menuPortal:cot,multiValue:Vot,multiValueLabel:Wot,multiValueRemove:qot,noOptionsMessage:iot,option:Zot,placeholder:tlt,singleValue:slt,valueContainer:hot},$lt={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%)"},Ult=4,mje=4,zlt=38,Hlt=mje*2,Vlt={baseUnit:mje,controlHeight:zlt,menuGutter:Hlt},Wz={borderRadius:Ult,colors:$lt,spacing:Vlt},Wlt={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Mhe(),captureMenuScroll:!Mhe(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:ylt(),formatGroupLabel:Mlt,getOptionLabel:Rlt,getOptionValue:Llt,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:Dlt,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!Hat(),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 Ghe(e,t,n,r){var s=bje(e,t,n),a=yje(e,t,n),o=gje(e,t),l=nM(e,t);return{type:"option",data:t,isDisabled:s,isSelected:a,label:o,value:l,index:r}}function MF(e,t){return e.options.map(function(n,r){if("options"in n){var s=n.options.map(function(o,l){return Ghe(e,o,t,l)}).filter(function(o){return Yhe(e,o)});return s.length>0?{type:"group",data:n,options:s,index:r}:void 0}var a=Ghe(e,n,t,r);return Yhe(e,a)?a:void 0}).filter(qat)}function xje(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Rse(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function Khe(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,Rse(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 qlt(e,t){return xje(MF(e,t))}function Yhe(e,t){var n=e.inputValue,r=n===void 0?"":n,s=t.data,a=t.isSelected,o=t.label,l=t.value;return(!wje(e)||!a)&&vje(e,{label:o,value:l,data:s},r)}function Glt(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 Klt(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var qz=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},gje=function(t,n){return t.getOptionLabel(n)},nM=function(t,n){return t.getOptionValue(n)};function bje(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function yje(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=nM(e,t);return n.some(function(s){return nM(e,s)===r})}function vje(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var wje=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},Ylt=1,Cje=function(e){yit(n,e);var t=Cit(n);function n(r){var s;if(git(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=Olt(),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(Rse(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=PI(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(PI(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=PI(c,f,f[0]||null);d&&s.onChange(x,{action:"pop-value",removedValue:d})},s.getFocusedOptionId=function(c){return qz(s.state.focusableOptionsWithIds,c)},s.getFocusableOptionsWithIds=function(){return Khe(MF(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 Dat.apply(void 0,[s.props.classNamePrefix].concat(u))},s.getOptionLabel=function(c){return gje(s.props,c)},s.getOptionValue=function(c){return nM(s.props,c)},s.getStyles=function(c,u){var d=s.props.unstyled,f=Blt[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 olt(s.props)},s.buildCategorizedOptions=function(){return MF(s.props,s.state.selectValue)},s.getCategorizedOptions=function(){return s.props.menuIsOpen?s.buildCategorizedOptions():[]},s.buildFocusableOptions=function(){return xje(s.buildCategorizedOptions())},s.getFocusableOptions=function(){return s.props.menuIsOpen?s.buildFocusableOptions():[]},s.ariaOnChange=function(c,u){s.setState({ariaSelection:Ys({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&&GD(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 wje(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,P=u.tabSelectsValue,I=u.openMenuOnFocus,R=s.state,O=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||!P||!O||I&&s.isOptionSelected(O,L))return;s.selectOption(O);break;case"Enter":if(c.keyCode===229)break;if(C){if(!O||s.isComposing)return;s.selectOption(O);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(!O)return;s.selectOption(O);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||++Ylt),s.state.selectValue=Fhe(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=qz(a,o[l])}return s}return bit(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&&Ohe(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&&(Ohe(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(Wz):Ys(Ys({},Wz),this.props.theme):Wz}},{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 bje(this.props,s,a)}},{key:"isOptionSelected",value:function(s,a){return yje(this.props,s,a)}},{key:"filterOption",value:function(s,a){return vje(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,P=this.commonProps,I=l||this.getElementId("input"),R=Ys(Ys(Ys({"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,ni({},P,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:I,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(wlt,ni({id:I,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:eM,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,P=g.placeholder,I=this.state,R=I.selectValue,O=I.focusedValue,U=I.isFocused;if(!this.hasValue()||!v)return N?null:m.createElement(f,ni({},x,{key:"placeholder",isDisabled:w,isFocused:U,innerProps:{id:this.getElementId("placeholder")}}),P);if(C)return R.map(function(z,X){var ne=z===O,J="".concat(s.getOptionLabel(z),"-").concat(s.getOptionValue(z));return m.createElement(o,ni({},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,ni({},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,ni({},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,ni({},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,ni({},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,ni({},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,P=C.inputValue,I=C.isLoading,R=C.loadingMessage,O=C.minMenuHeight,U=C.maxMenuHeight,L=C.menuIsOpen,z=C.menuPlacement,X=C.menuPosition,ne=C.menuPortalTarget,J=C.menuShouldBlockScroll,K=C.menuShouldScrollIntoView,re=C.noOptionsMessage,he=C.onMenuScrollToTop,Q=C.onMenuScrollToBottom;if(!L)return null;var ie=function(Ne,me){var we=Ne.type,xe=Ne.data,ye=Ne.isDisabled,je=Ne.isSelected,Pe=Ne.label,Re=Ne.value,Xe=w===xe,Ke=ye?void 0:function(){return s.onOptionHover(xe)},ut=ye?void 0:function(){return s.selectOption(xe)},et="".concat(s.getElementId("option"),"-").concat(me),tt={id:et,onClick:ut,onMouseMove:Ke,onMouseOver:Ke,tabIndex:-1,role:"option","aria-selected":s.isAppleDevice?void 0:je};return m.createElement(g,ni({},v,{innerProps:tt,data:xe,isDisabled:ye,isSelected:je,key:et,label:Pe,type:we,value:Re,isFocused:Xe,innerRef:Xe?s.getFocusedOptionRef:void 0}),s.formatOptionLabel(Ne.data,"menu"))},oe;if(this.hasOptions())oe=this.getCategorizedOptions().map(function(fe){if(fe.type==="group"){var Ne=fe.data,me=fe.options,we=fe.index,xe="".concat(s.getElementId("group"),"-").concat(we),ye="".concat(xe,"-heading");return m.createElement(o,ni({},v,{key:xe,data:Ne,options:me,Heading:l,headingProps:{id:ye,data:fe.data},label:s.formatGroupLabel(fe.data)}),fe.options.map(function(je){return ie(je,"".concat(we,"-").concat(je.index))}))}else if(fe.type==="option")return ie(fe,"".concat(fe.index))});else if(I){var G=R({inputValue:P});if(G===null)return null;oe=m.createElement(f,v,G)}else{var V=re({inputValue:P});if(V===null)return null;oe=m.createElement(x,v,V)}var te={minMenuHeight:O,maxMenuHeight:U,menuPlacement:z,menuPosition:X,menuShouldScrollIntoView:K},ae=m.createElement(eot,ni({},v,te),function(fe){var Ne=fe.ref,me=fe.placerProps,we=me.placement,xe=me.maxHeight;return m.createElement(c,ni({},v,te,{innerRef:Ne,innerProps:{onMouseDown:s.onMenuMouseDown,onMouseMove:s.onMenuMouseMove},isLoading:I,placement:we}),m.createElement(Elt,{captureEnabled:N,onTopArrive:he,onBottomArrive:Q,lockEnabled:J},function(ye){return m.createElement(u,ni({},v,{innerRef:function(Pe){s.getMenuListRef(Pe),ye(Pe)},innerProps:{role:"listbox","aria-multiselectable":v.isMulti,id:s.getElementId("listbox")},isLoading:I,maxHeight:xe,focusedOption:w}),oe)}))});return ne||X==="fixed"?m.createElement(d,ni({},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(Tlt,{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(mlt,ni({},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,ni({},w,{className:d,innerProps:{id:f,onKeyDown:this.onKeyDown},isDisabled:x,isFocused:v}),this.renderLiveRegion(),m.createElement(a,ni({},w,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:x,isFocused:v,menuIsOpen:g}),m.createElement(c,ni({},w,{isDisabled:x}),this.renderPlaceholderOrValue(),this.renderInput()),m.createElement(o,ni({},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,P=Fhe(v),I={};if(o&&(v!==o.value||g!==o.options||w!==o.menuIsOpen||C!==o.inputValue)){var R=w?qlt(s,P):[],O=w?Khe(MF(s,P),"".concat(x,"-option")):[],U=l?Glt(a,P):null,L=Klt(a,R),z=qz(O,L);I={selectValue:P,focusedOption:L,focusedOptionId:z,focusableOptionsWithIds:O,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:PI(N,P,P[0]||null),options:P,action:"initial-input-focus"},J=!f),(u==null?void 0:u.action)==="initial-input-focus"&&(ne=null),Ys(Ys(Ys({},I),X),{},{prevProps:s,ariaSelection:ne,prevWasFocused:J})}}]),n}(m.Component);Cje.defaultProps=Wlt;var Xlt=m.forwardRef(function(e,t){var n=xit(e);return m.createElement(Cje,ni({ref:t},n))}),Nl=Xlt;function iu(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 p3(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 Ro(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 Qlt(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 FI(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 Zlt(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 Os(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 Jlt(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 ect(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 oo(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 fy(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 Sv(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 KD=e=>e?`${e.slice(0,4)}..${e.slice(-4)}`:"-";function td(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 Ww(e){if(isNaN(e))return;const t=e.toString().replace(".",",");return Number(t.replace(",",".")).toLocaleString("en-US",{maximumFractionDigits:20})}const Sje="2.28.0";let m7={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${Sje}`},Lr=class rZ extends Error{constructor(t,n={}){var l;const r=(()=>{var c;return n.cause instanceof rZ?n.cause.details:(c=n.cause)!=null&&c.message?n.cause.message:n.details})(),s=n.cause instanceof rZ&&n.cause.docsPath||n.docsPath,a=(l=m7.getDocsUrl)==null?void 0:l.call(m7,{...n,docsPath:s}),o=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...r?[`Details: ${r}`]:[],...m7.version?[`Version: ${m7.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=Sje}walk(t){return Nje(this,t)}};function Nje(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?Nje(e.cause,t):t?null:e}let Aje=class extends Lr{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 tct extends Lr{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 nct extends Lr{constructor(t){super(`Hex value "${t}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}let rct=class extends Lr{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}},jje=class extends Lr{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}},Eje=class extends Lr{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 Xhe extends Lr{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 hA(e,{dir:t,size:n=32}={}){return typeof e=="string"?wy(e,{dir:t,size:n}):sct(e,{dir:t,size:n})}function wy(e,{dir:t,size:n=32}={}){if(n===null)return e;const r=e.replace("0x","");if(r.length>n*2)throw new Eje({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function sct(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new Eje({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 X0(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function al(e){return X0(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function Wf(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 ict=new TextEncoder;function pA(e,t={}){return typeof e=="number"||typeof e=="bigint"?oct(e,t):typeof e=="boolean"?act(e,t):X0(e)?sp(e,t):qw(e,t)}function act(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(pp(n,{size:t.size}),hA(n,{size:t.size})):n}const Lx={zero:48,nine:57,A:65,F:70,a:97,f:102};function Qhe(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 sp(e,t={}){let n=e;t.size&&(pp(n,{size:t.size}),n=hA(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=Qhe(r.charCodeAt(l++)),u=Qhe(r.charCodeAt(l++));if(c===void 0||u===void 0)throw new Lr(`Invalid byte sequence ("${r[l-2]}${r[l-1]}" in "${r}").`);a[o]=c*16+u}return a}function oct(e,t){const n=Us(e,t);return sp(n)}function qw(e,t={}){const n=ict.encode(e);return typeof t.size=="number"?(pp(n,{size:t.size}),hA(n,{dir:"right",size:t.size})):n}function pp(e,{size:t}){if(al(e)>t)throw new rct({givenSize:al(e),maxSize:t})}function sd(e,t={}){const{signed:n}=t;t.size&&pp(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 lct(e,t={}){let n=e;if(t.size&&(pp(n,{size:t.size}),n=Wf(n)),Wf(n)==="0x00")return!1;if(Wf(n)==="0x01")return!0;throw new nct(n)}function Q0(e,t={}){return Number(sd(e,t))}function cct(e,t={}){let n=sp(e);return t.size&&(pp(n,{size:t.size}),n=Wf(n,{dir:"right"})),new TextDecoder().decode(n)}const uct=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function ui(e,t={}){return typeof e=="number"||typeof e=="bigint"?Us(e,t):typeof e=="string"?IS(e,t):typeof e=="boolean"?_je(e,t):Vl(e,t)}function _je(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(pp(n,{size:t.size}),hA(n,{size:t.size})):n}function Vl(e,t={}){let n="";for(let s=0;s<e.length;s++)n+=uct[e[s]];const r=`0x${n}`;return typeof t.size=="number"?(pp(r,{size:t.size}),hA(r,{dir:"right",size:t.size})):r}function Us(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 Aje({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?hA(l,{size:r}):l}const dct=new TextEncoder;function IS(e,t={}){const n=dct.encode(e);return Vl(n,t)}function gm(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new Nct(e.type);return`${e.name}(${YD(e.inputs,{includeName:t})})`}function YD(e,{includeName:t=!1}={}){return e?e.map(n=>fct(n,{includeName:t})).join(t?", ":","):""}function fct(e,{includeName:t}){return e.type.startsWith("tuple")?`(${YD(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}class hct extends Lr{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 Zhe extends Lr{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 kje extends Lr{constructor({data:t,params:n,size:r}){super([`Data size of ${r} bytes is too small for given parameters.`].join(`
`),{metaMessages:[`Params: (${YD(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 Ak extends Lr{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class pct extends Lr{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 mct extends Lr{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${al(n)}) does not match expected size (bytes${t}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class xct extends Lr{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${n}`].join(`
`),{name:"AbiEncodingLengthMismatchError"})}}class gct extends Lr{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 Jhe extends Lr{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 Tje extends Lr{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 bct extends Lr{constructor({docsPath:t}){super("Cannot extract event signature from empty topics.",{docsPath:t,name:"AbiEventSignatureEmptyTopicsError"})}}class Ije extends Lr{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 epe extends Lr{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 PS extends Lr{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 Pje extends Lr{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 yct extends Lr{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 vct extends Lr{constructor(t,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${gm(t.abiItem)}\`, and`,`\`${n.type}\` in \`${gm(n.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}let wct=class extends Lr{constructor({expectedSize:t,givenSize:n}){super(`Expected bytes${t}, got bytes${n}.`,{name:"BytesSizeMismatchError"})}};class O9 extends Lr{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: (${YD(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 XD extends Lr{constructor({abiItem:t,param:n}){super([`Expected a topic for indexed event parameter${n.name?` "${n.name}"`:""} on event "${gm(t,{includeName:!0})}".`].join(`
`),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t}}class Cct extends Lr{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 Sct extends Lr{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 Fje=class extends Lr{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
`),{name:"InvalidArrayError"})}};class Nct extends Lr{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
`),{name:"InvalidDefinitionTypeError"})}}function r1(e){return typeof e[0]=="string"?Nm(e):Act(e)}function Act(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 Nm(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}let xd=class extends Lr{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"})}},QD=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 rM(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function jct(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function jk(e,...t){if(!jct(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 Ect(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");rM(e.outputLen),rM(e.blockLen)}function FS(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 Oje(e,t){jk(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}const OI=BigInt(2**32-1),tpe=BigInt(32);function _ct(e,t=!1){return t?{h:Number(e&OI),l:Number(e>>tpe&OI)}:{h:Number(e>>tpe&OI)|0,l:Number(e&OI)|0}}function kct(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}=_ct(e[s],t);[n[s],r[s]]=[a,o]}return[n,r]}const Tct=(e,t,n)=>e<<n|t>>>32-n,Ict=(e,t,n)=>t<<n|e>>>32-n,Pct=(e,t,n)=>t<<n-32|e>>>64-n,Fct=(e,t,n)=>e<<n-32|t>>>64-n,L6=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Oct(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Gz(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Km(e,t){return e<<32-t|e>>>t}const npe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Mct(e){return 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]=Mct(e[t])}typeof Uint8Array.from([]).toHex=="function"&&Uint8Array.fromHex;function Rct(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function ZD(e){return typeof e=="string"&&(e=Rct(e)),jk(e),e}function Lct(...e){let t=0;for(let r=0;r<e.length;r++){const s=e[r];jk(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 Gse=class{clone(){return this._cloneInto()}};function Mje(e){const t=r=>e().update(ZD(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Dct(e=32){if(L6&&typeof L6.getRandomValues=="function")return L6.getRandomValues(new Uint8Array(e));if(L6&&typeof L6.randomBytes=="function")return Uint8Array.from(L6.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}const Rje=[],Lje=[],Dje=[],Bct=BigInt(0),x7=BigInt(1),$ct=BigInt(2),Uct=BigInt(7),zct=BigInt(256),Hct=BigInt(113);for(let e=0,t=x7,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Rje.push(2*(5*r+n)),Lje.push((e+1)*(e+2)/2%64);let s=Bct;for(let a=0;a<7;a++)t=(t<<x7^(t>>Uct)*Hct)%zct,t&$ct&&(s^=x7<<(x7<<BigInt(a))-x7);Dje.push(s)}const[Vct,Wct]=kct(Dje,!0),spe=(e,t,n)=>n>32?Pct(e,t,n):Tct(e,t,n),ipe=(e,t,n)=>n>32?Fct(e,t,n):Ict(e,t,n);function qct(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=spe(u,d,1)^n[l],x=ipe(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=Lje[o],c=spe(s,a,l),u=ipe(s,a,l),d=Rje[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]^=Vct[r],e[1]^=Wct[r]}n.fill(0)}let Gct=class Bje extends Gse{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,rM(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Oct(this.state)}keccak(){npe||rpe(this.state32),qct(this.state32,this.rounds),npe||rpe(this.state32),this.posOut=0,this.pos=0}update(t){FS(this);const{blockLen:n,state:r}=this;t=ZD(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){FS(this,!1),jk(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 rM(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Oje(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 Bje(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 Kct=(e,t,n)=>Mje(()=>new Gct(t,e,n)),Yct=Kct(1,136,256/8);function tu(e,t){const n=t||"hex",r=Yct(X0(e,{strict:!1})?pA(e):e);return n==="bytes"?r:ui(r)}const Kz=new QD(8192);function JD(e,t){if(Kz.has(`${e}.${t}`))return Kz.get(`${e}.${t}`);const n=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),r=tu(qw(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 Kz.set(`${e}.${t}`,a),a}function Ec(e,t){if(!ic(e,{strict:!1}))throw new xd({address:e});return JD(e,t)}const Xct=/^0x[a-fA-F0-9]{40}$/,Yz=new QD(8192);function ic(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if(Yz.has(r))return Yz.get(r);const s=Xct.test(e)?e.toLowerCase()===e?!0:n?JD(e)===e:!0:!1;return Yz.set(r,s),s}function m3(e,t,n,{strict:r}={}){return X0(e,{strict:!1})?Hje(e,t,n,{strict:r}):zje(e,t,n,{strict:r})}function $je(e,t){if(typeof t=="number"&&t>0&&t>al(e)-1)throw new jje({offset:t,position:"start",size:al(e)})}function Uje(e,t,n){if(typeof t=="number"&&typeof n=="number"&&al(e)!==n-t)throw new jje({offset:n,position:"end",size:al(e)})}function zje(e,t,n,{strict:r}={}){$je(e,t);const s=e.slice(t,n);return r&&Uje(s,t,n),s}function Hje(e,t,n,{strict:r}={}){$je(e,t);const s=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return r&&Uje(s,t,n),s}const Qct=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Vje=/^(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 s2(e,t){if(e.length!==t.length)throw new xct({expectedLength:e.length,givenLength:t.length});const n=Zct({params:e,values:t}),r=Yse(n);return r.length===0?"0x":r}function Zct({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(Kse({param:e[r],value:t[r]}));return n}function Kse({param:e,value:t}){const n=Xse(e.type);if(n){const[r,s]=n;return eut(t,{length:r,param:{...e,type:s}})}if(e.type==="tuple")return iut(t,{param:e});if(e.type==="address")return Jct(t);if(e.type==="bool")return nut(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const r=e.type.startsWith("int"),[,,s="256"]=Vje.exec(e.type)??[];return rut(t,{signed:r,size:Number(s)})}if(e.type.startsWith("bytes"))return tut(t,{param:e});if(e.type==="string")return sut(t);throw new Cct(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Yse(e){let t=0;for(let a=0;a<e.length;a++){const{dynamic:o,encoded:l}=e[a];o?t+=32:t+=al(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(Us(t+s,{size:32})),r.push(l),s+=al(l)):n.push(l)}return r1([...n,...r])}function Jct(e){if(!ic(e))throw new xd({address:e});return{dynamic:!1,encoded:wy(e.toLowerCase())}}function eut(e,{length:t,param:n}){const r=t===null;if(!Array.isArray(e))throw new Fje(e);if(!r&&e.length!==t)throw new pct({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let s=!1;const a=[];for(let o=0;o<e.length;o++){const l=Kse({param:n,value:e[o]});l.dynamic&&(s=!0),a.push(l)}if(r||s){const o=Yse(a);if(r){const l=Us(a.length,{size:32});return{dynamic:!0,encoded:a.length>0?r1([l,o]):l}}if(s)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:r1(a.map(({encoded:o})=>o))}}function tut(e,{param:t}){const[,n]=t.type.split("bytes"),r=al(e);if(!n){let s=e;return r%32!==0&&(s=wy(s,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:r1([wy(Us(r,{size:32})),s])}}if(r!==Number.parseInt(n))throw new mct({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:wy(e,{dir:"right"})}}function nut(e){if(typeof e!="boolean")throw new Lr(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:wy(_je(e))}}function rut(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 Aje({max:r.toString(),min:s.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:Us(e,{size:32,signed:t})}}function sut(e){const t=IS(e),n=Math.ceil(al(t)/32),r=[];for(let s=0;s<n;s++)r.push(wy(m3(t,s*32,(s+1)*32),{dir:"right"}));return{dynamic:!0,encoded:r1([wy(Us(al(t),{size:32})),...r])}}function iut(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=Kse({param:a,value:e[o]});r.push(l),l.dynamic&&(n=!0)}return{dynamic:n,encoded:n?Yse(r):r1(r.map(({encoded:s})=>s))}}function Xse(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const Xz="/docs/contract/encodeDeployData";function Qse(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 hct({docsPath:Xz});if(!("inputs"in s))throw new Zhe({docsPath:Xz});if(!s.inputs||s.inputs.length===0)throw new Zhe({docsPath:Xz});const a=s2(s.inputs,n);return Nm([r,a])}function Bu(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}class eB extends Lr{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 Qz extends Lr{constructor({docsPath:t,metaMessages:n,type:r}){super(`Account type "${r}" is not supported.`,{docsPath:t,metaMessages:n,name:"AccountTypeNotSupportedError"})}}function aut(e){const t=tu(`0x${e.substring(4)}`).substring(26);return JD(`0x${t}`)}const out="modulepreload",lut=function(e){return"/"+e},ape={},is=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=lut(c),c in ape)return;ape[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":out,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 cut({hash:e,signature:t}){const n=X0(e)?e:ui(e),{secp256k1:r}=await is(async()=>{const{secp256k1:o}=await Promise.resolve().then(()=>Wmt);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=ope(g);return new r.Signature(sd(u),sd(d)).addRecoveryBit(v)}const o=X0(t)?t:ui(t),l=Q0(`0x${o.slice(130)}`),c=ope(l);return r.Signature.fromCompact(o.substring(2,130)).addRecoveryBit(c)})().recoverPublicKey(n.substring(2)).toHex(!1)}`}function ope(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 Wje({hash:e,signature:t}){return aut(await cut({hash:e,signature:t}))}class lpe extends Lr{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class qje extends Lr{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}}class uut extends Lr{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}}const dut={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 uut({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new qje({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new lpe({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 lpe({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 Zse(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(dut);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function By(e,t="hex"){const n=Gje(e),r=Zse(new Uint8Array(n.length));return n.encode(r),t==="hex"?Vl(r.bytes):r.bytes}function Gje(e){return Array.isArray(e)?fut(e.map(t=>Gje(t))):hut(e)}function fut(e){const t=e.reduce((s,a)=>s+a.length,0),n=Kje(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 hut(e){const t=typeof e=="string"?sp(e):e,n=Kje(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 Kje(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 Lr("Length is too large.")}function put(e){const{chainId:t,nonce:n,to:r}=e,s=e.contractAddress??e.address,a=tu(Nm(["0x05",By([t?Us(t):"0x",s,n?Us(n):"0x"])]));return r==="bytes"?sp(a):a}async function Yje(e){const{authorization:t,signature:n}=e;return Wje({hash:put(t),signature:n??t})}class sZ extends Lr{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 mut=class extends Lr{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 xut extends Lr{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 Xje extends Lr{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}class tB extends Lr{constructor({chainId:t}){super(typeof t=="number"?`Chain ID "${t}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}function gut({chain:e,currentChainId:t}){if(!e)throw new xut;if(t!==e.id)throw new mut({chain:e,currentChainId:t})}const but={gwei:9,wei:18},yut={ether:-9,wei:9},vut={ether:-18,gwei:-9};function Ek(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 nf(e,t="wei"){return Ek(e,yut[t])}class FC extends Lr{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(FC,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(FC,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class x3 extends Lr{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${nf(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}}Object.defineProperty(x3,"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 iZ extends Lr{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${nf(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}}Object.defineProperty(iZ,"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 aZ extends Lr{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(aZ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class oZ extends Lr{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(oZ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class lZ extends Lr{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}exceeds the maximum allowed nonce.`,{cause:t,name:"NonceMaxValueError"})}}Object.defineProperty(lZ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class cZ extends Lr{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(cZ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class uZ extends Lr{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(uZ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class dZ extends Lr{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(dZ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class fZ extends Lr{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(fZ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class M9 extends Lr{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${nf(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${nf(r)} gwei`:""}).`].join(`
`),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(M9,"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 _k extends Lr{constructor({cause:t}){super(`An error occurred while executing: ${t==null?void 0:t.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}function Jse(e,t="wei"){return Ek(e,but[t])}function kk(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 wut extends Lr{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 Cut extends Lr{constructor({v:t}){super(`Invalid \`v\` value "${t}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class Sut extends Lr{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",kk(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 Nut extends Lr{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 Aut extends Lr{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=kk({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"&&`${Jse(x)} ${((v=s==null?void 0:s.nativeCurrency)==null?void 0:v.symbol)||"ETH"}`,data:a,gas:o,gasPrice:typeof l<"u"&&`${nf(l)} gwei`,maxFeePerGas:typeof c<"u"&&`${nf(c)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${nf(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 Qje extends Lr{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 Zje extends Lr{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 jut extends Lr{constructor({hash:t}){super(`Timed out while waiting for transaction with hash "${t}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}const Pc=(e,t,n)=>JSON.stringify(e,(r,s)=>typeof s=="bigint"?s.toString():s,n),Eut=e=>e,eie=e=>e;class Hj extends Lr{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: ${eie(o)}`,t&&`Request body: ${Pc(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 tie extends Lr{constructor({body:t,error:n,url:r}){super("RPC Request failed.",{cause:n,details:n.message,metaMessages:[`URL: ${eie(r)}`,`Request body: ${Pc(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 cpe extends Lr{constructor({body:t,url:n}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${eie(n)}`,`Request body: ${Pc(t)}`],name:"TimeoutError"})}}const _ut=-1;let ff=class extends Lr{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 tie?t.code:n??_ut}};class Zf extends ff{constructor(t,n){super(t,n),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=n.data}}class R9 extends ff{constructor(t){super(t,{code:R9.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(R9,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class L9 extends ff{constructor(t){super(t,{code:L9.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(L9,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class D9 extends ff{constructor(t,{method:n}={}){super(t,{code:D9.code,name:"MethodNotFoundRpcError",shortMessage:`The method${n?` "${n}"`:""} does not exist / is not available.`})}}Object.defineProperty(D9,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class B9 extends ff{constructor(t){super(t,{code:B9.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
`)})}}Object.defineProperty(B9,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class g3 extends ff{constructor(t){super(t,{code:g3.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(g3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class b3 extends ff{constructor(t){super(t,{code:b3.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
`)})}}Object.defineProperty(b3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class $9 extends ff{constructor(t){super(t,{code:$9.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty($9,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class Cy extends ff{constructor(t){super(t,{code:Cy.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(Cy,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class U9 extends ff{constructor(t){super(t,{code:U9.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(U9,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class Wv extends ff{constructor(t,{method:n}={}){super(t,{code:Wv.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${n?` "${n}"`:""} is not supported.`})}}Object.defineProperty(Wv,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class OS extends ff{constructor(t){super(t,{code:OS.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(OS,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class z9 extends ff{constructor(t){super(t,{code:z9.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(z9,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class yo extends Zf{constructor(t){super(t,{code:yo.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(yo,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class H9 extends Zf{constructor(t){super(t,{code:H9.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(H9,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class V9 extends Zf{constructor(t,{method:n}={}){super(t,{code:V9.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${n?` " ${n}"`:""}.`})}}Object.defineProperty(V9,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class W9 extends Zf{constructor(t){super(t,{code:W9.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(W9,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class q9 extends Zf{constructor(t){super(t,{code:q9.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(q9,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class ip extends Zf{constructor(t){super(t,{code:ip.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(ip,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class G9 extends Zf{constructor(t){super(t,{code:G9.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(G9,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class K9 extends Zf{constructor(t){super(t,{code:K9.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(K9,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class Y9 extends Zf{constructor(t){super(t,{code:Y9.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(Y9,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class X9 extends Zf{constructor(t){super(t,{code:X9.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(X9,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class Q9 extends Zf{constructor(t){super(t,{code:Q9.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(Q9,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class Z9 extends Zf{constructor(t){super(t,{code:Z9.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(Z9,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class J9 extends Zf{constructor(t){super(t,{code:J9.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(J9,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class kut extends ff{constructor(t){super(t,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}function nB(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof Lr?e.walk(s=>(s==null?void 0:s.code)===FC.code):e;return r instanceof Lr?new FC({cause:e,message:r.details}):FC.nodeMessage.test(n)?new FC({cause:e,message:e.details}):x3.nodeMessage.test(n)?new x3({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):iZ.nodeMessage.test(n)?new iZ({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):aZ.nodeMessage.test(n)?new aZ({cause:e,nonce:t==null?void 0:t.nonce}):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}):uZ.nodeMessage.test(n)?new uZ({cause:e,gas:t==null?void 0:t.gas}):dZ.nodeMessage.test(n)?new dZ({cause:e,gas:t==null?void 0:t.gas}):fZ.nodeMessage.test(n)?new fZ({cause:e}):M9.nodeMessage.test(n)?new M9({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas,maxPriorityFeePerGas:t==null?void 0:t.maxPriorityFeePerGas}):new _k({cause:e})}function Tut(e,{docsPath:t,...n}){const r=(()=>{const s=nB(e,n);return s instanceof _k?e:s})();return new Aut(r,{docsPath:t,...n})}function rB(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 nie(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 Iut={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function Tk(e){const t={};return typeof e.authorizationList<"u"&&(t.authorizationList=Put(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=>Vl(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=Us(e.gas)),typeof e.gasPrice<"u"&&(t.gasPrice=Us(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(t.maxFeePerBlobGas=Us(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(t.maxFeePerGas=Us(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(t.maxPriorityFeePerGas=Us(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(t.nonce=Us(e.nonce)),typeof e.to<"u"&&(t.to=e.to),typeof e.type<"u"&&(t.type=Iut[e.type]),typeof e.value<"u"&&(t.value=Us(e.value)),t}function Put(e){return e.map(t=>({address:t.address,r:t.r?Us(BigInt(t.r)):t.r,s:t.s?Us(BigInt(t.s)):t.s,chainId:Us(t.chainId),nonce:Us(t.nonce),...typeof t.yParity<"u"?{yParity:Us(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:Us(t.v)}:{}}))}function ii(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 sB=2n**256n-1n;function mA(e){const{account:t,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:s,to:a}=e,o=t?Bu(t):void 0;if(o&&!ic(o.address))throw new xd({address:o.address});if(a&&!ic(a))throw new xd({address:a});if(typeof n<"u"&&(typeof r<"u"||typeof s<"u"))throw new wut;if(r&&r>sB)throw new x3({maxFeePerGas:r});if(s&&r&&s>r)throw new M9({maxFeePerGas:r,maxPriorityFeePerGas:s})}async function rie(e){const t=await e.request({method:"eth_chainId"},{dedupe:!0});return Q0(t)}class Fut extends Lr{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class sie extends Lr{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class Out extends Lr{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${nf(t)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class Jje extends Lr{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 e9e={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function iB(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?Q0(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?Q0(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?e9e[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=Rut(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 Mut=nie("transaction",iB);function Rut(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 iie(e){const t=(e.transactions??[]).map(n=>typeof n=="string"?n:iB(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 Lut=nie("block",iie);async function E0(e,{blockHash:t,blockNumber:n,blockTag:r,includeTransactions:s}={}){var d,f,x;const a=r??"latest",o=s??!1,l=n!==void 0?Us(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 Jje({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)||iie)(c)}async function aie(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function Dut(e,t){return t9e(e,t)}async function t9e(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 ii(e,E0,"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 sd(c)}catch{const[l,c]=await Promise.all([n?Promise.resolve(n):ii(e,E0,"getBlock")({}),ii(e,aie,"getGasPrice")({})]);if(typeof l.baseFeePerGas!="bigint")throw new sie;const u=c-l.baseFeePerGas;return u<0n?0n:u}}async function But(e,t){return hZ(e,t)}async function hZ(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 Fut;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 ii(e,E0,"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 sie;const v=typeof(s==null?void 0:s.maxPriorityFeePerGas)=="bigint"?s.maxPriorityFeePerGas:await t9e(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 ii(e,aie,"getGasPrice")({}))}}class $ut extends Lr{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=kk({from:n==null?void 0:n.address,to:f,value:typeof x<"u"&&`${Jse(x)} ${((v=s==null?void 0:s.nativeCurrency)==null?void 0:v.symbol)||"ETH"}`,data:a,gas:o,gasPrice:typeof l<"u"&&`${nf(l)} gwei`,maxFeePerGas:typeof c<"u"&&`${nf(c)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${nf(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 Uut(e,{docsPath:t,...n}){const r=(()=>{const s=nB(e,n);return s instanceof _k?e:s})();return new $ut(r,{docsPath:t,...n})}class zut extends Lr{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"})}}class Hut extends Lr{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function upe(e){return e.reduce((t,{slot:n,value:r})=>`${t}        ${n}: ${r}
`,"")}function Vut(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+=upe(r.state)),r.stateDiff&&(s+=`      stateDiff:
`,s+=upe(r.stateDiff)),s},`  State Override:
`).slice(0,-1)}function dpe(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:r})=>{if(n.length!==66)throw new Xhe({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new Xhe({size:r.length,targetSize:66,type:"hex"});return t[n]=r,t},{})}function Wut(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=Us(t)),n!==void 0&&(o.nonce=Us(n)),r!==void 0&&(o.state=dpe(r)),s!==void 0){if(o.state)throw new Hut;o.stateDiff=dpe(s)}return o}function oie(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!ic(n,{strict:!1}))throw new xd({address:n});if(t[n])throw new zut({address:n});t[n]=Wut(r)}return t}async function lie(e,{address:t,blockNumber:n,blockTag:r="latest"}){const s=n?Us(n):void 0,a=await e.request({method:"eth_getBalance",params:[t,s||r]});return BigInt(a)}async function cie(e,t){var s,a,o;const{account:n=e.account}=t,r=n?Bu(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:P,nonce:I,value:R,stateOverride:O,...U}=await hie(e,{...t,parameters:(r==null?void 0:r.type)==="local"?void 0:["blobVersionedHashes"]}),z=(f?Us(f):void 0)||x,X=oie(O),ne=await(async()=>{if(U.to)return U.to;if(c&&c.length>0)return await Yje({authorization:c[0]}).catch(()=>{throw new Lr("`to` is required. Could not infer from `authorizationList`")})})();mA(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||Tk)({...rB(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:P,nonce:I,to:ne,value:R});let Q=BigInt(await he({block:z,request:re,rpcStateOverride:X}));if(c){const ie=await lie(e,{address:re.from}),oe=await Promise.all(c.map(async G=>{const{address:V}=G,te=await he({block:z,request:{authorizationList:void 0,data:g,from:r==null?void 0:r.address,to:V,value:Us(ie)},rpcStateOverride:X}).catch(()=>100000n);return 2n*BigInt(te)}));Q+=oe.reduce((G,V)=>G+V,0n)}return Q}catch(l){throw Uut(l,{...t,account:r,chain:e.chain})}}async function n9e(e,{address:t,blockTag:n="latest",blockNumber:r}){const s=await e.request({method:"eth_getTransactionCount",params:[t,r?Us(r):n]},{dedupe:!!r});return Q0(s)}function uie(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=>sp(a)):e.blobs,s=[];for(const a of r)s.push(Uint8Array.from(t.blobToKzgCommitment(a)));return n==="bytes"?s:s.map(a=>Vl(a))}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(o=>sp(o)):e.blobs,s=typeof e.commitments[0]=="string"?e.commitments.map(o=>sp(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=>Vl(o))}function qut(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 Gut(e,t,n){return e&t^~e&n}function Kut(e,t,n){return e&t^e&n^t&n}let Yut=class extends Gse{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=Gz(this.buffer)}update(t){FS(this);const{view:n,buffer:r,blockLen:s}=this;t=ZD(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=Gz(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){FS(this),Oje(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;qut(r,s-8,BigInt(this.length*8),a),this.process(r,0);const l=Gz(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 Xut=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]),ab=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ob=new Uint32Array(64);let Qut=class extends Yut{constructor(t=32){super(64,t,8,!1),this.A=ab[0]|0,this.B=ab[1]|0,this.C=ab[2]|0,this.D=ab[3]|0,this.E=ab[4]|0,this.F=ab[5]|0,this.G=ab[6]|0,this.H=ab[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)ob[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const x=ob[f-15],g=ob[f-2],v=Km(x,7)^Km(x,18)^x>>>3,w=Km(g,17)^Km(g,19)^g>>>10;ob[f]=w+ob[f-7]+v+ob[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=Km(l,6)^Km(l,11)^Km(l,25),g=d+x+Gut(l,c,u)+Xut[f]+ob[f]|0,w=(Km(r,2)^Km(r,13)^Km(r,22))+Kut(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(){ob.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const r9e=Mje(()=>new Qut);function Zut(e,t){return r9e(X0(e,{strict:!1})?pA(e):e)}function Jut(e){const{commitment:t,version:n=1}=e,r=e.to??(typeof t=="string"?"hex":"bytes"),s=Zut(t);return s.set([n],0),r==="bytes"?s:Vl(s)}function s9e(e){const{commitments:t,version:n}=e,r=e.to??(typeof t[0]=="string"?"hex":"bytes"),s=[];for(const a of t)s.push(Jut({commitment:a,to:r,version:n}));return s}const fpe=6,i9e=32,fie=4096,a9e=i9e*fie,hpe=a9e*fpe-1-1*fie*fpe,o9e=1;class edt extends Lr{constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`],name:"BlobSizeTooLargeError"})}}class l9e extends Lr{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class tdt extends Lr{constructor({hash:t,size:n}){super(`Versioned hash "${t}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${n}`],name:"InvalidVersionedHashSizeError"})}}class ndt extends Lr{constructor({hash:t,version:n}){super(`Versioned hash "${t}" version is invalid.`,{metaMessages:[`Expected: ${o9e}`,`Received: ${n}`],name:"InvalidVersionedHashVersionError"})}}function rdt(e){const t=e.to??(typeof e.data=="string"?"hex":"bytes"),n=typeof e.data=="string"?sp(e.data):e.data,r=al(n);if(!r)throw new l9e;if(r>hpe)throw new edt({maxSize:hpe,size:r});const s=[];let a=!0,o=0;for(;a;){const l=Zse(new Uint8Array(a9e));let c=0;for(;c<fie;){const u=n.slice(o,o+(i9e-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=>Vl(l.bytes))}function c9e(e){const{data:t,kzg:n,to:r}=e,s=e.blobs??rdt({data:t,to:r}),a=e.commitments??uie({blobs:s,kzg:n,to:r}),o=e.proofs??die({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 u9e(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 Sut({transaction:e})}const d9e=["blobVersionedHashes","chainId","fees","gas","nonce","type"],ppe=new Map;async function hie(e,t){const{account:n=e.account,blobs:r,chain:s,gas:a,kzg:o,nonce:l,nonceManager:c,parameters:u=d9e,type:d}=t,f=n&&Bu(n),x={...t,...f?{from:f==null?void 0:f.address}:{}};let g;async function v(){return g||(g=await ii(e,E0,"getBlock")({blockTag:"latest"}),g)}let w;async function C(){return w||(s?s.id:typeof t.chainId<"u"?t.chainId:(w=await ii(e,rie,"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 ii(e,n9e,"getTransactionCount")({address:f.address,blockTag:"pending"});if((u.includes("blobVersionedHashes")||u.includes("sidecars"))&&r&&o){const N=uie({blobs:r,kzg:o});if(u.includes("blobVersionedHashes")){const P=s9e({commitments:N,to:"hex"});x.blobVersionedHashes=P}if(u.includes("sidecars")){const P=die({blobs:r,commitments:N,kzg:o}),I=c9e({blobs:r,commitments:N,proofs:P,to:"hex"});x.sidecars=I}}if(u.includes("chainId")&&(x.chainId=await C()),(u.includes("fees")||u.includes("type"))&&typeof d>"u")try{x.type=u9e(x)}catch{let N=ppe.get(e.uid);if(typeof N>"u"){const P=await v();N=typeof(P==null?void 0:P.baseFeePerGas)=="bigint",ppe.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:P,maxPriorityFeePerGas:I}=await hZ(e,{block:N,chain:s,request:x});if(typeof t.maxPriorityFeePerGas>"u"&&t.maxFeePerGas&&t.maxFeePerGas<I)throw new Out({maxPriorityFeePerGas:I});x.maxPriorityFeePerGas=I,x.maxFeePerGas=P}}else{if(typeof t.maxFeePerGas<"u"||typeof t.maxPriorityFeePerGas<"u")throw new sie;if(typeof t.gasPrice>"u"){const N=await v(),{gasPrice:P}=await hZ(e,{block:N,chain:s,request:x,type:"legacy"});x.gasPrice=P}}return u.includes("gas")&&typeof a>"u"&&(x.gas=await ii(e,cie,"estimateGas")({...x,account:f&&{address:f.address,type:"json-rpc"}})),mA(x),delete x.parameters,x}async function f9e(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}const Zz=new QD(128);async function sdt(e,t){var N,P,I,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 eB({docsPath:"/docs/actions/wallet/sendTransaction"});const C=n?Bu(n):null;try{mA(t);const O=await(async()=>{if(t.to)return t.to;if(t.to!==null&&a&&a.length>0)return await Yje({authorization:a[0]}).catch(()=>{throw new Lr("`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 ii(e,rie,"getChainId")({}),gut({currentChainId:U,chain:r}));const L=(I=(P=(N=e.chain)==null?void 0:N.formatters)==null?void 0:P.transactionRequest)==null?void 0:I.format,X=(L||Tk)({...rB(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:O,value:v}),ne=Zz.get(e.uid),J=ne?"wallet_sendTransaction":"eth_sendTransaction";try{return await e.request({method:J,params:[X]},{retryCount:0})}catch(K){if(ne===!1)throw K;const re=K;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=>(Zz.set(e.uid,!0),he)).catch(he=>{const Q=he;throw Q.name==="MethodNotFoundRpcError"||Q.name==="MethodNotSupportedRpcError"?(Zz.set(e.uid,!1),re):Q});throw re}}if((C==null?void 0:C.type)==="local"){const U=await ii(e,hie,"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:[...d9e,"sidecars"],value:v,...w,to:O}),L=(R=r==null?void 0:r.serializers)==null?void 0:R.transaction,z=await C.signTransaction(U,{serializer:L});return await ii(e,f9e,"sendRawTransaction")({serializedTransaction:z})}throw(C==null?void 0:C.type)==="smart"?new Qz({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new Qz({docsPath:"/docs/actions/wallet/sendTransaction",type:C==null?void 0:C.type})}catch(O){throw O instanceof Qz?O:Tut(O,{...t,account:C,chain:t.chain||void 0})}}const pZ=[{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"}],mZ=[{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"}]}],h9e=[{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"}],p9e=[...h9e,{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"}]}],idt=[...h9e,{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"}]}],mpe=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],xpe=[{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"}]}],gpe=[{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 adt(e,t={}){typeof t.size<"u"&&pp(e,{size:t.size});const n=Vl(e,t);return sd(n,t)}function odt(e,t={}){let n=e;if(typeof t.size<"u"&&(pp(n,{size:t.size}),n=Wf(n)),n.length>1||n[0]>1)throw new tct(n);return!!n[0]}function Hg(e,t={}){typeof t.size<"u"&&pp(e,{size:t.size});const n=Vl(e,t);return Q0(n,t)}function ldt(e,t={}){let n=e;return typeof t.size<"u"&&(pp(n,{size:t.size}),n=Wf(n,{dir:"right"})),new TextDecoder().decode(n)}function Ik(e,t){const n=typeof t=="string"?sp(t):t,r=Zse(n);if(al(n)===0&&e.length>0)throw new Ak;if(al(t)&&al(t)<32)throw new kje({data:typeof t=="string"?t:Vl(t),params:e,size:al(t)});let s=0;const a=[];for(let o=0;o<e.length;++o){const l=e[o];r.setPosition(s);const[c,u]=ZC(r,l,{staticPosition:0});s+=u,a.push(c)}return a}function ZC(e,t,{staticPosition:n}){const r=Xse(t.type);if(r){const[s,a]=r;return udt(e,{...t,type:a},{length:s,staticPosition:n})}if(t.type==="tuple")return pdt(e,t,{staticPosition:n});if(t.type==="address")return cdt(e);if(t.type==="bool")return ddt(e);if(t.type.startsWith("bytes"))return fdt(e,t,{staticPosition:n});if(t.type.startsWith("uint")||t.type.startsWith("int"))return hdt(e,t);if(t.type==="string")return mdt(e,{staticPosition:n});throw new Sct(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const bpe=32,xZ=32;function cdt(e){const t=e.readBytes(32);return[JD(Vl(zje(t,-20))),32]}function udt(e,t,{length:n,staticPosition:r}){if(!n){const o=Hg(e.readBytes(xZ)),l=r+o,c=l+bpe;e.setPosition(l);const u=Hg(e.readBytes(bpe)),d=eE(t);let f=0;const x=[];for(let g=0;g<u;++g){e.setPosition(c+(d?g*32:f));const[v,w]=ZC(e,t,{staticPosition:c});f+=w,x.push(v)}return e.setPosition(r+32),[x,32]}if(eE(t)){const o=Hg(e.readBytes(xZ)),l=r+o,c=[];for(let u=0;u<n;++u){e.setPosition(l+u*32);const[d]=ZC(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]=ZC(e,t,{staticPosition:r+s});s+=c,a.push(l)}return[a,s]}function ddt(e){return[odt(e.readBytes(32),{size:32}),32]}function fdt(e,t,{staticPosition:n}){const[r,s]=t.type.split("bytes");if(!s){const o=Hg(e.readBytes(32));e.setPosition(n+o);const l=Hg(e.readBytes(32));if(l===0)return e.setPosition(n+32),["0x",32];const c=e.readBytes(l);return e.setPosition(n+32),[Vl(c),32]}return[Vl(e.readBytes(Number.parseInt(s),32)),32]}function hdt(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256"),s=e.readBytes(32);return[r>48?adt(s,{signed:n}):Hg(s,{signed:n}),32]}function pdt(e,t,{staticPosition:n}){const r=t.components.length===0||t.components.some(({name:o})=>!o),s=r?[]:{};let a=0;if(eE(t)){const o=Hg(e.readBytes(xZ)),l=n+o;for(let c=0;c<t.components.length;++c){const u=t.components[c];e.setPosition(l+a);const[d,f]=ZC(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]=ZC(e,l,{staticPosition:n});s[r?o:l==null?void 0:l.name]=c,a+=u}return[s,a]}function mdt(e,{staticPosition:t}){const n=Hg(e.readBytes(32)),r=t+n;e.setPosition(r);const s=Hg(e.readBytes(32));if(s===0)return e.setPosition(t+32),["",32];const a=e.readBytes(s,32),o=ldt(Wf(a));return e.setPosition(t+32),[o,32]}function eE(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(eE);const n=Xse(e.type);return!!(n&&eE({...e,type:n[1]}))}const xdt=e=>tu(pA(e));function gdt(e){return xdt(e)}const bdt="1.0.8";let Jf=class gZ extends Error{constructor(t,n={}){var o;const r=n.cause instanceof gZ?n.cause.details:(o=n.cause)!=null&&o.message?n.cause.message:n.details,s=n.cause instanceof gZ&&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@${bdt}`].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 w1(e,t){const n=e.exec(t);return n==null?void 0:n.groups}const m9e=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,x9e=/^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)?$/,g9e=/^\(.+?\).*?$/,ype=/^tuple(?<array>(\[(\d*)\])*)$/;function bZ(e){let t=e.type;if(ype.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+=bZ(a),s<n-1&&(t+=", ")}const r=w1(ype,e.type);return t+=`)${(r==null?void 0:r.array)??""}`,bZ({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function g7(e){let t="";const n=e.length;for(let r=0;r<n;r++){const s=e[r];t+=bZ(s),r!==n-1&&(t+=", ")}return t}function sM(e){var t;return e.type==="function"?`function ${e.name}(${g7(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${(t=e.outputs)!=null&&t.length?` returns (${g7(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${g7(e.inputs)})`:e.type==="error"?`error ${e.name}(${g7(e.inputs)})`:e.type==="constructor"?`constructor(${g7(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}const b9e=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function ydt(e){return b9e.test(e)}function vdt(e){return w1(b9e,e)}const y9e=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function wdt(e){return y9e.test(e)}function Cdt(e){return w1(y9e,e)}const v9e=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function Sdt(e){return v9e.test(e)}function Ndt(e){return w1(v9e,e)}const w9e=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function pie(e){return w9e.test(e)}function Adt(e){return w1(w9e,e)}const C9e=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function jdt(e){return C9e.test(e)}function Edt(e){return w1(C9e,e)}const S9e=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function _dt(e){return S9e.test(e)}function kdt(e){return w1(S9e,e)}const Tdt=/^receive\(\) external payable$/;function Idt(e){return Tdt.test(e)}const Pdt=new Set(["indexed"]),yZ=new Set(["calldata","memory","storage"]);class Fdt extends Jf{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 Odt extends Jf{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 Mdt extends Jf{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 Rdt extends Jf{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class Ldt extends Jf{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 Ddt extends Jf{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 Bdt extends Jf{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 $dt extends Jf{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 xA=class extends Jf{constructor({signature:t,type:n}){super(`Invalid ${n} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}};class Udt extends Jf{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class zdt extends Jf{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 Hdt extends Jf{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 Vdt extends Jf{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 Wdt(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 Jz=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 vZ(e,t={}){if(Sdt(e))return qdt(e,t);if(wdt(e))return Gdt(e,t);if(ydt(e))return Kdt(e,t);if(jdt(e))return Ydt(e,t);if(_dt(e))return Xdt(e);if(Idt(e))return{type:"receive",stateMutability:"payable"};throw new Udt({signature:e})}function qdt(e,t={}){const n=Ndt(e);if(!n)throw new xA({signature:e,type:"function"});const r=rm(n.parameters),s=[],a=r.length;for(let l=0;l<a;l++)s.push(y3(r[l],{modifiers:yZ,structs:t,type:"function"}));const o=[];if(n.returns){const l=rm(n.returns),c=l.length;for(let u=0;u<c;u++)o.push(y3(l[u],{modifiers:yZ,structs:t,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:s,outputs:o}}function Gdt(e,t={}){const n=Cdt(e);if(!n)throw new xA({signature:e,type:"event"});const r=rm(n.parameters),s=[],a=r.length;for(let o=0;o<a;o++)s.push(y3(r[o],{modifiers:Pdt,structs:t,type:"event"}));return{name:n.name,type:"event",inputs:s}}function Kdt(e,t={}){const n=vdt(e);if(!n)throw new xA({signature:e,type:"error"});const r=rm(n.parameters),s=[],a=r.length;for(let o=0;o<a;o++)s.push(y3(r[o],{structs:t,type:"error"}));return{name:n.name,type:"error",inputs:s}}function Ydt(e,t={}){const n=Edt(e);if(!n)throw new xA({signature:e,type:"constructor"});const r=rm(n.parameters),s=[],a=r.length;for(let o=0;o<a;o++)s.push(y3(r[o],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:s}}function Xdt(e){const t=kdt(e);if(!t)throw new xA({signature:e,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}const Qdt=/^(?<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$_]*))?$/,Zdt=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Jdt=/^u?int$/;function y3(e,t){var f,x;const n=Wdt(e,t==null?void 0:t.type,t==null?void 0:t.structs);if(Jz.has(n))return Jz.get(n);const r=g9e.test(e),s=w1(r?Zdt:Qdt,e);if(!s)throw new Rdt({param:e});if(s.name&&tft(s.name))throw new Ldt({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=rm(s.type),v=[],w=g.length;for(let C=0;C<w;C++)v.push(y3(g[C],{structs:l}));u={components:v}}else if(s.type in l)c="tuple",u={components:l[s.type]};else if(Jdt.test(s.type))c=`${s.type}256`;else if(c=s.type,(t==null?void 0:t.type)!=="struct"&&!N9e(c))throw new Mdt({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 Ddt({param:e,type:t==null?void 0:t.type,modifier:s.modifier});if(yZ.has(s.modifier)&&!nft(c,!!s.array))throw new Bdt({param:e,type:t==null?void 0:t.type,modifier:s.modifier})}const d={type:`${c}${s.array??""}`,...a,...o,...u};return Jz.set(n,d),d}function rm(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?rm(l,[...t,n.trim()]):rm(l,t,`${n}${o}`,r);case"(":return rm(l,t,`${n}${o}`,r+1);case")":return rm(l,t,`${n}${o}`,r-1);default:return rm(l,t,`${n}${o}`,r)}}if(n==="")return t;if(r!==0)throw new Vdt({current:n,depth:r});return t.push(n.trim()),t}function N9e(e){return e==="address"||e==="bool"||e==="function"||e==="string"||m9e.test(e)||x9e.test(e)}const eft=/^(?: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 tft(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||m9e.test(e)||x9e.test(e)||eft.test(e)}function nft(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function A9e(e){const t={},n=e.length;for(let o=0;o<n;o++){const l=e[o];if(!pie(l))continue;const c=Adt(l);if(!c)throw new xA({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=y3(v,{type:"struct"});d.push(w)}if(!d.length)throw new zdt({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]=j9e(c,t)}return r}const rft=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function j9e(e,t,n=new Set){const r=[],s=e.length;for(let a=0;a<s;a++){const o=e[a];if(g9e.test(o.type))r.push(o);else{const c=w1(rft,o.type);if(!(c!=null&&c.type))throw new $dt({abiParameter:o});const{array:u,type:d}=c;if(d in t){if(n.has(d))throw new Hdt({type:d});r.push({...o,type:`tuple${u??""}`,components:j9e(t[d]??[],t,new Set([...n,d]))})}else if(N9e(d))r.push(o);else throw new Odt({type:d})}}return r}function E9e(e){const t=A9e(e),n=[],r=e.length;for(let s=0;s<r;s++){const a=e[s];pie(a)||n.push(vZ(a,t))}return n}function vpe(e){let t;if(typeof e=="string")t=vZ(e);else{const n=A9e(e),r=e.length;for(let s=0;s<r;s++){const a=e[s];if(!pie(a)){t=vZ(a,n);break}}}if(!t)throw new Fdt({signature:e});return t}function sft(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 Lr("Unable to normalize signature.");return s}const ift=e=>{const t=typeof e=="string"?e:sM(e);return sft(t)};function _9e(e){return gdt(ift(e))}const aB=_9e,Pk=e=>m3(_9e(e),0,4);function i5(e){const{abi:t,args:n=[],name:r}=e,s=X0(r,{strict:!1}),a=t.filter(l=>s?l.type==="function"?Pk(l)===r:l.type==="event"?aB(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?wZ(u,f):!1})){if(o&&"inputs"in o&&o.inputs){const u=k9e(l.inputs,o.inputs,n);if(u)throw new vct({abiItem:l,type:u[0]},{abiItem:o,type:u[1]})}o=l}}return o||a[0]}function wZ(e,t){const n=typeof e,r=t.type;switch(r){case"address":return ic(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)=>wZ(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=>wZ(s,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function k9e(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 k9e(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")?ic(n[r],{strict:!1}):o.includes("address")&&o.includes("bytes")?ic(n[r],{strict:!1}):!1)return o}}const eH="/docs/contract/decodeFunctionResult";function a5(e){const{abi:t,args:n,functionName:r,data:s}=e;let a=t[0];if(r){const l=i5({abi:t,args:n,name:r});if(!l)throw new PS(r,{docsPath:eH});a=l}if(a.type!=="function")throw new PS(void 0,{docsPath:eH});if(!a.outputs)throw new Pje(a.name,{docsPath:eH});const o=Ik(a.outputs,s);if(o.length>1)return o;if(o.length===1)return o[0]}const wpe="/docs/contract/encodeFunctionData";function aft(e){const{abi:t,args:n,functionName:r}=e;let s=t[0];if(r){const a=i5({abi:t,args:n,name:r});if(!a)throw new PS(r,{docsPath:wpe});s=a}if(s.type!=="function")throw new PS(void 0,{docsPath:wpe});return{abi:[s],functionName:Pk(gm(s))}}function Am(e){const{args:t}=e,{abi:n,functionName:r}=(()=>{var l;return e.abi.length===1&&((l=e.functionName)!=null&&l.startsWith("0x"))?e:aft(e)})(),s=n[0],a=r,o="inputs"in s&&s.inputs?s2(s.inputs,t??[]):void 0;return Nm([a,o??"0x"])}function gA({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 sZ({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new sZ({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}const T9e={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."},I9e={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},oft={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function lft(e){const{abi:t,data:n}=e,r=m3(n,0,4);if(r==="0x")throw new Ak;const a=[...t||[],I9e,oft].find(o=>o.type==="error"&&r===Pk(gm(o)));if(!a)throw new Tje(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:a,args:"inputs"in a&&a.inputs&&a.inputs.length>0?Ik(a.inputs,m3(n,4)):void 0,errorName:a.name}}function P9e({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"?Pc(t[a]):t[a]}`).join(", ")})`}class F9e extends Lr{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?Bu(n):void 0;let w=kk({from:v==null?void 0:v.address,to:f,value:typeof x<"u"&&`${Jse(x)} ${((C=s==null?void 0:s.nativeCurrency)==null?void 0:C.symbol)||"ETH"}`,data:a,gas:o,gasPrice:typeof l<"u"&&`${nf(l)} gwei`,maxFeePerGas:typeof c<"u"&&`${nf(c)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${nf(u)} gwei`,nonce:d});g&&(w+=`
${Vut(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 O9e extends Lr{constructor(t,{abi:n,args:r,contractAddress:s,docsPath:a,functionName:o,sender:l}){const c=i5({abi:n,args:r,name:o}),u=c?P9e({abiItem:c,args:r,includeFunctionName:!1,includeName:!1}):void 0,d=c?gm(c,{includeName:!0}):void 0,f=kk({address:s&&Eut(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 CZ extends Lr{constructor({abi:t,data:n,functionName:r,message:s}){let a,o,l,c;if(n&&n!=="0x")try{o=lft({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=T9e[g]}else{const g=d?gm(d,{includeName:!0}):void 0,v=d&&x?P9e({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 Tje&&(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 cft extends Lr{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 uft extends Lr{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 oB extends Lr{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 mie(e,t){var r,s,a,o,l,c;if(!(e instanceof Lr))return!1;const n=e.walk(u=>u instanceof CZ);return n instanceof CZ?!!(((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===T9e[50]):!1}function dft(e){const{abi:t,data:n}=e,r=m3(n,0,4),s=t.find(a=>a.type==="function"&&r===Pk(gm(a)));if(!s)throw new yct(r,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:s.name,args:"inputs"in s&&s.inputs&&s.inputs.length>0?Ik(s.inputs,m3(n,4)):void 0}}const tH="/docs/contract/encodeErrorResult";function Cpe(e){const{abi:t,errorName:n,args:r}=e;let s=t[0];if(n){const c=i5({abi:t,args:r,name:n});if(!c)throw new Jhe(n,{docsPath:tH});s=c}if(s.type!=="error")throw new Jhe(void 0,{docsPath:tH});const a=gm(s),o=Pk(a);let l="0x";if(r&&r.length>0){if(!s.inputs)throw new gct(s.name,{docsPath:tH});l=s2(s.inputs,r)}return Nm([o,l])}const nH="/docs/contract/encodeFunctionResult";function fft(e){const{abi:t,functionName:n,result:r}=e;let s=t[0];if(n){const o=i5({abi:t,name:n});if(!o)throw new PS(n,{docsPath:nH});s=o}if(s.type!=="function")throw new PS(void 0,{docsPath:nH});if(!s.outputs)throw new Pje(s.name,{docsPath:nH});const a=(()=>{if(s.outputs.length===0)return[];if(s.outputs.length===1)return[r];if(Array.isArray(r))return r;throw new Fje(r)})();return s2(s.outputs,a)}const M9e="x-batch-gateway:true";async function X2n(e){const{data:t,ccipRequest:n}=e,{args:[r]}=dft({abi:mZ,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]=hft(c)}})),fft({abi:mZ,functionName:"query",result:[s,a]})}function hft(e){return e.name==="HttpRequestError"&&e.status?Cpe({abi:mZ,errorName:"HttpError",args:[e.status,e.shortMessage]}):Cpe({abi:[I9e],errorName:"Error",args:["shortMessage"in e?e.shortMessage:e.message]})}function R9e(e){if(e.length!==66||e.indexOf("[")!==0||e.indexOf("]")!==65)return null;const t=`0x${e.slice(1,65)}`;return X0(t)?t:null}function RF(e){let t=new Uint8Array(32).fill(0);if(!e)return Vl(t);const n=e.split(".");for(let r=n.length-1;r>=0;r-=1){const s=R9e(n[r]),a=s?pA(s):tu(qw(n[r]),"bytes");t=tu(r1([t,a]),"bytes")}return Vl(t)}function pft(e){return`[${e.slice(2)}]`}function mft(e){const t=new Uint8Array(32).fill(0);return e?R9e(e)||tu(qw(e)):Vl(t)}function lB(e){const t=e.replace(/^\.|\.$/gm,"");if(t.length===0)return new Uint8Array(1);const n=new Uint8Array(qw(t).byteLength+2);let r=0;const s=t.split(".");for(let a=0;a<s.length;a++){let o=qw(s[a]);o.byteLength>255&&(o=qw(pft(mft(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 xft=3;function v3(e,{abi:t,address:n,args:r,docsPath:s,functionName:a,sender:o}){const l=e instanceof oB?e:e instanceof Lr?e.walk(v=>"data"in v)||e.walk():{},{code:c,data:u,details:d,message:f,shortMessage:x}=l,g=e instanceof Ak?new cft({functionName:a}):[xft,g3.code].includes(c)&&(u||d||f||x)?new CZ({abi:t,data:typeof u=="object"?u.data:u,functionName:a,message:l instanceof tie?d:x??f}):e;return new O9e(g,{abi:t,args:r,contractAddress:n,docsPath:s,functionName:a,sender:o})}const gft="0x82ad56cb",L9e="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",bft="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",yft="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";function D9e(e,{docsPath:t,...n}){const r=(()=>{const s=nB(e,n);return s instanceof _k?e:s})();return new F9e(r,{docsPath:t,...n})}function B9e(){let e=()=>{},t=()=>{};return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}const rH=new Map;function $9e({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=()=>rH.delete(t),l=()=>c().map(({args:d})=>d),c=()=>rH.get(t)||[],u=d=>rH.set(t,[...c(),d]);return{flush:o,async schedule(d){const{promise:f,resolve:x,reject:g}=B9e();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 cB(e,t){var J,K,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:P,value:I,stateOverride:R,...O}=t,U=n?Bu(n):void 0;if(c&&(d||f))throw new Lr("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(c&&P)throw new Lr("Cannot provide both `code` & `to` as parameters.");const L=c&&u,z=d&&f&&P&&u,X=L||z,ne=L?Cft({code:c,data:u}):z?Sft({data:u,factory:d,factoryData:f,to:P}):u;try{mA(t);const ie=(s?Us(s):void 0)||a,oe=oie(R),G=(he=(re=(K=e.chain)==null?void 0:K.formatters)==null?void 0:re.transactionRequest)==null?void 0:he.format,te=(G||Tk)({...rB(O,{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:P,value:I});if(r&&vft({request:te})&&!oe)try{return await wft(e,{...te,blockNumber:s,blockTag:a})}catch(fe){if(!(fe instanceof Xje)&&!(fe instanceof sZ))throw fe}const ae=await e.request({method:"eth_call",params:oe?[te,ie,oe]:[te,ie]});return ae==="0x"?{data:void 0}:{data:ae}}catch(Q){const ie=Nft(Q),{offchainLookup:oe,offchainLookupSignature:G}=await is(async()=>{const{offchainLookup:V,offchainLookupSignature:te}=await import("./ccip-CS3S5-Yb.js");return{offchainLookup:V,offchainLookupSignature:te}},[]);if(e.ccipRead!==!1&&(ie==null?void 0:ie.slice(0,10))===G&&P)return{data:await oe(e,{data:ie,to:P})};throw X&&(ie==null?void 0:ie.slice(0,10))==="0x101bb98d"?new uft({factory:d}):D9e(Q,{...t,account:U,chain:e.chain})}}function vft({request:e}){const{data:t,to:n,...r}=e;return!(!t||t.startsWith(gft)||!n||Object.values(r).filter(s=>typeof s<"u").length>0)}async function wft(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 Xje;u=gA({blockNumber:s,chain:e.chain,contract:"multicall3"})}const f=(s?Us(s):void 0)||a,{schedule:x}=$9e({id:`${e.uid}.${f}`,wait:r,shouldSplitBatch(C){return C.reduce((P,{data:I})=>P+(I.length-2),0)>n*2},fn:async C=>{const N=C.map(R=>({allowFailure:!0,callData:R.data,target:R.to})),P=Am({abi:pZ,args:[N],functionName:"aggregate3"}),I=await e.request({method:"eth_call",params:[{data:P,to:u},f]});return a5({abi:pZ,args:[N],functionName:"aggregate3",data:I||"0x"})}}),[{returnData:g,success:v}]=await x({data:o,to:c});if(!v)throw new oB({data:g});return g==="0x"?{data:void 0}:{data:g}}function Cft(e){const{code:t,data:n}=e;return Qse({abi:E9e(["constructor(bytes, bytes)"]),bytecode:L9e,args:[t,n]})}function Sft(e){const{data:t,factory:n,factoryData:r,to:s}=e;return Qse({abi:E9e(["constructor(address, bytes, address, bytes)"]),bytecode:bft,args:[s,t,n,r]})}function Nft(e){var n;if(!(e instanceof Lr))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 Z0(e,t){const{abi:n,address:r,args:s,functionName:a,...o}=t,l=Am({abi:n,args:s,functionName:a});try{const{data:c}=await ii(e,cB,"call")({...o,data:l,to:r});return a5({abi:n,args:s,functionName:a,data:c||"0x"})}catch(c){throw v3(c,{abi:n,address:r,args:s,docsPath:"/docs/contract/readContract",functionName:a})}}async function Aft(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 gA({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=Am({abi:xpe,functionName:"addr",...s!=null?{args:[RF(a),BigInt(s)]}:{args:[RF(a)]}}),x={address:u,abi:p9e,functionName:"resolve",args:[ui(lB(a)),f,o??[M9e]],blockNumber:n,blockTag:r},v=await ii(e,Z0,"readContract")(x);if(v[0]==="0x")return null;const w=a5({abi:xpe,args:s!=null?[RF(a),BigInt(s)]:void 0,functionName:"addr",data:v[0]});return w==="0x"||Wf(w)==="0x00"?null:w}catch(f){if(l)throw f;if(mie(f,"resolve"))return null;throw f}}class jft extends Lr{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 b7 extends Lr{constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`,{name:"EnsAvatarInvalidNftUriError"})}}class xie extends Lr{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 Eft extends Lr{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const _ft=/(?<protocol>https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,kft=/^(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>\/.*)?$/,Tft=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,Ift=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function Pft(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 Spe(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function U9e({uri:e,gatewayUrls:t}){const n=Tft.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=Spe(t==null?void 0:t.ipfs,"https://ipfs.io"),s=Spe(t==null?void 0:t.arweave,"https://arweave.net"),a=e.match(_ft),{protocol:o,subpath:l,target:c,subtarget:u=""}=(a==null?void 0:a.groups)||{},d=o==="ipns:/"||l==="ipns/",f=o==="ipfs:/"||l==="ipfs/"||kft.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(Ift,"");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 xie({uri:e})}function z9e(e){if(typeof e!="object"||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new jft({data:e});return e.image||e.image_url||e.image_data}async function Fft({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then(s=>s.json());return await gie({gatewayUrls:e,uri:z9e(n)})}catch{throw new xie({uri:t})}}async function gie({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:r}=U9e({uri:t,gatewayUrls:e});if(r||await Pft(n))return n;throw new xie({uri:t})}function Oft(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 b7({reason:"Only EIP-155 supported"});if(!o)throw new b7({reason:"Chain ID not found"});if(!c)throw new b7({reason:"Contract address not found"});if(!s)throw new b7({reason:"Token ID not found"});if(!l)throw new b7({reason:"ERC namespace not found"});return{chainID:Number.parseInt(o),namespace:l.toLowerCase(),contractAddress:c,tokenID:s}}async function Mft(e,{nft:t}){if(t.namespace==="erc721")return Z0(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 Z0(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 Eft({namespace:t.namespace})}async function Rft(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?Lft(e,{gatewayUrls:t,record:n}):gie({uri:n,gatewayUrls:t})}async function Lft(e,{gatewayUrls:t,record:n}){const r=Oft(n),s=await Mft(e,{nft:r}),{uri:a,isOnChain:o,isEncoded:l}=U9e({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 gie({uri:z9e(d),gatewayUrls:t})}let c=r.tokenID;return r.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),Fft({gatewayUrls:t,uri:a.replace(/(?:0x)?{id}/,c)})}async function H9e(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 gA({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:p9e,functionName:"resolve",args:[ui(lB(a)),Am({abi:mpe,functionName:"text",args:[RF(a),s]}),o??[M9e]],blockNumber:n,blockTag:r},g=await ii(e,Z0,"readContract")(f);if(g[0]==="0x")return null;const v=a5({abi:mpe,functionName:"text",data:g[0]});return v===""?null:v}catch(f){if(l)throw f;if(mie(f,"resolve"))return null;throw f}}async function V9e(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:s,gatewayUrls:a,strict:o,universalResolverAddress:l}){const c=await ii(e,H9e,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:s,universalResolverAddress:l,gatewayUrls:a,strict:o});if(!c)return null;try{return await Rft(e,{record:c,gatewayUrls:r})}catch{return null}}async function W9e(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=gA({blockNumber:n,chain:e.chain,contract:"ensUniversalResolver"})}const c=`${t.toLowerCase().substring(2)}.addr.reverse`;try{const u={address:l,abi:idt,functionName:"reverse",args:[ui(lB(c))],blockNumber:n,blockTag:r},d=ii(e,Z0,"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(mie(u,"reverse"))return null;throw u}}async function Dft(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 gA({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 ii(e,Z0,"readContract")({address:o,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[ui(lB(s))],blockNumber:n,blockTag:r});return c}async function q9e(e,t){var C,N,P;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?Bu(n):void 0;try{mA(t);const R=(r?Us(r):void 0)||s,O=(P=(N=(C=e.chain)==null?void 0:C.formatters)==null?void 0:N.transactionRequest)==null?void 0:P.format,L=(O||Tk)({...rB(v,{format:O}),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(I){throw D9e(I,{...t,account:w,chain:e.chain})}}function uB(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 Bft(e){const t=uB(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}class $ft extends Lr{constructor(t){super(`Filter type "${t}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}const Npe="/docs/contract/encodeEventTopics";function Fk(e){var c;const{abi:t,eventName:n,args:r}=e;let s=t[0];if(n){const u=i5({abi:t,name:n});if(!u)throw new epe(n,{docsPath:Npe});s=u}if(s.type!=="event")throw new epe(void 0,{docsPath:Npe});const a=gm(s),o=aB(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)=>Ape({param:f,value:d[x][v]})):typeof d[x]<"u"&&d[x]!==null?Ape({param:f,value:d[x]}):null))??[])}return[o,...l]}function Ape({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return tu(pA(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new $ft(e.type);return s2([e],[t])}async function G9e(e,t){const{address:n,abi:r,args:s,eventName:a,fromBlock:o,strict:l,toBlock:c}=t,u=uB(e,{method:"eth_newFilter"}),d=a?Fk({abi:r,args:s,eventName:a}):void 0,f=await e.request({method:"eth_newFilter",params:[{address:n,fromBlock:typeof o=="bigint"?Us(o):o,toBlock:typeof c=="bigint"?Us(c):c,topics:d}]});return{abi:r,args:s,eventName:a,id:f,request:u(f),strict:!!l,type:"event"}}async function K9e(e,{address:t,args:n,event:r,events:s,fromBlock:a,strict:o,toBlock:l}={}){const c=s??(r?[r]:void 0),u=uB(e,{method:"eth_newFilter"});let d=[];c&&(d=[c.flatMap(g=>Fk({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"?Us(a):a,toBlock:typeof l=="bigint"?Us(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 Y9e(e){const t=uB(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}async function Uft(e,t){const{abi:n,address:r,args:s,functionName:a,dataSuffix:o,...l}=t,c=Am({abi:n,args:s,functionName:a});try{return await ii(e,cie,"estimateGas")({data:`${c}${o?o.replace("0x",""):""}`,to:r,...l})}catch(u){const d=l.account?Bu(l.account):void 0;throw v3(u,{abi:n,address:r,args:s,docsPath:"/docs/contract/estimateContractGas",functionName:a,sender:d==null?void 0:d.address})}}async function zft(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}const Hft=new Map,Vft=new Map;function Wft(e){const t=(s,a)=>({clear:()=>a.delete(s),get:()=>a.get(s),set:o=>a.set(s,o)}),n=t(e,Hft),r=t(e,Vft);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}async function qft(e,{cacheKey:t,cacheTime:n=Number.POSITIVE_INFINITY}){const r=Wft(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 Gft=e=>`blockNumber.${e}`;async function Ok(e,{cacheTime:t=e.cacheTime}={}){const n=await qft(()=>e.request({method:"eth_blockNumber"}),{cacheKey:Gft(e.uid),cacheTime:t});return BigInt(n)}async function Kft(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const s=n!==void 0?Us(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}),Q0(a)}async function jpe(e,{address:t,blockNumber:n,blockTag:r="latest"}){const s=n!==void 0?Us(n):void 0,a=await e.request({method:"eth_getCode",params:[t,s||r]},{dedupe:!!s});if(a!=="0x")return a}function bie(e,t){if(!ic(e,{strict:!1}))throw new xd({address:e});if(!ic(t,{strict:!1}))throw new xd({address:t});return e.toLowerCase()===t.toLowerCase()}const Epe="/docs/contract/decodeEventLog";function yie(e){const{abi:t,data:n,strict:r,topics:s}=e,a=r??!0,[o,...l]=s;if(!o)throw new bct({docsPath:Epe});const c=t.length===1?t[0]:t.find(w=>w.type==="event"&&o===aB(gm(w)));if(!(c&&"name"in c)||c.type!=="event")throw new Ije(o,{docsPath:Epe});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 XD({abiItem:c,param:C});x[f?w:C.name||w]=Yft({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=Ik(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 kje||w instanceof qje?new O9({abiItem:c,data:n,params:v,size:al(n)}):w}else if(a)throw new O9({abiItem:c,data:"0x",params:v,size:0})}return{eventName:u,args:Object.values(x).length>0?x:void 0}}function Yft({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:Ik([e],t)[0]}function vie(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]===aB(d));if(!c)return null;const u=yie({...o,abi:[c],strict:s});return a&&!a.includes(u.eventName)||!Xft({args:u.args,inputs:c.inputs,matchArgs:n})?null:{...u,...o}}catch(c){let u,d;if(c instanceof Ije)return null;if(c instanceof O9||c instanceof XD){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 Xft(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"?bie(o,l):a.type==="string"||a.type==="bytes"?tu(pA(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 s1(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 wie(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=>Fk({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"?Us(r):r,toBlock:typeof s=="bigint"?Us(s):s}]});const g=x.map(v=>s1(v));return d?vie({abi:d,args:l,logs:g,strict:u}):g}async function X9e(e,t){const{abi:n,address:r,args:s,blockHash:a,eventName:o,fromBlock:l,toBlock:c,strict:u}=t,d=o?i5({abi:n,name:o}):void 0,f=d?void 0:n.filter(x=>x.type==="event");return ii(e,wie,"getLogs")({address:r,args:s,blockHash:a,event:d,events:f,fromBlock:l,toBlock:c,strict:u})}class Qft extends Lr{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 Zft(e,t){const{address:n,factory:r,factoryData:s}=t;try{const[a,o,l,c,u,d,f]=await ii(e,Z0,"readContract")({abi:Jft,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 Qft({address:n}):o}}const Jft=[{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 eht(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 tht(e,{blockCount:t,blockNumber:n,blockTag:r="latest",rewardPercentiles:s}){const a=n?Us(n):void 0,o=await e.request({method:"eth_feeHistory",params:[Us(t),a||r,s]},{dedupe:!!a});return eht(o)}async function dB(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=>s1(a));return!("abi"in t)||!t.abi?s:vie({abi:t.abi,logs:s,strict:n})}async function nht(e,{filter:t}){const n=t.strict??!1,s=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(a=>s1(a));return t.abi?vie({abi:t.abi,logs:s,strict:n}):s}async function rht(e,{address:t,blockNumber:n,blockTag:r="latest",slot:s}){const a=n!==void 0?Us(n):void 0;return await e.request({method:"eth_getStorageAt",params:[t,s,a||r]})}async function Cie(e,{blockHash:t,blockNumber:n,blockTag:r,hash:s,index:a}){var d,f,x;const o=r||"latest",l=n!==void 0?Us(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,Us(a)]},{dedupe:!0}):(l||o)&&(c=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[l||o,Us(a)]},{dedupe:!!l})),!c)throw new Qje({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)||iB)(c)}async function sht(e,{hash:t,transactionReceipt:n}){const[r,s]=await Promise.all([ii(e,Ok,"getBlockNumber")({}),t?ii(e,Cie,"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 iht={"0x0":"reverted","0x1":"success"};function Q9e(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=>s1(n)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Q0(e.transactionIndex):null,status:e.status?iht[e.status]:null,type:e.type?e9e[e.type]||e.type:null};return e.blobGasPrice&&(t.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(t.blobGasUsed=BigInt(e.blobGasUsed)),t}const aht=nie("transactionReceipt",Q9e);async function SZ(e,{hash:t}){var s,a,o;const n=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!n)throw new Zje({hash:t});return(((o=(a=(s=e.chain)==null?void 0:s.formatters)==null?void 0:a.transactionReceipt)==null?void 0:o.format)||Q9e)(n)}async function Z9e(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=gA({blockNumber:s,chain:e.chain,contract:"multicall3"})}const f=[[]];let x=0,g=0;for(let N=0;N<c.length;N++){const{abi:P,address:I,args:R,functionName:O}=c[N];try{const U=Am({abi:P,args:R,functionName:O});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:I}]}catch(U){const L=v3(U,{abi:P,address:I,args:R,docsPath:"/docs/contract/multicall",functionName:O});if(!n)throw L;f[x]=[...f[x],{allowFailure:!0,callData:"0x",target:I}]}}const v=await Promise.allSettled(f.map(N=>ii(e,Z0,"readContract")({abi:pZ,address:d,args:[N],blockNumber:s,blockTag:a,functionName:"aggregate3",stateOverride:l}))),w=[];for(let N=0;N<v.length;N++){const P=v[N];if(P.status==="rejected"){if(!n)throw P.reason;for(let R=0;R<f[N].length;R++)w.push({status:"failure",error:P.reason,result:void 0});continue}const I=P.value;for(let R=0;R<I.length;R++){const{returnData:O,success:U}=I[R],{callData:L}=f[N][R],{abi:z,address:X,functionName:ne,args:J}=c[w.length];try{if(L==="0x")throw new Ak;if(!U)throw new oB({data:O});const K=a5({abi:z,args:J,data:O,functionName:ne});w.push(n?{result:K,status:"success"}:K)}catch(K){const re=v3(K,{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 Lr("multicall results mismatch");return w}const oht="0.1.1";function lht(){return oht}let jl=class NZ extends Error{constructor(t,n={}){const r=(()=>{var c;if(n.cause instanceof NZ){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 NZ&&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@${lht()}`}),this.cause=n.cause,this.details=r,this.docs=o,this.docsPath=s,this.shortMessage=t}walk(t){return J9e(this,t)}};function J9e(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?J9e(e.cause,t):t?null:e}const cht="#__bigint";function uht(e,t,n){return JSON.stringify(e,(r,s)=>typeof s=="bigint"?s.toString()+cht:s,n)}function dht(e,t){if(kpe(e)>t)throw new wht({givenSize:kpe(e),maxSize:t})}const Dx={zero:48,nine:57,A:65,F:70,a:97,f:102};function _pe(e){if(e>=Dx.zero&&e<=Dx.nine)return e-Dx.zero;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 fht(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;if(e.length>r)throw new Cht({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 Sie(e,t){if(ap(e)>t)throw new Eht({givenSize:ap(e),maxSize:t})}function hht(e,t){if(typeof t=="number"&&t>0&&t>ap(e)-1)throw new sEe({offset:t,position:"start",size:ap(e)})}function pht(e,t,n){if(typeof t=="number"&&typeof n=="number"&&ap(e)!==n-t)throw new sEe({offset:n,position:"end",size:ap(e)})}function eEe(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 _ht({size:Math.ceil(s.length/2),targetSize:r,type:"Hex"});return`0x${s[n==="right"?"padEnd":"padStart"](r*2,"0")}`}const mht=new TextEncoder;function xht(e){return e instanceof Uint8Array?e:typeof e=="string"?bht(e):ght(e)}function ght(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function bht(e,t={}){const{size:n}=t;let r=e;n&&(Sie(e,n),r=C3(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=_pe(s.charCodeAt(c++)),d=_pe(s.charCodeAt(c++));if(u===void 0||d===void 0)throw new jl(`Invalid byte sequence ("${s[c-2]}${s[c-1]}" in "${s}").`);o[l]=u*16+d}return o}function yht(e,t={}){const{size:n}=t,r=mht.encode(e);return typeof n=="number"?(dht(r,n),vht(r,n)):r}function vht(e,t){return fht(e,{dir:"right",size:t})}function kpe(e){return e.length}let wht=class extends jl{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"})}},Cht=class extends jl{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 Sht=new TextEncoder,Nht=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Aht(e,t={}){const{strict:n=!1}=t;if(!e)throw new Tpe(e);if(typeof e!="string")throw new Tpe(e);if(n&&!/^0x[0-9a-fA-F]*$/.test(e))throw new Ipe(e);if(!e.startsWith("0x"))throw new Ipe(e)}function J0(...e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function tEe(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(Sie(n,t.size),w3(n,t.size)):n}function nEe(e,t={}){let n="";for(let s=0;s<e.length;s++)n+=Nht[e[s]];const r=`0x${n}`;return typeof t.size=="number"?(Sie(r,t.size),C3(r,t.size)):r}function nd(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 rEe({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?w3(c,r):c}function Nie(e,t={}){return nEe(Sht.encode(e),t)}function w3(e,t){return eEe(e,{dir:"left",size:t})}function C3(e,t){return eEe(e,{dir:"right",size:t})}function Aie(e,t,n,r={}){const{strict:s}=r;hht(e,t);const a=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return s&&pht(a,t,n),a}function ap(e){return Math.ceil((e.length-2)/2)}function jht(e,t={}){const{strict:n=!1}=t;try{return Aht(e,{strict:n}),!0}catch{return!1}}class rEe extends jl{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 Tpe extends jl{constructor(t){super(`Value \`${typeof t=="object"?uht(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 Ipe extends jl{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 Eht extends jl{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 sEe extends jl{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 _ht extends jl{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 kht(e){return{address:e.address,amount:nd(e.amount),index:nd(e.index),validatorIndex:nd(e.validatorIndex)}}function Tht(e){return{...typeof e.baseFeePerGas=="bigint"&&{baseFeePerGas:nd(e.baseFeePerGas)},...typeof e.blobBaseFee=="bigint"&&{blobBaseFee:nd(e.blobBaseFee)},...typeof e.feeRecipient=="string"&&{feeRecipient:e.feeRecipient},...typeof e.gasLimit=="bigint"&&{gasLimit:nd(e.gasLimit)},...typeof e.number=="bigint"&&{number:nd(e.number)},...typeof e.prevRandao=="bigint"&&{prevRandao:nd(e.prevRandao)},...typeof e.time=="bigint"&&{time:nd(e.time)},...e.withdrawals&&{withdrawals:e.withdrawals.map(kht)}}}async function AZ(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?Tht(x.blockOverrides):void 0,v=x.calls.map(C=>{const N=C,P=N.account?Bu(N.account):void 0,I={...N,data:N.abi?Am(N):N.data,from:N.from??(P==null?void 0:P.address)};return mA(I),Tk(I)}),w=x.stateOverrides?oie(x.stateOverrides):void 0;c.push({blockOverrides:g,calls:v,stateOverrides:w})}const d=(n?Us(n):void 0)||r;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:c,returnFullTransactions:a,traceTransfers:o,validation:l},d]})).map((x,g)=>({...iie(x),calls:x.calls.map((v,w)=>{var ne,J;const{abi:C,args:N,functionName:P,to:I}=s[g].calls[w],R=((ne=v.error)==null?void 0:ne.data)??v.returnData,O=BigInt(v.gasUsed),U=(J=v.logs)==null?void 0:J.map(K=>s1(K)),L=v.status==="0x1"?"success":"failure",z=C&&L==="success"&&R!=="0x"?a5({abi:C,data:R,functionName:P}):null,X=(()=>{var re;if(L==="success")return;let K;if(((re=v.error)==null?void 0:re.data)==="0x"?K=new Ak:v.error&&(K=new oB(v.error)),!!K)return v3(K,{abi:C??[],address:I,args:N,functionName:P??"<unknown>"})})();return{data:R,gasUsed:O,logs:U,status:L,...L==="success"?{result:z}:{error:X}}})}))}catch(c){const u=c,d=nB(u,{});throw d instanceof _k?u:d}}function Ppe(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Iht(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function jie(e,...t){if(!Iht(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 Fpe(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 Pht(e,t){jie(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 Fht=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),Ope=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,Oht=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;function Mpe(e){for(let t=0;t<e.length;t++)e[t]=Oht(e[t])}function Mht(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function iEe(e){return typeof e=="string"&&(e=Mht(e)),jie(e),e}let Rht=class{clone(){return this._cloneInto()}};function Lht(e){const t=r=>e().update(iEe(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}const MI=BigInt(2**32-1),Rpe=BigInt(32);function Dht(e,t=!1){return t?{h:Number(e&MI),l:Number(e>>Rpe&MI)}:{h:Number(e>>Rpe&MI)|0,l:Number(e&MI)|0}}function Bht(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}=Dht(e[s],t);[n[s],r[s]]=[a,o]}return[n,r]}const $ht=(e,t,n)=>e<<n|t>>>32-n,Uht=(e,t,n)=>t<<n|e>>>32-n,zht=(e,t,n)=>t<<n-32|e>>>64-n,Hht=(e,t,n)=>e<<n-32|t>>>64-n,aEe=[],oEe=[],lEe=[],Vht=BigInt(0),y7=BigInt(1),Wht=BigInt(2),qht=BigInt(7),Ght=BigInt(256),Kht=BigInt(113);for(let e=0,t=y7,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],aEe.push(2*(5*r+n)),oEe.push((e+1)*(e+2)/2%64);let s=Vht;for(let a=0;a<7;a++)t=(t<<y7^(t>>qht)*Kht)%Ght,t&Wht&&(s^=y7<<(y7<<BigInt(a))-y7);lEe.push(s)}const[Yht,Xht]=Bht(lEe,!0),Lpe=(e,t,n)=>n>32?zht(e,t,n):$ht(e,t,n),Dpe=(e,t,n)=>n>32?Hht(e,t,n):Uht(e,t,n);function Qht(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=Lpe(u,d,1)^n[l],x=Dpe(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=oEe[o],c=Lpe(s,a,l),u=Dpe(s,a,l),d=aEe[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]^=Yht[r],e[1]^=Xht[r]}n.fill(0)}let Zht=class cEe extends Rht{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,Ppe(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Fht(this.state)}keccak(){Ope||Mpe(this.state32),Qht(this.state32,this.rounds),Ope||Mpe(this.state32),this.posOut=0,this.pos=0}update(t){Fpe(this);const{blockLen:n,state:r}=this;t=iEe(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){Fpe(this,!1),jie(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 Ppe(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Pht(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 cEe(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 Jht=(e,t,n)=>Lht(()=>new Zht(t,e,n)),ept=Jht(1,136,256/8);function uEe(e,t={}){const{as:n=typeof e=="string"?"Hex":"Bytes"}=t,r=ept(xht(e));return n==="Bytes"?r:nEe(r)}class tpt 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 npt={checksum:new tpt(8192)},sH=npt.checksum,rpt=/^0x[a-fA-F0-9]{40}$/;function fB(e,t={}){const{strict:n=!0}=t;if(!rpt.test(e))throw new Bpe({address:e,cause:new ipt});if(n){if(e.toLowerCase()===e)return;if(spt(e)!==e)throw new Bpe({address:e,cause:new apt})}}function spt(e){if(sH.has(e))return sH.get(e);fB(e,{strict:!1});const t=e.substring(2).toLowerCase(),n=uEe(yht(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 sH.set(e,s),s}function jZ(e,t={}){const{strict:n=!0}=t??{};try{return fB(e,{strict:n}),!0}catch{return!1}}let Bpe=class extends jl{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"})}},ipt=class extends jl{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 apt extends jl{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}function EZ(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 jl("Unable to normalize signature.");return s}function _Z(e,t){const n=typeof e,r=t.type;switch(r){case"address":return jZ(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)=>_Z(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=>_Z(s,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function dEe(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 dEe(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")?jZ(n[r],{strict:!1}):o.includes("address")&&o.includes("bytes")?jZ(n[r],{strict:!1}):!1)return o}}function fEe(e,t={}){const{prepare:n=!0}=t,r=Array.isArray(e)||typeof e=="string"?vpe(e):e;return{...r,...n?{hash:OC(r)}:{}}}function opt(e,t,n){const{args:r=[],prepare:s=!0}=n,a=jht(t,{strict:!1}),o=e.filter(u=>a?u.type==="function"||u.type==="error"?hEe(u)===Aie(t,0,4):u.type==="event"?OC(u)===t:!1:"name"in u&&u.name===t);if(o.length===0)throw new kZ({name:t});if(o.length===1)return{...o[0],...s?{hash:OC(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:OC(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?_Z(f,g):!1})){if(l&&"inputs"in l&&l.inputs){const f=dEe(u.inputs,l.inputs,r);if(f)throw new cpt({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 kZ({name:t});return{...c,...s?{hash:OC(c)}:{}}}function hEe(e){return Aie(OC(e),0,4)}function lpt(e){const t=typeof e=="string"?e:sM(e);return EZ(t)}function OC(e){return typeof e!="string"&&"hash"in e&&e.hash?e.hash:uEe(Nie(lpt(e)))}class cpt extends jl{constructor(t,n){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${t.type}\` in \`${EZ(sM(t.abiItem))}\`, and`,`\`${n.type}\` in \`${EZ(sM(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 kZ extends jl{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 upt=/^(.*)\[([0-9]*)\]$/,dpt=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,pEe=/^(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 fpt({checksumAddress:e,parameters:t,values:n}){const r=[];for(let s=0;s<t.length;s++)r.push(Eie({checksumAddress:e,parameter:t[s],value:n[s]}));return r}function Eie({checksumAddress:e=!1,parameter:t,value:n}){const r=t,s=vpt(r.type);if(s){const[a,o]=s;return ppt(n,{checksumAddress:e,length:a,parameter:{...r,type:o}})}if(r.type==="tuple")return ypt(n,{checksumAddress:e,parameter:r});if(r.type==="address")return hpt(n,{checksum:e});if(r.type==="bool")return xpt(n);if(r.type.startsWith("uint")||r.type.startsWith("int")){const a=r.type.startsWith("int"),[,,o="256"]=pEe.exec(r.type)??[];return gpt(n,{signed:a,size:Number(o)})}if(r.type.startsWith("bytes"))return mpt(n,{type:r.type});if(r.type==="string")return bpt(n);throw new yEe(r.type)}function _ie(e){let t=0;for(let a=0;a<e.length;a++){const{dynamic:o,encoded:l}=e[a];o?t+=32:t+=ap(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(nd(t+s,{size:32})),r.push(l),s+=ap(l)):n.push(l)}return J0(...n,...r)}function hpt(e,t){const{checksum:n=!1}=t;return fB(e,{strict:n}),{dynamic:!1,encoded:w3(e.toLowerCase())}}function ppt(e,t){const{checksumAddress:n,length:r,parameter:s}=t,a=r===null;if(!Array.isArray(e))throw new Cpt(e);if(!a&&e.length!==r)throw new wpt({expectedLength:r,givenLength:e.length,type:`${s.type}[${r}]`});let o=!1;const l=[];for(let c=0;c<e.length;c++){const u=Eie({checksumAddress:n,parameter:s,value:e[c]});u.dynamic&&(o=!0),l.push(u)}if(a||o){const c=_ie(l);if(a){const u=nd(l.length,{size:32});return{dynamic:!0,encoded:l.length>0?J0(u,c):u}}if(o)return{dynamic:!0,encoded:c}}return{dynamic:!1,encoded:J0(...l.map(({encoded:c})=>c))}}function mpt(e,{type:t}){const[,n]=t.split("bytes"),r=ap(e);if(!n){let s=e;return r%32!==0&&(s=C3(s,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:J0(w3(nd(r,{size:32})),s)}}if(r!==Number.parseInt(n))throw new gEe({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:C3(e)}}function xpt(e){if(typeof e!="boolean")throw new jl(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:w3(tEe(e))}}function gpt(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 rEe({max:r.toString(),min:s.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:nd(e,{size:32,signed:t})}}function bpt(e){const t=Nie(e),n=Math.ceil(ap(t)/32),r=[];for(let s=0;s<n;s++)r.push(C3(Aie(t,s*32,(s+1)*32)));return{dynamic:!0,encoded:J0(C3(nd(ap(t),{size:32})),...r)}}function ypt(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=Eie({checksumAddress:n,parameter:l,value:e[c]});a.push(u),u.dynamic&&(s=!0)}return{dynamic:s,encoded:s?_ie(a):J0(...a.map(({encoded:o})=>o))}}function vpt(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function mEe(e,t,n){const{checksumAddress:r=!1}={};if(e.length!==t.length)throw new bEe({expectedLength:e.length,givenLength:t.length});const s=fpt({checksumAddress:r,parameters:e,values:t}),a=_ie(s);return a.length===0?"0x":a}function xEe(e,t){if(e.length!==t.length)throw new bEe({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(xEe.encode(s,a))}return J0(...n)}(function(e){function t(n,r,s=!1){if(n==="address"){const c=r;return fB(c),w3(c.toLowerCase(),s?32:0)}if(n==="string")return Nie(r);if(n==="bytes")return r;if(n==="bool")return w3(tEe(r),s?32:1);const a=n.match(pEe);if(a){const[c,u,d="256"]=a,f=Number.parseInt(d)/8;return nd(r,{size:s?32:f,signed:u==="int"})}const o=n.match(dpt);if(o){const[c,u]=o;if(Number.parseInt(u)!==(r.length-2)/2)throw new gEe({expectedSize:Number.parseInt(u),value:r});return C3(r,s?32:0)}const l=n.match(upt);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":J0(...d)}throw new yEe(n)}e.encode=t})(xEe);class wpt extends jl{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 gEe extends jl{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${ap(n)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class bEe extends jl{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 Cpt extends jl{constructor(t){super(`Value \`${t}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class yEe extends jl{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 Spt(e,t){var s;const{bytecode:n,args:r}=t;return J0(n,(s=e.inputs)!=null&&s.length&&(r!=null&&r.length)?mEe(e.inputs,r):"0x")}function Npt(e){return fEe(e)}function Apt(e,...t){const{overloads:n}=e,r=n?jpt([e,...n],e.name,{args:t[0]}):e,s=Ept(r),a=t.length>0?mEe(r.inputs,t[0]):void 0;return a?J0(s,a):s}function D6(e,t={}){return fEe(e,t)}function jpt(e,t,n){const r=opt(e,t,n);if(r.type!=="function")throw new kZ({name:t,type:"function"});return r}function Ept(e){return hEe(e)}const _pt="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",Ym="0x0000000000000000000000000000000000000000",RI=new QD(8192);function kpt(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(RI.get(n))return RI.get(n);const r=e().finally(()=>RI.delete(n));return RI.set(n,r),r}async function TZ(e){return new Promise(t=>setTimeout(t,e))}function iM(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 TZ(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 Tpt(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 Wv(new Error("method not supported"),{method:u});if(a!=null&&a.include&&!a.include.includes(u))throw new Wv(new Error("method not supported"),{method:u});const d=s?IS(`${c}.${Pc(n)}`):void 0;return kpt(()=>iM(async()=>{try{return await e(n)}catch(x){const g=x;switch(g.code){case R9.code:throw new R9(g);case L9.code:throw new L9(g);case D9.code:throw new D9(g,{method:n.method});case B9.code:throw new B9(g);case g3.code:throw new g3(g);case b3.code:throw new b3(g);case $9.code:throw new $9(g);case Cy.code:throw new Cy(g);case U9.code:throw new U9(g);case Wv.code:throw new Wv(g,{method:n.method});case OS.code:throw new OS(g);case z9.code:throw new z9(g);case yo.code:throw new yo(g);case H9.code:throw new H9(g);case V9.code:throw new V9(g);case W9.code:throw new W9(g);case q9.code:throw new q9(g);case ip.code:throw new ip(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 J9.code:throw new J9(g);case 5e3:throw new yo(g);default:throw x instanceof Lr?x:new kut(g)}}},{delay:({count:x,error:g})=>{var v;if(g&&g instanceof Hj){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})=>Ipt(x)}),{enabled:s,id:d})}}function Ipt(e){return"code"in e&&typeof e.code=="number"?e.code===-1||e.code===OS.code||e.code===g3.code:e instanceof Hj&&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 hB(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}function kie(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 Ppt(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const $pe=Ppt();function Fpt(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 kie(async({signal:v})=>{const w={...l,body:Array.isArray(r)?Pc(r.map(I=>({jsonrpc:"2.0",id:I.id??$pe.take(),...I}))):Pc({jsonrpc:"2.0",id:r.id??$pe.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 cpe({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 Hj({body:r,details:Pc(g.error)||x.statusText,headers:x.headers,status:x.status,url:e});return g}catch(x){throw x instanceof Hj||x instanceof cpe?x:new Hj({body:r,cause:x,url:e})}}}}class Opt extends Lr{constructor({domain:t}){super(`Invalid domain "${Pc(t)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class Mpt extends Lr{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 Rpt extends Lr{constructor({type:t}){super(`Struct type "${t}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function Lpt(e){const{domain:t={},message:n,primaryType:r}=e,s={EIP712Domain:AEe({domain:t}),...e.types};NEe({domain:t,message:n,primaryType:r,types:s});const a=["0x1901"];return t&&a.push(Dpt({domain:t,types:s})),r!=="EIP712Domain"&&a.push(vEe({data:n,primaryType:r,types:s})),tu(r1(a))}function Dpt({domain:e,types:t}){return vEe({data:e,primaryType:"EIP712Domain",types:t})}function vEe({data:e,primaryType:t,types:n}){const r=wEe({data:e,primaryType:t,types:n});return tu(r)}function wEe({data:e,primaryType:t,types:n}){const r=[{type:"bytes32"}],s=[Bpt({primaryType:t,types:n})];for(const a of n[t]){const[o,l]=SEe({types:n,name:a.name,type:a.type,value:e[a.name]});r.push(o),s.push(l)}return s2(r,s)}function Bpt({primaryType:e,types:t}){const n=ui($pt({primaryType:e,types:t}));return tu(n)}function $pt({primaryType:e,types:t}){let n="";const r=CEe({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 CEe({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])CEe({primaryType:a.type,types:t},n);return n}function SEe({types:e,name:t,type:n,value:r}){if(e[n]!==void 0)return[{type:"bytes32"},tu(wEe({data:r,primaryType:n,types:e}))];if(n==="bytes")return r=`0x${(r.length%2?"0":"")+r.slice(2)}`,[{type:"bytes32"},tu(r)];if(n==="string")return[{type:"bytes32"},tu(ui(r))];if(n.lastIndexOf("]")===n.length-1){const s=n.slice(0,n.lastIndexOf("[")),a=r.map(o=>SEe({name:t,type:s,types:e,value:o}));return[{type:"bytes32"},tu(s2(a.map(([o])=>o),a.map(([,o])=>o)))]}return[{type:n},r]}function Upt(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 Pc({domain:o,message:l,primaryType:r,types:s})}function NEe(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(Vje);if(x&&(typeof f=="number"||typeof f=="bigint")){const[w,C,N]=x;Us(f,{signed:C==="int",size:Number.parseInt(N)/8})}if(d==="address"&&typeof f=="string"&&!ic(f))throw new xd({address:f});const g=d.match(Qct);if(g){const[w,C]=g;if(C&&al(f)!==Number.parseInt(C))throw new wct({expectedSize:Number.parseInt(C),givenSize:al(f)})}const v=s[d];v&&(zpt(d),a(v,f))}};if(s.EIP712Domain&&t){if(typeof t!="object")throw new Opt({domain:t});a(s.EIP712Domain,t)}if(r!=="EIP712Domain")if(s[r])a(s[r],n);else throw new Mpt({primaryType:r,types:s})}function AEe({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 zpt(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new Rpt({type:e})}function Hpt(e){const{authorizationList:t}=e;if(t)for(const n of t){const{chainId:r}=n,s=n.address;if(!ic(s))throw new xd({address:s});if(r<0)throw new tB({chainId:r})}Tie(e)}function Vpt(e){const{blobVersionedHashes:t}=e;if(t){if(t.length===0)throw new l9e;for(const n of t){const r=al(n),s=Q0(m3(n,0,1));if(r!==32)throw new tdt({hash:n,size:r});if(s!==o9e)throw new ndt({hash:n,version:s})}}Tie(e)}function Tie(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:r,to:s}=e;if(t<=0)throw new tB({chainId:t});if(s&&!ic(s))throw new xd({address:s});if(r&&r>sB)throw new x3({maxFeePerGas:r});if(n&&r&&n>r)throw new M9({maxFeePerGas:r,maxPriorityFeePerGas:n})}function Wpt(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:a}=e;if(t<=0)throw new tB({chainId:t});if(a&&!ic(a))throw new xd({address:a});if(n||s)throw new Lr("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>sB)throw new x3({maxFeePerGas:r})}function qpt(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:a}=e;if(a&&!ic(a))throw new xd({address:a});if(typeof t<"u"&&t<=0)throw new tB({chainId:t});if(n||s)throw new Lr("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>sB)throw new x3({maxFeePerGas:r})}function pB(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 Nut({storageKey:s[a]});if(!ic(r,{strict:!1}))throw new xd({address:r});t.push([r,s])}return t}function Gpt(e,t){const n=u9e(e);return n==="eip1559"?Xpt(e,t):n==="eip2930"?Qpt(e,t):n==="eip4844"?Ypt(e,t):n==="eip7702"?Kpt(e,t):Zpt(e,t)}function Kpt(e,t){const{authorizationList:n,chainId:r,gas:s,nonce:a,to:o,value:l,maxFeePerGas:c,maxPriorityFeePerGas:u,accessList:d,data:f}=e;Hpt(e);const x=pB(d),g=Jpt(n);return Nm(["0x04",By([ui(r),a?ui(a):"0x",u?ui(u):"0x",c?ui(c):"0x",s?ui(s):"0x",o??"0x",l?ui(l):"0x",f??"0x",x,g,...Mk(e,t)])])}function Ypt(e,t){const{chainId:n,gas:r,nonce:s,to:a,value:o,maxFeePerBlobGas:l,maxFeePerGas:c,maxPriorityFeePerGas:u,accessList:d,data:f}=e;Vpt(e);let x=e.blobVersionedHashes,g=e.sidecars;if(e.blobs&&(typeof x>"u"||typeof g>"u")){const I=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(U=>Vl(U)),R=e.kzg,O=uie({blobs:I,kzg:R});if(typeof x>"u"&&(x=s9e({commitments:O})),typeof g>"u"){const U=die({blobs:I,commitments:O,kzg:R});g=c9e({blobs:I,commitments:O,proofs:U})}}const v=pB(d),w=[ui(n),s?ui(s):"0x",u?ui(u):"0x",c?ui(c):"0x",r?ui(r):"0x",a??"0x",o?ui(o):"0x",f??"0x",v,l?ui(l):"0x",x??[],...Mk(e,t)],C=[],N=[],P=[];if(g)for(let I=0;I<g.length;I++){const{blob:R,commitment:O,proof:U}=g[I];C.push(R),N.push(O),P.push(U)}return Nm(["0x03",By(g?[w,C,N,P]:w)])}function Xpt(e,t){const{chainId:n,gas:r,nonce:s,to:a,value:o,maxFeePerGas:l,maxPriorityFeePerGas:c,accessList:u,data:d}=e;Tie(e);const f=pB(u),x=[ui(n),s?ui(s):"0x",c?ui(c):"0x",l?ui(l):"0x",r?ui(r):"0x",a??"0x",o?ui(o):"0x",d??"0x",f,...Mk(e,t)];return Nm(["0x02",By(x)])}function Qpt(e,t){const{chainId:n,gas:r,data:s,nonce:a,to:o,value:l,accessList:c,gasPrice:u}=e;Wpt(e);const d=pB(c),f=[ui(n),a?ui(a):"0x",u?ui(u):"0x",r?ui(r):"0x",o??"0x",l?ui(l):"0x",s??"0x",d,...Mk(e,t)];return Nm(["0x01",By(f)])}function Zpt(e,t){const{chainId:n=0,gas:r,data:s,nonce:a,to:o,value:l,gasPrice:c}=e;qpt(e);let u=[a?ui(a):"0x",c?ui(c):"0x",r?ui(r):"0x",o??"0x",l?ui(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 Cut({v:t.v});return g})(),f=Wf(t.r),x=Wf(t.s);u=[...u,ui(d),f==="0x00"?"0x":f,x==="0x00"?"0x":x]}else n>0&&(u=[...u,ui(n),"0x","0x"]);return By(u)}function Mk(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=Wf(n.r),o=Wf(n.s);return[typeof s=="number"?s?ui(1):"0x":r===0n?"0x":r===1n?ui(1):r===27n?"0x":ui(1),a==="0x00"?"0x":a,o==="0x00"?"0x":o]}function Jpt(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?ui(r):"0x",o,s?ui(s):"0x",...Mk({},a)])}return t}const emt=`Ethereum Signed Message:
`;function tmt(e){const t=typeof e=="string"?IS(e):typeof e.raw=="string"?e.raw:Vl(e.raw),n=IS(`${emt}${al(t)}`);return r1([n,t])}function jEe(e,t){return tu(tmt(e),t)}const EEe="0x6492649264926492649264926492649264926492649264926492649264926492";function nmt(e){return Hje(e,-32)===EEe}function rmt(e){const{address:t,data:n,signature:r,to:s="hex"}=e,a=Nm([s2([{type:"address"},{type:"bytes"},{type:"bytes"}],[t,n,r]),EEe]);return s==="hex"?a:sp(a)}class smt extends Lr{constructor({value:t}){super(`Number \`${t}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function imt(e,t){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(e))throw new smt({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 amt="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function omt(e,t){const{blockNumber:n,blockTag:r,calls:s,stateOverrides:a,traceAssetChanges:o,traceTransfers:l,validation:c}=t,u=t.account?Bu(t.account):void 0;if(o&&!u)throw new Lr("`account` is required when `traceAssetChanges` is true");const d=u?Spt(Npt("constructor(bytes, bytes)"),{bytecode:L9e,args:[amt,Apt(D6("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:te}=await q9e(e,{account:u.address,...V,data:V.abi?Am(V):V.data});return te.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 AZ(e,{blockNumber:n,blockTag:r,blocks:[...o?[{calls:[{data:d}],stateOverrides:a},{calls:f.map((V,te)=>({abi:[D6("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:V,from:Ym,nonce:te})),stateOverrides:[{address:Ym,nonce:0}]}]:[],{calls:[...s,{}].map((V,te)=>({...V,from:u==null?void 0:u.address,nonce:te})),stateOverrides:x},...o?[{calls:[{data:d}]},{calls:f.map((V,te)=>({abi:[D6("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:V,from:Ym,nonce:te})),stateOverrides:[{address:Ym,nonce:0}]},{calls:f.map((V,te)=>({to:V,abi:[D6("function decimals() returns (uint256)")],functionName:"decimals",from:Ym,nonce:te})),stateOverrides:[{address:Ym,nonce:0}]},{calls:f.map((V,te)=>({to:V,abi:[D6("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:Ym,nonce:te})),stateOverrides:[{address:Ym,nonce:0}]},{calls:f.map((V,te)=>({to:V,abi:[D6("function symbol() returns (string)")],functionName:"symbol",from:Ym,nonce:te})),stateOverrides:[{address:Ym,nonce:0}]}]:[]],traceTransfers:l,validation:c}),v=o?g[2]:g[0],[w,C,,N,P,I,R,O]=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"?sd(V.data):null),K=(N==null?void 0:N.calls)??[],re=(P==null?void 0:P.calls)??[],he=[...K,...re].map(V=>V.status==="success"?sd(V.data):null),Q=((I==null?void 0:I.calls)??[]).map(V=>V.status==="success"?V.result:null),ie=((O==null?void 0:O.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,te]of he.entries()){const ae=J[V];if(typeof te!="bigint"||typeof ae!="bigint")continue;const fe=Q[V-1],Ne=ie[V-1],me=oe[V-1],we=V===0?{address:_pt,decimals:18,symbol:"ETH"}:{address:f[V-1],decimals:me||fe?Number(fe??1):void 0,symbol:Ne??void 0};G.some(xe=>xe.token.address===we.address)||G.push({token:we,value:{pre:ae,post:te,diff:te-ae}})}return{assetChanges:G,block:L,results:z}}const iH=new Map,Upe=new Map;let lmt=0;function $y(e,t,n){const r=++lmt,s=()=>iH.get(e)||[],a=()=>{const d=s();iH.set(e,d.filter(f=>f.id!==r))},o=()=>{const d=s();if(!d.some(x=>x.id===r))return;const f=Upe.get(e);d.length===1&&f&&f(),a()},l=s();if(iH.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"&&Upe.set(e,u),o}function Rk(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 TZ(c);const u=async()=>{s&&(await e({unpoll:a}),await TZ(r),u())};u()})(),a}function cmt(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=Pc(["watchBlocks",e.uid,t,n,r,d,c]);return $y(v,{onBlock:s,onError:a},w=>Rk(async()=>{var C;try{const N=await ii(e,E0,"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 P=(f==null?void 0:f.number)+1n;P<N.number;P++){const I=await ii(e,E0,"getBlock")({blockNumber:P,includeTransactions:d});w.onBlock(I,f),f=I}}(!(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&&ii(e,E0,"getBlock")({blockTag:t,includeTransactions:d}).then(I=>{v&&w&&(s(I,void 0),w=!1)});const N=(()=>{if(e.transport.type==="fallback"){const I=e.transport.transports.find(R=>R.config.type==="webSocket");return I?I.value:e.transport}return e.transport})(),{unsubscribe:P}=await N.subscribe({params:["newHeads"],async onData(I){if(!v)return;const R=await ii(e,E0,"getBlock")({blockNumber:I.blockNumber,includeTransactions:d}).catch(()=>{});v&&(s(R,f),w=!1,f=R)},onError(I){a==null||a(I)}});C=P,v||C()}catch(N){a==null||a(N)}})(),()=>C()})()}function _Ee(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=Pc(["watchBlockNumber",e.uid,t,n,o]);return $y(f,{onBlockNumber:r,onError:s},x=>Rk(async()=>{var g;try{const v=await ii(e,Ok,"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=Pc(["watchBlockNumber",e.uid,t,n]);return $y(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(P=>P.config.type==="webSocket");return N?N.value:e.transport}return e.transport})(),{unsubscribe:C}=await w.subscribe({params:["newHeads"],onData(N){var I;if(!g)return;const P=sd((I=N.result)==null?void 0:I.number);x.onBlockNumber(P,c),c=P},onError(N){var P;(P=x.onError)==null||P.call(x,N)}});v=C,g||v()}catch(w){s==null||s(w)}})(),()=>v()})})()}async function mB(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}function umt(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=Pc(["watchEvent",t,n,r,e.uid,s,d,o]);return $y(C,{onLogs:c,onError:l},N=>{let P;o!==void 0&&(P=o-1n);let I,R=!1;const O=Rk(async()=>{var U;if(!R){try{I=await ii(e,K9e,"createEventFilter")({address:t,args:n,event:s,events:a,strict:g,fromBlock:o})}catch{}R=!0;return}try{let L;if(I)L=await ii(e,dB,"getFilterChanges")({filter:I});else{const z=await ii(e,Ok,"getBlockNumber")({});P&&P!==z?L=await ii(e,wie,"getLogs")({address:t,args:n,event:s,events:a,fromBlock:P+1n,toBlock:z}):L=[],P=z}if(L.length===0)return;if(r)N.onLogs(L);else for(const z of L)N.onLogs([z])}catch(L){I&&L instanceof b3&&(R=!1),(U=N.onError)==null||U.call(N,L)}},{emitOnBegin:!0,interval:d});return async()=>{I&&await ii(e,mB,"uninstallFilter")({filter:I}),O()}})})():(()=>{let C=!0,N=()=>C=!1;return(async()=>{try{const P=(()=>{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})(),I=a??(s?[s]:void 0);let R=[];I&&(R=[I.flatMap(L=>Fk({abi:[L],eventName:L.name,args:n}))],s&&(R=R[0]));const{unsubscribe:O}=await P.subscribe({params:["logs",{address:t,topics:R}],onData(U){var z;if(!C)return;const L=U.result;try{const{eventName:X,args:ne}=yie({abi:I??[],data:L.data,topics:L.topics,strict:g}),J=s1(L,{args:ne,eventName:X});c([J])}catch(X){let ne,J;if(X instanceof O9||X instanceof XD){if(f)return;ne=X.abiItem.name,J=(z=X.abiItem.inputs)==null?void 0:z.some(re=>!("name"in re&&re.name))}const K=s1(L,{args:J?[]:{},eventName:ne});c([K])}},onError(U){l==null||l(U)}});N=O,C||N()}catch(P){l==null||l(P)}})(),()=>N()})()}function dmt(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=Pc(["watchPendingTransactions",e.uid,t,a]);return $y(u,{onTransactions:r,onError:n},d=>{let f;const x=Rk(async()=>{var g;try{if(!f)try{f=await ii(e,Y9e,"createPendingTransactionFilter")({});return}catch(w){throw x(),w}const v=await ii(e,dB,"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 ii(e,mB,"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 fmt(e){return e.map(t=>({...t,value:BigInt(t.value)}))}function hmt(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?Q0(e.nonce):void 0,storageProof:e.storageProof?fmt(e.storageProof):void 0}}async function pmt(e,{address:t,blockNumber:n,blockTag:r,storageKeys:s}){const a=r??"latest",o=n!==void 0?Us(n):void 0,l=await e.request({method:"eth_getProof",params:[t,s,o||a]});return hmt(l)}async function mmt(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=Pc(["waitForTransactionReceipt",e.uid,n]);let u,d,f,x=!1;const{promise:g,resolve:v,reject:w}=B9e(),C=l?setTimeout(()=>w(new jut({hash:n})),l):void 0,N=$y(c,{onReplaced:r,resolve:v,reject:w},P=>{const I=ii(e,_Ee,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:s,async onBlockNumber(R){const O=L=>{clearTimeout(C),I(),L(),N()};let U=R;if(!x)try{if(f){if(t>1&&(!f.blockNumber||U-f.blockNumber+1n<t))return;O(()=>P.resolve(f));return}if(u||(x=!0,await iM(async()=>{u=await ii(e,Cie,"getTransaction")({hash:n}),u.blockNumber&&(U=u.blockNumber)},{delay:o,retryCount:a}),x=!1),f=await ii(e,SZ,"getTransactionReceipt")({hash:n}),t>1&&(!f.blockNumber||U-f.blockNumber+1n<t))return;O(()=>P.resolve(f))}catch(L){if(L instanceof Qje||L instanceof Zje){if(!u){x=!1;return}try{d=u,x=!0;const z=await iM(()=>ii(e,E0,"getBlock")({blockNumber:U,includeTransactions:!0}),{delay:o,retryCount:a,shouldRetry:({error:J})=>J instanceof Jje});x=!1;const X=z.transactions.find(({from:J,nonce:K})=>J===d.from&&K===d.nonce);if(!X||(f=await ii(e,SZ,"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"),O(()=>{var J;(J=P.onReplaced)==null||J.call(P,{reason:ne,replacedTransaction:d,transaction:X,transactionReceipt:f}),P.resolve(f)})}catch(z){O(()=>P.reject(z))}}else O(()=>P.reject(L))}}})});return g}async function xmt(e,{account:t=e.account,message:n}){if(!t)throw new eB({docsPath:"/docs/actions/wallet/signMessage"});const r=Bu(t);if(r.signMessage)return r.signMessage({message:n});const s=typeof n=="string"?IS(n):n.raw instanceof Uint8Array?ui(n.raw):n.raw;return e.request({method:"personal_sign",params:[s,r.address]},{retryCount:0})}async function gmt(e,t){const{account:n=e.account,domain:r,message:s,primaryType:a}=t;if(!n)throw new eB({docsPath:"/docs/actions/wallet/signTypedData"});const o=Bu(n),l={EIP712Domain:AEe({domain:r}),...t.types};if(NEe({domain:r,message:s,primaryType:a,types:l}),o.signTypedData)return o.signTypedData({domain:r,message:s,primaryType:a,types:l});const c=Upt({domain:r,message:s,primaryType:a,types:l});return e.request({method:"eth_signTypedData_v4",params:[o.address,c]},{retryCount:0})}async function bmt(e,t){const{abi:n,address:r,args:s,dataSuffix:a,functionName:o,...l}=t,c=l.account?Bu(l.account):e.account,u=Am({abi:n,args:s,functionName:o});try{const{data:d}=await ii(e,cB,"call")({batch:!1,data:`${u}${a?a.replace("0x",""):""}`,to:r,...l,account:c}),f=a5({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 v3(d,{abi:n,address:r,args:s,docsPath:"/docs/contract/simulateContract",functionName:o,sender:c==null?void 0:c.address})}}let kEe=class extends Gse{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,Ect(t);const r=ZD(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 FS(this),this.iHash.update(t),this}digestInto(t){FS(this),jk(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 TEe=(e,t,n)=>new kEe(e,t).update(n).digest();TEe.create=(e,t)=>new kEe(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Iie=BigInt(0),IZ=BigInt(1);function MS(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Pie(e){if(!MS(e))throw new Error("Uint8Array expected")}function tE(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}function LI(e){const t=e.toString(16);return t.length&1?"0"+t:t}function IEe(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?Iie:BigInt("0x"+e)}const PEe=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",ymt=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function nE(e){if(Pie(e),PEe)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=ymt[e[n]];return t}const Bx={_0:48,_9:57,A:65,F:70,a:97,f:102};function zpe(e){if(e>=Bx._0&&e<=Bx._9)return e-Bx._0;if(e>=Bx.A&&e<=Bx.F)return e-(Bx.A-10);if(e>=Bx.a&&e<=Bx.f)return e-(Bx.a-10)}function aM(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(PEe)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=zpe(e.charCodeAt(a)),l=zpe(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 Gw(e){return IEe(nE(e))}function FEe(e){return Pie(e),IEe(nE(Uint8Array.from(e).reverse()))}function rE(e,t){return aM(e.toString(16).padStart(t*2,"0"))}function OEe(e,t){return rE(e,t).reverse()}function Bp(e,t,n){let r;if(typeof t=="string")try{r=aM(t)}catch(a){throw new Error(e+" must be hex string or Uint8Array, cause: "+a)}else if(MS(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 oM(...e){let t=0;for(let r=0;r<e.length;r++){const s=e[r];Pie(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 aH=e=>typeof e=="bigint"&&Iie<=e;function Fie(e,t,n){return aH(e)&&aH(t)&&aH(n)&&t<=e&&e<n}function JC(e,t,n,r){if(!Fie(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)}function vmt(e){let t;for(t=0;e>Iie;e>>=IZ,t+=1);return t}const xB=e=>(IZ<<BigInt(e))-IZ,oH=e=>new Uint8Array(e),Hpe=e=>Uint8Array.from(e);function wmt(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=oH(e),s=oH(e),a=0;const o=()=>{r.fill(1),s.fill(0),a=0},l=(...f)=>n(s,r,...f),c=(f=oH(0))=>{s=l(Hpe([0]),f),r=l(),f.length!==0&&(s=l(Hpe([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 oM(...x)};return(f,x)=>{o(),c(f);let g;for(;!(g=x(u()));)c();return o(),g}}const Cmt={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"||MS(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 gB(e,t,n={}){const r=(s,a,o)=>{const l=Cmt[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 Vpe(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 _c=BigInt(0),vl=BigInt(1),Ov=BigInt(2),Smt=BigInt(3),PZ=BigInt(4),Wpe=BigInt(5),qpe=BigInt(8);function Hd(e,t){const n=e%t;return n>=_c?n:t+n}function Nmt(e,t,n){if(t<_c)throw new Error("invalid exponent, negatives unsupported");if(n<=_c)throw new Error("invalid modulus");if(n===vl)return _c;let r=vl;for(;t>_c;)t&vl&&(r=r*e%n),e=e*e%n,t>>=vl;return r}function xh(e,t,n){let r=e;for(;t-- >_c;)r*=r,r%=n;return r}function FZ(e,t){if(e===_c)throw new Error("invert: expected non-zero number");if(t<=_c)throw new Error("invert: expected positive modulus, got "+t);let n=Hd(e,t),r=t,s=_c,a=vl;for(;n!==_c;){const l=r/n,c=r%n,u=s-a*l;r=n,n=c,s=a,a=u}if(r!==vl)throw new Error("invert: does not exist");return Hd(s,t)}function Amt(e){const t=(e-vl)/Ov;let n,r,s;for(n=e-vl,r=0;n%Ov===_c;n/=Ov,r++);for(s=Ov;s<e&&Nmt(s,t,e)!==e-vl;s++)if(s>1e3)throw new Error("Cannot find square root: likely non-prime P");if(r===1){const o=(e+vl)/PZ;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+vl)/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,vl<<BigInt(u-g-1));d=l.sqr(v),f=l.mul(f,v),x=l.mul(x,d),u=g}return f}}function jmt(e){if(e%PZ===Smt){const t=(e+vl)/PZ;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%qpe===Wpe){const t=(e-Wpe)/qpe;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 Amt(e)}const Emt=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function _mt(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=Emt.reduce((r,s)=>(r[s]="function",r),t);return gB(e,n)}function kmt(e,t,n){if(n<_c)throw new Error("invalid exponent, negatives unsupported");if(n===_c)return e.ONE;if(n===vl)return t;let r=e.ONE,s=t;for(;n>_c;)n&vl&&(r=e.mul(r,s)),s=e.sqr(s),n>>=vl;return r}function Tmt(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 MEe(e,t){const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function REe(e,t,n=!1,r={}){if(e<=_c)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:s,nByteLength:a}=MEe(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:xB(s),ZERO:_c,ONE:vl,create:c=>Hd(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return _c<=c&&c<e},is0:c=>c===_c,isOdd:c=>(c&vl)===vl,neg:c=>Hd(-c,e),eql:(c,u)=>c===u,sqr:c=>Hd(c*c,e),add:(c,u)=>Hd(c+u,e),sub:(c,u)=>Hd(c-u,e),mul:(c,u)=>Hd(c*u,e),pow:(c,u)=>kmt(l,c,u),div:(c,u)=>Hd(c*FZ(u,e),e),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>FZ(c,e),sqrt:r.sqrt||(c=>(o||(o=jmt(e)),o(l,c))),invertBatch:c=>Tmt(l,c),cmov:(c,u,d)=>d?u:c,toBytes:c=>n?OEe(c,a):rE(c,a),fromBytes:c=>{if(c.length!==a)throw new Error("Field.fromBytes: expected "+a+" bytes, got "+c.length);return n?FEe(c):Gw(c)}});return Object.freeze(l)}function LEe(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 DEe(e){const t=LEe(e);return t+Math.ceil(t/2)}function Imt(e,t,n=!1){const r=e.length,s=LEe(t),a=DEe(t);if(r<16||r<a||r>1024)throw new Error("expected "+a+"-1024 bytes of input, got "+r);const o=n?FEe(e):Gw(e),l=Hd(o,t-vl)+vl;return n?OEe(l,s):rE(l,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Gpe=BigInt(0),OZ=BigInt(1);function lH(e,t){const n=t.negate();return e?n:t}function BEe(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function cH(e,t){BEe(e,t);const n=Math.ceil(t/e)+1,r=2**(e-1),s=2**e,a=xB(e),o=BigInt(e);return{windows:n,windowSize:r,mask:a,maxNumber:s,shiftBy:o}}function Kpe(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+=OZ);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 Pmt(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 Fmt(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 uH=new WeakMap,$Ee=new WeakMap;function dH(e){return $Ee.get(e)||1}function Omt(e,t){return{constTimeNegate:lH,hasPrecomputes(n){return dH(n)!==1},unsafeLadder(n,r,s=e.ZERO){let a=n;for(;r>Gpe;)r&OZ&&(s=s.add(a)),a=a.double(),r>>=OZ;return s},precomputeWindow(n,r){const{windows:s,windowSize:a}=cH(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=cH(n,t);for(let c=0;c<l.windows;c++){const{nextN:u,offset:d,isZero:f,isNeg:x,isNegF:g,offsetF:v}=Kpe(s,c,l);s=u,f?o=o.add(lH(g,r[v])):a=a.add(lH(x,r[d]))}return{p:a,f:o}},wNAFUnsafe(n,r,s,a=e.ZERO){const o=cH(n,t);for(let l=0;l<o.windows&&s!==Gpe;l++){const{nextN:c,offset:u,isZero:d,isNeg:f}=Kpe(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=uH.get(r);return a||(a=this.precomputeWindow(r,n),n!==1&&uH.set(r,s(a))),a},wNAFCached(n,r,s){const a=dH(n);return this.wNAF(a,this.getPrecomputes(a,n,s),r)},wNAFCachedUnsafe(n,r,s,a){const o=dH(n);return o===1?this.unsafeLadder(n,r,a):this.wNAFUnsafe(o,this.getPrecomputes(o,n,s),r,a)},setWindowSize(n,r){BEe(r,t),$Ee.set(n,r),uH.delete(n)}}}function Mmt(e,t,n,r){if(Pmt(n,e),Fmt(r,t),n.length!==r.length)throw new Error("arrays of points and scalars must have equal length");const s=e.ZERO,a=vmt(BigInt(n.length)),o=a>12?a-3:a>4?a-2:a?2:1,l=xB(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 UEe(e){return _mt(e.Fp),gB(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...MEe(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Ype(e){e.lowS!==void 0&&tE("lowS",e.lowS),e.prehash!==void 0&&tE("prehash",e.prehash)}function Rmt(e){const t=UEe(e);gB(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 Lmt extends Error{constructor(t=""){super(t)}}const cg={Err:Lmt,_tlv:{encode:(e,t)=>{const{Err:n}=cg;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=LI(r);if(s.length/2&128)throw new n("tlv.encode: long form length too big");const a=r>127?LI(s.length/2|128):"";return LI(e)+a+s+t},decode(e,t){const{Err:n}=cg;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}=cg;if(e<Eg)throw new t("integer: negative integers are not allowed");let n=LI(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}=cg;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 Gw(e)}},toSig(e){const{Err:t,_int:n,_tlv:r}=cg,s=Bp("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}=cg,r=t.encode(2,n.encode(e.r)),s=t.encode(2,n.encode(e.s)),a=r+s;return t.encode(48,a)}},Eg=BigInt(0),Nc=BigInt(1);BigInt(2);const Xpe=BigInt(3);BigInt(4);function Dmt(e){const t=Rmt(e),{Fp:n}=t,r=REe(t.n,t.nBitLength),s=t.toBytes||((w,C,N)=>{const P=C.toAffine();return oM(Uint8Array.from([4]),n.toBytes(P.x),n.toBytes(P.y))}),a=t.fromBytes||(w=>{const C=w.subarray(1),N=n.fromBytes(C.subarray(0,n.BYTES)),P=n.fromBytes(C.subarray(n.BYTES,2*n.BYTES));return{x:N,y:P}});function o(w){const{a:C,b:N}=t,P=n.sqr(w),I=n.mul(P,w);return n.add(n.add(I,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 Fie(w,Nc,t.n)}function c(w){const{allowedPrivateKeyLengths:C,nByteLength:N,wrapPrivateKey:P,n:I}=t;if(C&&typeof w!="bigint"){if(MS(w)&&(w=nE(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:Gw(Bp("private key",w,N))}catch{throw new Error("invalid private key, expected hex or "+N+" bytes, got "+typeof w)}return P&&(R=Hd(R,I)),JC("private key",R,Nc,I),R}function u(w){if(!(w instanceof x))throw new Error("ProjectivePoint expected")}const d=Vpe((w,C)=>{const{px:N,py:P,pz:I}=w;if(n.eql(I,n.ONE))return{x:N,y:P};const R=w.is0();C==null&&(C=R?n.ONE:n.inv(I));const O=n.mul(N,C),U=n.mul(P,C),L=n.mul(I,C);if(R)return{x:n.ZERO,y:n.ZERO};if(!n.eql(L,n.ONE))throw new Error("invZ was invalid");return{x:O,y:U}}),f=Vpe(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 P=n.sqr(N),I=o(C);if(!n.eql(P,I))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,P){if(C==null||!n.isValid(C))throw new Error("x required");if(N==null||!n.isValid(N))throw new Error("y required");if(P==null||!n.isValid(P))throw new Error("z required");this.px=C,this.py=N,this.pz=P,Object.freeze(this)}static fromAffine(C){const{x:N,y:P}=C||{};if(!C||!n.isValid(N)||!n.isValid(P))throw new Error("invalid affine point");if(C instanceof x)throw new Error("projective point not allowed");const I=R=>n.eql(R,n.ZERO);return I(N)&&I(P)?x.ZERO:new x(N,P,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(C){const N=n.invertBatch(C.map(P=>P.pz));return C.map((P,I)=>P.toAffine(N[I])).map(x.fromAffine)}static fromHex(C){const N=x.fromAffine(a(Bp("pointHex",C)));return N.assertValidity(),N}static fromPrivateKey(C){return x.BASE.multiply(c(C))}static msm(C,N){return Mmt(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:P,pz:I}=this,{px:R,py:O,pz:U}=C,L=n.eql(n.mul(N,U),n.mul(R,I)),z=n.eql(n.mul(P,U),n.mul(O,I));return L&&z}negate(){return new x(this.px,n.neg(this.py),this.pz)}double(){const{a:C,b:N}=t,P=n.mul(N,Xpe),{px:I,py:R,pz:O}=this;let U=n.ZERO,L=n.ZERO,z=n.ZERO,X=n.mul(I,I),ne=n.mul(R,R),J=n.mul(O,O),K=n.mul(I,R);return K=n.add(K,K),z=n.mul(I,O),z=n.add(z,z),U=n.mul(C,z),L=n.mul(P,J),L=n.add(U,L),U=n.sub(ne,L),L=n.add(ne,L),L=n.mul(U,L),U=n.mul(K,U),z=n.mul(P,z),J=n.mul(C,J),K=n.sub(X,J),K=n.mul(C,K),K=n.add(K,z),z=n.add(X,X),X=n.add(z,X),X=n.add(X,J),X=n.mul(X,K),L=n.add(L,X),J=n.mul(R,O),J=n.add(J,J),X=n.mul(J,K),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:P,pz:I}=this,{px:R,py:O,pz:U}=C;let L=n.ZERO,z=n.ZERO,X=n.ZERO;const ne=t.a,J=n.mul(t.b,Xpe);let K=n.mul(N,R),re=n.mul(P,O),he=n.mul(I,U),Q=n.add(N,P),ie=n.add(R,O);Q=n.mul(Q,ie),ie=n.add(K,re),Q=n.sub(Q,ie),ie=n.add(N,I);let oe=n.add(R,U);return ie=n.mul(ie,oe),oe=n.add(K,he),ie=n.sub(ie,oe),oe=n.add(P,I),L=n.add(O,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(K,K),re=n.add(re,K),he=n.mul(ne,he),ie=n.mul(J,ie),re=n.add(re,he),he=n.sub(K,he),he=n.mul(ne,he),ie=n.add(ie,he),K=n.mul(re,ie),z=n.add(z,K),K=n.mul(oe,ie),L=n.mul(Q,L),L=n.sub(L,K),K=n.mul(Q,re),X=n.mul(oe,X),X=n.add(X,K),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:P}=t;JC("scalar",C,Eg,P);const I=x.ZERO;if(C===Eg)return I;if(this.is0()||C===Nc)return this;if(!N||v.hasPrecomputes(this))return v.wNAFCachedUnsafe(this,C,x.normalizeZ);let{k1neg:R,k1:O,k2neg:U,k2:L}=N.splitScalar(C),z=I,X=I,ne=this;for(;O>Eg||L>Eg;)O&Nc&&(z=z.add(ne)),L&Nc&&(X=X.add(ne)),ne=ne.double(),O>>=Nc,L>>=Nc;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:P}=t;JC("scalar",C,Nc,P);let I,R;if(N){const{k1neg:O,k1:U,k2neg:L,k2:z}=N.splitScalar(C);let{p:X,f:ne}=this.wNAF(U),{p:J,f:K}=this.wNAF(z);X=v.constTimeNegate(O,X),J=v.constTimeNegate(L,J),J=new x(n.mul(J.px,N.beta),J.py,J.pz),I=X.add(J),R=ne.add(K)}else{const{p:O,f:U}=this.wNAF(C);I=O,R=U}return x.normalizeZ([I,R])[0]}multiplyAndAddUnsafe(C,N,P){const I=x.BASE,R=(U,L)=>L===Eg||L===Nc||!U.equals(I)?U.multiplyUnsafe(L):U.multiply(L),O=R(this,N).add(R(C,P));return O.is0()?void 0:O}toAffine(C){return d(this,C)}isTorsionFree(){const{h:C,isTorsionFree:N}=t;if(C===Nc)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===Nc?this:N?N(x,this):this.multiplyUnsafe(t.h)}toRawBytes(C=!0){return tE("isCompressed",C),this.assertValidity(),s(x,this,C)}toHex(C=!0){return tE("isCompressed",C),nE(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=Omt(x,t.endo?Math.ceil(g/2):g);return{CURVE:t,ProjectivePoint:x,normPrivateKeyToScalar:c,weierstrassEquation:o,isWithinCurveOrder:l}}function Bmt(e){const t=UEe(e);return gB(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function $mt(e){const t=Bmt(e),{Fp:n,n:r}=t,s=n.BYTES+1,a=2*n.BYTES+1;function o(he){return Hd(he,r)}function l(he){return FZ(he,r)}const{ProjectivePoint:c,normPrivateKeyToScalar:u,weierstrassEquation:d,isWithinCurveOrder:f}=Dmt({...t,toBytes(he,Q,ie){const oe=Q.toAffine(),G=n.toBytes(oe.x),V=oM;return tE("isCompressed",ie),ie?V(Uint8Array.from([Q.hasEvenY()?2:3]),G):V(Uint8Array.from([4]),G,n.toBytes(oe.y))},fromBytes(he){const Q=he.length,ie=he[0],oe=he.subarray(1);if(Q===s&&(ie===2||ie===3)){const G=Gw(oe);if(!Fie(G,Nc,n.ORDER))throw new Error("Point is not on curve");const V=d(G);let te;try{te=n.sqrt(V)}catch(Ne){const me=Ne instanceof Error?": "+Ne.message:"";throw new Error("Point is not on curve"+me)}const ae=(te&Nc)===Nc;return(ie&1)===1!==ae&&(te=n.neg(te)),{x:G,y:te}}else if(Q===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 "+Q)}}}),x=he=>nE(rE(he,t.nByteLength));function g(he){const Q=r>>Nc;return he>Q}function v(he){return g(he)?o(-he):he}const w=(he,Q,ie)=>Gw(he.slice(Q,ie));class C{constructor(Q,ie,oe){JC("r",Q,Nc,r),JC("s",ie,Nc,r),this.r=Q,this.s=ie,oe!=null&&(this.recovery=oe),Object.freeze(this)}static fromCompact(Q){const ie=t.nByteLength;return Q=Bp("compactSignature",Q,ie*2),new C(w(Q,0,ie),w(Q,ie,2*ie))}static fromDER(Q){const{r:ie,s:oe}=cg.toSig(Bp("DER",Q));return new C(ie,oe)}assertValidity(){}addRecoveryBit(Q){return new C(this.r,this.s,Q)}recoverPublicKey(Q){const{r:ie,s:oe,recovery:G}=this,V=U(Bp("msgHash",Q));if(G==null||![0,1,2,3].includes(G))throw new Error("recovery id invalid");const te=G===2||G===3?ie+t.n:ie;if(te>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const ae=G&1?"03":"02",fe=c.fromHex(ae+x(te)),Ne=l(te),me=o(-V*Ne),we=o(oe*Ne),xe=c.BASE.multiplyAndAddUnsafe(fe,me,we);if(!xe)throw new Error("point at infinify");return xe.assertValidity(),xe}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new C(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return aM(this.toDERHex())}toDERHex(){return cg.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return aM(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=DEe(t.n);return Imt(t.randomBytes(he),t.n)},precompute(he=8,Q=c.BASE){return Q._setWindowSize(he),Q.multiply(BigInt(3)),Q}};function P(he,Q=!0){return c.fromPrivateKey(he).toRawBytes(Q)}function I(he){const Q=MS(he),ie=typeof he=="string",oe=(Q||ie)&&he.length;return Q?oe===s||oe===a:ie?oe===2*s||oe===2*a:he instanceof c}function R(he,Q,ie=!0){if(I(he))throw new Error("first arg must be private key");if(!I(Q))throw new Error("second arg must be public key");return c.fromHex(Q).multiply(u(he)).toRawBytes(ie)}const O=t.bits2int||function(he){if(he.length>8192)throw new Error("input is too large");const Q=Gw(he),ie=he.length*8-t.nBitLength;return ie>0?Q>>BigInt(ie):Q},U=t.bits2int_modN||function(he){return o(O(he))},L=xB(t.nBitLength);function z(he){return JC("num < 2^"+t.nBitLength,he,Eg,L),rE(he,t.nByteLength)}function X(he,Q,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:te,extraEntropy:ae}=ie;V==null&&(V=!0),he=Bp("msgHash",he),Ype(ie),te&&(he=Bp("prehashed msgHash",oe(he)));const fe=U(he),Ne=u(Q),me=[z(Ne),z(fe)];if(ae!=null&&ae!==!1){const je=ae===!0?G(n.BYTES):ae;me.push(Bp("extraEntropy",je))}const we=oM(...me),xe=fe;function ye(je){const Pe=O(je);if(!f(Pe))return;const Re=l(Pe),Xe=c.BASE.multiply(Pe).toAffine(),Ke=o(Xe.x);if(Ke===Eg)return;const ut=o(Re*o(xe+Ke*Ne));if(ut===Eg)return;let et=(Xe.x===Ke?0:2)|Number(Xe.y&Nc),tt=ut;return V&&g(ut)&&(tt=v(ut),et^=1),new C(Ke,tt,et)}return{seed:we,k2sig:ye}}const ne={lowS:t.lowS,prehash:!1},J={lowS:t.lowS,prehash:!1};function K(he,Q,ie=ne){const{seed:oe,k2sig:G}=X(he,Q,ie),V=t;return wmt(V.hash.outputLen,V.nByteLength,V.hmac)(oe,G)}c.BASE._setWindowSize(8);function re(he,Q,ie,oe=J){var et;const G=he;Q=Bp("msgHash",Q),ie=Bp("publicKey",ie);const{lowS:V,prehash:te,format:ae}=oe;if(Ype(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"||MS(G),Ne=!fe&&!ae&&typeof G=="object"&&G!==null&&typeof G.r=="bigint"&&typeof G.s=="bigint";if(!fe&&!Ne)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let me,we;try{if(Ne&&(me=new C(G.r,G.s)),fe){try{ae!=="compact"&&(me=C.fromDER(G))}catch(tt){if(!(tt instanceof cg.Err))throw tt}!me&&ae!=="der"&&(me=C.fromCompact(G))}we=c.fromHex(ie)}catch{return!1}if(!me||V&&me.hasHighS())return!1;te&&(Q=t.hash(Q));const{r:xe,s:ye}=me,je=U(Q),Pe=l(ye),Re=o(je*Pe),Xe=o(xe*Pe),Ke=(et=c.BASE.multiplyAndAddUnsafe(we,Re,Xe))==null?void 0:et.toAffine();return Ke?o(Ke.x)===xe:!1}return{CURVE:t,getPublicKey:P,getSharedSecret:R,sign:K,verify:re,ProjectivePoint:c,Signature:C,utils:N}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Umt(e){return{hash:e,hmac:(t,...n)=>TEe(e,t,Lct(...n)),randomBytes:Dct}}function zmt(e,t){const n=r=>$mt({...e,...Umt(r)});return{...n(t),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const zEe=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Qpe=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Hmt=BigInt(1),MZ=BigInt(2),Zpe=(e,t)=>(e+t/MZ)/t;function Vmt(e){const t=zEe,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=xh(d,n,t)*d%t,x=xh(f,n,t)*d%t,g=xh(x,MZ,t)*u%t,v=xh(g,s,t)*g%t,w=xh(v,a,t)*v%t,C=xh(w,l,t)*w%t,N=xh(C,c,t)*C%t,P=xh(N,l,t)*w%t,I=xh(P,n,t)*d%t,R=xh(I,o,t)*v%t,O=xh(R,r,t)*u%t,U=xh(O,MZ,t);if(!RZ.eql(RZ.sqr(U),e))throw new Error("Cannot find square root");return U}const RZ=REe(zEe,void 0,void 0,{sqrt:Vmt}),Oie=zmt({a:BigInt(0),b:BigInt(7),Fp:RZ,n:Qpe,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Qpe,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Hmt*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=n,o=BigInt("0x100000000000000000000000000000000"),l=Zpe(a*e,t),c=Zpe(-r*e,t);let u=Hd(e-l*n-c*s,t),d=Hd(-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}}}},r9e);BigInt(0);Oie.ProjectivePoint;const Wmt=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:Oie},Symbol.toStringTag,{value:"Module"}));function qmt({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 Oie.Signature(sd(e),sd(t)).toCompactHex()}${a===0?"1b":"1c"}`;return n==="hex"?o:sp(o)}async function Mie(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=X0(o)?o:typeof o=="object"&&"r"in o&&"s"in o?qmt(o):Vl(o),d=await(async()=>!r&&!s||nmt(u)?u:rmt({address:r,data:s,signature:u}))();try{const v=l?{to:l,data:Am({abi:gpe,functionName:"isValidSig",args:[n,a,d]}),...c}:{data:Qse({abi:gpe,args:[n,a,d],bytecode:yft}),...c},{data:w}=await ii(e,cB,"call")(v);return lct(w??"0x0")}catch(v){try{if(bie(Ec(n),await Wje({hash:a,signature:o})))return!0}catch{}if(v instanceof F9e)return!1;throw v}}async function Gmt(e,{address:t,message:n,factory:r,factoryData:s,signature:a,...o}){const l=jEe(n);return Mie(e,{address:t,factory:r,factoryData:s,hash:l,signature:a,...o})}async function Kmt(e,t){const{address:n,factory:r,factoryData:s,signature:a,message:o,primaryType:l,types:c,domain:u,...d}=t,f=Lpt({message:o,primaryType:l,types:c,domain:u});return Mie(e,{address:n,factory:r,factoryData:s,hash:f,signature:a,...d})}function Ymt(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=Pc(["watchContractEvent",r,s,a,e.uid,o,f,C,l]);return $y(N,{onLogs:u,onError:c},P=>{let I;l!==void 0&&(I=l-1n);let R,O=!1;const U=Rk(async()=>{var L;if(!O){try{R=await ii(e,G9e,"createContractEventFilter")({abi:n,address:r,args:s,eventName:o,strict:C,fromBlock:l})}catch{}O=!0;return}try{let z;if(R)z=await ii(e,dB,"getFilterChanges")({filter:R});else{const X=await ii(e,Ok,"getBlockNumber")({});I&&I<X?z=await ii(e,X9e,"getContractEvents")({abi:n,address:r,args:s,eventName:o,fromBlock:I+1n,toBlock:X,strict:C}):z=[],I=X}if(z.length===0)return;if(a)P.onLogs(z);else for(const X of z)P.onLogs([X])}catch(z){R&&z instanceof b3&&(O=!1),(L=P.onError)==null||L.call(P,z)}},{emitOnBegin:!0,interval:f});return async()=>{R&&await ii(e,mB,"uninstallFilter")({filter:R}),U()}})})():(()=>{const C=x??!1,N=Pc(["watchContractEvent",r,s,a,e.uid,o,f,C]);let P=!0,I=()=>P=!1;return $y(N,{onLogs:u,onError:c},R=>((async()=>{try{const O=(()=>{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?Fk({abi:n,eventName:o,args:s}):[],{unsubscribe:L}=await O.subscribe({params:["logs",{address:r,topics:U}],onData(z){var ne;if(!P)return;const X=z.result;try{const{eventName:J,args:K}=yie({abi:n,data:X.data,topics:X.topics,strict:x}),re=s1(X,{args:K,eventName:J});R.onLogs([re])}catch(J){let K,re;if(J instanceof O9||J instanceof XD){if(x)return;K=J.abiItem.name,re=(ne=J.abiItem.inputs)==null?void 0:ne.some(Q=>!("name"in Q&&Q.name))}const he=s1(X,{args:re?[]:{},eventName:K});R.onLogs([he])}},onError(z){var X;(X=R.onError)==null||X.call(R,z)}});I=L,P||I()}catch(O){c==null||c(O)}})(),()=>I()))})()}async function Xmt(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 eB({docsPath:"/docs/contract/writeContract"});const u=r?Bu(r):null,d=Am({abi:n,args:a,functionName:l});try{return await ii(e,sdt,"sendTransaction")({data:`${d}${o?o.replace("0x",""):""}`,to:s,account:u,...c})}catch(f){throw v3(f,{abi:n,address:s,args:a,docsPath:"/docs/contract/writeContract",functionName:l,sender:u==null?void 0:u.address})}}function i2(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 LF="2.16.7",Qmt=()=>`@wagmi/core@${LF}`;var HEe=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)},lM,VEe;let C1=class LZ extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return Qmt()}constructor(t,n={}){var a;super(),lM.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 LZ?n.cause.details:(a=n.cause)!=null&&a.message?n.cause.message:n.details,s=n.cause instanceof LZ&&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 HEe(this,lM,"m",VEe).call(this,this,t)}};lM=new WeakSet,VEe=function e(t,n){return n!=null&&n(t)?t:t.cause?HEe(this,lM,"m",e).call(this,t.cause,n):t};class S3 extends C1{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class Zmt extends C1{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class Jmt extends C1{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class e0t extends C1{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 t0t extends C1{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 n0t extends C1{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 r0t(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 Zmt;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 DZ=256;let DI=DZ,BI;function WEe(e=11){if(!BI||DI+e>DZ*2){BI="",DI=0;for(let t=0;t<DZ;t++)BI+=(256+Math.random()*256|0).toString(16).substring(1)}return BI.substring(DI,DI+++e)}function qEe(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?Bu(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:WEe()};function w(C){return N=>{const P=N(C);for(const R in v)delete P[R];const I={...C,...P};return Object.assign(I,{extend:w(I)})}}return Object.assign(v,{extend:w(v)})}function GEe({key:e,methods:t,name:n,request:r,retryCount:s=3,retryDelay:a=150,timeout:o,type:l},c){const u=WEe();return{config:{key:e,methods:t,name:n,request:r,retryCount:s,retryDelay:a,timeout:o,type:l},request:Tpt(r,{methods:t,retryCount:s,retryDelay:a,uid:u}),value:c}}function s0t(e,t={}){const{key:n="custom",methods:r,name:s="Custom Provider",retryDelay:a}=t;return({retryCount:o})=>GEe({key:n,methods:r,name:s,request:e.request.bind(e),retryCount:t.retryCount??o,retryDelay:a,type:"custom"})}class i0t extends Lr{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 uj(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,P=f==null?void 0:f.rpcUrls.default.http[0];if(!P)throw new i0t;const I=Fpt(P,{fetchOptions:r,onRequest:l,onResponse:c,timeout:N});return GEe({key:s,methods:a,name:o,async request({method:R,params:O}){const U={method:R,params:O},{schedule:L}=$9e({id:P,wait:w,shouldSplitBatch(J){return J.length>v},fn:J=>I.request({body:J}),sort:(J,K)=>J.id-K.id}),z=async J=>n?L(J):[await I.request({body:J})],[{error:X,result:ne}]=await z(U);if(d)return{error:X,result:ne};if(X)throw new tie({body:U,error:X,url:P});return ne},retryCount:C,retryDelay:u,timeout:N,type:"http"},{fetchOptions:r,url:P})}}function a0t(e){var f,x,g;const{scheme:t,statement:n,...r}=((f=e.match(o0t))==null?void 0:f.groups)??{},{chainId:s,expirationTime:a,issuedAt:o,notBefore:l,requestId:c,...u}=((x=e.match(l0t))==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 o0t=/^(?:(?<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)?/,l0t=/(?: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 c0t(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&&!bie(r.address,t))return!1}catch{return!1}return!0}async function u0t(e,t){const{address:n,domain:r,message:s,nonce:a,scheme:o,signature:l,time:c=new Date,...u}=t,d=a0t(s);if(!d.address||!c0t({address:n,domain:r,message:d,nonce:a,scheme:o,time:c}))return!1;const x=jEe(s);return Mie(e,{address:d.address,hash:x,signature:l,...u})}function d0t(e){return{call:t=>cB(e,t),createAccessList:t=>q9e(e,t),createBlockFilter:()=>Bft(e),createContractEventFilter:t=>G9e(e,t),createEventFilter:t=>K9e(e,t),createPendingTransactionFilter:()=>Y9e(e),estimateContractGas:t=>Uft(e,t),estimateGas:t=>cie(e,t),getBalance:t=>lie(e,t),getBlobBaseFee:()=>zft(e),getBlock:t=>E0(e,t),getBlockNumber:t=>Ok(e,t),getBlockTransactionCount:t=>Kft(e,t),getBytecode:t=>jpe(e,t),getChainId:()=>rie(e),getCode:t=>jpe(e,t),getContractEvents:t=>X9e(e,t),getEip712Domain:t=>Zft(e,t),getEnsAddress:t=>Aft(e,t),getEnsAvatar:t=>V9e(e,t),getEnsName:t=>W9e(e,t),getEnsResolver:t=>Dft(e,t),getEnsText:t=>H9e(e,t),getFeeHistory:t=>tht(e,t),estimateFeesPerGas:t=>But(e,t),getFilterChanges:t=>dB(e,t),getFilterLogs:t=>nht(e,t),getGasPrice:()=>aie(e),getLogs:t=>wie(e,t),getProof:t=>pmt(e,t),estimateMaxPriorityFeePerGas:t=>Dut(e,t),getStorageAt:t=>rht(e,t),getTransaction:t=>Cie(e,t),getTransactionConfirmations:t=>sht(e,t),getTransactionCount:t=>n9e(e,t),getTransactionReceipt:t=>SZ(e,t),multicall:t=>Z9e(e,t),prepareTransactionRequest:t=>hie(e,t),readContract:t=>Z0(e,t),sendRawTransaction:t=>f9e(e,t),simulate:t=>AZ(e,t),simulateBlocks:t=>AZ(e,t),simulateCalls:t=>omt(e,t),simulateContract:t=>bmt(e,t),verifyMessage:t=>Gmt(e,t),verifySiweMessage:t=>u0t(e,t),verifyTypedData:t=>Kmt(e,t),uninstallFilter:t=>mB(e,t),waitForTransactionReceipt:t=>mmt(e,t),watchBlocks:t=>cmt(e,t),watchBlockNumber:t=>_Ee(e,t),watchContractEvent:t=>Ymt(e,t),watchEvent:t=>umt(e,t),watchPendingTransactions:t=>dmt(e,t)}}async function Rie(e,t={}){let n;if(t.connector){const{connector:u}=t;if(e.state.status==="reconnecting"&&!u.getAccounts&&!u.getChainId)throw new n0t({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 Jmt;const r=t.chainId??n.chainId,s=await n.connector.getChainId();if(s!==n.chainId)throw new t0t({connectionChainId:n.chainId,connectorChainId:s});const a=n.connector;if(a.getClient)return a.getClient({chainId:r});const o=Bu(t.account??n.accounts[0]);if(o&&(o.address=Ec(o.address)),t.account&&!n.accounts.some(u=>u.toLowerCase()===o.address.toLowerCase()))throw new e0t({address:o.address,connector:a});const l=e.chains.find(u=>u.id===r),c=await n.connector.getProvider({chainId:r});return qEe({account:o,chain:l,name:"Connector Client",transport:u=>s0t(c)({...u,retryCount:0})})}async function f0t(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 KEe(e){return typeof e=="number"?e:e==="wei"?0:Math.abs(vut[e])}function YEe(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 h0t(e,t){const{allowFailure:n=!0,chainId:r,contracts:s,...a}=t,o=e.getClient({chainId:r});return i2(o,Z9e,"multicall")({allowFailure:n,contracts:s,...a})}function XEe(e,t){const{chainId:n,...r}=t,s=e.getClient({chainId:n});return i2(s,Z0,"readContract")(r)}async function p0t(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])=>h0t(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 O9e)throw c;const u=()=>o.map(d=>XEe(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 m0t(e,t){const{address:n,blockNumber:r,blockTag:s,chainId:a,token:o,unit:l="ether"}=t;if(o)try{return await Jpe(e,{balanceAddress:n,chainId:a,symbolType:"string",tokenAddress:o})}catch(x){if(x.name==="ContractFunctionExecutionError"){const g=await Jpe(e,{balanceAddress:n,chainId:a,symbolType:"bytes32",tokenAddress:o}),v=cct(Wf(g.symbol,{dir:"right"}));return{...g,symbol:v}}throw x}const c=e.getClient({chainId:a}),d=await i2(c,lie,"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:Ek(d,KEe(l)),symbol:f.nativeCurrency.symbol,value:d}}async function Jpe(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 p0t(e,{allowFailure:!1,contracts:[{...l,functionName:"balanceOf",args:[n],chainId:r},{...l,functionName:"decimals",chainId:r},{...l,functionName:"symbol",chainId:r}]}),f=Ek(c??"0",KEe(o??u));return{decimals:u,formatted:f,symbol:d,value:c}}function eme(e){return e.state.chainId}function Uy(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(!Uy(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&&!Uy(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}let fH=[];function tme(e){const t=e.chains;return Uy(fH,t)?fH:(fH=t,t)}function x0t(e,t={}){let n;try{n=e.getClient(t)}catch{}return n}let $I=[];function BZ(e){const t=[...e.state.connections.values()];return e.state.status==="reconnecting"||Uy($I,t)?$I:($I=t,t)}let hH=[];function nme(e){const t=e.connectors;return Uy(hH,t)?hH:(hH=t,t)}function g0t(e,t){const{chainId:n,...r}=t,s=e.getClient({chainId:n});return i2(s,V9e,"getEnsAvatar")(r)}function b0t(e,t){const{chainId:n,...r}=t,s=e.getClient({chainId:n});return i2(s,W9e,"getEnsName")(r)}function $Z(e,t={}){const n=x0t(e,t);return n==null?void 0:n.extend(d0t)}let pH=!1;async function y0t(e,t={}){var u,d;if(pH)return[];pH=!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"}))),pH=!1,l}async function v0t(e,t){const{account:n,connector:r,...s}=t;let a;return typeof n=="object"&&n.type==="local"?a=e.getClient():a=await Rie(e,{account:n,connector:r}),i2(a,xmt,"signMessage")({...s,...n?{account:n}:{}})}async function w0t(e,t){const{account:n,connector:r,...s}=t;let a;return typeof n=="object"&&n.type==="local"?a=e.getClient():a=await Rie(e,{account:n,connector:r}),i2(a,gmt,"signTypedData")({...s,...n?{account:n}:{}})}class qh extends C1{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class C0t extends C1{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 S0t(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 C0t({connector:l});return await l.switchChain({addEthereumChainParameter:n,chainId:r})}const a=e.chains.find(l=>l.id===r);if(!a)throw new S3;return e.setState(l=>({...l,chainId:r})),a}function QEe(e,t){const{onChange:n}=t;return e.subscribe(()=>YEe(e),n,{equalityFn(r,s){const{connector:a,...o}=r,{connector:l,...c}=s;return Uy(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 N0t(e,t){const{onChange:n}=t;return e.subscribe(r=>r.chainId,n)}function A0t(e,t){const{onChange:n}=t;return e.subscribe(()=>BZ(e),n,{equalityFn:Uy})}function j0t(e,t){const{onChange:n}=t;return e._internal.connectors.subscribe((r,s)=>{n(Object.values(r),s)})}function E0t(e,t){const{onChange:n}=t;return e.subscribe(()=>$Z(e),n,{equalityFn(r,s){return(r==null?void 0:r.uid)===(s==null?void 0:s.uid)}})}async function _0t(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 Rie(e,{account:n??void 0,chainId:r,connector:s}),await i2(o,Xmt,"writeContract")({...a,...n?{account:n}:{},chain:r?{id:r}:null})}bB.type="injected";function bB(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"?{...k0t[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:bB.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,P;const f=await this.getProvider();if(!f)throw new qh;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=>Ec(R)),x.length>0&&(x=await this.getAccounts())}catch(I){const R=I;if(R.code===yo.code)throw new yo(R);if(R.code===Cy.code)throw R}try{!(x!=null&&x.length)&&!d&&(x=(await f.request({method:"eth_requestAccounts"})).map(O=>Ec(O))),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 I=await this.getChainId();if(u&&I!==u){const R=await this.switchChain({chainId:u}).catch(O=>{if(O.code===yo.code)throw O;return{id:I}});I=(R==null?void 0:R.id)??I}return t&&await((N=c.storage)==null?void 0:N.removeItem(`${this.id}.disconnected`)),e.target||await((P=c.storage)==null?void 0:P.setItem("injected.connected",!0)),{accounts:x,chainId:I}}catch(I){const R=I;throw R.code===yo.code?new yo(R):R.code===Cy.code?new Cy(R):R}},async disconnect(){var d,f;const u=await this.getProvider();if(!u)throw new qh;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 kie(()=>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 qh;return(await u.request({method:"eth_accounts"})).map(f=>Ec(f))},async getChainId(){const u=await this.getProvider();if(!u)throw new qh;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=DF(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 qh}return!!(await iM(()=>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 qh;const x=c.chains.find(P=>P.id===d);if(!x)throw new ip(new S3);const g=new Promise(P=>{const I=R=>{"chainId"in R&&R.chainId===d&&(c.emitter.off("change",I),P())};c.emitter.on("change",I)});try{return await Promise.all([f.request({method:"wallet_switchEthereumChain",params:[{chainId:Us(d)}]}).then(async()=>{await this.getChainId()===d&&c.emitter.emit("change",{chainId:d})}),g]),x}catch(P){const I=P;if(I.code===4902||((w=(v=I==null?void 0:I.data)==null?void 0:v.originalError)==null?void 0:w.code)===4902)try{const{default:R,...O}=x.blockExplorers??{};let U;u!=null&&u.blockExplorerUrls?U=u.blockExplorerUrls:R&&(U=[R.url,...Object.values(O).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:Us(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 yo(new Error("User rejected switch after adding network."))}),g]),x}catch(R){throw new yo(R)}throw I.code===yo.code?new yo(I):new ip(I)}},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=>Ec(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 k0t={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(e){return e!=null&&e.coinbaseWalletExtension?e.coinbaseWalletExtension:DF(e,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(e){return DF(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:DF(e,"isPhantom")}}};function DF(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 T0t(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 I0t(){const e=new Set;let t=[];const n=()=>T0t(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 P0t=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)},F0t=P0t;function O0t(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 UZ=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return UZ(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return UZ(r)(n)}}}},M0t=(e,t)=>(n,r,s)=>{let a={storage:O0t(()=>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(P=>{var I;return P((I=r())!=null?I:x)});const N=((C=a.onRehydrateStorage)==null?void 0:C.call(a,(w=r())!=null?w:x))||void 0;return UZ(u.getItem.bind(u))(a.name).then(P=>{if(P)if(typeof P.version=="number"&&P.version!==a.version){if(a.migrate)return[!0,a.migrate(P.state,P.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,P.state];return[!1,void 0]}).then(P=>{var I;const[R,O]=P;if(g=a.merge(O,(I=r())!=null?I:x),n(g,!0),R)return d()}).then(()=>{N==null||N(g,void 0),g=r(),o=!0,c.forEach(P=>P(g))}).catch(P=>{N==null||N(void 0,P)})};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},R0t=M0t,rme=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},mH=e=>e?rme(e):rme;var xH={exports:{}},sme;function L0t(){return sme||(sme=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,P,I;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(I=1,P=new Array(N-1);I<N;I++)P[I-1]=arguments[I];C.fn.apply(C.context,P)}else{var R=C.length,O;for(I=0;I<R;I++)switch(C[I].once&&this.removeListener(u,C[I].fn,void 0,!0),N){case 1:C[I].fn.call(C[I].context);break;case 2:C[I].fn.call(C[I].context,d);break;case 3:C[I].fn.call(C[I].context,d,f);break;case 4:C[I].fn.call(C[I].context,d,f,x);break;default:if(!P)for(O=1,P=new Array(N-1);O<N;O++)P[O-1]=arguments[O];C[I].fn.apply(C[I].context,P)}}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}(xH)),xH.exports}var D0t=L0t();const Lie=Ii(D0t);let B0t=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 Lie})}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 $0t(e){return new B0t(e)}function U0t(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 ime(e,t){return e.slice(0,t).join(".")||"."}function ame(e,t){const{length:n}=e;for(let r=0;r<n;++r)if(e[r]===t)return r+1;return 0}function z0t(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=ame(s,this);u===0?s[s.length]=this:(s.splice(u),a.splice(u)),a[a.length]=l;const d=ame(s,c);if(d!==0)return r?t.call(this,l,c,ime(a,d)):`[ref=${ime(a,d)}]`}else s[0]=c,a[0]=l;return n?e.call(this,l,c):c}}function H0t(e,t,n,r){return JSON.stringify(e,z0t((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 V0t(e){const{deserialize:t=U0t,key:n="wagmi",serialize:r=H0t,storage:s=ZEe}=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 ZEe={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function W0t(){const e=typeof window<"u"&&window.localStorage?window.localStorage:ZEe;return{getItem(t){return e.getItem(t)},removeItem(t){e.removeItem(t)},setItem(t,n){try{e.setItem(t,n)}catch{}}}}const zZ=256;let UI=zZ,zI;function q0t(e=11){if(!zI||UI+e>zZ*2){zI="",UI=0;for(let t=0;t<zZ;t++)zI+=(256+Math.random()*256|0).toString(16).substring(1)}return zI.substring(UI,UI+++e)}function G0t(e){const{multiInjectedProviderDiscovery:t=!0,storage:n=V0t({storage:W0t()}),syncConnectedChain:r=!0,ssr:s=!1,...a}=e,o=typeof window<"u"&&t?I0t():void 0,l=mH(()=>a.chains),c=mH(()=>{const O=[],U=new Set;for(const L of a.connectors??[]){const z=u(L);if(O.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)||O.push(u(d(z)))}return O});function u(O){var z;const U=$0t(q0t()),L={...O({emitter:U,chains:l.getState(),storage:n,transports:a.transports}),emitter:U,uid:U.uid};return U.on("connect",I),(z=L.setup)==null||z.call(L),L}function d(O){const{info:U}=O,L=O.provider;return bB({target:{...U,id:U.rdns,provider:L}})}const f=new Map;function x(O={}){const U=O.chainId??C.getState().chainId,L=l.getState().find(X=>X.id===U);if(O.chainId&&!L)throw new S3;{const X=f.get(C.getState().chainId);if(X&&!L)return X;if(!L)throw new S3}{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={},K=Object.entries(a);for(const[re,he]of K)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=qEe({...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-";LF.startsWith(w)?v=Number.parseInt(LF.replace(w,"")):v=Number.parseInt(LF.split(".")[0]??"0");const C=mH(F0t(n?R0t(g,{migrate(O,U){if(U===v)return O;const L=g(),z=N(O,L.chainId);return{...L,chainId:z}},name:"store",partialize(O){return{connections:{__type:"Map",value:Array.from(O.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:O.chainId,current:O.current}},merge(O,U){typeof O=="object"&&O&&"status"in O&&delete O.status;const L=N(O,U.chainId);return{...U,...O,chainId:L}},skipHydration:s,storage:n,version:v}):g));C.setState(g());function N(O,U){return O&&typeof O=="object"&&"chainId"in O&&typeof O.chainId=="number"&&l.getState().some(L=>L.id===O.chainId)?O.chainId:U}r&&C.subscribe(({connections:O,current:U})=>{var L;return U?(L=O.get(U))==null?void 0:L.chainId:void 0},O=>{if(l.getState().some(L=>L.id===O))return C.setState(L=>({...L,chainId:O??L.chainId}))}),o==null||o.subscribe(O=>{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 O){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 P(O){C.setState(U=>{const L=U.connections.get(O.uid);return L?{...U,connections:new Map(U.connections).set(O.uid,{accounts:O.accounts??L.accounts,chainId:O.chainId??L.chainId,connector:L.connector})}:U})}function I(O){C.getState().status==="connecting"||C.getState().status==="reconnecting"||C.setState(U=>{const L=c.getState().find(z=>z.uid===O.uid);return L?(L.emitter.listenerCount("connect")&&L.emitter.off("connect",P),L.emitter.listenerCount("change")||L.emitter.on("change",P),L.emitter.listenerCount("disconnect")||L.emitter.on("disconnect",R),{...U,connections:new Map(U.connections).set(O.uid,{accounts:O.accounts,chainId:O.chainId,connector:L}),current:O.uid,status:"connected"}):U})}function R(O){C.setState(U=>{const L=U.connections.get(O.uid);if(L){const X=L.connector;X.emitter.listenerCount("change")&&L.connector.emitter.off("change",P),X.emitter.listenerCount("disconnect")&&L.connector.emitter.off("disconnect",R),X.emitter.listenerCount("connect")||L.connector.emitter.on("connect",I)}if(U.connections.delete(O.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(O){let U;typeof O=="function"?U=O(C.getState()):U=O;const L=g();typeof U!="object"&&(U=L),Object.keys(L).some(X=>!(X in U))&&(U=L),C.setState(U,!0)},subscribe(O,U,L){return C.subscribe(O,U,L?{...L,fireImmediately:L.emitImmediately}:void 0)},_internal:{mipd:o,store:C,ssr:!!s,syncConnectedChain:r,transports:a.transports,chains:{setState(O){const U=typeof O=="function"?O(l.getState()):O;if(U.length!==0)return l.setState(U,!0)},subscribe(O){return l.subscribe(O)}},connectors:{providerDetailToConnector:d,setup:u,setState(O){return c.setState(typeof O=="function"?O(c.getState()):O,!0)},subscribe(O){return c.subscribe(O)}},events:{change:P,connect:I,disconnect:R}}}}function K0t(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?y0t(e):e.storage&&e.setState(s=>({...s,connections:new Map}))}}}function Y0t(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 X0t(e){const{children:t,config:n,initialState:r,reconnectOnMount:s=!0}=e,{onMount:a}=K0t(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 JEe=m.createContext(void 0);function Q0t(e){const{children:t,config:n}=e,r={value:n};return m.createElement(X0t,e,m.createElement(JEe.Provider,r,t))}const Z0t="2.14.16",J0t=()=>`wagmi@${Z0t}`;let ext=class extends C1{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 J0t()}};class txt extends ext{constructor(){super("`useConfig` must be used within `WagmiProvider`.",{docsPath:"/api/WagmiProvider"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiProviderNotFoundError"})}}function El(e={}){const t=e.config??m.useContext(JEe);if(!t)throw new txt;return t}function nxt(e,t){const{onChange:n}=t;return e._internal.chains.subscribe((r,s)=>{n(r,s)})}var gH={exports:{}},bH={},yH={exports:{}},vH={};/**
 * @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 ome;function rxt(){if(ome)return vH;ome=1;var e=ox();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 vH.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,vH}var lme;function sxt(){return lme||(lme=1,yH.exports=rxt()),yH.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 cme;function ixt(){if(cme)return bH;cme=1;var e=ox(),t=sxt();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 bH.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(!P){if(P=!0,I=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(I,U))return L;var z=x(U);return g!==void 0&&g(L,z)?(I=U,L):(I=U,R=z)}var P=!1,I,R,O=f===void 0?null:f;return[function(){return N(d())},O===null?void 0:function(){return N(O())}]},[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},bH}var ume;function axt(){return ume||(ume=1,gH.exports=ixt()),gH.exports}var e_e=axt();const wH=e=>typeof e=="object"&&!Array.isArray(e);function oxt(e,t,n=t,r=Uy){const s=m.useRef([]),a=e_e.useSyncExternalStoreWithSelector(e,t,n,o=>o,(o,l)=>{if(wH(o)&&wH(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(wH(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 ts(e={}){const t=El(e);return oxt(n=>QEe(t,{onChange:n}),()=>YEe(t))}function t_e(e={}){const{onConnect:t,onDisconnect:n}=e,r=El(e);m.useEffect(()=>QEe(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 bA=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(){}},N3=typeof window>"u"||"Deno"in globalThis;function zh(){}function lxt(e,t){return typeof e=="function"?e(t):e}function HZ(e){return typeof e=="number"&&e>=0&&e!==1/0}function n_e(e,t){return Math.max(e+(t||0)-Date.now(),0)}function e4(e,t){return typeof e=="function"?e(t):e}function em(e,t){return typeof e=="function"?e(t):e}function dme(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:a,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==Die(o,t.options))return!1}else if(!sE(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 fme(e,t){const{exact:n,status:r,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(A3(t.options.mutationKey)!==A3(a))return!1}else if(!sE(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function Die(e,t){return((t==null?void 0:t.queryKeyHashFn)||A3)(e)}function A3(e){return JSON.stringify(e,(t,n)=>VZ(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function sE(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>sE(e[n],t[n])):!1}function Bie(e,t){if(e===t)return e;const n=hme(e)&&hme(t);if(n||VZ(e)&&VZ(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]=Bie(e[d],t[d]),l[d]===e[d]&&e[d]!==void 0&&c++)}return s===o&&c===s?e:l}return t}function cM(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 hme(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function VZ(e){if(!pme(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!pme(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function pme(e){return Object.prototype.toString.call(e)==="[object Object]"}function cxt(e){return new Promise(t=>{setTimeout(t,e)})}function WZ(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Bie(e,t):t}function uxt(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function dxt(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var $ie=Symbol();function r_e(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===$ie?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var dw,Lb,v4,wNe,fxt=(wNe=class extends bA{constructor(){super();On(this,dw);On(this,Lb);On(this,v4);Ht(this,v4,t=>{if(!N3&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){He(this,Lb)||this.setEventListener(He(this,v4))}onUnsubscribe(){var t;this.hasListeners()||((t=He(this,Lb))==null||t.call(this),Ht(this,Lb,void 0))}setEventListener(t){var n;Ht(this,v4,t),(n=He(this,Lb))==null||n.call(this),Ht(this,Lb,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){He(this,dw)!==t&&(Ht(this,dw,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof He(this,dw)=="boolean"?He(this,dw):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},dw=new WeakMap,Lb=new WeakMap,v4=new WeakMap,wNe),Uie=new fxt,w4,Db,C4,CNe,hxt=(CNe=class extends bA{constructor(){super();On(this,w4,!0);On(this,Db);On(this,C4);Ht(this,C4,t=>{if(!N3&&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(){He(this,Db)||this.setEventListener(He(this,C4))}onUnsubscribe(){var t;this.hasListeners()||((t=He(this,Db))==null||t.call(this),Ht(this,Db,void 0))}setEventListener(t){var n;Ht(this,C4,t),(n=He(this,Db))==null||n.call(this),Ht(this,Db,t(this.setOnline.bind(this)))}setOnline(t){He(this,w4)!==t&&(Ht(this,w4,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return He(this,w4)}},w4=new WeakMap,Db=new WeakMap,C4=new WeakMap,CNe),uM=new hxt;function qZ(){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 pxt(e){return Math.min(1e3*2**e,3e4)}function s_e(e){return(e??"online")==="online"?uM.isOnline():!0}var i_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 CH(e){return e instanceof i_e}function a_e(e){let t=!1,n=0,r=!1,s;const a=qZ(),o=w=>{var C;r||(x(new i_e(w)),(C=e.abort)==null||C.call(e))},l=()=>{t=!0},c=()=>{t=!1},u=()=>Uie.isFocused()&&(e.networkMode==="always"||uM.isOnline())&&e.canRun(),d=()=>s_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 P=e.retry??(N3?0:3),I=e.retryDelay??pxt,R=typeof I=="function"?I(n,N):I,O=P===!0||typeof P=="number"&&n<P||typeof P=="function"&&P(n,N);if(t||!O){x(N);return}n++,(U=e.onFail)==null||U.call(e,n,N),cxt(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 mxt=e=>setTimeout(e,0);function xxt(){let e=[],t=0,n=l=>{l()},r=l=>{l()},s=mxt;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 Jl=xxt(),fw,SNe,o_e=(SNe=class{constructor(){On(this,fw)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),HZ(this.gcTime)&&Ht(this,fw,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(N3?1/0:5*60*1e3))}clearGcTimeout(){He(this,fw)&&(clearTimeout(He(this,fw)),Ht(this,fw,void 0))}},fw=new WeakMap,SNe),S4,N4,Lh,hw,yu,K_,pw,zp,ng,NNe,gxt=(NNe=class extends o_e{constructor(t){super();On(this,zp);On(this,S4);On(this,N4);On(this,Lh);On(this,hw);On(this,yu);On(this,K_);On(this,pw);Ht(this,pw,!1),Ht(this,K_,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ht(this,hw,t.client),Ht(this,Lh,He(this,hw).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ht(this,S4,bxt(this.options)),this.state=t.state??He(this,S4),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=He(this,yu))==null?void 0:t.promise}setOptions(t){this.options={...He(this,K_),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&He(this,Lh).remove(this)}setData(t,n){const r=WZ(this.state.data,t,this.options);return wr(this,zp,ng).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){wr(this,zp,ng).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=He(this,yu))==null?void 0:r.promise;return(s=He(this,yu))==null||s.cancel(t),n?n.then(zh).catch(zh):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(He(this,S4))}isActive(){return this.observers.some(t=>em(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===$ie||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||!n_e(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=He(this,yu))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=He(this,yu))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),He(this,Lh).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(He(this,yu)&&(He(this,pw)?He(this,yu).cancel({revert:!0}):He(this,yu).cancelRetry()),this.scheduleGc()),He(this,Lh).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||wr(this,zp,ng).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(He(this,yu))return He(this,yu).continueRetry(),He(this,yu).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,pw,!0),r.signal)})},a=()=>{const f=r_e(this.options,n),x={client:He(this,hw),queryKey:this.queryKey,meta:this.meta};return s(x),Ht(this,pw,!1),this.options.persister?this.options.persister(f,x,this):f(x)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:He(this,hw),state:this.state,fetchFn:a};s(o),(c=this.options.behavior)==null||c.onFetch(o,this),Ht(this,N4,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=o.fetchOptions)==null?void 0:u.meta))&&wr(this,zp,ng).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta});const l=f=>{var x,g,v,w;CH(f)&&f.silent||wr(this,zp,ng).call(this,{type:"error",error:f}),CH(f)||((g=(x=He(this,Lh).config).onError)==null||g.call(x,f,this),(w=(v=He(this,Lh).config).onSettled)==null||w.call(v,this.state.data,f,this)),this.scheduleGc()};return Ht(this,yu,a_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=He(this,Lh).config).onSuccess)==null||g.call(x,f,this),(w=(v=He(this,Lh).config).onSettled)==null||w.call(v,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,x)=>{wr(this,zp,ng).call(this,{type:"failed",failureCount:f,error:x})},onPause:()=>{wr(this,zp,ng).call(this,{type:"pause"})},onContinue:()=>{wr(this,zp,ng).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),He(this,yu).start()}},S4=new WeakMap,N4=new WeakMap,Lh=new WeakMap,hw=new WeakMap,yu=new WeakMap,K_=new WeakMap,pw=new WeakMap,zp=new WeakSet,ng=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,...l_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 CH(s)&&s.revert&&He(this,N4)?{...He(this,N4),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),Jl.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),He(this,Lh).notify({query:this,type:"updated",action:t})})},NNe);function l_e(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:s_e(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function bxt(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 i0,ANe,yxt=(ANe=class extends bA{constructor(t={}){super();On(this,i0);this.config=t,Ht(this,i0,new Map)}build(t,n,r){const s=n.queryKey,a=n.queryHash??Die(s,n);let o=this.get(a);return o||(o=new gxt({client:t,queryKey:s,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){He(this,i0).has(t.queryHash)||(He(this,i0).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=He(this,i0).get(t.queryHash);n&&(t.destroy(),n===t&&He(this,i0).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Jl.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return He(this,i0).get(t)}getAll(){return[...He(this,i0).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>dme(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>dme(t,r)):n}notify(t){Jl.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Jl.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Jl.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},i0=new WeakMap,ANe),a0,Xu,mw,o0,Nb,jNe,vxt=(jNe=class extends o_e{constructor(t){super();On(this,o0);On(this,a0);On(this,Xu);On(this,mw);this.mutationId=t.mutationId,Ht(this,Xu,t.mutationCache),Ht(this,a0,[]),this.state=t.state||c_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){He(this,a0).includes(t)||(He(this,a0).push(t),this.clearGcTimeout(),He(this,Xu).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ht(this,a0,He(this,a0).filter(n=>n!==t)),this.scheduleGc(),He(this,Xu).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){He(this,a0).length||(this.state.status==="pending"?this.scheduleGc():He(this,Xu).remove(this))}continue(){var t;return((t=He(this,mw))==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,P,I,R,O,U,L,z;const n=()=>{wr(this,o0,Nb).call(this,{type:"continue"})};Ht(this,mw,a_e({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(X,ne)=>{wr(this,o0,Nb).call(this,{type:"failed",failureCount:X,error:ne})},onPause:()=>{wr(this,o0,Nb).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>He(this,Xu).canRun(this)}));const r=this.state.status==="pending",s=!He(this,mw).canStart();try{if(r)n();else{wr(this,o0,Nb).call(this,{type:"pending",variables:t,isPaused:s}),await((o=(a=He(this,Xu).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&&wr(this,o0,Nb).call(this,{type:"pending",context:ne,variables:t,isPaused:s})}const X=await He(this,mw).start();return await((d=(u=He(this,Xu).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=He(this,Xu).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)),wr(this,o0,Nb).call(this,{type:"success",data:X}),X}catch(X){try{throw await((P=(N=He(this,Xu).config).onError)==null?void 0:P.call(N,X,t,this.state.context,this)),await((R=(I=this.options).onError)==null?void 0:R.call(I,X,t,this.state.context)),await((U=(O=He(this,Xu).config).onSettled)==null?void 0:U.call(O,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{wr(this,o0,Nb).call(this,{type:"error",error:X})}}finally{He(this,Xu).runNext(this)}}},a0=new WeakMap,Xu=new WeakMap,mw=new WeakMap,o0=new WeakSet,Nb=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),Jl.batch(()=>{He(this,a0).forEach(r=>{r.onMutationUpdate(t)}),He(this,Xu).notify({mutation:this,type:"updated",action:t})})},jNe);function c_e(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var pg,Hp,Y_,ENe,wxt=(ENe=class extends bA{constructor(t={}){super();On(this,pg);On(this,Hp);On(this,Y_);this.config=t,Ht(this,pg,new Set),Ht(this,Hp,new Map),Ht(this,Y_,0)}build(t,n,r){const s=new vxt({mutationCache:this,mutationId:++ib(this,Y_)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){He(this,pg).add(t);const n=HI(t);if(typeof n=="string"){const r=He(this,Hp).get(n);r?r.push(t):He(this,Hp).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(He(this,pg).delete(t)){const n=HI(t);if(typeof n=="string"){const r=He(this,Hp).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&He(this,Hp).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=HI(t);if(typeof n=="string"){const r=He(this,Hp).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=HI(t);if(typeof n=="string"){const s=(r=He(this,Hp).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(){Jl.batch(()=>{He(this,pg).forEach(t=>{this.notify({type:"removed",mutation:t})}),He(this,pg).clear(),He(this,Hp).clear()})}getAll(){return Array.from(He(this,pg))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>fme(n,r))}findAll(t={}){return this.getAll().filter(n=>fme(t,n))}notify(t){Jl.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Jl.batch(()=>Promise.all(t.map(n=>n.continue().catch(zh))))}},pg=new WeakMap,Hp=new WeakMap,Y_=new WeakMap,ENe);function HI(e){var t;return(t=e.options.scope)==null?void 0:t.id}function mme(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=I=>{Object.defineProperty(I,"signal",{enumerable:!0,get:()=>(t.signal.aborted?w=!0:t.signal.addEventListener("abort",()=>{w=!0}),t.signal)})},N=r_e(t.options,t.fetchOptions),P=async(I,R,O)=>{if(w)return Promise.reject();if(R==null&&I.pages.length)return Promise.resolve(I);const U={client:t.client,queryKey:t.queryKey,pageParam:R,direction:O?"backward":"forward",meta:t.options.meta};C(U);const L=await N(U),{maxPages:z}=t.options,X=O?dxt:uxt;return{pages:X(I.pages,L,z),pageParams:X(I.pageParams,R,z)}};if(s&&a.length){const I=s==="backward",R=I?Cxt:xme,O={pages:a,pageParams:o},U=R(r,O);l=await P(O,U,I)}else{const I=e??a.length;do{const R=c===0?o[0]??r.initialPageParam:xme(r,l);if(c>0&&R==null)break;l=await P(l,R),c++}while(c<I)}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 xme(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 Cxt(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 Zo,Bb,$b,A4,j4,Ub,E4,_4,_Ne,Sxt=(_Ne=class{constructor(e={}){On(this,Zo);On(this,Bb);On(this,$b);On(this,A4);On(this,j4);On(this,Ub);On(this,E4);On(this,_4);Ht(this,Zo,e.queryCache||new yxt),Ht(this,Bb,e.mutationCache||new wxt),Ht(this,$b,e.defaultOptions||{}),Ht(this,A4,new Map),Ht(this,j4,new Map),Ht(this,Ub,0)}mount(){ib(this,Ub)._++,He(this,Ub)===1&&(Ht(this,E4,Uie.subscribe(async e=>{e&&(await this.resumePausedMutations(),He(this,Zo).onFocus())})),Ht(this,_4,uM.subscribe(async e=>{e&&(await this.resumePausedMutations(),He(this,Zo).onOnline())})))}unmount(){var e,t;ib(this,Ub)._--,He(this,Ub)===0&&((e=He(this,E4))==null||e.call(this),Ht(this,E4,void 0),(t=He(this,_4))==null||t.call(this),Ht(this,_4,void 0))}isFetching(e){return He(this,Zo).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return He(this,Bb).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=He(this,Zo).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=He(this,Zo).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(e4(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return He(this,Zo).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=He(this,Zo).get(r.queryHash),a=s==null?void 0:s.state.data,o=lxt(t,a);if(o!==void 0)return He(this,Zo).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Jl.batch(()=>He(this,Zo).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=He(this,Zo).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=He(this,Zo);Jl.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=He(this,Zo);return Jl.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Jl.batch(()=>He(this,Zo).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(zh).catch(zh)}invalidateQueries(e,t={}){return Jl.batch(()=>(He(this,Zo).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=Jl.batch(()=>He(this,Zo).findAll(e).filter(s=>!s.isDisabled()).map(s=>{let a=s.fetch(void 0,n);return n.throwOnError||(a=a.catch(zh)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(zh)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=He(this,Zo).build(this,t);return n.isStaleByTime(e4(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(zh).catch(zh)}fetchInfiniteQuery(e){return e.behavior=mme(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(zh).catch(zh)}ensureInfiniteQueryData(e){return e.behavior=mme(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return uM.isOnline()?He(this,Bb).resumePausedMutations():Promise.resolve()}getQueryCache(){return He(this,Zo)}getMutationCache(){return He(this,Bb)}getDefaultOptions(){return He(this,$b)}setDefaultOptions(e){Ht(this,$b,e)}setQueryDefaults(e,t){He(this,A4).set(A3(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...He(this,A4).values()],n={};return t.forEach(r=>{sE(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){He(this,j4).set(A3(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...He(this,j4).values()],n={};return t.forEach(r=>{sE(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...He(this,$b).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Die(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===$ie&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...He(this,$b).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){He(this,Zo).clear(),He(this,Bb).clear()}},Zo=new WeakMap,Bb=new WeakMap,$b=new WeakMap,A4=new WeakMap,j4=new WeakMap,Ub=new WeakMap,E4=new WeakMap,_4=new WeakMap,_Ne),Bd,Ji,X_,Qu,xw,k4,zb,Hb,Q_,T4,I4,gw,bw,Vb,P4,Ra,dj,GZ,KZ,YZ,XZ,QZ,ZZ,JZ,u_e,kNe,Nxt=(kNe=class extends bA{constructor(t,n){super();On(this,Ra);On(this,Bd);On(this,Ji);On(this,X_);On(this,Qu);On(this,xw);On(this,k4);On(this,zb);On(this,Hb);On(this,Q_);On(this,T4);On(this,I4);On(this,gw);On(this,bw);On(this,Vb);On(this,P4,new Set);this.options=n,Ht(this,Bd,t),Ht(this,Hb,null),Ht(this,zb,qZ()),this.options.experimental_prefetchInRender||He(this,zb).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&&(He(this,Ji).addObserver(this),gme(He(this,Ji),this.options)?wr(this,Ra,dj).call(this):this.updateResult(),wr(this,Ra,XZ).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return eJ(He(this,Ji),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return eJ(He(this,Ji),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,wr(this,Ra,QZ).call(this),wr(this,Ra,ZZ).call(this),He(this,Ji).removeObserver(this)}setOptions(t){const n=this.options,r=He(this,Ji);if(this.options=He(this,Bd).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof em(this.options.enabled,He(this,Ji))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");wr(this,Ra,JZ).call(this),He(this,Ji).setOptions(this.options),n._defaulted&&!cM(this.options,n)&&He(this,Bd).getQueryCache().notify({type:"observerOptionsUpdated",query:He(this,Ji),observer:this});const s=this.hasListeners();s&&bme(He(this,Ji),r,this.options,n)&&wr(this,Ra,dj).call(this),this.updateResult(),s&&(He(this,Ji)!==r||em(this.options.enabled,He(this,Ji))!==em(n.enabled,He(this,Ji))||e4(this.options.staleTime,He(this,Ji))!==e4(n.staleTime,He(this,Ji)))&&wr(this,Ra,GZ).call(this);const a=wr(this,Ra,KZ).call(this);s&&(He(this,Ji)!==r||em(this.options.enabled,He(this,Ji))!==em(n.enabled,He(this,Ji))||a!==He(this,Vb))&&wr(this,Ra,YZ).call(this,a)}getOptimisticResult(t){const n=He(this,Bd).getQueryCache().build(He(this,Bd),t),r=this.createResult(n,t);return jxt(this,r)&&(Ht(this,Qu,r),Ht(this,k4,this.options),Ht(this,xw,He(this,Ji).state)),r}getCurrentResult(){return He(this,Qu)}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){He(this,P4).add(t)}getCurrentQuery(){return He(this,Ji)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=He(this,Bd).defaultQueryOptions(t),r=He(this,Bd).getQueryCache().build(He(this,Bd),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return wr(this,Ra,dj).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),He(this,Qu)))}createResult(t,n){var X;const r=He(this,Ji),s=this.options,a=He(this,Qu),o=He(this,xw),l=He(this,k4),u=t!==r?t.state:He(this,X_),{state:d}=t;let f={...d},x=!1,g;if(n._optimisticResults){const ne=this.hasListeners(),J=!ne&&gme(t,n),K=ne&&bme(t,r,n,s);(J||K)&&(f={...f,...l_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=He(this,I4))==null?void 0:X.state.data,He(this,I4)):n.placeholderData,ne!==void 0&&(C="success",g=WZ(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===He(this,Q_))g=He(this,T4);else try{Ht(this,Q_,n.select),g=n.select(g),g=WZ(a==null?void 0:a.data,g,n),Ht(this,T4,g),Ht(this,Hb,null)}catch(ne){Ht(this,Hb,ne)}He(this,Hb)&&(v=He(this,Hb),g=He(this,T4),w=Date.now(),C="error");const P=f.fetchStatus==="fetching",I=C==="pending",R=C==="error",O=I&&P,U=g!==void 0,z={status:C,fetchStatus:f.fetchStatus,isPending:I,isSuccess:C==="success",isError:R,isInitialLoading:O,isLoading:O,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:P,isRefetching:P&&!I,isLoadingError:R&&!U,isPaused:f.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:R&&U,isStale:zie(t,n),refetch:this.refetch,promise:He(this,zb)};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,zb,z.promise=qZ());ne(re)},K=He(this,zb);switch(K.status){case"pending":t.queryHash===r.queryHash&&ne(K);break;case"fulfilled":(z.status==="error"||z.data!==K.value)&&J();break;case"rejected":(z.status!=="error"||z.error!==K.reason)&&J();break}}return z}updateResult(){const t=He(this,Qu),n=this.createResult(He(this,Ji),this.options);if(Ht(this,xw,He(this,Ji).state),Ht(this,k4,this.options),He(this,xw).data!==void 0&&Ht(this,I4,He(this,Ji)),cM(n,t))return;Ht(this,Qu,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!He(this,P4).size)return!0;const o=new Set(a??He(this,P4));return this.options.throwOnError&&o.add("error"),Object.keys(He(this,Qu)).some(l=>{const c=l;return He(this,Qu)[c]!==t[c]&&o.has(c)})};wr(this,Ra,u_e).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&wr(this,Ra,XZ).call(this)}},Bd=new WeakMap,Ji=new WeakMap,X_=new WeakMap,Qu=new WeakMap,xw=new WeakMap,k4=new WeakMap,zb=new WeakMap,Hb=new WeakMap,Q_=new WeakMap,T4=new WeakMap,I4=new WeakMap,gw=new WeakMap,bw=new WeakMap,Vb=new WeakMap,P4=new WeakMap,Ra=new WeakSet,dj=function(t){wr(this,Ra,JZ).call(this);let n=He(this,Ji).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(zh)),n},GZ=function(){wr(this,Ra,QZ).call(this);const t=e4(this.options.staleTime,He(this,Ji));if(N3||He(this,Qu).isStale||!HZ(t))return;const r=n_e(He(this,Qu).dataUpdatedAt,t)+1;Ht(this,gw,setTimeout(()=>{He(this,Qu).isStale||this.updateResult()},r))},KZ=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(He(this,Ji)):this.options.refetchInterval)??!1},YZ=function(t){wr(this,Ra,ZZ).call(this),Ht(this,Vb,t),!(N3||em(this.options.enabled,He(this,Ji))===!1||!HZ(He(this,Vb))||He(this,Vb)===0)&&Ht(this,bw,setInterval(()=>{(this.options.refetchIntervalInBackground||Uie.isFocused())&&wr(this,Ra,dj).call(this)},He(this,Vb)))},XZ=function(){wr(this,Ra,GZ).call(this),wr(this,Ra,YZ).call(this,wr(this,Ra,KZ).call(this))},QZ=function(){He(this,gw)&&(clearTimeout(He(this,gw)),Ht(this,gw,void 0))},ZZ=function(){He(this,bw)&&(clearInterval(He(this,bw)),Ht(this,bw,void 0))},JZ=function(){const t=He(this,Bd).getQueryCache().build(He(this,Bd),this.options);if(t===He(this,Ji))return;const n=He(this,Ji);Ht(this,Ji,t),Ht(this,X_,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},u_e=function(t){Jl.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(He(this,Qu))}),He(this,Bd).getQueryCache().notify({query:He(this,Ji),type:"observerResultsUpdated"})})},kNe);function Axt(e,t){return em(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function gme(e,t){return Axt(e,t)||e.state.data!==void 0&&eJ(e,t,t.refetchOnMount)}function eJ(e,t,n){if(em(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&zie(e,t)}return!1}function bme(e,t,n,r){return(e!==t||em(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&zie(e,n)}function zie(e,t){return em(t.enabled,e)!==!1&&e.isStaleByTime(e4(t.staleTime,e))}function jxt(e,t){return!cM(e.getCurrentResult(),t)}var Wb,qb,$d,mg,Jg,BF,tJ,TNe,Ext=(TNe=class extends bA{constructor(n,r){super();On(this,Jg);On(this,Wb);On(this,qb);On(this,$d);On(this,mg);Ht(this,Wb,n),this.setOptions(r),this.bindMethods(),wr(this,Jg,BF).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=He(this,Wb).defaultMutationOptions(n),cM(this.options,r)||He(this,Wb).getMutationCache().notify({type:"observerOptionsUpdated",mutation:He(this,$d),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&A3(r.mutationKey)!==A3(this.options.mutationKey)?this.reset():((s=He(this,$d))==null?void 0:s.state.status)==="pending"&&He(this,$d).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=He(this,$d))==null||n.removeObserver(this)}onMutationUpdate(n){wr(this,Jg,BF).call(this),wr(this,Jg,tJ).call(this,n)}getCurrentResult(){return He(this,qb)}reset(){var n;(n=He(this,$d))==null||n.removeObserver(this),Ht(this,$d,void 0),wr(this,Jg,BF).call(this),wr(this,Jg,tJ).call(this)}mutate(n,r){var s;return Ht(this,mg,r),(s=He(this,$d))==null||s.removeObserver(this),Ht(this,$d,He(this,Wb).getMutationCache().build(He(this,Wb),this.options)),He(this,$d).addObserver(this),He(this,$d).execute(n)}},Wb=new WeakMap,qb=new WeakMap,$d=new WeakMap,mg=new WeakMap,Jg=new WeakSet,BF=function(){var r;const n=((r=He(this,$d))==null?void 0:r.state)??c_e();Ht(this,qb,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},tJ=function(n){Jl.batch(()=>{var r,s,a,o,l,c,u,d;if(He(this,mg)&&this.hasListeners()){const f=He(this,qb).variables,x=He(this,qb).context;(n==null?void 0:n.type)==="success"?((s=(r=He(this,mg)).onSuccess)==null||s.call(r,n.data,f,x),(o=(a=He(this,mg)).onSettled)==null||o.call(a,n.data,null,f,x)):(n==null?void 0:n.type)==="error"&&((c=(l=He(this,mg)).onError)==null||c.call(l,n.error,f,x),(d=(u=He(this,mg)).onSettled)==null||d.call(u,void 0,n.error,f,x))}this.listeners.forEach(f=>{f(He(this,qb))})})},TNe);function _xt(e,t){return Bie(e,t)}function kxt(e){return JSON.stringify(e,(t,n)=>Txt(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):typeof n=="bigint"?n.toString():n)}function Txt(e){if(!yme(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!yme(n)||!n.hasOwnProperty("isPrototypeOf"))}function yme(e){return Object.prototype.toString.call(e)==="[object Object]"}function yB(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:P,_optimisticResults:I,enabled:R,notifyOnChangeProps:O,placeholderData:U,refetchInterval:L,refetchIntervalInBackground:z,refetchOnMount:X,refetchOnReconnect:ne,refetchOnWindowFocus:J,retryOnMount:K,select:re,staleTime:he,suspense:Q,throwOnError:ie,config:oe,connector:G,query:V,...te}=e;return te}function Ixt(e){return{mutationFn(t){return r0t(e,t)},mutationKey:["connect"]}}function Pxt(e){return{mutationFn(t){return f0t(e,t)},mutationKey:["disconnect"]}}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 await m0t(e,{...a,address:r})??null},queryKey:Oxt(t)}}function Oxt(e={}){return["balance",yB(e)]}function Mxt(e,t={}){return{async queryFn({queryKey:n}){const{name:r,scopeKey:s,...a}=n[1];if(!r)throw new Error("name is required");return g0t(e,{...a,name:r})},queryKey:Rxt(t)}}function Rxt(e={}){return["ensAvatar",yB(e)]}function Lxt(e,t={}){return{async queryFn({queryKey:n}){const{address:r,scopeKey:s,...a}=n[1];if(!r)throw new Error("address is required");return b0t(e,{...a,address:r})},queryKey:Dxt(t)}}function Dxt(e={}){return["ensName",yB(e)]}function Bxt(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 XEe(e,{abi:r,functionName:s,args:o.args,...l,...o})},queryKey:$xt(t)}}function $xt(e={}){const{abi:t,...n}=e;return["readContract",yB(n)]}function Uxt(e){return{mutationFn(t){return v0t(e,t)},mutationKey:["signMessage"]}}function zxt(e){return{mutationFn(t){return w0t(e,t)},mutationKey:["signTypedData"]}}function Hxt(e){return{mutationFn(t){return S0t(e,t)},mutationKey:["switchChain"]}}function Vxt(e){return{mutationFn(t){return _0t(e,t)},mutationKey:["writeContract"]}}var d_e=m.createContext(void 0),f_e=e=>{const t=m.useContext(d_e);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Wxt=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),i.jsx(d_e.Provider,{value:e,children:t})),h_e=m.createContext(!1),qxt=()=>m.useContext(h_e);h_e.Provider;function Gxt(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Kxt=m.createContext(Gxt()),Yxt=()=>m.useContext(Kxt);function p_e(e,t){return typeof e=="function"?e(...t):!!e}function nJ(){}var Xxt=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Qxt=e=>{m.useEffect(()=>{e.clearReset()},[e])},Zxt=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||p_e(n,[e.error,r])),Jxt=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)))},egt=(e,t)=>e.isLoading&&e.isFetching&&!t,tgt=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,vme=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ngt(e,t,n){var f,x,g,v,w;const r=f_e(),s=qxt(),a=Yxt(),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",Jxt(o),Xxt(o,a),Qxt(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(Jl.batchCalls(C)):nJ;return c.updateResult(),N},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),m.useEffect(()=>{c.setOptions(o)},[o,c]),tgt(o,u))throw vme(o,c,a);if(Zxt({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&&!N3&&egt(u,s)){const C=l?vme(o,c,a):(w=r.getQueryCache().get(o.queryHash))==null?void 0:w.promise;C==null||C.catch(nJ).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?u:c.trackResult(u)}function m_e(e,t){return ngt(e,Nxt)}function yA(e,t){const n=f_e(),[r]=m.useState(()=>new Ext(n,e));m.useEffect(()=>{r.setOptions(e)},[r,e]);const s=m.useSyncExternalStore(m.useCallback(o=>r.subscribe(Jl.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=m.useCallback((o,l)=>{r.mutate(o,l).catch(nJ)},[r]);if(s.error&&p_e(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}function vB(e){const t=m_e({...e,queryKeyHashFn:kxt});return t.queryKey=e.queryKey,t}function vA(e={}){const t=El(e);return m.useSyncExternalStore(n=>N0t(t,{onChange:n}),()=>eme(t),()=>eme(t))}function x_e(e={}){const{address:t,query:n={}}=e,r=El(e),s=vA({config:r}),a=Fxt(r,{...e,chainId:e.chainId??s}),o=!!(t&&(n.enabled??!0));return vB({...n,...a,enabled:o})}function rgt(e={}){const t=El(e);return m.useSyncExternalStore(n=>nxt(t,{onChange:n}),()=>tme(t),()=>tme(t))}function sgt(e={}){const t=El(e);return m.useSyncExternalStore(n=>j0t(t,{onChange:n}),()=>nme(t),()=>nme(t))}function igt(e={}){const{mutation:t}=e,n=El(e),r=Ixt(n),{mutate:s,mutateAsync:a,...o}=yA({...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:sgt({config:n})}}function agt(e={}){const t=El(e);return m.useSyncExternalStore(n=>A0t(t,{onChange:n}),()=>BZ(t),()=>BZ(t))}function wB(e={}){const{mutation:t}=e,n=El(e),r=Pxt(n),{mutate:s,mutateAsync:a,...o}=yA({...t,...r});return{...o,connectors:agt({config:n}).map(l=>l.connector),disconnect:s,disconnectAsync:a}}function ogt(e={}){const{name:t,query:n={}}=e,r=El(e),s=vA({config:r}),a=Mxt(r,{...e,chainId:e.chainId??s}),o=!!(t&&(n.enabled??!0));return vB({...n,...a,enabled:o})}function lgt(e={}){const{address:t,query:n={}}=e,r=El(e),s=vA({config:r}),a=Lxt(r,{...e,chainId:e.chainId??s}),o=!!(t&&(n.enabled??!0));return vB({...n,...a,enabled:o})}function g_e(e={}){const t=El(e);return e_e.useSyncExternalStoreWithSelector(n=>E0t(t,{onChange:n}),()=>$Z(t,e),()=>$Z(t,e),n=>n,(n,r)=>(n==null?void 0:n.uid)===(r==null?void 0:r.uid))}function wme(e={}){const{abi:t,address:n,functionName:r,query:s={}}=e,a=e.code,o=El(e),l=vA({config:o}),c=Bxt(o,{...e,chainId:e.chainId??l}),u=!!((n||a)&&t&&r&&(s.enabled??!0));return vB({...s,...c,enabled:u,structuralSharing:s.structuralSharing??_xt})}function b_e(e={}){const{mutation:t}=e,n=El(e),r=Uxt(n),{mutate:s,mutateAsync:a,...o}=yA({...t,...r});return{...o,signMessage:s,signMessageAsync:a}}function cgt(e={}){const{mutation:t}=e,n=El(e),r=zxt(n),{mutate:s,mutateAsync:a,...o}=yA({...t,...r});return{...o,signTypedData:s,signTypedDataAsync:a}}function Hie(e={}){const{mutation:t}=e,n=El(e),r=Hxt(n),{mutate:s,mutateAsync:a,...o}=yA({...t,...r});return{...o,chains:rgt({config:n}),switchChain:s,switchChainAsync:a}}function ugt(e={}){const{mutation:t}=e,n=El(e),r=Vxt(n),{mutate:s,mutateAsync:a,...o}=yA({...t,...r});return{...o,writeContract:s,writeContractAsync:a}}const ex=Object.create(null);ex.open="0";ex.close="1";ex.ping="2";ex.pong="3";ex.message="4";ex.upgrade="5";ex.noop="6";const $F=Object.create(null);Object.keys(ex).forEach(e=>{$F[ex[e]]=e});const rJ={type:"error",data:"parser error"},y_e=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",v_e=typeof ArrayBuffer=="function",w_e=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Vie=({type:e,data:t},n,r)=>y_e&&t instanceof Blob?n?r(t):Cme(t,r):v_e&&(t instanceof ArrayBuffer||w_e(t))?n?r(t):Cme(new Blob([t]),r):r(ex[e]+(t||"")),Cme=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function Sme(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let SH;function dgt(e,t){if(y_e&&e.data instanceof Blob)return e.data.arrayBuffer().then(Sme).then(t);if(v_e&&(e.data instanceof ArrayBuffer||w_e(e.data)))return t(Sme(e.data));Vie(e,!1,n=>{SH||(SH=new TextEncoder),t(SH.encode(n))})}const Nme="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fj=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Nme.length;e++)fj[Nme.charCodeAt(e)]=e;const fgt=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=fj[e.charCodeAt(r)],o=fj[e.charCodeAt(r+1)],l=fj[e.charCodeAt(r+2)],c=fj[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},hgt=typeof ArrayBuffer=="function",Wie=(e,t)=>{if(typeof e!="string")return{type:"message",data:C_e(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:pgt(e.substring(1),t)}:$F[n]?e.length>1?{type:$F[n],data:e.substring(1)}:{type:$F[n]}:rJ},pgt=(e,t)=>{if(hgt){const n=fgt(e);return C_e(n,t)}else return{base64:!0,data:e}},C_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}},S_e="",mgt=(e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach((a,o)=>{Vie(a,!1,l=>{r[o]=l,++s===n&&t(r.join(S_e))})})},xgt=(e,t)=>{const n=e.split(S_e),r=[];for(let s=0;s<n.length;s++){const a=Wie(n[s],t);if(r.push(a),a.type==="error")break}return r};function ggt(){return new TransformStream({transform(e,t){dgt(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 NH;function VI(e){return e.reduce((t,n)=>t+n.length,0)}function WI(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 bgt(e,t){NH||(NH=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(VI(n)<1)break;const c=WI(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(VI(n)<2)break;const c=WI(n,2);s=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),r=3}else if(r===2){if(VI(n)<8)break;const c=WI(n,8),u=new DataView(c.buffer,c.byteOffset,c.length),d=u.getUint32(0);if(d>Math.pow(2,21)-1){l.enqueue(rJ);break}s=d*Math.pow(2,32)+u.getUint32(4),r=3}else{if(VI(n)<s)break;const c=WI(n,s);l.enqueue(Wie(a?c:NH.decode(c),t)),r=0}if(s===0||s>e){l.enqueue(rJ);break}}}})}const N_e=4;function $l(e){if(e)return ygt(e)}function ygt(e){for(var t in $l.prototype)e[t]=$l.prototype[t];return e}$l.prototype.on=$l.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};$l.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};$l.prototype.off=$l.prototype.removeListener=$l.prototype.removeAllListeners=$l.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};$l.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};$l.prototype.emitReserved=$l.prototype.emit;$l.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};$l.prototype.hasListeners=function(e){return!!this.listeners(e).length};const CB=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Gh=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),vgt="arraybuffer";function A_e(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const wgt=Gh.setTimeout,Cgt=Gh.clearTimeout;function SB(e,t){t.useNativeTimers?(e.setTimeoutFn=wgt.bind(Gh),e.clearTimeoutFn=Cgt.bind(Gh)):(e.setTimeoutFn=Gh.setTimeout.bind(Gh),e.clearTimeoutFn=Gh.clearTimeout.bind(Gh))}const Sgt=1.33;function Ngt(e){return typeof e=="string"?Agt(e):Math.ceil((e.byteLength||e.size)*Sgt)}function Agt(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 j_e(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function jgt(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function Egt(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 _gt extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}let qie=class extends $l{constructor(t){super(),this.writable=!1,SB(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 _gt(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=Wie(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=jgt(t);return n.length?"?"+n:""}};class kgt extends qie{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)};xgt(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,mgt(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]=j_e()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let E_e=!1;try{E_e=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Tgt=E_e;function Igt(){}class Pgt extends kgt{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 t4=class UF extends $l{constructor(t,n,r){super(),this.createRequest=t,SB(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=A_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=UF.requestsCount++,UF.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=Igt,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete UF.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()}};t4.requestsCount=0;t4.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Ame);else if(typeof addEventListener=="function"){const e="onpagehide"in Gh?"pagehide":"unload";addEventListener(e,Ame,!1)}}function Ame(){for(let e in t4.requests)t4.requests.hasOwnProperty(e)&&t4.requests[e].abort()}const Fgt=function(){const e=__e({xdomain:!1});return e&&e.responseType!==null}();class Ogt extends Pgt{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=Fgt&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new t4(__e,this.uri(),t)}}function __e(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Tgt))return new XMLHttpRequest}catch{}if(!t)try{return new Gh[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const k_e=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Mgt extends qie{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=k_e?{}:A_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;Vie(r,this.supportsBinary,a=>{try{this.doWrite(r,a)}catch{}s&&CB(()=>{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]=j_e()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const AH=Gh.WebSocket||Gh.MozWebSocket;let Rgt=class extends Mgt{createSocket(t,n,r){return k_e?new AH(t,n,r):n?new AH(t,n):new AH(t)}doWrite(t,n){this.ws.send(n)}};class Lgt extends qie{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=bgt(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),s=ggt();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&&CB(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const Dgt={websocket:Rgt,webtransport:Lgt,polling:Ogt},Bgt=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,$gt=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function sJ(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=Bgt.exec(e||""),a={},o=14;for(;o--;)a[$gt[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=Ugt(a,a.path),a.queryKey=zgt(a,a.query),a}function Ugt(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 zgt(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,s,a){s&&(n[s]=a)}),n}const iJ=typeof addEventListener=="function"&&typeof removeEventListener=="function",zF=[];iJ&&addEventListener("offline",()=>{zF.forEach(e=>e())},!1);class Sy extends $l{constructor(t,n){if(super(),this.binaryType=vgt,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=sJ(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=sJ(n.host).host);SB(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=Egt(this.opts.query)),iJ&&(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"})},zF.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=N_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&&Sy.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",Sy.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+=Ngt(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,CB(()=>{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(Sy.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(),iJ&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=zF.indexOf(this._offlineEventListener);r!==-1&&zF.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Sy.protocol=N_e;class Hgt extends Sy{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;Sy.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;Sy.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 Vgt=class extends Hgt{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=>Dgt[s]).filter(s=>!!s)),super(t,r)}};function Wgt(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=sJ(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 qgt=typeof ArrayBuffer=="function",Ggt=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,T_e=Object.prototype.toString,Kgt=typeof Blob=="function"||typeof Blob<"u"&&T_e.call(Blob)==="[object BlobConstructor]",Ygt=typeof File=="function"||typeof File<"u"&&T_e.call(File)==="[object FileConstructor]";function Gie(e){return qgt&&(e instanceof ArrayBuffer||Ggt(e))||Kgt&&e instanceof Blob||Ygt&&e instanceof File}function HF(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(HF(e[n]))return!0;return!1}if(Gie(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return HF(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&HF(e[n]))return!0;return!1}function Xgt(e){const t=[],n=e.data,r=e;return r.data=aJ(n,t),r.attachments=t.length,{packet:r,buffers:t}}function aJ(e,t){if(!e)return e;if(Gie(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]=aJ(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]=aJ(e[r],t));return n}return e}function Qgt(e,t){return e.data=oJ(e.data,t),delete e.attachments,e}function oJ(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]=oJ(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=oJ(e[n],t));return e}const Zgt=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Jgt=5;var ea;(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"})(ea||(ea={}));let e1t=class{constructor(t){this.replacer=t}encode(t){return(t.type===ea.EVENT||t.type===ea.ACK)&&HF(t)?this.encodeAsBinary({type:t.type===ea.EVENT?ea.BINARY_EVENT:ea.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===ea.BINARY_EVENT||t.type===ea.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=Xgt(t),r=this.encodeAsString(n.packet),s=n.buffers;return s.unshift(r),s}};function jme(e){return Object.prototype.toString.call(e)==="[object Object]"}class Kie extends $l{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===ea.BINARY_EVENT;r||n.type===ea.BINARY_ACK?(n.type=r?ea.EVENT:ea.ACK,this.reconstructor=new t1t(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Gie(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(ea[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===ea.BINARY_EVENT||r.type===ea.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(Kie.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 ea.CONNECT:return jme(n);case ea.DISCONNECT:return n===void 0;case ea.CONNECT_ERROR:return typeof n=="string"||jme(n);case ea.EVENT:case ea.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&Zgt.indexOf(n[0])===-1);case ea.ACK:case ea.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class t1t{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=Qgt(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const n1t=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Kie,Encoder:e1t,get PacketType(){return ea},protocol:Jgt},Symbol.toStringTag,{value:"Module"}));function Yp(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const r1t=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class I_e extends $l{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=[Yp(t,"open",this.onopen.bind(this)),Yp(t,"packet",this.onpacket.bind(this)),Yp(t,"error",this.onerror.bind(this)),Yp(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(r1t.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:ea.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:ea.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 ea.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 ea.EVENT:case ea.BINARY_EVENT:this.onevent(t);break;case ea.ACK:case ea.BINARY_ACK:this.onack(t);break;case ea.DISCONNECT:this.ondisconnect();break;case ea.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:ea.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:ea.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 wA(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}wA.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};wA.prototype.reset=function(){this.attempts=0};wA.prototype.setMin=function(e){this.ms=e};wA.prototype.setMax=function(e){this.max=e};wA.prototype.setJitter=function(e){this.jitter=e};class lJ extends $l{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,SB(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 wA({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||n1t;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 Vgt(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const s=Yp(n,"open",function(){r.onopen(),t&&t()}),a=l=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",l),t?t(l):this.maybeReconnectOnOpen()},o=Yp(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(Yp(t,"ping",this.onping.bind(this)),Yp(t,"data",this.ondata.bind(this)),Yp(t,"error",this.onerror.bind(this)),Yp(t,"close",this.onclose.bind(this)),Yp(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){CB(()=>{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 I_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 v7={};function Ny(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=Wgt(e,t.path||"/socket.io"),r=n.source,s=n.id,a=n.path,o=v7[s]&&a in v7[s].nsps,l=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let c;return l?c=new lJ(r,t):(v7[s]||(v7[s]=new lJ(r,t)),c=v7[s]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(Ny,{Manager:lJ,Socket:I_e,io:Ny,connect:Ny});function P_e(e,t){return function(){return e.apply(t,arguments)}}const{toString:s1t}=Object.prototype,{getPrototypeOf:Yie}=Object,NB=(e=>t=>{const n=s1t.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),jm=e=>(e=e.toLowerCase(),t=>NB(t)===e),AB=e=>t=>typeof t===e,{isArray:CA}=Array,iE=AB("undefined");function i1t(e){return e!==null&&!iE(e)&&e.constructor!==null&&!iE(e.constructor)&&qf(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const F_e=jm("ArrayBuffer");function a1t(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&F_e(e.buffer),t}const o1t=AB("string"),qf=AB("function"),O_e=AB("number"),jB=e=>e!==null&&typeof e=="object",l1t=e=>e===!0||e===!1,VF=e=>{if(NB(e)!=="object")return!1;const t=Yie(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},c1t=jm("Date"),u1t=jm("File"),d1t=jm("Blob"),f1t=jm("FileList"),h1t=e=>jB(e)&&qf(e.pipe),p1t=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||qf(e.append)&&((t=NB(e))==="formdata"||t==="object"&&qf(e.toString)&&e.toString()==="[object FormData]"))},m1t=jm("URLSearchParams"),[x1t,g1t,b1t,y1t]=["ReadableStream","Request","Response","Headers"].map(jm),v1t=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Lk(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),CA(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 M_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 qv=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,R_e=e=>!iE(e)&&e!==qv;function cJ(){const{caseless:e}=R_e(this)&&this||{},t={},n=(r,s)=>{const a=e&&M_e(t,s)||s;VF(t[a])&&VF(r)?t[a]=cJ(t[a],r):VF(r)?t[a]=cJ({},r):CA(r)?t[a]=r.slice():t[a]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&Lk(arguments[r],n);return t}const w1t=(e,t,n,{allOwnKeys:r}={})=>(Lk(t,(s,a)=>{n&&qf(s)?e[a]=P_e(s,n):e[a]=s},{allOwnKeys:r}),e),C1t=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),S1t=(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)},N1t=(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&&Yie(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},A1t=(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},j1t=e=>{if(!e)return null;if(CA(e))return e;let t=e.length;if(!O_e(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},E1t=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Yie(Uint8Array)),_1t=(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])}},k1t=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},T1t=jm("HTMLFormElement"),I1t=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Eme=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),P1t=jm("RegExp"),L_e=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Lk(n,(s,a)=>{let o;(o=t(s,a,e))!==!1&&(r[a]=o||s)}),Object.defineProperties(e,r)},F1t=e=>{L_e(e,(t,n)=>{if(qf(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(qf(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+"'")})}})},O1t=(e,t)=>{const n={},r=s=>{s.forEach(a=>{n[a]=!0})};return CA(e)?r(e):r(String(e).split(t)),n},M1t=()=>{},R1t=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,jH="abcdefghijklmnopqrstuvwxyz",_me="0123456789",D_e={DIGIT:_me,ALPHA:jH,ALPHA_DIGIT:jH+jH.toUpperCase()+_me},L1t=(e=16,t=D_e.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function D1t(e){return!!(e&&qf(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const B1t=e=>{const t=new Array(10),n=(r,s)=>{if(jB(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const a=CA(r)?[]:{};return Lk(r,(o,l)=>{const c=n(o,s+1);!iE(c)&&(a[l]=c)}),t[s]=void 0,a}}return r};return n(e,0)},$1t=jm("AsyncFunction"),U1t=e=>e&&(jB(e)||qf(e))&&qf(e.then)&&qf(e.catch),B_e=((e,t)=>e?setImmediate:t?((n,r)=>(qv.addEventListener("message",({source:s,data:a})=>{s===qv&&a===n&&r.length&&r.shift()()},!1),s=>{r.push(s),qv.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",qf(qv.postMessage)),z1t=typeof queueMicrotask<"u"?queueMicrotask.bind(qv):typeof process<"u"&&process.nextTick||B_e,vr={isArray:CA,isArrayBuffer:F_e,isBuffer:i1t,isFormData:p1t,isArrayBufferView:a1t,isString:o1t,isNumber:O_e,isBoolean:l1t,isObject:jB,isPlainObject:VF,isReadableStream:x1t,isRequest:g1t,isResponse:b1t,isHeaders:y1t,isUndefined:iE,isDate:c1t,isFile:u1t,isBlob:d1t,isRegExp:P1t,isFunction:qf,isStream:h1t,isURLSearchParams:m1t,isTypedArray:E1t,isFileList:f1t,forEach:Lk,merge:cJ,extend:w1t,trim:v1t,stripBOM:C1t,inherits:S1t,toFlatObject:N1t,kindOf:NB,kindOfTest:jm,endsWith:A1t,toArray:j1t,forEachEntry:_1t,matchAll:k1t,isHTMLForm:T1t,hasOwnProperty:Eme,hasOwnProp:Eme,reduceDescriptors:L_e,freezeMethods:F1t,toObjectSet:O1t,toCamelCase:I1t,noop:M1t,toFiniteNumber:R1t,findKey:M_e,global:qv,isContextDefined:R_e,ALPHABET:D_e,generateString:L1t,isSpecCompliantForm:D1t,toJSONObject:B1t,isAsyncFn:$1t,isThenable:U1t,setImmediate:B_e,asap:z1t};function ki(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)}vr.inherits(ki,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:vr.toJSONObject(this.config),code:this.code,status:this.status}}});const $_e=ki.prototype,U_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=>{U_e[e]={value:e}});Object.defineProperties(ki,U_e);Object.defineProperty($_e,"isAxiosError",{value:!0});ki.from=(e,t,n,r,s,a)=>{const o=Object.create($_e);return vr.toFlatObject(e,o,function(c){return c!==Error.prototype},l=>l!=="isAxiosError"),ki.call(o,e.message,t,n,r,s),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};const H1t=null;function uJ(e){return vr.isPlainObject(e)||vr.isArray(e)}function z_e(e){return vr.endsWith(e,"[]")?e.slice(0,-2):e}function kme(e,t,n){return e?e.concat(t).map(function(s,a){return s=z_e(s),!n&&a?"["+s+"]":s}).join(n?".":""):t}function V1t(e){return vr.isArray(e)&&!e.some(uJ)}const W1t=vr.toFlatObject(vr,{},null,function(t){return/^is[A-Z]/.test(t)});function EB(e,t,n){if(!vr.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=vr.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,C){return!vr.isUndefined(C[w])});const r=n.metaTokens,s=n.visitor||d,a=n.dots,o=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&vr.isSpecCompliantForm(t);if(!vr.isFunction(s))throw new TypeError("visitor must be a function");function u(v){if(v===null)return"";if(vr.isDate(v))return v.toISOString();if(!c&&vr.isBlob(v))throw new ki("Blob is not supported. Use a Buffer instead.");return vr.isArrayBuffer(v)||vr.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(vr.endsWith(w,"{}"))w=r?w:w.slice(0,-2),v=JSON.stringify(v);else if(vr.isArray(v)&&V1t(v)||(vr.isFileList(v)||vr.endsWith(w,"[]"))&&(N=vr.toArray(v)))return w=z_e(w),N.forEach(function(I,R){!(vr.isUndefined(I)||I===null)&&t.append(o===!0?kme([w],R,a):o===null?w:w+"[]",u(I))}),!1}return uJ(v)?!0:(t.append(kme(C,w,a),u(v)),!1)}const f=[],x=Object.assign(W1t,{defaultVisitor:d,convertValue:u,isVisitable:uJ});function g(v,w){if(!vr.isUndefined(v)){if(f.indexOf(v)!==-1)throw Error("Circular reference detected in "+w.join("."));f.push(v),vr.forEach(v,function(N,P){(!(vr.isUndefined(N)||N===null)&&s.call(t,N,vr.isString(P)?P.trim():P,w,x))===!0&&g(N,w?w.concat(P):[P])}),f.pop()}}if(!vr.isObject(e))throw new TypeError("data must be an object");return g(e),t}function Tme(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Xie(e,t){this._pairs=[],e&&EB(e,this,t)}const H_e=Xie.prototype;H_e.append=function(t,n){this._pairs.push([t,n])};H_e.toString=function(t){const n=t?function(r){return t.call(this,r,Tme)}:Tme;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function q1t(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function V_e(e,t,n){if(!t)return e;const r=n&&n.encode||q1t;vr.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let a;if(s?a=s(t,n):a=vr.isURLSearchParams(t)?t.toString():new Xie(t,n).toString(r),a){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class Ime{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){vr.forEach(this.handlers,function(r){r!==null&&t(r)})}}const W_e={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},G1t=typeof URLSearchParams<"u"?URLSearchParams:Xie,K1t=typeof FormData<"u"?FormData:null,Y1t=typeof Blob<"u"?Blob:null,X1t={isBrowser:!0,classes:{URLSearchParams:G1t,FormData:K1t,Blob:Y1t},protocols:["http","https","file","blob","url","data"]},Qie=typeof window<"u"&&typeof document<"u",dJ=typeof navigator=="object"&&navigator||void 0,Q1t=Qie&&(!dJ||["ReactNative","NativeScript","NS"].indexOf(dJ.product)<0),Z1t=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",J1t=Qie&&window.location.href||"http://localhost",ebt=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Qie,hasStandardBrowserEnv:Q1t,hasStandardBrowserWebWorkerEnv:Z1t,navigator:dJ,origin:J1t},Symbol.toStringTag,{value:"Module"})),Tu={...ebt,...X1t};function tbt(e,t){return EB(e,new Tu.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,a){return Tu.isNode&&vr.isBuffer(n)?(this.append(r,n.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function nbt(e){return vr.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function rbt(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 q_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&&vr.isArray(s)?s.length:o,c?(vr.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!l):((!s[o]||!vr.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],a)&&vr.isArray(s[o])&&(s[o]=rbt(s[o])),!l)}if(vr.isFormData(e)&&vr.isFunction(e.entries)){const n={};return vr.forEachEntry(e,(r,s)=>{t(nbt(r),s,n,0)}),n}return null}function sbt(e,t,n){if(vr.isString(e))try{return(t||JSON.parse)(e),vr.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const Dk={transitional:W_e,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,a=vr.isObject(t);if(a&&vr.isHTMLForm(t)&&(t=new FormData(t)),vr.isFormData(t))return s?JSON.stringify(q_e(t)):t;if(vr.isArrayBuffer(t)||vr.isBuffer(t)||vr.isStream(t)||vr.isFile(t)||vr.isBlob(t)||vr.isReadableStream(t))return t;if(vr.isArrayBufferView(t))return t.buffer;if(vr.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 tbt(t,this.formSerializer).toString();if((l=vr.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return EB(l?{"files[]":t}:t,c&&new c,this.formSerializer)}}return a||s?(n.setContentType("application/json",!1),sbt(t)):t}],transformResponse:[function(t){const n=this.transitional||Dk.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(vr.isResponse(t)||vr.isReadableStream(t))return t;if(t&&vr.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"?ki.from(l,ki.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:Tu.classes.FormData,Blob:Tu.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};vr.forEach(["delete","get","head","post","put","patch"],e=>{Dk.headers[e]={}});const ibt=vr.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"]),abt=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]&&ibt[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Pme=Symbol("internals");function w7(e){return e&&String(e).trim().toLowerCase()}function WF(e){return e===!1||e==null?e:vr.isArray(e)?e.map(WF):String(e)}function obt(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 lbt=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function EH(e,t,n,r,s){if(vr.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!vr.isString(t)){if(vr.isString(r))return t.indexOf(r)!==-1;if(vr.isRegExp(r))return r.test(t)}}function cbt(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function ubt(e,t){const n=vr.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 rf{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function a(l,c,u){const d=w7(c);if(!d)throw new Error("header name must be a non-empty string");const f=vr.findKey(s,d);(!f||s[f]===void 0||u===!0||u===void 0&&s[f]!==!1)&&(s[f||c]=WF(l))}const o=(l,c)=>vr.forEach(l,(u,d)=>a(u,d,c));if(vr.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(vr.isString(t)&&(t=t.trim())&&!lbt(t))o(abt(t),n);else if(vr.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=w7(t),t){const r=vr.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return obt(s);if(vr.isFunction(n))return n.call(this,s,r);if(vr.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=w7(t),t){const r=vr.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||EH(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function a(o){if(o=w7(o),o){const l=vr.findKey(r,o);l&&(!n||EH(r,r[l],l,n))&&(delete r[l],s=!0)}}return vr.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||EH(this,this[a],a,t,!0))&&(delete this[a],s=!0)}return s}normalize(t){const n=this,r={};return vr.forEach(this,(s,a)=>{const o=vr.findKey(r,a);if(o){n[o]=WF(s),delete n[a];return}const l=t?cbt(a):String(a).trim();l!==a&&delete n[a],n[l]=WF(s),r[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return vr.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&vr.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[Pme]=this[Pme]={accessors:{}}).accessors,s=this.prototype;function a(o){const l=w7(o);r[l]||(ubt(s,o),r[l]=!0)}return vr.isArray(t)?t.forEach(a):a(t),this}}rf.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);vr.reduceDescriptors(rf.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});vr.freezeMethods(rf);function _H(e,t){const n=this||Dk,r=t||n,s=rf.from(r.headers);let a=r.data;return vr.forEach(e,function(l){a=l.call(n,a,s.normalize(),t?t.status:void 0)}),s.normalize(),a}function G_e(e){return!!(e&&e.__CANCEL__)}function SA(e,t,n){ki.call(this,e??"canceled",ki.ERR_CANCELED,t,n),this.name="CanceledError"}vr.inherits(SA,ki,{__CANCEL__:!0});function K_e(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ki("Request failed with status code "+n.status,[ki.ERR_BAD_REQUEST,ki.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function dbt(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function fbt(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 hbt(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 dM=(e,t,n=3)=>{let r=0;const s=fbt(50,250);return hbt(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)},Fme=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ome=e=>(...t)=>vr.asap(()=>e(...t)),pbt=Tu.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Tu.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Tu.origin),Tu.navigator&&/(msie|trident)/i.test(Tu.navigator.userAgent)):()=>!0,mbt=Tu.hasStandardBrowserEnv?{write(e,t,n,r,s,a){const o=[e+"="+encodeURIComponent(t)];vr.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),vr.isString(r)&&o.push("path="+r),vr.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 xbt(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function gbt(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Y_e(e,t){return e&&!xbt(t)?gbt(e,t):t}const Mme=e=>e instanceof rf?{...e}:e;function j3(e,t){t=t||{};const n={};function r(u,d,f,x){return vr.isPlainObject(u)&&vr.isPlainObject(d)?vr.merge.call({caseless:x},u,d):vr.isPlainObject(d)?vr.merge({},d):vr.isArray(d)?d.slice():d}function s(u,d,f,x){if(vr.isUndefined(d)){if(!vr.isUndefined(u))return r(void 0,u,f,x)}else return r(u,d,f,x)}function a(u,d){if(!vr.isUndefined(d))return r(void 0,d)}function o(u,d){if(vr.isUndefined(d)){if(!vr.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(Mme(u),Mme(d),f,!0)};return vr.forEach(Object.keys(Object.assign({},e,t)),function(d){const f=c[d]||s,x=f(e[d],t[d],d);vr.isUndefined(x)&&f!==l||(n[d]=x)}),n}const X_e=e=>{const t=j3({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:a,headers:o,auth:l}=t;t.headers=o=rf.from(o),t.url=V_e(Y_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(vr.isFormData(n)){if(Tu.hasStandardBrowserEnv||Tu.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(Tu.hasStandardBrowserEnv&&(r&&vr.isFunction(r)&&(r=r(t)),r||r!==!1&&pbt(t.url))){const u=s&&a&&mbt.read(a);u&&o.set(s,u)}return t},bbt=typeof XMLHttpRequest<"u",ybt=bbt&&function(e){return new Promise(function(n,r){const s=X_e(e);let a=s.data;const o=rf.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 I=rf.from("getAllResponseHeaders"in C&&C.getAllResponseHeaders()),O={data:!l||l==="text"||l==="json"?C.responseText:C.response,status:C.status,statusText:C.statusText,headers:I,config:e,request:C};K_e(function(L){n(L),w()},function(L){r(L),w()},O),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 ki("Request aborted",ki.ECONNABORTED,e,C)),C=null)},C.onerror=function(){r(new ki("Network Error",ki.ERR_NETWORK,e,C)),C=null},C.ontimeout=function(){let R=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const O=s.transitional||W_e;s.timeoutErrorMessage&&(R=s.timeoutErrorMessage),r(new ki(R,O.clarifyTimeoutError?ki.ETIMEDOUT:ki.ECONNABORTED,e,C)),C=null},a===void 0&&o.setContentType(null),"setRequestHeader"in C&&vr.forEach(o.toJSON(),function(R,O){C.setRequestHeader(O,R)}),vr.isUndefined(s.withCredentials)||(C.withCredentials=!!s.withCredentials),l&&l!=="json"&&(C.responseType=s.responseType),u&&([x,v]=dM(u,!0),C.addEventListener("progress",x)),c&&C.upload&&([f,g]=dM(c),C.upload.addEventListener("progress",f),C.upload.addEventListener("loadend",g)),(s.cancelToken||s.signal)&&(d=I=>{C&&(r(!I||I.type?new SA(null,e,C):I),C.abort(),C=null)},s.cancelToken&&s.cancelToken.subscribe(d),s.signal&&(s.signal.aborted?d():s.signal.addEventListener("abort",d)));const P=dbt(s.url);if(P&&Tu.protocols.indexOf(P)===-1){r(new ki("Unsupported protocol "+P+":",ki.ERR_BAD_REQUEST,e));return}C.send(a||null)})},vbt=(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 ki?d:new SA(d instanceof Error?d.message:d))}};let o=t&&setTimeout(()=>{o=null,a(new ki(`timeout ${t} of ms exceeded`,ki.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=()=>vr.asap(l),c}},wbt=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},Cbt=async function*(e,t){for await(const n of Sbt(e))yield*wbt(n,t)},Sbt=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()}},Rme=(e,t,n,r)=>{const s=Cbt(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})},_B=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Q_e=_B&&typeof ReadableStream=="function",Nbt=_B&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Z_e=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Abt=Q_e&&Z_e(()=>{let e=!1;const t=new Request(Tu.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Lme=64*1024,fJ=Q_e&&Z_e(()=>vr.isReadableStream(new Response("").body)),fM={stream:fJ&&(e=>e.body)};_B&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!fM[t]&&(fM[t]=vr.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new ki(`Response type '${t}' is not supported`,ki.ERR_NOT_SUPPORT,r)})})})(new Response);const jbt=async e=>{if(e==null)return 0;if(vr.isBlob(e))return e.size;if(vr.isSpecCompliantForm(e))return(await new Request(Tu.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(vr.isArrayBufferView(e)||vr.isArrayBuffer(e))return e.byteLength;if(vr.isURLSearchParams(e)&&(e=e+""),vr.isString(e))return(await Nbt(e)).byteLength},Ebt=async(e,t)=>{const n=vr.toFiniteNumber(e.getContentLength());return n??jbt(t)},_bt=_B&&(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}=X_e(e);u=u?(u+"").toLowerCase():"text";let g=vbt([s,a&&a.toAbortSignal()],o),v;const w=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let C;try{if(c&&Abt&&n!=="get"&&n!=="head"&&(C=await Ebt(d,r))!==0){let O=new Request(t,{method:"POST",body:r,duplex:"half"}),U;if(vr.isFormData(r)&&(U=O.headers.get("content-type"))&&d.setContentType(U),O.body){const[L,z]=Fme(C,dM(Ome(c)));r=Rme(O.body,Lme,L,z)}}vr.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 P=await fetch(v);const I=fJ&&(u==="stream"||u==="response");if(fJ&&(l||I&&w)){const O={};["status","statusText","headers"].forEach(X=>{O[X]=P[X]});const U=vr.toFiniteNumber(P.headers.get("content-length")),[L,z]=l&&Fme(U,dM(Ome(l),!0))||[];P=new Response(Rme(P.body,Lme,L,()=>{z&&z(),w&&w()}),O)}u=u||"text";let R=await fM[vr.findKey(fM,u)||"text"](P,e);return!I&&w&&w(),await new Promise((O,U)=>{K_e(O,U,{data:R,headers:rf.from(P.headers),status:P.status,statusText:P.statusText,config:e,request:v})})}catch(N){throw w&&w(),N&&N.name==="TypeError"&&/fetch/i.test(N.message)?Object.assign(new ki("Network Error",ki.ERR_NETWORK,e,v),{cause:N.cause||N}):ki.from(N,N&&N.code,e,v)}}),hJ={http:H1t,xhr:ybt,fetch:_bt};vr.forEach(hJ,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Dme=e=>`- ${e}`,kbt=e=>vr.isFunction(e)||e===null||e===!1,J_e={getAdapter:e=>{e=vr.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,!kbt(n)&&(r=hJ[(o=String(n)).toLowerCase()],r===void 0))throw new ki(`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(Dme).join(`
`):" "+Dme(a[0]):"as no adapter specified";throw new ki("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:hJ};function kH(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new SA(null,e)}function Bme(e){return kH(e),e.headers=rf.from(e.headers),e.data=_H.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),J_e.getAdapter(e.adapter||Dk.adapter)(e).then(function(r){return kH(e),r.data=_H.call(e,e.transformResponse,r),r.headers=rf.from(r.headers),r},function(r){return G_e(r)||(kH(e),r&&r.response&&(r.response.data=_H.call(e,e.transformResponse,r.response),r.response.headers=rf.from(r.response.headers))),Promise.reject(r)})}const eke="1.7.9",kB={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{kB[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const $me={};kB.transitional=function(t,n,r){function s(a,o){return"[Axios v"+eke+"] Transitional option '"+a+"'"+o+(r?". "+r:"")}return(a,o,l)=>{if(t===!1)throw new ki(s(o," has been removed"+(n?" in "+n:"")),ki.ERR_DEPRECATED);return n&&!$me[o]&&($me[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}};kB.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Tbt(e,t,n){if(typeof e!="object")throw new ki("options must be an object",ki.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 ki("option "+a+" must be "+c,ki.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ki("Unknown option "+a,ki.ERR_BAD_OPTION)}}const qF={assertOptions:Tbt,validators:kB},Xm=qF.validators;class Kw{constructor(t){this.defaults=t,this.interceptors={request:new Ime,response:new Ime}}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=j3(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:a}=n;r!==void 0&&qF.assertOptions(r,{silentJSONParsing:Xm.transitional(Xm.boolean),forcedJSONParsing:Xm.transitional(Xm.boolean),clarifyTimeoutError:Xm.transitional(Xm.boolean)},!1),s!=null&&(vr.isFunction(s)?n.paramsSerializer={serialize:s}:qF.assertOptions(s,{encode:Xm.function,serialize:Xm.function},!0)),qF.assertOptions(n,{baseUrl:Xm.spelling("baseURL"),withXsrfToken:Xm.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=a&&vr.merge(a.common,a[n.method]);a&&vr.forEach(["delete","get","head","post","put","patch","common"],v=>{delete a[v]}),n.headers=rf.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=[Bme.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=Bme.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=j3(this.defaults,t);const n=Y_e(t.baseURL,t.url);return V_e(n,t.params,t.paramsSerializer)}}vr.forEach(["delete","get","head","options"],function(t){Kw.prototype[t]=function(n,r){return this.request(j3(r||{},{method:t,url:n,data:(r||{}).data}))}});vr.forEach(["post","put","patch"],function(t){function n(r){return function(a,o,l){return this.request(j3(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:o}))}}Kw.prototype[t]=n(),Kw.prototype[t+"Form"]=n(!0)});class Zie{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 SA(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 Zie(function(s){t=s}),cancel:t}}}function Ibt(e){return function(n){return e.apply(null,n)}}function Pbt(e){return vr.isObject(e)&&e.isAxiosError===!0}const pJ={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(pJ).forEach(([e,t])=>{pJ[t]=e});function tke(e){const t=new Kw(e),n=P_e(Kw.prototype.request,t);return vr.extend(n,Kw.prototype,t,{allOwnKeys:!0}),vr.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return tke(j3(e,s))},n}const hs=tke(Dk);hs.Axios=Kw;hs.CanceledError=SA;hs.CancelToken=Zie;hs.isCancel=G_e;hs.VERSION=eke;hs.toFormData=EB;hs.AxiosError=ki;hs.Cancel=hs.CanceledError;hs.all=function(t){return Promise.all(t)};hs.spread=Ibt;hs.isAxiosError=Pbt;hs.mergeConfig=j3;hs.AxiosHeaders=rf;hs.formToJSON=e=>q_e(vr.isHTMLForm(e)?new FormData(e):e);hs.getAdapter=J_e.getAdapter;hs.HttpStatusCode=pJ;hs.default=hs;var zy="https://dextrabothypev2.nftinit.io/";async function Fbt(e,t){if(t==1||t==null)return fetch(zy+"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(zy+"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 Obt(e,t,n,r){if(r==1||r==null)return fetch(zy+"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(zy+"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 _i(e,t){if(e)return await fetch(zy+"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 Mbt(e,t){if(e)return await fetch(zy+"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 Rbt(e,t){if(e)return await fetch(zy+"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 Lbt(e,t){if(e)return await fetch(zy+"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 Dbt(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 TH=null;function Bbt(e){TH&&clearInterval(TH),TH=setInterval(async()=>{const t=localStorage.getItem("hyperTradeTokenExp"),n=Date.now()/1e3;(!t||t-n<600)&&await Dbt(e)&&(localStorage.setItem("hyperTradeTokenExp",n+259200),console.log("Trade token refreshed"))},5*60*1e3)}const $bt=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)},Qr=m.createContext(),Ubt=({children:e})=>{const t=oc(),{isConnected:n,address:r}=ts(),{signMessageAsync:s}=b_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,P]=m.useState(!1),[I,R]=m.useState(0),[O,U]=m.useState(window.localStorage.getItem("hyperToken")),[L,z]=m.useState(window.localStorage.getItem("hyperAddress")),[X,ne]=m.useState(!1),[J,K]=m.useState(!1),[re,he]=m.useState(!1),[Q,ie]=m.useState(null),[oe,G]=m.useState(!1),[V,te]=m.useState(null),[ae,fe]=m.useState(null),[Ne,me]=m.useState([]),[we,xe]=m.useState([]),[ye,je]=m.useState([]),[Pe,Re]=m.useState(""),[Xe,Ke]=m.useState({activeRange:"",day:0,week:0,month:0}),[ut,et]=m.useState([]),tt=m.useCallback(async()=>{const Xt=window.localStorage.getItem("hyperToken"),on=window.localStorage.getItem("hyperAddress");if(!Xt||!on){et([]);return}try{const Zt=await _i(on.toLowerCase(),Xt);Zt!=null&&Zt.success&&et((Zt==null?void 0:Zt.bot_slots_info)||[])}catch{}},[]);async function Le(){var Ye,Ze;const Xt=window.localStorage.getItem("hyperToken"),on=window.localStorage.getItem("hyperAddress"),Zt=Jlt(Xt);if(Xt&&Zt!==!1){const Ft=await _i(on,Xt);Ft.success?(et((Ft==null?void 0:Ft.bot_slots_info)||[]),c(Ft.telegram_chat_id),o(Ft.subscriber_role),d((Ye=Ft==null?void 0:Ft.mushboomer_counts)==null?void 0:Ye.eth),x((Ze=Ft==null?void 0:Ft.mushboomer_counts)==null?void 0:Ze.sol),v(Ft==null?void 0:Ft.referral_code),C(Ft==null?void 0:Ft.refcode),P(Ft==null?void 0:Ft.whitelist),R(Ft==null?void 0:Ft.subs_expire_day),U(localStorage.getItem("hyperToken")),z(localStorage.getItem("hyperAddress")),cn(),Kt()):et([])}else $e(1)}async function $e(Xt){try{if(!r)throw new Error("No accounts found. Please connect your wallet.");const on=await Fbt(r,Xt);if(!on.success)return{success:!1,message:on.error_message};const Zt=on.temp_password,Ye=`dextrabot.io verification code : ${Zt}`,Ze=await s({message:Ye}),Ft=await Obt(on.address,Zt,Ze,Xt);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 dn=Date.now()/1e3;window.localStorage.setItem("hyperTradeTokenExp",dn+(Ft.expires_in||259200)),Bbt(Ft.address)}return Le(),window.dispatchEvent(new Event("localStorageUpdated")),{success:!0,initToken:Ft.token}}else throw new Error("Failed to complete the signing process.")}catch(on){return console.error("Error during sign-in:",on),{success:!1,message:on.message||"An unknown error occurred."}}}const[ht,pt]=m.useState([]);async function Kt(){const Xt=window.localStorage.getItem("hyperToken"),on=window.localStorage.getItem("hyperAddress");try{he(!0);const Zt=await Rbt(r||on,Xt);if(!Zt.success){Zt.error_message!="User not verified"&&tn.error(Zt.error_message),Zt.error_message=="User not verified";return}Zt.success?pt(Zt==null?void 0:Zt.data):pt([])}catch(Zt){Zt.name!=="AbortError"&&(ie(Zt.message),tn.error(Zt.message)),pt([])}finally{he(!1)}}const[wt,nn]=m.useState([]);async function cn(){const Xt=window.localStorage.getItem("hyperToken"),on=window.localStorage.getItem("hyperAddress");try{G(!0);const Zt=await Lbt(r||on,Xt);if(!Zt.success){Zt.error_message!="User not verified"&&tn.error(Zt.error_message),Zt.error_message=="User not verified";return}Zt.success?nn(Zt==null?void 0:Zt.data):nn([])}catch(Zt){Zt.name!=="AbortError"&&(te(Zt.message),tn.error(Zt.message)),nn([])}finally{G(!1)}}m.useEffect(()=>{window.localStorage.getItem("hyperToken")==null&&t.pathname!="/tracked-wallets"&&J&&ne(!0)},[n]),m.useEffect(()=>{!n&&!O||(t.pathname=="/wallet-management"||t.pathname.includes("referral")||t.pathname=="/leaderboard")&&O!=null&&O&&Kt()},[O]),m.useRef(!1),m.useEffect(()=>{if(t.pathname==="/"||t.pathname==="/sitemap"||t.pathname==="/videos"||!window.localStorage.getItem("hyperToken"))return;const Zt=`notificationsFeedSocket_${r==null?void 0:r.toLowerCase()}`,Ye=localStorage.getItem(Zt);me(Ye?JSON.parse(Ye):[]);const Ze=Ny("https://dextrabothypesocketv2.nftinit.io/");return fe(Ze),Ze.on("connect",()=>{console.log("Socket connected")}),Ze.on("disconnect",()=>{console.log("Socket disconnected")}),Ze.on("hyper_get_trade_message",async Ft=>{const dn=(Array.isArray(Ft)?Ft:[Ft]).map(ot=>({...ot,is_read:!1,trader_pnl:null}));me(ot=>{const De=new Set(ot.map(nt=>nt==null?void 0:nt.oid)),ze=[...dn==null?void 0:dn.filter(nt=>!(De!=null&&De.has(nt==null?void 0:nt.oid))),...ot].slice(0,100);return localStorage.setItem(Zt,JSON.stringify(ze)),ze});const Yt=window.localStorage.getItem("hyperToken");if(!r||!Yt){console.log("User logged out before timeout - skipping PNL fetch.");return}const Bt=dn.map(ot=>ot==null?void 0:ot.trader_wallet).filter(Boolean)[0];try{const ot=await hs.post("https://api-ui.hyperliquid.xyz/info",{aggregateByTime:!0,type:"userFills",user:Bt});if(ot.data){const De=$bt(ot.data),_t=new Map(De==null?void 0:De.map(ze=>[ze==null?void 0:ze.oid,ze==null?void 0:ze.pnl]));me(ze=>{const nt=ze==null?void 0:ze.map(mt=>_t!=null&&_t.has(mt==null?void 0:mt.trader_oid)?{...mt,trader_pnl:_t==null?void 0:_t.get(mt==null?void 0:mt.trader_oid)}:mt);return localStorage.setItem(Zt,JSON.stringify(nt)),nt})}else console.log("Unexpected API response")}catch(ot){console.error("PNL API error:",ot)}}),()=>{Ze.disconnect()}},[O]),m.useEffect(()=>{if(!ae||!r||!ht||ht.length===0)return;ht.map(on=>on.wallet_address);const Xt=window.localStorage.getItem("hyperToken");return ae.emit("subscribe",{login:r==null?void 0:r.toLowerCase(),token:Xt}),()=>{}},[ae,r,ht]);const zn=async()=>{try{const Xt=window.localStorage.getItem("hyperToken"),on="https://dextrabothypev2.nftinit.io/api/subscriber/announcement/getannouncements/";let Zt={};r&&Xt&&(Zt={address:r.toLowerCase(),token:Xt});const Ye=await fetch(on,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(Zt)});if(!Ye.ok)throw new Error(`Server responded with status ${Ye.status}`);const Ze=await Ye.json();Ze.success?xe(Ze):console.log(Ze.error_message)}catch(Xt){console.error("Error in handleAnnouncement:",Xt)}};return m.useEffect(()=>{zn();const Xt=setInterval(()=>{zn()},6e4);return()=>clearInterval(Xt)},[n,O]),m.useEffect(()=>{(async()=>{try{const Ye=(await(await fetch("https://dextradata.nftinit.io/api/hyper/terminal_coins/v2/")).json()).coins;je(Ye)}catch(on){console.error("Data retrieval error:",on),Re(on.message)}})()},[]),i.jsx(Qr.Provider,{value:{subscriberRole:a,setSubscriberRole:o,subsExpireDay:I,setSubsExpireDay:R,hyperToken:O,setHyperToken:U,hyperAddress:L,setHyperAddress:z,signModalOpen:X,setSignModalOpen:ne,walletLogin:Le,signIn:$e,copyTradeWatchList:ht,setCopyTradeWatchList:pt,trackedWatchList:wt,setTrackedWatchList:nn,getCopyTradeWatchList:Kt,getTrackedWatchList:cn,copyWatchListLoading:re,setCopyWatchListLoading:he,trackedWatchListLoading:oe,setTrackedWatchListLoading:G,copyWatchListError:Q,setCopyWatchListError:ie,trackedWatchListError:V,setTrackedWatchListError:te,signInConnectButtonOpen:J,setSignInConnectButtonOpen:K,telegramChatId:l,setTelegramChatId:c,mushboomerETH:u,setMushboomerETH:d,isWhitelist:N,setIsWhitelist:P,mushboomerSOL:f,setMushboomerSOL:x,isReferralCode:g,setIsReferralCode:v,isReferralCodeName:w,setIsReferralCodeName:C,latestPnL:Xe,setLatestPnL:Ke,notificationData:Ne,setNotificationData:me,announcementData:we,setAnnouncementData:xe,handleAnnouncement:zn,searchTerminalCoin:ye,setSearchTerminalCoin:je,isSearchTerminalError:Pe,setIsSearchTerminalError:Re,botSlotsInfo:ut,setBotSlotsInfo:et,refreshBotSlots:tt},children:e})},zbt="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",Ki="/assets/dextrabotIcon-B5aLRkPC.png",Hbt="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",Vbt="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",Wa="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",$a="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",Co="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",Wbt="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",S1="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",nke="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",qbt="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",Gbt="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",ac="/assets/noDataNewIcon-D33nv6-9.svg",NA="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",o5="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",Kbt="/assets/referralBgIcon-C-Csekzm.svg",l5="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",bm="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",hM="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",Ybt="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",Xbt="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",Qbt="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",Zbt="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",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='%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",mM="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",AA="/assets/sharePnlGreenIcon-CwGFUwvO.svg",jA="/assets/sharePnlRedIcon-NsgQBTQF.svg",EA="/assets/dextrabotShareIcon-DbUzC8hq.png",Jbt="/assets/buttonHyperrIcon-BEIlirim.png",Ume="/assets/mushroomRed-DlifwotO.svg",zme="/assets/mushroomBlue-DU8qWKKQ.svg",Xc="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",eyt="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",tyt="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",ec="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",Jie="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",nyt="/assets/copyTradeBanner-Bzh6f0rX.svg",ryt="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",Hme="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",eae="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",syt="/assets/introductionModalIcon-C3qCLVbZ.svg",iyt="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",ayt="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",oyt="/assets/dextrabot-copy-trade-hyperliquid-BgdeQSj5.png",lyt="/assets/dextrabot-position-copy-Ph5ntD17.png",cyt="/assets/dextrabot-referral-rewards-CvRzGBKC.png",uyt="/assets/hyperliquid-discover-wallets-CgeXGTl5.svg",dyt="/assets/dextrabot-telegram-alerts-CJHcZn29.png",fyt="/assets/hyperliquid-wallet-analysis-DwEnicpm.png",hyt="/assets/dextrabot-discover-wallets-filters-BSnYa19g.svg",pyt="/assets/hyperliquid-trading-metrics-Cwsy4rqz.svg",myt="/assets/dextrabot-risk-parameters-DzTb7mB0.svg",xyt="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",IH="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",gyt="/assets/dextrabotNewLogoIcon-V6eDxoac.png",tae="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",byt="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",yyt="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",vyt="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",wyt="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",rke="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",Cyt="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",ske="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",Syt="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",Nyt="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",Ayt="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",jyt="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",ike="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=",Eyt="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",_yt="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",kyt="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",Vme="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",mJ="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",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='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",Tyt="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",Iyt="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",_A="/assets/dextrabotIcon64x64-CGBWeHNW.png",Pyt="/assets/telegramfilterIcon-D3R-nSo1.svg",Fyt="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",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%200L0%208L9%208L4.5%200Z'%20fill='%233DB380'/%3e%3c/svg%3e",oE="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",_0="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",Oyt="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",Myt="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",Ryt="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",Lyt="/assets/telegramModalIcon-CwWiyADO.png",ake="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",oke="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",Wme="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",lke="/assets/basedLogoSvgIcon-C71QETXb.png",cke="/assets/variationalIcon-VFI-7A--.png",uke="/assets/apexIcon-pUC7_jPm.png",dke="/assets/paradexIcon-gNYlng5D.jpg",Dyt="/assets/basedAppIcon-xn9d9rQz.jpg",Byt="/assets/pacificaErrorImage-BKGQKjSV.jpeg";function $yt({open:e,setOpen:t,setGenModalOpen:n,setGenWalletSuccess:r,setGenWalletData:s,setShowPrivateKey:a}){return i.jsx(i.Fragment,{children:i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-[9999999999] font-manrope",children:[i.jsx(ja,{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(ga,{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:$a})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Ki,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),tn.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 Uyt=()=>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"})]}),Ba=Ae.memo(Uyt),zyt=({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(Qr),{address:w}=ts(),C=async()=>{const P=window.localStorage.getItem("hyperToken");if(!P){v(!0);return}if(!s){d("Please enter a name.");return}f(!0),d("");const I=window.localStorage.getItem("hyperAddress");try{const O=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:P,wallet_name:s})})).json();O.success?(c(O==null?void 0:O.wallet),u(!0),a(""),x(),g(1)):(console.log("An error has occurred. Please try again."),d(O==null?void 0:O.error_message))}catch(R){console.error("An error has occurred:",R.message),d(R==null?void 0:R.message)}finally{f(!1)}},N=()=>{l(P=>!P)};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(Ba,{})}):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:P=>{P.stopPropagation(),navigator.clipboard.writeText(n==null?void 0:n.address),tn.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:Co,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:P=>{P.stopPropagation(),navigator.clipboard.writeText(n==null?void 0:n.private_key),tn.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:Co,alt:"",className:"cursor-pointer"}),i.jsx("span",{onClick:()=>{N()},className:"p-1 rounded cursor-pointer",children:r?i.jsx(Eet,{className:"w-4 h-4"}):i.jsx(Aet,{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:P=>a(P.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:ec,alt:"Dextrabot"}),i.jsx("p",{className:"text-[#ff7171] text-[13px] font-normal font-['Inter'] leading-4",children:o})]})]})})},Hyt=({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(Qr),{address:w}=ts(),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 P=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():P,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(I){console.error("An error has occurred:",I.message),a(I==null?void 0:I.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(Ba,{})}):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})]})})},fke="6.15.0";function Vyt(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 Nu(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 Bs(e,t,n){for(let r in t){let s=t[r];const a=n?n[r]:null;a&&Vyt(s,a,r),Object.defineProperty(e,r,{enumerable:!0,value:s,writable:!1})}}function MC(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=>MC(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 MC(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=>`${MC(r,t)}: ${MC(e[r],t)}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Jc(e,t){return e&&e.code===t}function nae(e){return Jc(e,"CALL_EXCEPTION")}function ko(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: ${MC(n)}`);for(const o in n){if(o==="shortMessage")continue;const l=n[o];a.push(o+"="+MC(l))}}a.push(`code=${t}`),a.push(`version=${fke}`),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 Bs(s,{code:t}),n&&Object.assign(s,n),s.shortMessage==null&&Bs(s,{shortMessage:r}),s}function Rr(e,t,n,r){if(!e)throw ko(t,n,r)}function bn(e,t,n,r){Rr(e,t,"INVALID_ARGUMENT",{argument:n,value:r})}function hke(e,t,n){n==null&&(n=""),n&&(n=": "+n),Rr(e>=t,"missing argument"+n,"MISSING_ARGUMENT",{count:e,expectedCount:t}),Rr(e<=t,"too many arguments"+n,"UNEXPECTED_ARGUMENT",{count:e,expectedCount:t})}const Wyt=["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 pke(e){Rr(Wyt.indexOf(e)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:e}})}function c5(e,t,n){if(n==null&&(n=""),e!==t){let r=n,s="new";n&&(r+=".",s+=" "+n),Rr(!1,`private constructor; use ${r}from* methods`,"UNSUPPORTED_OPERATION",{operation:s})}}function mke(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}bn(!1,"invalid BytesLike value",t||"value",e)}function ps(e,t){return mke(e,t,!1)}function eu(e,t){return mke(e,t,!0)}function uo(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 TB(e){return uo(e,!0)||e instanceof Uint8Array}const qme="0123456789abcdef";function Gr(e){const t=ps(e);let n="0x";for(let r=0;r<t.length;r++){const s=t[r];n+=qme[(s&240)>>4]+qme[s&15]}return n}function La(e){return"0x"+e.map(t=>Gr(t).substring(2)).join("")}function n4(e){return uo(e,!0)?(e.length-2)/2:ps(e).length}function bo(e,t,n){const r=ps(e);return n!=null&&n>r.length&&Rr(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:n}),Gr(r.slice(t??0,n??r.length))}function xke(e,t,n){const r=ps(e);Rr(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),Gr(s)}function i1(e,t){return xke(e,t,!0)}function qyt(e,t){return xke(e,t,!1)}const IB=BigInt(0),sm=BigInt(1),gJ=9007199254740991;function Gyt(e,t){const n=PB(e,"value"),r=BigInt(Bi(t,"width"));if(Rr(n>>r===IB,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:e}),n>>r-sm){const s=(sm<<r)-sm;return-((~n&s)+sm)}return n}function gke(e,t){let n=js(e,"value");const r=BigInt(Bi(t,"width")),s=sm<<r-sm;if(n<IB){n=-n,Rr(n<=s,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:e});const a=(sm<<r)-sm;return(~n&a)+sm}else Rr(n<s,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:e});return n}function hj(e,t){const n=PB(e,"value"),r=BigInt(Bi(t,"bits"));return n&(sm<<r)-sm}function js(e,t){switch(typeof e){case"bigint":return e;case"number":return bn(Number.isInteger(e),"underflow",t||"value",e),bn(e>=-9007199254740991&&e<=gJ,"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){bn(!1,`invalid BigNumberish string: ${n.message}`,t||"value",e)}}bn(!1,"invalid BigNumberish value",t||"value",e)}function PB(e,t){const n=js(e,t);return Rr(n>=IB,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:e}),n}const Gme="0123456789abcdef";function FB(e){if(e instanceof Uint8Array){let t="0x0";for(const n of e)t+=Gme[n>>4],t+=Gme[n&15];return BigInt(t)}return js(e)}function Bi(e,t){switch(typeof e){case"bigint":return bn(e>=-9007199254740991&&e<=gJ,"overflow",t||"value",e),Number(e);case"number":return bn(Number.isInteger(e),"underflow",t||"value",e),bn(e>=-9007199254740991&&e<=gJ,"overflow",t||"value",e),e;case"string":try{if(e==="")throw new Error("empty string");return Bi(BigInt(e),t)}catch(n){bn(!1,`invalid numeric string: ${n.message}`,t||"value",e)}}bn(!1,"invalid numeric value",t||"value",e)}function Kyt(e){return Bi(FB(e))}function a1(e,t){let r=PB(e,"value").toString(16);if(t==null)r.length%2&&(r="0"+r);else{const s=Bi(t,"width");for(Rr(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 ol(e){const t=PB(e,"value");if(t===IB)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 tm(e){let t=Gr(TB(e)?e:ol(e)).substring(2);for(;t.startsWith("0");)t=t.substring(1);return t===""&&(t="0"),"0x"+t}const xM="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";let qI=null;function Yyt(e){if(qI==null){qI={};for(let n=0;n<xM.length;n++)qI[xM[n]]=BigInt(n)}const t=qI[e];return bn(t!=null,"invalid base58 value","letter",e),t}const Xyt=BigInt(0),bJ=BigInt(58);function bke(e){const t=ps(e);let n=FB(t),r="";for(;n;)r=xM[Number(n%bJ)]+r,n/=bJ;for(let s=0;s<t.length&&!t[s];s++)r=xM[0]+r;return r}function Qyt(e){let t=Xyt;for(let n=0;n<e.length;n++)t*=bJ,t+=Yyt(e[n]);return t}function Zyt(e){e=atob(e);const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return ps(t)}function Jyt(e){const t=ps(e);let n="";for(let r=0;r<t.length;r++)n+=String.fromCharCode(t[r]);return btoa(n)}var F4;class yke{constructor(t,n,r){Dn(this,"filter");Dn(this,"emitter");On(this,F4);Ht(this,F4,n),Bs(this,{emitter:t,filter:r})}async removeListener(){He(this,F4)!=null&&await this.emitter.off(this.filter,He(this,F4))}}F4=new WeakMap;function e2t(e,t,n,r,s){bn(!1,`invalid codepoint at offset ${t}; ${e}`,"bytes",n)}function vke(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 t2t(e,t,n,r,s){return e==="OVERLONG"?(bn(typeof s=="number","invalid bad code point for replacement","badCodepoint",s),r.push(s),0):(r.push(65533),vke(e,t,n))}const n2t=Object.freeze({error:e2t,ignore:vke,replace:t2t});function r2t(e,t){t==null&&(t=n2t.error);const n=ps(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 fd(e,t){bn(typeof e=="string","invalid string value","str",e),t!=null&&(pke(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);bn(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 s2t(e){return e.map(t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10&1023)+55296,(t&1023)+56320))).join("")}function gM(e,t){return s2t(r2t(e,t))}function wke(e){async function t(n,r){Rr(r==null||!r.cancelled,"request cancelled before sending","CANCELLED");const s=n.url.split(":")[0].toLowerCase();Rr(s==="http"||s==="https",`unsupported protocol ${s}`,"UNSUPPORTED_OPERATION",{info:{protocol:s},operation:"request"}),Rr(s==="https"||!n.credentials||n.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let a=null;const o=new AbortController,l=setTimeout(()=>{a=ko("request timeout","TIMEOUT"),o.abort()},n.timeout);r&&r.addListener(()=>{a=ko("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 i2t=12,a2t=250;let Kme=wke();const o2t=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),l2t=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let PH=!1;async function Cke(e,t){try{const n=e.match(o2t);if(!n)throw new Error("invalid data");return new Ay(200,"OK",{"content-type":n[1]||"text/plain"},n[2]?Zyt(n[3]):u2t(n[3]))}catch{return new Ay(599,"BAD REQUEST (invalid data: URI)",{},null,new Hy(e))}}function Ske(e){async function t(n,r){try{const s=n.match(l2t);if(!s)throw new Error("invalid link");return new Hy(`${e}${s[2]}`)}catch{return new Ay(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Hy(n))}}return t}const GI={data:Cke,ipfs:Ske("https://gateway.ipfs.io/ipfs/")},Nke=new WeakMap;var yw,Gb;class c2t{constructor(t){On(this,yw);On(this,Gb);Ht(this,yw,[]),Ht(this,Gb,!1),Nke.set(t,()=>{if(!He(this,Gb)){Ht(this,Gb,!0);for(const n of He(this,yw))setTimeout(()=>{n()},0);Ht(this,yw,[])}})}addListener(t){Rr(!He(this,Gb),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),He(this,yw).push(t)}get cancelled(){return He(this,Gb)}checkSignal(){Rr(!this.cancelled,"cancelled","CANCELLED",{})}}yw=new WeakMap,Gb=new WeakMap;function KI(e){if(e==null)throw new Error("missing signal; should not happen");return e.checkSignal(),e}var O4,M4,Vp,xg,R4,L4,Cc,Ff,gg,vw,ww,Cw,l0,Wp,Kb,Sw,pj;const uD=class uD{constructor(t){On(this,Sw);On(this,O4);On(this,M4);On(this,Vp);On(this,xg);On(this,R4);On(this,L4);On(this,Cc);On(this,Ff);On(this,gg);On(this,vw);On(this,ww);On(this,Cw);On(this,l0);On(this,Wp);On(this,Kb);Ht(this,L4,String(t)),Ht(this,O4,!1),Ht(this,M4,!0),Ht(this,Vp,{}),Ht(this,xg,""),Ht(this,R4,3e5),Ht(this,Wp,{slotInterval:a2t,maxAttempts:i2t}),Ht(this,Kb,null)}get url(){return He(this,L4)}set url(t){Ht(this,L4,String(t))}get body(){return He(this,Cc)==null?null:new Uint8Array(He(this,Cc))}set body(t){if(t==null)Ht(this,Cc,void 0),Ht(this,Ff,void 0);else if(typeof t=="string")Ht(this,Cc,fd(t)),Ht(this,Ff,"text/plain");else if(t instanceof Uint8Array)Ht(this,Cc,t),Ht(this,Ff,"application/octet-stream");else if(typeof t=="object")Ht(this,Cc,fd(JSON.stringify(t))),Ht(this,Ff,"application/json");else throw new Error("invalid body")}hasBody(){return He(this,Cc)!=null}get method(){return He(this,xg)?He(this,xg):this.hasBody()?"POST":"GET"}set method(t){t==null&&(t=""),Ht(this,xg,String(t).toUpperCase())}get headers(){const t=Object.assign({},He(this,Vp));return He(this,gg)&&(t.authorization=`Basic ${Jyt(fd(He(this,gg)))}`),this.allowGzip&&(t["accept-encoding"]="gzip"),t["content-type"]==null&&He(this,Ff)&&(t["content-type"]=He(this,Ff)),this.body&&(t["content-length"]=String(this.body.length)),t}getHeader(t){return this.headers[t.toLowerCase()]}setHeader(t,n){He(this,Vp)[String(t).toLowerCase()]=String(n)}clearHeaders(){Ht(this,Vp,{})}[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 He(this,gg)||null}setCredentials(t,n){bn(!t.match(/:/),"invalid basic authentication username","username","[REDACTED]"),Ht(this,gg,`${t}:${n}`)}get allowGzip(){return He(this,M4)}set allowGzip(t){Ht(this,M4,!!t)}get allowInsecureAuthentication(){return!!He(this,O4)}set allowInsecureAuthentication(t){Ht(this,O4,!!t)}get timeout(){return He(this,R4)}set timeout(t){bn(t>=0,"timeout must be non-zero","timeout",t),Ht(this,R4,t)}get preflightFunc(){return He(this,vw)||null}set preflightFunc(t){Ht(this,vw,t)}get processFunc(){return He(this,ww)||null}set processFunc(t){Ht(this,ww,t)}get retryFunc(){return He(this,Cw)||null}set retryFunc(t){Ht(this,Cw,t)}get getUrlFunc(){return He(this,Kb)||Kme}set getUrlFunc(t){Ht(this,Kb,t)}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${He(this,Cc)?Gr(He(this,Cc)):"null"}>`}setThrottleParams(t){t.slotInterval!=null&&(He(this,Wp).slotInterval=t.slotInterval),t.maxAttempts!=null&&(He(this,Wp).maxAttempts=t.maxAttempts)}send(){return Rr(He(this,l0)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),Ht(this,l0,new c2t(this)),wr(this,Sw,pj).call(this,0,Yme()+this.timeout,0,this,new Ay(0,"",{},null,this))}cancel(){Rr(He(this,l0)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const t=Nke.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();Rr(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 uD(t);return s.method="GET",s.allowGzip=this.allowGzip,s.timeout=this.timeout,Ht(s,Vp,Object.assign({},He(this,Vp))),He(this,Cc)&&Ht(s,Cc,new Uint8Array(He(this,Cc))),Ht(s,Ff,He(this,Ff)),s}clone(){const t=new uD(this.url);return Ht(t,xg,He(this,xg)),He(this,Cc)&&Ht(t,Cc,He(this,Cc)),Ht(t,Ff,He(this,Ff)),Ht(t,Vp,Object.assign({},He(this,Vp))),Ht(t,gg,He(this,gg)),this.allowGzip&&(t.allowGzip=!0),t.timeout=this.timeout,this.allowInsecureAuthentication&&(t.allowInsecureAuthentication=!0),Ht(t,vw,He(this,vw)),Ht(t,ww,He(this,ww)),Ht(t,Cw,He(this,Cw)),Ht(t,Wp,Object.assign({},He(this,Wp))),Ht(t,Kb,He(this,Kb)),t}static lockConfig(){PH=!0}static getGateway(t){return GI[t.toLowerCase()]||null}static registerGateway(t,n){if(t=t.toLowerCase(),t==="http"||t==="https")throw new Error(`cannot intercept ${t}; use registerGetUrl`);if(PH)throw new Error("gateways locked");GI[t]=n}static registerGetUrl(t){if(PH)throw new Error("gateways locked");Kme=t}static createGetUrlFunc(t){return wke(t)}static createDataGateway(){return Cke}static createIpfsGatewayFunc(t){return Ske(t)}};O4=new WeakMap,M4=new WeakMap,Vp=new WeakMap,xg=new WeakMap,R4=new WeakMap,L4=new WeakMap,Cc=new WeakMap,Ff=new WeakMap,gg=new WeakMap,vw=new WeakMap,ww=new WeakMap,Cw=new WeakMap,l0=new WeakMap,Wp=new WeakMap,Kb=new WeakMap,Sw=new WeakSet,pj=async function(t,n,r,s,a){var d,f,x;if(t>=He(this,Wp).maxAttempts)return a.makeServerError("exceeded maximum retry limit");Rr(Yme()<=n,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:s}),r>0&&await d2t(r);let o=this.clone();const l=(o.url.split(":")[0]||"").toLowerCase();if(l in GI){const g=await GI[l](o.url,KI(He(s,l0)));if(g instanceof Ay){let v=g;if(this.processFunc){KI(He(s,l0));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,KI(He(s,l0)));let u=new Ay(c.statusCode,c.statusMessage,c.headers,c.body,s);if(u.statusCode===301||u.statusCode===302){try{const g=u.headers.location||"";return wr(d=o.redirect(g),Sw,pj).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=He(this,Wp).slotInterval*Math.trunc(Math.random()*Math.pow(2,t));return typeof g=="string"&&g.match(/^[1-9][0-9]*$/)&&(v=parseInt(g)),wr(f=o.clone(),Sw,pj).call(f,t+1,n,v,s,u)}if(this.processFunc){KI(He(s,l0));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=He(this,Wp).slotInterval*Math.trunc(Math.random()*Math.pow(2,t));return g.stall>=0&&(v=g.stall),wr(x=o.clone(),Sw,pj).call(x,t+1,n,v,s,u)}}return u};let Hy=uD;var Z_,J_,ek,Of,D4,Nw;const Hue=class Hue{constructor(t,n,r,s,a){On(this,Z_);On(this,J_);On(this,ek);On(this,Of);On(this,D4);On(this,Nw);Ht(this,Z_,t),Ht(this,J_,n),Ht(this,ek,Object.keys(r).reduce((o,l)=>(o[l.toLowerCase()]=String(r[l]),o),{})),Ht(this,Of,s==null?null:new Uint8Array(s)),Ht(this,D4,a||null),Ht(this,Nw,{message:""})}toString(){return`<FetchResponse status=${this.statusCode} body=${He(this,Of)?Gr(He(this,Of)):"null"}>`}get statusCode(){return He(this,Z_)}get statusMessage(){return He(this,J_)}get headers(){return Object.assign({},He(this,ek))}get body(){return He(this,Of)==null?null:new Uint8Array(He(this,Of))}get bodyText(){try{return He(this,Of)==null?"":gM(He(this,Of))}catch{Rr(!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{Rr(!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 Hue(599,r,this.headers,this.body,He(this,D4)||void 0);return Ht(s,Nw,{message:t,error:n}),s}throwThrottleError(t,n){n==null?n=-1:bn(Number.isInteger(n)&&n>=0,"invalid stall timeout","stall",n);const r=new Error(t||"throttling requests");throw Bs(r,{stall:n,throttle:!0}),r}getHeader(t){return this.headers[t.toLowerCase()]}hasBody(){return He(this,Of)!=null}get request(){return He(this,D4)}ok(){return He(this,Nw).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:t,error:n}=He(this,Nw);t===""&&(t=`server response ${this.statusCode} ${this.statusMessage}`);let r=null;this.request&&(r=this.request.url);let s=null;try{He(this,Of)&&(s=gM(He(this,Of)))}catch{}Rr(!1,t,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:n,info:{requestUrl:r,responseBody:s,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}};Z_=new WeakMap,J_=new WeakMap,ek=new WeakMap,Of=new WeakMap,D4=new WeakMap,Nw=new WeakMap;let Ay=Hue;function Yme(){return new Date().getTime()}function u2t(e){return fd(e.replace(/%([0-9a-f][0-9a-f])/gi,(t,n)=>String.fromCharCode(parseInt(n,16))))}function d2t(e){return new Promise(t=>setTimeout(t,e))}function f2t(e){let t=e.toString(16);for(;t.length<2;)t="0"+t;return"0x"+t}function Xme(e,t,n){let r=0;for(let s=0;s<n;s++)r=r*256+e[t+s];return r}function Qme(e,t,n,r){const s=[];for(;n<t+1+r;){const a=Ake(e,n);s.push(a.result),n+=a.consumed,Rr(n<=t+1+r,"child data too short","BUFFER_OVERRUN",{buffer:e,length:r,offset:t})}return{consumed:1+r,result:s}}function Ake(e,t){Rr(e.length!==0,"data too short","BUFFER_OVERRUN",{buffer:e,length:0,offset:1});const n=r=>{Rr(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=Xme(e,t+1,r);return n(t+1+r+s),Qme(e,t,t+1+r,r+s)}else if(e[t]>=192){const r=e[t]-192;return n(t+1+r),Qme(e,t,t+1,r)}else if(e[t]>=184){const r=e[t]-183;n(t+1+r);const s=Xme(e,t+1,r);n(t+1+r+s);const a=Gr(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=Gr(e.slice(t+1,t+1+r));return{consumed:1+r,result:s}}return{consumed:1,result:f2t(e[t])}}function Bk(e){const t=ps(e,"data"),n=Ake(t,0);return bn(n.consumed===t.length,"unexpected junk after rlp payload","data",e),n.result}function Zme(e){const t=[];for(;e;)t.unshift(e&255),e>>=8;return t}function jke(e){if(Array.isArray(e)){let r=[];if(e.forEach(function(a){r=r.concat(jke(a))}),r.length<=55)return r.unshift(192+r.length),r;const s=Zme(r.length);return s.unshift(247+s.length),s.concat(r)}const t=Array.prototype.slice.call(ps(e,"object"));if(t.length===1&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const n=Zme(t.length);return n.unshift(183+n.length),n.concat(t)}const Jme="0123456789abcdef";function o1(e){let t="0x";for(const n of jke(e))t+=Jme[n>>4],t+=Jme[n&15];return t}function h2t(e){const t=ps(e,"randomBytes");t[6]=t[6]&15|64,t[8]=t[8]&63|128;const n=Gr(t);return[n.substring(2,10),n.substring(10,14),n.substring(14,18),n.substring(18,22),n.substring(22,34)].join("-")}const od=32,yJ=new Uint8Array(od),p2t=["then"],YI={},Eke=new WeakMap;function Mv(e){return Eke.get(e)}function e0e(e,t){Eke.set(e,t)}function C7(e,t){const n=new Error(`deferred error during ABI decoding triggered accessing ${e}`);throw n.error=t,n}function vJ(e,t,n){return e.indexOf(null)>=0?t.map((r,s)=>r instanceof bM?vJ(Mv(r),r,n):r):e.reduce((r,s,a)=>{let o=t.getValue(s);return s in r||(n&&o instanceof bM&&(o=vJ(Mv(o),o,n)),r[s]=o),r},{})}var B4,$g;let bM=($g=class extends Array{constructor(...n){const r=n[0];let s=n[1],a=(n[2]||[]).slice(),o=!0;r!==YI&&(s=n,a=[],o=!1);super(s.length);On(this,B4);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(e0e(this,Object.freeze(s.map((u,d)=>{const f=a[d];return f!=null&&l.get(f)===1?f:null}))),Ht(this,B4,[]),He(this,B4)==null&&He(this,B4),!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=Bi(d,"%index");if(g<0||g>=this.length)throw new RangeError("out of result range");const v=u[g];return v instanceof Error&&C7(`index ${g}`,v),v}if(p2t.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 e0e(c,Mv(this)),c}toArray(n){const r=[];return this.forEach((s,a)=>{s instanceof Error&&C7(`index ${a}`,s),n&&s instanceof $g&&(s=s.toArray(n)),r.push(s)}),r}toObject(n){const r=Mv(this);return r.reduce((s,a,o)=>(Rr(a!=null,`value at index ${o} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),vJ(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=Mv(this),a=[],o=[];for(let l=n;l<r;l++)a.push(this[l]),o.push(s[l]);return new $g(YI,a,o)}filter(n,r){const s=Mv(this),a=[],o=[];for(let l=0;l<this.length;l++){const c=this[l];c instanceof Error&&C7(`index ${l}`,c),n.call(r,c,l,this)&&(a.push(c),o.push(s[l]))}return new $g(YI,a,o)}map(n,r){const s=[];for(let a=0;a<this.length;a++){const o=this[a];o instanceof Error&&C7(`index ${a}`,o),s.push(n.call(r,o,a,this))}return s}getValue(n){const r=Mv(this).indexOf(n);if(r===-1)return;const s=this[r];return s instanceof Error&&C7(`property ${JSON.stringify(n)}`,s.error),s}static fromItems(n,r){return new $g(YI,n,r)}},B4=new WeakMap,$g);function t0e(e){let t=ol(e);return Rr(t.length<=od,"value out-of-bounds","BUFFER_OVERRUN",{buffer:t,length:od,offset:t.length}),t.length!==od&&(t=eu(La([yJ.slice(t.length%od),t]))),t}class N1{constructor(t,n,r,s){Dn(this,"name");Dn(this,"type");Dn(this,"localName");Dn(this,"dynamic");Bs(this,{name:t,type:n,localName:r,dynamic:s},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(t,n){bn(!1,t,this.localName,n)}}var bg,Aw,$4,GF;class wJ{constructor(){On(this,$4);On(this,bg);On(this,Aw);Ht(this,bg,[]),Ht(this,Aw,0)}get data(){return La(He(this,bg))}get length(){return He(this,Aw)}appendWriter(t){return wr(this,$4,GF).call(this,eu(t.data))}writeBytes(t){let n=eu(t);const r=n.length%od;return r&&(n=eu(La([n,yJ.slice(r)]))),wr(this,$4,GF).call(this,n)}writeValue(t){return wr(this,$4,GF).call(this,t0e(t))}writeUpdatableValue(){const t=He(this,bg).length;return He(this,bg).push(yJ),Ht(this,Aw,He(this,Aw)+od),n=>{He(this,bg)[t]=t0e(n)}}}bg=new WeakMap,Aw=new WeakMap,$4=new WeakSet,GF=function(t){return He(this,bg).push(t),Ht(this,Aw,He(this,Aw)+t.length),t.length};var Ud,Mf,jw,Ew,Yb,e5,SJ,_ke;const Vue=class Vue{constructor(t,n,r){On(this,e5);Dn(this,"allowLoose");On(this,Ud);On(this,Mf);On(this,jw);On(this,Ew);On(this,Yb);Bs(this,{allowLoose:!!n}),Ht(this,Ud,eu(t)),Ht(this,jw,0),Ht(this,Ew,null),Ht(this,Yb,r??1024),Ht(this,Mf,0)}get data(){return Gr(He(this,Ud))}get dataLength(){return He(this,Ud).length}get consumed(){return He(this,Mf)}get bytes(){return new Uint8Array(He(this,Ud))}subReader(t){const n=new Vue(He(this,Ud).slice(He(this,Mf)+t),this.allowLoose,He(this,Yb));return Ht(n,Ew,this),n}readBytes(t,n){let r=wr(this,e5,_ke).call(this,0,t,!!n);return wr(this,e5,SJ).call(this,t),Ht(this,Mf,He(this,Mf)+r.length),r.slice(0,t)}readValue(){return FB(this.readBytes(od))}readIndex(){return Kyt(this.readBytes(od))}};Ud=new WeakMap,Mf=new WeakMap,jw=new WeakMap,Ew=new WeakMap,Yb=new WeakMap,e5=new WeakSet,SJ=function(t){var n;if(He(this,Ew))return wr(n=He(this,Ew),e5,SJ).call(n,t);Ht(this,jw,He(this,jw)+t),Rr(He(this,Yb)<1||He(this,jw)<=He(this,Yb)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${He(this,Yb)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:eu(He(this,Ud)),offset:He(this,Mf),length:t,info:{bytesRead:He(this,jw),dataLength:this.dataLength}})},_ke=function(t,n,r){let s=Math.ceil(n/od)*od;return He(this,Mf)+s>He(this,Ud).length&&(this.allowLoose&&r&&He(this,Mf)+n<=He(this,Ud).length?s=n:Rr(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:eu(He(this,Ud)),length:He(this,Ud).length,offset:He(this,Mf)+s})),He(this,Ud).slice(He(this,Mf),He(this,Mf)+s)};let CJ=Vue;function Bf(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function rae(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 kke(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Bf(e.outputLen),Bf(e.blockLen)}function RS(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 Tke(e,t){rae(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const FH=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ike=e=>e instanceof Uint8Array,KF=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),YF=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Qm=(e,t)=>e<<32-t|e>>>t,m2t=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!m2t)throw new Error("Non little-endian hardware is not supported");const x2t=async()=>{};async function n0e(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 x2t(),r+=a)}}function g2t(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function LS(e){if(typeof e=="string"&&(e=g2t(e)),!Ike(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}function b2t(...e){const t=new Uint8Array(e.reduce((r,s)=>r+s.length,0));let n=0;return e.forEach(r=>{if(!Ike(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}let sae=class{clone(){return this._cloneInto()}};const y2t={}.toString;function Pke(e,t){if(t!==void 0&&y2t.call(t)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(e,t)}function OB(e){const t=r=>e().update(LS(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function v2t(e=32){if(FH&&typeof FH.getRandomValues=="function")return FH.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}let Fke=class extends sae{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,kke(t);const r=LS(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 RS(this),this.iHash.update(t),this}digestInto(t){RS(this),rae(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 MB=(e,t,n)=>new Fke(e,t).update(n).digest();MB.create=(e,t)=>new Fke(e,t);function w2t(e,t,n,r){kke(e);const s=Pke({dkLen:32,asyncTick:10},r),{c:a,dkLen:o,asyncTick:l}=s;if(Bf(a),Bf(o),Bf(l),a<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const c=LS(t),u=LS(n),d=new Uint8Array(o),f=MB.create(e,c),x=f._cloneInto().update(u);return{c:a,dkLen:o,asyncTick:l,DK:d,PRF:f,PRFSalt:x}}function C2t(e,t,n,r,s){return e.destroy(),t.destroy(),r&&r.destroy(),s.fill(0),n}function iae(e,t,n,r){const{c:s,dkLen:a,DK:o,PRF:l,PRFSalt:c}=w2t(e,t,n,r);let u;const d=new Uint8Array(4),f=YF(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 C2t(l,c,o,u,x)}function S2t(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 aae extends sae{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=YF(this.buffer)}update(t){RS(this);const{view:n,buffer:r,blockLen:s}=this;t=LS(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=YF(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){RS(this),Tke(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;S2t(r,s-8,BigInt(this.length*8),a),this.process(r,0);const l=YF(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 N2t=(e,t,n)=>e&t^~e&n,A2t=(e,t,n)=>e&t^e&n^t&n,j2t=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]),lb=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),cb=new Uint32Array(64);let E2t=class extends aae{constructor(){super(64,32,8,!1),this.A=lb[0]|0,this.B=lb[1]|0,this.C=lb[2]|0,this.D=lb[3]|0,this.E=lb[4]|0,this.F=lb[5]|0,this.G=lb[6]|0,this.H=lb[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)cb[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const x=cb[f-15],g=cb[f-2],v=Qm(x,7)^Qm(x,18)^x>>>3,w=Qm(g,17)^Qm(g,19)^g>>>10;cb[f]=w+cb[f-7]+v+cb[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=Qm(l,6)^Qm(l,11)^Qm(l,25),g=d+x+N2t(l,c,u)+j2t[f]+cb[f]|0,w=(Qm(r,2)^Qm(r,13)^Qm(r,22))+A2t(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(){cb.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const kA=OB(()=>new E2t),XI=BigInt(2**32-1),NJ=BigInt(32);function Oke(e,t=!1){return t?{h:Number(e&XI),l:Number(e>>NJ&XI)}:{h:Number(e>>NJ&XI)|0,l:Number(e&XI)|0}}function Mke(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}=Oke(e[s],t);[n[s],r[s]]=[a,o]}return[n,r]}const _2t=(e,t)=>BigInt(e>>>0)<<NJ|BigInt(t>>>0),k2t=(e,t,n)=>e>>>n,T2t=(e,t,n)=>e<<32-n|t>>>n,I2t=(e,t,n)=>e>>>n|t<<32-n,P2t=(e,t,n)=>e<<32-n|t>>>n,F2t=(e,t,n)=>e<<64-n|t>>>n-32,O2t=(e,t,n)=>e>>>n-32|t<<64-n,M2t=(e,t)=>t,R2t=(e,t)=>e,Rke=(e,t,n)=>e<<n|t>>>32-n,Lke=(e,t,n)=>t<<n|e>>>32-n,Dke=(e,t,n)=>t<<n-32|e>>>64-n,Bke=(e,t,n)=>e<<n-32|t>>>64-n;function L2t(e,t,n,r){const s=(t>>>0)+(r>>>0);return{h:e+n+(s/2**32|0)|0,l:s|0}}const D2t=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),B2t=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,$2t=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),U2t=(e,t,n,r,s)=>t+n+r+s+(e/2**32|0)|0,z2t=(e,t,n,r,s)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(s>>>0),H2t=(e,t,n,r,s,a)=>t+n+r+s+a+(e/2**32|0)|0,Li={fromBig:Oke,split:Mke,toBig:_2t,shrSH:k2t,shrSL:T2t,rotrSH:I2t,rotrSL:P2t,rotrBH:F2t,rotrBL:O2t,rotr32H:M2t,rotr32L:R2t,rotlSH:Rke,rotlSL:Lke,rotlBH:Dke,rotlBL:Bke,add:L2t,add3L:D2t,add3H:B2t,add4L:$2t,add4H:U2t,add5H:H2t,add5L:z2t},[V2t,W2t]=Li.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))),ub=new Uint32Array(80),db=new Uint32Array(80);class q2t extends aae{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 I=0;I<16;I++,n+=4)ub[I]=t.getUint32(n),db[I]=t.getUint32(n+=4);for(let I=16;I<80;I++){const R=ub[I-15]|0,O=db[I-15]|0,U=Li.rotrSH(R,O,1)^Li.rotrSH(R,O,8)^Li.shrSH(R,O,7),L=Li.rotrSL(R,O,1)^Li.rotrSL(R,O,8)^Li.shrSL(R,O,7),z=ub[I-2]|0,X=db[I-2]|0,ne=Li.rotrSH(z,X,19)^Li.rotrBH(z,X,61)^Li.shrSH(z,X,6),J=Li.rotrSL(z,X,19)^Li.rotrBL(z,X,61)^Li.shrSL(z,X,6),K=Li.add4L(L,J,db[I-7],db[I-16]),re=Li.add4H(K,U,ne,ub[I-7],ub[I-16]);ub[I]=re|0,db[I]=K|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:P}=this;for(let I=0;I<80;I++){const R=Li.rotrSH(f,x,14)^Li.rotrSH(f,x,18)^Li.rotrBH(f,x,41),O=Li.rotrSL(f,x,14)^Li.rotrSL(f,x,18)^Li.rotrBL(f,x,41),U=f&g^~f&w,L=x&v^~x&C,z=Li.add5L(P,O,L,W2t[I],db[I]),X=Li.add5H(z,N,R,U,V2t[I],ub[I]),ne=z|0,J=Li.rotrSH(r,s,28)^Li.rotrBH(r,s,34)^Li.rotrBH(r,s,39),K=Li.rotrSL(r,s,28)^Li.rotrBL(r,s,34)^Li.rotrBL(r,s,39),re=r&a^r&l^a&l,he=s&o^s&c^o&c;N=w|0,P=C|0,w=g|0,C=v|0,g=f|0,v=x|0,{h:f,l:x}=Li.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 Q=Li.add3L(ne,K,he);r=Li.add3H(Q,X,J,re),s=Q|0}({h:r,l:s}=Li.add(this.Ah|0,this.Al|0,r|0,s|0)),{h:a,l:o}=Li.add(this.Bh|0,this.Bl|0,a|0,o|0),{h:l,l:c}=Li.add(this.Ch|0,this.Cl|0,l|0,c|0),{h:u,l:d}=Li.add(this.Dh|0,this.Dl|0,u|0,d|0),{h:f,l:x}=Li.add(this.Eh|0,this.El|0,f|0,x|0),{h:g,l:v}=Li.add(this.Fh|0,this.Fl|0,g|0,v|0),{h:w,l:C}=Li.add(this.Gh|0,this.Gl|0,w|0,C|0),{h:N,l:P}=Li.add(this.Hh|0,this.Hl|0,N|0,P|0),this.set(r,s,a,o,l,c,u,d,f,x,g,v,w,C,N,P)}roundClean(){ub.fill(0),db.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 oae=OB(()=>new q2t);function G2t(){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 r0e=G2t(),s0e=r0e.crypto||r0e.msCrypto;function K2t(e){switch(e){case"sha256":return kA.create();case"sha512":return oae.create()}bn(!1,"invalid hashing algorithm name","algorithm",e)}function Y2t(e,t){const n={sha256:kA,sha512:oae}[e];return bn(n!=null,"invalid hmac algorithm","algorithm",e),MB.create(n,t)}function X2t(e,t,n,r,s){const a={sha256:kA,sha512:oae}[s];return bn(a!=null,"invalid pbkdf2 algorithm","algorithm",s),iae(a,e,t,{c:n,dkLen:r})}function Q2t(e){Rr(s0e!=null,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),bn(Number.isInteger(e)&&e>0&&e<=1024,"invalid length","length",e);const t=new Uint8Array(e);return s0e.getRandomValues(t),t}let $ke=!1;const Uke=function(e,t,n){return Y2t(e,t).update(n).digest()};let zke=Uke;function TA(e,t,n){const r=ps(t,"key"),s=ps(n,"data");return Gr(zke(e,r,s))}TA._=Uke;TA.lock=function(){$ke=!0};TA.register=function(e){if($ke)throw new Error("computeHmac is locked");zke=e};Object.freeze(TA);const[Hke,Vke,Wke]=[[],[],[]],Z2t=BigInt(0),S7=BigInt(1),J2t=BigInt(2),evt=BigInt(7),tvt=BigInt(256),nvt=BigInt(113);for(let e=0,t=S7,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Hke.push(2*(5*r+n)),Vke.push((e+1)*(e+2)/2%64);let s=Z2t;for(let a=0;a<7;a++)t=(t<<S7^(t>>evt)*nvt)%tvt,t&J2t&&(s^=S7<<(S7<<BigInt(a))-S7);Wke.push(s)}const[rvt,svt]=Mke(Wke,!0),i0e=(e,t,n)=>n>32?Dke(e,t,n):Rke(e,t,n),a0e=(e,t,n)=>n>32?Bke(e,t,n):Lke(e,t,n);function ivt(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=i0e(u,d,1)^n[l],x=a0e(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=Vke[o],c=i0e(s,a,l),u=a0e(s,a,l),d=Hke[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]^=rvt[r],e[1]^=svt[r]}n.fill(0)}let avt=class qke extends sae{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,Bf(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=KF(this.state)}keccak(){ivt(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){RS(this);const{blockLen:n,state:r}=this;t=LS(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){RS(this,!1),rae(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 Bf(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Tke(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 qke(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 ovt=(e,t,n)=>OB(()=>new avt(t,e,n)),lvt=ovt(1,136,256/8);let Gke=!1;const Kke=function(e){return lvt(e)};let Yke=Kke;function co(e){const t=ps(e,"data");return Gr(Yke(t))}co._=Kke;co.lock=function(){Gke=!0};co.register=function(e){if(Gke)throw new TypeError("keccak256 is locked");Yke=e};Object.freeze(co);const cvt=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Xke=Uint8Array.from({length:16},(e,t)=>t),uvt=Xke.map(e=>(9*e+5)%16);let lae=[Xke],cae=[uvt];for(let e=0;e<4;e++)for(let t of[lae,cae])t.push(t[e].map(n=>cvt[n]));const Qke=[[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)),dvt=lae.map((e,t)=>e.map(n=>Qke[t][n])),fvt=cae.map((e,t)=>e.map(n=>Qke[t][n])),hvt=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),pvt=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),QI=(e,t)=>e<<t|e>>>32-t;function o0e(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 ZI=new Uint32Array(16);class mvt extends aae{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)ZI[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=hvt[g],C=pvt[g],N=lae[g],P=cae[g],I=dvt[g],R=fvt[g];for(let O=0;O<16;O++){const U=QI(r+o0e(g,a,l,u)+ZI[N[O]]+w,I[O])+f|0;r=f,f=u,u=QI(l,10)|0,l=a,a=U}for(let O=0;O<16;O++){const U=QI(s+o0e(v,o,c,d)+ZI[P[O]]+C,R[O])+x|0;s=x,x=d,d=QI(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(){ZI.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const xvt=OB(()=>new mvt);let Zke=!1;const Jke=function(e){return xvt(e)};let eTe=Jke;function IA(e){const t=ps(e,"data");return Gr(eTe(t))}IA._=Jke;IA.lock=function(){Zke=!0};IA.register=function(e){if(Zke)throw new TypeError("ripemd160 is locked");eTe=e};Object.freeze(IA);let tTe=!1;const nTe=function(e,t,n,r,s){return X2t(e,t,n,r,s)};let rTe=nTe;function a2(e,t,n,r,s){const a=ps(e,"password"),o=ps(t,"salt");return Gr(rTe(a,o,n,r,s))}a2._=nTe;a2.lock=function(){tTe=!0};a2.register=function(e){if(tTe)throw new Error("pbkdf2 is locked");rTe=e};Object.freeze(a2);let sTe=!1;const iTe=function(e){return new Uint8Array(Q2t(e))};let aTe=iTe;function Vg(e){return aTe(e)}Vg._=iTe;Vg.lock=function(){sTe=!0};Vg.register=function(e){if(sTe)throw new Error("randomBytes is locked");aTe=e};Object.freeze(Vg);const ha=(e,t)=>e<<t|e>>>32-t;function l0e(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++],P=e[t++]^n[r++],I=e[t++]^n[r++],R=e[t++]^n[r++],O=e[t++]^n[r++],U=o,L=l,z=c,X=u,ne=d,J=f,K=x,re=g,he=v,Q=w,ie=C,oe=N,G=P,V=I,te=R,ae=O;for(let fe=0;fe<8;fe+=2)ne^=ha(U+G|0,7),he^=ha(ne+U|0,9),G^=ha(he+ne|0,13),U^=ha(G+he|0,18),Q^=ha(J+L|0,7),V^=ha(Q+J|0,9),L^=ha(V+Q|0,13),J^=ha(L+V|0,18),te^=ha(ie+K|0,7),z^=ha(te+ie|0,9),K^=ha(z+te|0,13),ie^=ha(K+z|0,18),X^=ha(ae+oe|0,7),re^=ha(X+ae|0,9),oe^=ha(re+X|0,13),ae^=ha(oe+re|0,18),L^=ha(U+X|0,7),z^=ha(L+U|0,9),X^=ha(z+L|0,13),U^=ha(X+z|0,18),K^=ha(J+ne|0,7),re^=ha(K+J|0,9),ne^=ha(re+K|0,13),J^=ha(ne+re|0,18),oe^=ha(ie+Q|0,7),he^=ha(oe+ie|0,9),Q^=ha(he+oe|0,13),ie^=ha(Q+he|0,18),G^=ha(ae+te|0,7),V^=ha(G+ae|0,9),te^=ha(V+G|0,13),ae^=ha(te+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+K|0,s[a++]=g+re|0,s[a++]=v+he|0,s[a++]=w+Q|0,s[a++]=C+ie|0,s[a++]=N+oe|0,s[a++]=P+G|0,s[a++]=I+V|0,s[a++]=R+te|0,s[a++]=O+ae|0}function r4(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)l0e(n,o,e,t,n,a),l>0&&(o+=16),l0e(n,a,e,t+=16,n,o)}function oTe(e,t,n){const r=Pke({dkLen:32,asyncTick:10,maxmem:1073742848},n),{N:s,r:a,p:o,dkLen:l,asyncTick:c,maxmem:u,onProgress:d}=r;if(Bf(s),Bf(a),Bf(o),Bf(l),Bf(c),Bf(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=iae(kA,e,t,{c:1,dkLen:f*o}),w=KF(v),C=KF(new Uint8Array(f*s)),N=KF(new Uint8Array(f));let P=()=>{};if(d){const I=2*s*o,R=Math.max(Math.floor(I/1e4),1);let O=0;P=()=>{O++,d&&(!(O%R)||O===I)&&d(O/I)}}return{N:s,r:a,p:o,dkLen:l,blockSize32:x,V:C,B32:w,B:v,tmp:N,blockMixCb:P,asyncTick:c}}function lTe(e,t,n,r,s){const a=iae(kA,e,n,{c:1,dkLen:t});return n.fill(0),r.fill(0),s.fill(0),a}function gvt(e,t,n){const{N:r,r:s,p:a,dkLen:o,blockSize32:l,V:c,B32:u,B:d,tmp:f,blockMixCb:x}=oTe(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++)r4(c,C,c,C+=l,s),x();r4(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];r4(f,0,u,v,s),x()}}return lTe(e,o,d,c,f)}async function bvt(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}=oTe(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 n0e(r-1,g,()=>{r4(c,C,c,C+=l,s),x()}),r4(c,(r-1)*l,u,w,s),x(),await n0e(r,g,()=>{const N=u[w+l-16]%r;for(let P=0;P<l;P++)f[P]=u[w+P]^c[N*l+P];r4(f,0,u,w,s),x()})}return lTe(e,o,d,c,f)}let cTe=!1,uTe=!1;const dTe=async function(e,t,n,r,s,a,o){return await bvt(e,t,{N:n,r,p:s,dkLen:a,onProgress:o})},fTe=function(e,t,n,r,s,a){return gvt(e,t,{N:n,r,p:s,dkLen:a})};let hTe=dTe,pTe=fTe;async function PA(e,t,n,r,s,a,o){const l=ps(e,"passwd"),c=ps(t,"salt");return Gr(await hTe(l,c,n,r,s,a,o))}PA._=dTe;PA.lock=function(){uTe=!0};PA.register=function(e){if(uTe)throw new Error("scrypt is locked");hTe=e};Object.freeze(PA);function FA(e,t,n,r,s,a){const o=ps(e,"passwd"),l=ps(t,"salt");return Gr(pTe(o,l,n,r,s,a))}FA._=fTe;FA.lock=function(){cTe=!0};FA.register=function(e){if(cTe)throw new Error("scryptSync is locked");pTe=e};Object.freeze(FA);const mTe=function(e){return K2t("sha256").update(e).digest()};let xTe=mTe,gTe=!1;function op(e){const t=ps(e,"data");return Gr(xTe(t))}op._=mTe;op.lock=function(){gTe=!0};op.register=function(e){if(gTe)throw new Error("sha256 is locked");xTe=e};Object.freeze(op);Object.freeze(op);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const bTe=BigInt(0),RB=BigInt(1),yvt=BigInt(2),LB=e=>e instanceof Uint8Array,vvt=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function DS(e){if(!LB(e))throw new Error("Uint8Array expected");let t="";for(let n=0;n<e.length;n++)t+=vvt[e[n]];return t}function yTe(e){const t=e.toString(16);return t.length&1?`0${t}`:t}function uae(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return BigInt(e===""?"0":`0x${e}`)}function BS(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 Yw(e){return uae(DS(e))}function dae(e){if(!LB(e))throw new Error("Uint8Array expected");return uae(DS(Uint8Array.from(e).reverse()))}function $S(e,t){return BS(e.toString(16).padStart(t*2,"0"))}function fae(e,t){return $S(e,t).reverse()}function wvt(e){return BS(yTe(e))}function $p(e,t,n){let r;if(typeof t=="string")try{r=BS(t)}catch(a){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${a}`)}else if(LB(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 lE(...e){const t=new Uint8Array(e.reduce((r,s)=>r+s.length,0));let n=0;return e.forEach(r=>{if(!LB(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}function Cvt(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 Svt(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function Nvt(e){let t;for(t=0;e>bTe;e>>=RB,t+=1);return t}function Avt(e,t){return e>>BigInt(t)&RB}const jvt=(e,t,n)=>e|(n?RB:bTe)<<BigInt(t),hae=e=>(yvt<<BigInt(e-1))-RB,OH=e=>new Uint8Array(e),c0e=e=>Uint8Array.from(e);function vTe(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=OH(e),s=OH(e),a=0;const o=()=>{r.fill(1),s.fill(0),a=0},l=(...f)=>n(s,r,...f),c=(f=OH())=>{s=l(c0e([0]),f),r=l(),f.length!==0&&(s=l(c0e([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 lE(...x)};return(f,x)=>{o(),c(f);let g;for(;!(g=x(u()));)c();return o(),g}}const Evt={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 $k(e,t,n={}){const r=(s,a,o)=>{const l=Evt[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 _vt=Object.freeze(Object.defineProperty({__proto__:null,bitGet:Avt,bitLen:Nvt,bitMask:hae,bitSet:jvt,bytesToHex:DS,bytesToNumberBE:Yw,bytesToNumberLE:dae,concatBytes:lE,createHmacDrbg:vTe,ensureBytes:$p,equalBytes:Cvt,hexToBytes:BS,hexToNumber:uae,numberToBytesBE:$S,numberToBytesLE:fae,numberToHexUnpadded:yTe,numberToVarBytesBE:wvt,utf8ToBytes:Svt,validateObject:$k},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const kc=BigInt(0),wl=BigInt(1),Rv=BigInt(2),kvt=BigInt(3),AJ=BigInt(4),u0e=BigInt(5),d0e=BigInt(8);BigInt(9);BigInt(16);function Vd(e,t){const n=e%t;return n>=kc?n:t+n}function Tvt(e,t,n){if(n<=kc||t<kc)throw new Error("Expected power/modulo > 0");if(n===wl)return kc;let r=wl;for(;t>kc;)t&wl&&(r=r*e%n),e=e*e%n,t>>=wl;return r}function gh(e,t,n){let r=e;for(;t-- >kc;)r*=r,r%=n;return r}function jJ(e,t){if(e===kc||t<=kc)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=Vd(e,t),r=t,s=kc,a=wl;for(;n!==kc;){const l=r/n,c=r%n,u=s-a*l;r=n,n=c,s=a,a=u}if(r!==wl)throw new Error("invert: does not exist");return Vd(s,t)}function Ivt(e){const t=(e-wl)/Rv;let n,r,s;for(n=e-wl,r=0;n%Rv===kc;n/=Rv,r++);for(s=Rv;s<e&&Tvt(s,t,e)!==e-wl;s++);if(r===1){const o=(e+wl)/AJ;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+wl)/Rv;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,wl<<BigInt(u-g-1));d=l.sqr(v),f=l.mul(f,v),x=l.mul(x,d),u=g}return f}}function Pvt(e){if(e%AJ===kvt){const t=(e+wl)/AJ;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%d0e===u0e){const t=(e-u0e)/d0e;return function(r,s){const a=r.mul(s,Rv),o=r.pow(a,t),l=r.mul(s,o),c=r.mul(r.mul(l,Rv),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 Ivt(e)}const Fvt=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Ovt(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=Fvt.reduce((r,s)=>(r[s]="function",r),t);return $k(e,n)}function Mvt(e,t,n){if(n<kc)throw new Error("Expected power > 0");if(n===kc)return e.ONE;if(n===wl)return t;let r=e.ONE,s=t;for(;n>kc;)n&wl&&(r=e.mul(r,s)),s=e.sqr(s),n>>=wl;return r}function Rvt(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 wTe(e,t){const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function Lvt(e,t,n=!1,r={}){if(e<=kc)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:a}=wTe(e,t);if(a>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=Pvt(e),l=Object.freeze({ORDER:e,BITS:s,BYTES:a,MASK:hae(s),ZERO:kc,ONE:wl,create:c=>Vd(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return kc<=c&&c<e},is0:c=>c===kc,isOdd:c=>(c&wl)===wl,neg:c=>Vd(-c,e),eql:(c,u)=>c===u,sqr:c=>Vd(c*c,e),add:(c,u)=>Vd(c+u,e),sub:(c,u)=>Vd(c-u,e),mul:(c,u)=>Vd(c*u,e),pow:(c,u)=>Mvt(l,c,u),div:(c,u)=>Vd(c*jJ(u,e),e),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>jJ(c,e),sqrt:r.sqrt||(c=>o(l,c)),invertBatch:c=>Rvt(l,c),cmov:(c,u,d)=>d?u:c,toBytes:c=>n?fae(c,a):$S(c,a),fromBytes:c=>{if(c.length!==a)throw new Error(`Fp.fromBytes: expected ${a}, got ${c.length}`);return n?dae(c):Yw(c)}});return Object.freeze(l)}function CTe(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 STe(e){const t=CTe(e);return t+Math.ceil(t/2)}function Dvt(e,t,n=!1){const r=e.length,s=CTe(t),a=STe(t);if(r<16||r<a||r>1024)throw new Error(`expected ${a}-1024 bytes of input, got ${r}`);const o=n?Yw(e):dae(e),l=Vd(o,t-wl)+wl;return n?fae(l,s):$S(l,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Bvt=BigInt(0),MH=BigInt(1);function $vt(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>Bvt;)a&MH&&(o=o.add(l)),l=l.double(),a>>=MH;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+=MH);const N=w,P=w+Math.abs(C)-1,I=v%2!==0,R=C<0;C===0?d=d.add(n(I,a[N])):u=u.add(n(R,a[P]))}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 NTe(e){return Ovt(e.Fp),$k(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...wTe(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Uvt(e){const t=NTe(e);$k(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:zvt,hexToBytes:Hvt}=_vt,Gv={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){const{Err:t}=Gv;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:zvt(r),l:e.subarray(n+2)}},toSig(e){const{Err:t}=Gv,n=typeof e=="string"?Hvt(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}=Gv._parseInt(n.subarray(2)),{d:o,l}=Gv._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}`}},_g=BigInt(0),Hh=BigInt(1);BigInt(2);const f0e=BigInt(3);BigInt(4);function Vvt(e){const t=Uvt(e),{Fp:n}=t,r=t.toBytes||((v,w,C)=>{const N=w.toAffine();return lE(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),P=n.mul(N,v);return n.add(n.add(P,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"&&_g<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:P}=t;if(w&&typeof v!="bigint"){if(v instanceof Uint8Array&&(v=DS(v)),typeof v!="string"||!w.includes(v.length))throw new Error("Invalid key");v=v.padStart(C*2,"0")}let I;try{I=typeof v=="bigint"?v:Yw($p("private key",v,C))}catch{throw new Error(`private key must be ${C} bytes, hex or bigint, not ${typeof v}`)}return N&&(I=Vd(I,P)),l(I),I}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 P=I=>n.eql(I,n.ZERO);return P(C)&&P(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,P)=>N.toAffine(C[P])).map(f.fromAffine)}static fromHex(w){const C=f.fromAffine(s($p("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),P=a(w);if(!n.eql(N,P))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:P}=this,{px:I,py:R,pz:O}=w,U=n.eql(n.mul(C,O),n.mul(I,P)),L=n.eql(n.mul(N,O),n.mul(R,P));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,f0e),{px:P,py:I,pz:R}=this;let O=n.ZERO,U=n.ZERO,L=n.ZERO,z=n.mul(P,P),X=n.mul(I,I),ne=n.mul(R,R),J=n.mul(P,I);return J=n.add(J,J),L=n.mul(P,R),L=n.add(L,L),O=n.mul(w,L),U=n.mul(N,ne),U=n.add(O,U),O=n.sub(X,U),U=n.add(X,U),U=n.mul(O,U),O=n.mul(J,O),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(I,R),ne=n.add(ne,ne),z=n.mul(ne,J),O=n.sub(O,z),L=n.mul(ne,X),L=n.add(L,L),L=n.add(L,L),new f(O,U,L)}add(w){d(w);const{px:C,py:N,pz:P}=this,{px:I,py:R,pz:O}=w;let U=n.ZERO,L=n.ZERO,z=n.ZERO;const X=t.a,ne=n.mul(t.b,f0e);let J=n.mul(C,I),K=n.mul(N,R),re=n.mul(P,O),he=n.add(C,N),Q=n.add(I,R);he=n.mul(he,Q),Q=n.add(J,K),he=n.sub(he,Q),Q=n.add(C,P);let ie=n.add(I,O);return Q=n.mul(Q,ie),ie=n.add(J,re),Q=n.sub(Q,ie),ie=n.add(N,P),U=n.add(R,O),ie=n.mul(ie,U),U=n.add(K,re),ie=n.sub(ie,U),z=n.mul(X,Q),U=n.mul(ne,re),z=n.add(U,z),U=n.sub(K,z),z=n.add(K,z),L=n.mul(U,z),K=n.add(J,J),K=n.add(K,J),re=n.mul(X,re),Q=n.mul(ne,Q),K=n.add(K,re),re=n.sub(J,re),re=n.mul(X,re),Q=n.add(Q,re),J=n.mul(K,Q),L=n.add(L,J),J=n.mul(ie,Q),U=n.mul(he,U),U=n.sub(U,J),J=n.mul(he,K),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(P=>P.pz));return C.map((P,I)=>P.toAffine(N[I])).map(f.fromAffine)})}multiplyUnsafe(w){const C=f.ZERO;if(w===_g)return C;if(l(w),w===Hh)return this;const{endo:N}=t;if(!N)return g.unsafeLadder(this,w);let{k1neg:P,k1:I,k2neg:R,k2:O}=N.splitScalar(w),U=C,L=C,z=this;for(;I>_g||O>_g;)I&Hh&&(U=U.add(z)),O&Hh&&(L=L.add(z)),z=z.double(),I>>=Hh,O>>=Hh;return P&&(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,P;const{endo:I}=t;if(I){const{k1neg:R,k1:O,k2neg:U,k2:L}=I.splitScalar(C);let{p:z,f:X}=this.wNAF(O),{p:ne,f:J}=this.wNAF(L);z=g.constTimeNegate(R,z),ne=g.constTimeNegate(U,ne),ne=new f(n.mul(ne.px,I.beta),ne.py,ne.pz),N=z.add(ne),P=X.add(J)}else{const{p:R,f:O}=this.wNAF(C);N=R,P=O}return f.normalizeZ([N,P])[0]}multiplyAndAddUnsafe(w,C,N){const P=f.BASE,I=(O,U)=>U===_g||U===Hh||!O.equals(P)?O.multiplyUnsafe(U):O.multiply(U),R=I(this,C).add(I(w,N));return R.is0()?void 0:R}toAffine(w){const{px:C,py:N,pz:P}=this,I=this.is0();w==null&&(w=I?n.ONE:n.inv(P));const R=n.mul(C,w),O=n.mul(N,w),U=n.mul(P,w);if(I)return{x:n.ZERO,y:n.ZERO};if(!n.eql(U,n.ONE))throw new Error("invZ was invalid");return{x:R,y:O}}isTorsionFree(){const{h:w,isTorsionFree:C}=t;if(w===Hh)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===Hh?this:C?C(f,this):this.multiplyUnsafe(t.h)}toRawBytes(w=!0){return this.assertValidity(),r(f,this,w)}toHex(w=!0){return DS(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=$vt(f,t.endo?Math.ceil(x/2):x);return{CURVE:t,ProjectivePoint:f,normPrivateKeyToScalar:c,weierstrassEquation:a,isWithinCurveOrder:o}}function Wvt(e){const t=NTe(e);return $k(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function qvt(e){const t=Wvt(e),{Fp:n,n:r}=t,s=n.BYTES+1,a=2*n.BYTES+1;function o(Q){return _g<Q&&Q<n.ORDER}function l(Q){return Vd(Q,r)}function c(Q){return jJ(Q,r)}const{ProjectivePoint:u,normPrivateKeyToScalar:d,weierstrassEquation:f,isWithinCurveOrder:x}=Vvt({...t,toBytes(Q,ie,oe){const G=ie.toAffine(),V=n.toBytes(G.x),te=lE;return oe?te(Uint8Array.from([ie.hasEvenY()?2:3]),V):te(Uint8Array.from([4]),V,n.toBytes(G.y))},fromBytes(Q){const ie=Q.length,oe=Q[0],G=Q.subarray(1);if(ie===s&&(oe===2||oe===3)){const V=Yw(G);if(!o(V))throw new Error("Point is not on curve");const te=f(V);let ae=n.sqrt(te);const fe=(ae&Hh)===Hh;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)),te=n.fromBytes(G.subarray(n.BYTES,2*n.BYTES));return{x:V,y:te}}else throw new Error(`Point of length ${ie} was invalid. Expected ${s} compressed bytes or ${a} uncompressed bytes`)}}),g=Q=>DS($S(Q,t.nByteLength));function v(Q){const ie=r>>Hh;return Q>ie}function w(Q){return v(Q)?l(-Q):Q}const C=(Q,ie,oe)=>Yw(Q.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=$p("compactSignature",ie,oe*2),new N(C(ie,0,oe),C(ie,oe,2*oe))}static fromDER(ie){const{r:oe,s:G}=Gv.toSig($p("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,te=L($p("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",Ne=u.fromHex(fe+g(ae)),me=c(ae),we=l(-te*me),xe=l(G*me),ye=u.BASE.multiplyAndAddUnsafe(Ne,we,xe);if(!ye)throw new Error("point at infinify");return ye.assertValidity(),ye}hasHighS(){return v(this.s)}normalizeS(){return this.hasHighS()?new N(this.r,l(-this.s),this.recovery):this}toDERRawBytes(){return BS(this.toDERHex())}toDERHex(){return Gv.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return BS(this.toCompactHex())}toCompactHex(){return g(this.r)+g(this.s)}}const P={isValidPrivateKey(Q){try{return d(Q),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const Q=STe(t.n);return Dvt(t.randomBytes(Q),t.n)},precompute(Q=8,ie=u.BASE){return ie._setWindowSize(Q),ie.multiply(BigInt(3)),ie}};function I(Q,ie=!0){return u.fromPrivateKey(Q).toRawBytes(ie)}function R(Q){const ie=Q instanceof Uint8Array,oe=typeof Q=="string",G=(ie||oe)&&Q.length;return ie?G===s||G===a:oe?G===2*s||G===2*a:Q instanceof u}function O(Q,ie,oe=!0){if(R(Q))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(Q)).toRawBytes(oe)}const U=t.bits2int||function(Q){const ie=Yw(Q),oe=Q.length*8-t.nBitLength;return oe>0?ie>>BigInt(oe):ie},L=t.bits2int_modN||function(Q){return l(U(Q))},z=hae(t.nBitLength);function X(Q){if(typeof Q!="bigint")throw new Error("bigint expected");if(!(_g<=Q&&Q<z))throw new Error(`bigint expected < 2^${t.nBitLength}`);return $S(Q,t.nByteLength)}function ne(Q,ie,oe=J){if(["recovered","canonical"].some(Pe=>Pe in oe))throw new Error("sign() legacy options not supported");const{hash:G,randomBytes:V}=t;let{lowS:te,prehash:ae,extraEntropy:fe}=oe;te==null&&(te=!0),Q=$p("msgHash",Q),ae&&(Q=$p("prehashed msgHash",G(Q)));const Ne=L(Q),me=d(ie),we=[X(me),X(Ne)];if(fe!=null){const Pe=fe===!0?V(n.BYTES):fe;we.push($p("extraEntropy",Pe))}const xe=lE(...we),ye=Ne;function je(Pe){const Re=U(Pe);if(!x(Re))return;const Xe=c(Re),Ke=u.BASE.multiply(Re).toAffine(),ut=l(Ke.x);if(ut===_g)return;const et=l(Xe*l(ye+ut*me));if(et===_g)return;let tt=(Ke.x===ut?0:2)|Number(Ke.y&Hh),Le=et;return te&&v(et)&&(Le=w(et),tt^=1),new N(ut,Le,tt)}return{seed:xe,k2sig:je}}const J={lowS:t.lowS,prehash:!1},K={lowS:t.lowS,prehash:!1};function re(Q,ie,oe=J){const{seed:G,k2sig:V}=ne(Q,ie,oe),te=t;return vTe(te.hash.outputLen,te.nByteLength,te.hmac)(G,V)}u.BASE._setWindowSize(8);function he(Q,ie,oe,G=K){var Ke;const V=Q;if(ie=$p("msgHash",ie),oe=$p("publicKey",oe),"strict"in G)throw new Error("options.strict was renamed to lowS");const{lowS:te,prehash:ae}=G;let fe,Ne;try{if(typeof V=="string"||V instanceof Uint8Array)try{fe=N.fromDER(V)}catch(ut){if(!(ut instanceof Gv.Err))throw ut;fe=N.fromCompact(V)}else if(typeof V=="object"&&typeof V.r=="bigint"&&typeof V.s=="bigint"){const{r:ut,s:et}=V;fe=new N(ut,et)}else throw new Error("PARSE");Ne=u.fromHex(oe)}catch(ut){if(ut.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(te&&fe.hasHighS())return!1;ae&&(ie=t.hash(ie));const{r:me,s:we}=fe,xe=L(ie),ye=c(we),je=l(xe*ye),Pe=l(me*ye),Re=(Ke=u.BASE.multiplyAndAddUnsafe(Ne,je,Pe))==null?void 0:Ke.toAffine();return Re?l(Re.x)===me:!1}return{CURVE:t,getPublicKey:I,getSharedSecret:O,sign:re,verify:he,ProjectivePoint:u,Signature:N,utils:P}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Gvt(e){return{hash:e,hmac:(t,...n)=>MB(e,t,b2t(...n)),randomBytes:v2t}}function Kvt(e,t){const n=r=>qvt({...e,...Gvt(r)});return Object.freeze({...n(t),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ATe=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),h0e=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Yvt=BigInt(1),EJ=BigInt(2),p0e=(e,t)=>(e+t/EJ)/t;function Xvt(e){const t=ATe,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=gh(d,n,t)*d%t,x=gh(f,n,t)*d%t,g=gh(x,EJ,t)*u%t,v=gh(g,s,t)*g%t,w=gh(v,a,t)*v%t,C=gh(w,l,t)*w%t,N=gh(C,c,t)*C%t,P=gh(N,l,t)*w%t,I=gh(P,n,t)*d%t,R=gh(I,o,t)*v%t,O=gh(R,r,t)*u%t,U=gh(O,EJ,t);if(!_J.eql(_J.sqr(U),e))throw new Error("Cannot find square root");return U}const _J=Lvt(ATe,void 0,void 0,{sqrt:Xvt}),Ab=Kvt({a:BigInt(0),b:BigInt(7),Fp:_J,n:h0e,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=h0e,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Yvt*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=n,o=BigInt("0x100000000000000000000000000000000"),l=p0e(a*e,t),c=p0e(-r*e,t);let u=Vd(e-l*n-c*s,t),d=Vd(-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}}}},kA);BigInt(0);Ab.ProjectivePoint;const cE="0x0000000000000000000000000000000000000000",m0e="0x0000000000000000000000000000000000000000000000000000000000000000",Qvt=`Ethereum Signed Message:
`,x0e=BigInt(0),g0e=BigInt(1),b0e=BigInt(2),y0e=BigInt(27),v0e=BigInt(28),JI=BigInt(35),B6={};function w0e(e){return i1(ol(e),32)}var U4,c0,z4,_w;const Lp=class Lp{constructor(t,n,r,s){On(this,U4);On(this,c0);On(this,z4);On(this,_w);c5(t,B6,"Signature"),Ht(this,U4,n),Ht(this,c0,r),Ht(this,z4,s),Ht(this,_w,null)}get r(){return He(this,U4)}set r(t){bn(n4(t)===32,"invalid r","value",t),Ht(this,U4,Gr(t))}get s(){return bn(parseInt(He(this,c0).substring(0,3))<8,"non-canonical s; use ._s","s",He(this,c0)),He(this,c0)}set s(t){bn(n4(t)===32,"invalid s","value",t),Ht(this,c0,Gr(t))}get _s(){return He(this,c0)}isValid(){return parseInt(He(this,c0).substring(0,3))<8}get v(){return He(this,z4)}set v(t){const n=Bi(t,"value");bn(n===27||n===28,"invalid v","v",t),Ht(this,z4,n)}get networkV(){return He(this,_w)}get legacyChainId(){const t=this.networkV;return t==null?null:Lp.getChainId(t)}get yParity(){return this.v===27?0:1}get yParityAndS(){const t=ps(this.s);return this.yParity&&(t[0]|=128),Gr(t)}get compactSerialized(){return La([this.r,this.yParityAndS])}get serialized(){return La([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 Lp(B6,this.r,this._s,this.v);return this.networkV&&Ht(t,_w,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=js(t,"v");return n==y0e||n==v0e?x0e:(bn(n>=JI,"invalid EIP-155 v","v",t),(n-JI)/b0e)}static getChainIdV(t,n){return js(t)*b0e+BigInt(35+n-27)}static getNormalizedV(t){const n=js(t);return n===x0e||n===y0e?27:n===g0e||n===v0e?28:(bn(n>=JI,"invalid v","v",t),n&g0e?27:28)}static from(t){function n(u,d){bn(u,d,"signature",t)}if(t==null)return new Lp(B6,m0e,m0e,27);if(typeof t=="string"){const u=ps(t,"signature");if(u.length===64){const d=Gr(u.slice(0,32)),f=u.slice(32,64),x=f[0]&128?28:27;return f[0]&=127,new Lp(B6,d,Gr(f),x)}if(u.length===65){const d=Gr(u.slice(0,32)),f=Gr(u.slice(32,64)),x=Lp.getNormalizedV(u[64]);return new Lp(B6,d,f,x)}n(!1,"invalid raw signature length")}if(t instanceof Lp)return t.clone();const r=t.r;n(r!=null,"missing r");const s=w0e(r),a=function(u,d){if(u!=null)return w0e(u);if(d!=null){n(uo(d,32),"invalid yParityAndS");const f=ps(d);return f[0]&=127,Gr(f)}n(!1,"missing s")}(t.s,t.yParityAndS),{networkV:o,v:l}=function(u,d,f){if(u!=null){const x=js(u);return{networkV:x>=JI?x:void 0,v:Lp.getNormalizedV(x)}}if(d!=null)return n(uo(d,32),"invalid yParityAndS"),{v:ps(d)[0]&128?28:27};if(f!=null){switch(Bi(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 Lp(B6,s,a,l);return o&&Ht(c,_w,o),n(t.yParity==null||Bi(t.yParity,"sig.yParity")===c.yParity,"yParity mismatch"),n(t.yParityAndS==null||t.yParityAndS===c.yParityAndS,"yParityAndS mismatch"),c}};U4=new WeakMap,c0=new WeakMap,z4=new WeakMap,_w=new WeakMap;let ru=Lp;var yg;const Dv=class Dv{constructor(t){On(this,yg);bn(n4(t)===32,"invalid private key","privateKey","[REDACTED]"),Ht(this,yg,Gr(t))}get privateKey(){return He(this,yg)}get publicKey(){return Dv.computePublicKey(He(this,yg))}get compressedPublicKey(){return Dv.computePublicKey(He(this,yg),!0)}sign(t){bn(n4(t)===32,"invalid digest length","digest",t);const n=Ab.sign(eu(t),eu(He(this,yg)),{lowS:!0});return ru.from({r:a1(n.r,32),s:a1(n.s,32),v:n.recovery?28:27})}computeSharedSecret(t){const n=Dv.computePublicKey(t);return Gr(Ab.getSharedSecret(eu(He(this,yg)),ps(n),!1))}static computePublicKey(t,n){let r=ps(t,"key");if(r.length===32){const a=Ab.getPublicKey(r,!!n);return Gr(a)}if(r.length===64){const a=new Uint8Array(65);a[0]=4,a.set(r,1),r=a}const s=Ab.ProjectivePoint.fromHex(r);return Gr(s.toRawBytes(n))}static recoverPublicKey(t,n){bn(n4(t)===32,"invalid digest length","digest",t);const r=ru.from(n);let s=Ab.Signature.fromCompact(eu(La([r.r,r.s])));s=s.addRecoveryBit(r.yParity);const a=s.recoverPublicKey(eu(t));return bn(a!=null,"invalid signature for digest","signature",n),"0x"+a.toHex(!1)}static addPoints(t,n,r){const s=Ab.ProjectivePoint.fromHex(Dv.computePublicKey(t).substring(2)),a=Ab.ProjectivePoint.fromHex(Dv.computePublicKey(n).substring(2));return"0x"+s.add(a).toHex(!!r)}};yg=new WeakMap;let D0=Dv;const Zvt=BigInt(0),Jvt=BigInt(36);function C0e(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=ps(co(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 pae={};for(let e=0;e<10;e++)pae[String(e)]=String(e);for(let e=0;e<26;e++)pae[String.fromCharCode(65+e)]=String(10+e);const S0e=15;function ewt(e){e=e.toUpperCase(),e=e.substring(4)+e.substring(0,2)+"00";let t=e.split("").map(r=>pae[r]).join("");for(;t.length>=S0e;){let r=t.substring(0,S0e);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 twt=function(){const e={};for(let t=0;t<36;t++){const n="0123456789abcdefghijklmnopqrstuvwxyz"[t];e[n]=BigInt(t)}return e}();function nwt(e){e=e.toLowerCase();let t=Zvt;for(let n=0;n<e.length;n++)t=t*Jvt+twt[e[n]];return t}function ra(e){if(bn(typeof e=="string","invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/)){e.startsWith("0x")||(e="0x"+e);const t=C0e(e);return bn(!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}$/)){bn(e.substring(2,4)===ewt(e),"bad icap checksum","address",e);let t=nwt(e.substring(4)).toString(16);for(;t.length<40;)t="0"+t;return C0e("0x"+t)}bn(!1,"invalid address","address",e)}function rwt(e){const t=ra(e.from);let r=js(e.nonce,"tx.nonce").toString(16);return r==="0"?r="0x":r.length%2?r="0x0"+r:r="0x"+r,ra(bo(co(o1([t,r])),12))}function jTe(e){return e&&typeof e.getAddress=="function"}async function RH(e,t){const n=await t;return(n==null||n==="0x0000000000000000000000000000000000000000")&&(Rr(typeof e!="string","unconfigured name","UNCONFIGURED_NAME",{value:e}),bn(!1,"invalid AddressLike value; did not resolve to a value address","target",e)),ra(n)}function Tc(e,t){if(typeof e=="string")return e.match(/^0x[0-9a-f]{40}$/i)?ra(e):(Rr(t!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),RH(e,t.resolveName(e)));if(jTe(e))return RH(e,e.getAddress());if(e&&typeof e.then=="function")return RH(e,e);bn(!1,"unsupported addressable value","target",e)}const ag={};function ks(e,t){let n=!1;return t<0&&(n=!0,t*=-1),new Ru(ag,`${n?"":"u"}int${t}`,e,{signed:n,width:t})}function pa(e,t){return new Ru(ag,`bytes${t||""}`,e,{size:t})}const N0e=Symbol.for("_ethers_typed");var kw;const lg=class lg{constructor(t,n,r,s){Dn(this,"type");Dn(this,"value");On(this,kw);Dn(this,"_typedSymbol");s==null&&(s=null),c5(ag,t,"Typed"),Bs(this,{_typedSymbol:N0e,type:n,value:r}),Ht(this,kw,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 He(this,kw)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return He(this,kw)===!0?-1:He(this,kw)===!1?this.value.length:null}static from(t,n){return new lg(ag,t,n)}static uint8(t){return ks(t,8)}static uint16(t){return ks(t,16)}static uint24(t){return ks(t,24)}static uint32(t){return ks(t,32)}static uint40(t){return ks(t,40)}static uint48(t){return ks(t,48)}static uint56(t){return ks(t,56)}static uint64(t){return ks(t,64)}static uint72(t){return ks(t,72)}static uint80(t){return ks(t,80)}static uint88(t){return ks(t,88)}static uint96(t){return ks(t,96)}static uint104(t){return ks(t,104)}static uint112(t){return ks(t,112)}static uint120(t){return ks(t,120)}static uint128(t){return ks(t,128)}static uint136(t){return ks(t,136)}static uint144(t){return ks(t,144)}static uint152(t){return ks(t,152)}static uint160(t){return ks(t,160)}static uint168(t){return ks(t,168)}static uint176(t){return ks(t,176)}static uint184(t){return ks(t,184)}static uint192(t){return ks(t,192)}static uint200(t){return ks(t,200)}static uint208(t){return ks(t,208)}static uint216(t){return ks(t,216)}static uint224(t){return ks(t,224)}static uint232(t){return ks(t,232)}static uint240(t){return ks(t,240)}static uint248(t){return ks(t,248)}static uint256(t){return ks(t,256)}static uint(t){return ks(t,256)}static int8(t){return ks(t,-8)}static int16(t){return ks(t,-16)}static int24(t){return ks(t,-24)}static int32(t){return ks(t,-32)}static int40(t){return ks(t,-40)}static int48(t){return ks(t,-48)}static int56(t){return ks(t,-56)}static int64(t){return ks(t,-64)}static int72(t){return ks(t,-72)}static int80(t){return ks(t,-80)}static int88(t){return ks(t,-88)}static int96(t){return ks(t,-96)}static int104(t){return ks(t,-104)}static int112(t){return ks(t,-112)}static int120(t){return ks(t,-120)}static int128(t){return ks(t,-128)}static int136(t){return ks(t,-136)}static int144(t){return ks(t,-144)}static int152(t){return ks(t,-152)}static int160(t){return ks(t,-160)}static int168(t){return ks(t,-168)}static int176(t){return ks(t,-176)}static int184(t){return ks(t,-184)}static int192(t){return ks(t,-192)}static int200(t){return ks(t,-200)}static int208(t){return ks(t,-208)}static int216(t){return ks(t,-216)}static int224(t){return ks(t,-224)}static int232(t){return ks(t,-232)}static int240(t){return ks(t,-240)}static int248(t){return ks(t,-248)}static int256(t){return ks(t,-256)}static int(t){return ks(t,-256)}static bytes1(t){return pa(t,1)}static bytes2(t){return pa(t,2)}static bytes3(t){return pa(t,3)}static bytes4(t){return pa(t,4)}static bytes5(t){return pa(t,5)}static bytes6(t){return pa(t,6)}static bytes7(t){return pa(t,7)}static bytes8(t){return pa(t,8)}static bytes9(t){return pa(t,9)}static bytes10(t){return pa(t,10)}static bytes11(t){return pa(t,11)}static bytes12(t){return pa(t,12)}static bytes13(t){return pa(t,13)}static bytes14(t){return pa(t,14)}static bytes15(t){return pa(t,15)}static bytes16(t){return pa(t,16)}static bytes17(t){return pa(t,17)}static bytes18(t){return pa(t,18)}static bytes19(t){return pa(t,19)}static bytes20(t){return pa(t,20)}static bytes21(t){return pa(t,21)}static bytes22(t){return pa(t,22)}static bytes23(t){return pa(t,23)}static bytes24(t){return pa(t,24)}static bytes25(t){return pa(t,25)}static bytes26(t){return pa(t,26)}static bytes27(t){return pa(t,27)}static bytes28(t){return pa(t,28)}static bytes29(t){return pa(t,29)}static bytes30(t){return pa(t,30)}static bytes31(t){return pa(t,31)}static bytes32(t){return pa(t,32)}static address(t){return new lg(ag,"address",t)}static bool(t){return new lg(ag,"bool",!!t)}static bytes(t){return new lg(ag,"bytes",t)}static string(t){return new lg(ag,"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 lg(ag,"overrides",Object.assign({},t))}static isTyped(t){return t&&typeof t=="object"&&"_typedSymbol"in t&&t._typedSymbol===N0e}static dereference(t,n){if(lg.isTyped(t)){if(t.type!==n)throw new Error(`invalid type: expecetd ${n}, got ${t.type}`);return t.value}return t}};kw=new WeakMap;let Ru=lg;class swt extends N1{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,n){let r=Ru.dereference(n,"string");try{r=ra(r)}catch(s){return this._throwError(s.message,n)}return t.writeValue(r)}decode(t){return ra(a1(t.readValue(),20))}}class iwt extends N1{constructor(n){super(n.name,n.type,"_",n.dynamic);Dn(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 ETe(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 Rr(d,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:n}),Rr(!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 bn(!1,"invalid tuple value","tuple",n);bn(t.length===r.length,"types/value length mismatch","tuple",n);let s=new wJ,a=new wJ,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 _Te(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(Jc(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(Jc(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)}),bM.fromItems(n,r)}class awt extends N1{constructor(n,r,s){const a=n.type+"["+(r>=0?r:"")+"]",o=r===-1||n.dynamic;super("array",a,s,o);Dn(this,"coder");Dn(this,"length");Bs(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=Ru.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)),hke(s.length,a,"coder array"+(this.localName?" "+this.localName:""));let o=[];for(let l=0;l<s.length;l++)o.push(this.coder);return ETe(n,o,s)}decode(n){let r=this.length;r===-1&&(r=n.readIndex(),Rr(r*od<=n.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:n.bytes,offset:r*od,length:n.dataLength}));let s=[];for(let a=0;a<r;a++)s.push(new iwt(this.coder));return _Te(n,s)}}class owt extends N1{constructor(t){super("bool","bool",t,!1)}defaultValue(){return!1}encode(t,n){const r=Ru.dereference(n,"bool");return t.writeValue(r?1:0)}decode(t){return!!t.readValue()}}class kTe extends N1{constructor(t,n){super(t,t,n,!0)}defaultValue(){return"0x"}encode(t,n){n=eu(n);let r=t.writeValue(n.length);return r+=t.writeBytes(n),r}decode(t){return t.readBytes(t.readIndex(),!0)}}class lwt extends kTe{constructor(t){super("bytes",t)}decode(t){return Gr(super.decode(t))}}class cwt extends N1{constructor(n,r){let s="bytes"+String(n);super(s,s,r,!1);Dn(this,"size");Bs(this,{size:n},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(n,r){let s=eu(Ru.dereference(r,this.type));return s.length!==this.size&&this._throwError("incorrect data length",r),n.writeBytes(s)}decode(n){return Gr(n.readBytes(this.size))}}const uwt=new Uint8Array([]);class dwt extends N1{constructor(t){super("null","",t,!1)}defaultValue(){return null}encode(t,n){return n!=null&&this._throwError("not null",n),t.writeBytes(uwt)}decode(t){return t.readBytes(0),null}}const fwt=BigInt(0),hwt=BigInt(1),pwt=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class mwt extends N1{constructor(n,r,s){const a=(r?"int":"uint")+n*8;super(a,a,s,!1);Dn(this,"size");Dn(this,"signed");Bs(this,{size:n,signed:r},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(n,r){let s=js(Ru.dereference(r,this.type)),a=hj(pwt,od*8);if(this.signed){let o=hj(a,this.size*8-1);(s>o||s<-(o+hwt))&&this._throwError("value out-of-bounds",r),s=gke(s,8*od)}else(s<fwt||s>hj(a,this.size*8))&&this._throwError("value out-of-bounds",r);return n.writeValue(s)}decode(n){let r=hj(n.readValue(),this.size*8);return this.signed&&(r=Gyt(r,this.size*8)),r}}class xwt extends kTe{constructor(t){super("string",t)}defaultValue(){return""}encode(t,n){return super.encode(t,fd(Ru.dereference(n,"string")))}decode(t){return gM(super.decode(t))}}class eP extends N1{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);Dn(this,"coders");Bs(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=Ru.dereference(r,"tuple");return ETe(n,this.coders,s)}decode(n){return _Te(n,this.coders)}}function LH(e,t){return{address:ra(e),storageKeys:t.map((n,r)=>(bn(uo(n,32),"invalid slot",`storageKeys[${r}]`,n),n.toLowerCase()))}}function u5(e){if(Array.isArray(e))return e.map((n,r)=>Array.isArray(n)?(bn(n.length===2,"invalid slot set",`value[${r}]`,n),LH(n[0],n[1])):(bn(n!=null&&typeof n=="object","invalid address-slot set","value",e),LH(n.address,n.storageKeys)));bn(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 LH(n,Object.keys(r).sort())});return t.sort((n,r)=>n.address.localeCompare(r.address)),t}function TTe(e){return{address:ra(e.address),nonce:js(e.nonce!=null?e.nonce:0),chainId:js(e.chainId!=null?e.chainId:0),signature:ru.from(e.signature)}}function Uk(e){let t;return typeof e=="string"?t=D0.computePublicKey(e,!1):t=e.publicKey,ra(co("0x"+t.substring(4)).substring(26))}function gwt(e,t){return Uk(D0.recoverPublicKey(e,t))}const jc=BigInt(0),bwt=BigInt(2),ywt=BigInt(27),vwt=BigInt(28),wwt=BigInt(35),Cwt=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),DH=4096*32;function Swt(e){return{blobToKzgCommitment:r=>{if("computeBlobProof"in e){if("blobToKzgCommitment"in e&&typeof e.blobToKzgCommitment=="function")return ps(e.blobToKzgCommitment(Gr(r)))}else if("blobToKzgCommitment"in e&&typeof e.blobToKzgCommitment=="function")return ps(e.blobToKzgCommitment(r));if("blobToKZGCommitment"in e&&typeof e.blobToKZGCommitment=="function")return ps(e.blobToKZGCommitment(Gr(r)));bn(!1,"unsupported KZG library","kzg",e)},computeBlobKzgProof:(r,s)=>{if("computeBlobProof"in e&&typeof e.computeBlobProof=="function")return ps(e.computeBlobProof(Gr(r),Gr(s)));if("computeBlobKzgProof"in e&&typeof e.computeBlobKzgProof=="function")return e.computeBlobKzgProof(r,s);if("computeBlobKZGProof"in e&&typeof e.computeBlobKZGProof=="function")return ps(e.computeBlobKZGProof(Gr(r),Gr(s)));bn(!1,"unsupported KZG library","kzg",e)}}}function A0e(e,t){let n=e.toString(16);for(;n.length<2;)n="0"+n;return n+=op(t).substring(4),"0x"+n}function OA(e){return e==="0x"?null:ra(e)}function DB(e,t){try{return u5(e)}catch(n){bn(!1,n.message,t,e)}}function Nwt(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:OA(s[1]),nonce:Va(s[2],"nonce"),chainId:Va(s[0],"chainId"),signature:ru.from({yParity:d5(s[3],"yParity"),r:i1(s[4],32),s:i1(s[5],32)})})}return n}catch(n){bn(!1,n.message,t,e)}}function d5(e,t){return e==="0x"?0:Bi(e,t)}function Va(e,t){if(e==="0x")return jc;const n=js(e,t);return bn(n<=Cwt,"value exceeds uint size",t,n),n}function na(e,t){const n=js(e,"value"),r=ol(n);return bn(r.length<=32,"value too large",`tx.${t}`,n),r}function BB(e){return u5(e).map(t=>[t.address,t.storageKeys])}function Awt(e){return e.map(t=>[na(t.chainId,"chainId"),t.address,na(t.nonce,"nonce"),na(t.signature.yParity,"yParity"),ol(t.signature.r),ol(t.signature.s)])}function jwt(e,t){bn(Array.isArray(e),`invalid ${t}`,"value",e);for(let n=0;n<e.length;n++)bn(uo(e[n],32),"invalid ${ param } hash",`value[${n}]`,e[n]);return e}function Ewt(e){const t=Bk(e);bn(Array.isArray(t)&&(t.length===9||t.length===6),"invalid field count for legacy transaction","data",e);const n={type:0,nonce:d5(t[0],"nonce"),gasPrice:Va(t[1],"gasPrice"),gasLimit:Va(t[2],"gasLimit"),to:OA(t[3]),value:Va(t[4],"value"),data:Gr(t[5]),chainId:jc};if(t.length===6)return n;const r=Va(t[6],"v"),s=Va(t[7],"r"),a=Va(t[8],"s");if(s===jc&&a===jc)n.chainId=r;else{let o=(r-wwt)/bwt;o<jc&&(o=jc),n.chainId=o,bn(o!==jc||r===ywt||r===vwt,"non-canonical legacy v","v",t[6]),n.signature=ru.from({r:i1(t[7],32),s:i1(t[8],32),v:r})}return n}function _wt(e,t){const n=[na(e.nonce,"nonce"),na(e.gasPrice||0,"gasPrice"),na(e.gasLimit,"gasLimit"),e.to||"0x",na(e.value,"value"),e.data];let r=jc;if(e.chainId!=jc)r=js(e.chainId,"tx.chainId"),bn(!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!==jc&&(n.push(ol(r)),n.push("0x"),n.push("0x")),o1(n);let s=BigInt(27+t.yParity);return r!==jc?s=ru.getChainIdV(r,t.v):BigInt(t.v)!==s&&bn(!1,"tx.chainId/sig.v mismatch","sig",t),n.push(ol(s)),n.push(ol(t.r)),n.push(ol(t.s)),o1(n)}function $B(e,t){let n;try{if(n=d5(t[0],"yParity"),n!==0&&n!==1)throw new Error("bad yParity")}catch{bn(!1,"invalid yParity","yParity",t[0])}const r=i1(t[1],32),s=i1(t[2],32),a=ru.from({r,s,yParity:n});e.signature=a}function kwt(e){const t=Bk(ps(e).slice(1));bn(Array.isArray(t)&&(t.length===9||t.length===12),"invalid field count for transaction type: 2","data",Gr(e));const n={type:2,chainId:Va(t[0],"chainId"),nonce:d5(t[1],"nonce"),maxPriorityFeePerGas:Va(t[2],"maxPriorityFeePerGas"),maxFeePerGas:Va(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:Va(t[4],"gasLimit"),to:OA(t[5]),value:Va(t[6],"value"),data:Gr(t[7]),accessList:DB(t[8],"accessList")};return t.length===9||$B(n,t.slice(9)),n}function Twt(e,t){const n=[na(e.chainId,"chainId"),na(e.nonce,"nonce"),na(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),na(e.maxFeePerGas||0,"maxFeePerGas"),na(e.gasLimit,"gasLimit"),e.to||"0x",na(e.value,"value"),e.data,BB(e.accessList||[])];return t&&(n.push(na(t.yParity,"yParity")),n.push(ol(t.r)),n.push(ol(t.s))),La(["0x02",o1(n)])}function Iwt(e){const t=Bk(ps(e).slice(1));bn(Array.isArray(t)&&(t.length===8||t.length===11),"invalid field count for transaction type: 1","data",Gr(e));const n={type:1,chainId:Va(t[0],"chainId"),nonce:d5(t[1],"nonce"),gasPrice:Va(t[2],"gasPrice"),gasLimit:Va(t[3],"gasLimit"),to:OA(t[4]),value:Va(t[5],"value"),data:Gr(t[6]),accessList:DB(t[7],"accessList")};return t.length===8||$B(n,t.slice(8)),n}function Pwt(e,t){const n=[na(e.chainId,"chainId"),na(e.nonce,"nonce"),na(e.gasPrice||0,"gasPrice"),na(e.gasLimit,"gasLimit"),e.to||"0x",na(e.value,"value"),e.data,BB(e.accessList||[])];return t&&(n.push(na(t.yParity,"recoveryParam")),n.push(ol(t.r)),n.push(ol(t.s))),La(["0x01",o1(n)])}function Fwt(e){let t=Bk(ps(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];bn(Array.isArray(a),"invalid network format: blobs not an array","fields[1]",a),bn(Array.isArray(o),"invalid network format: commitments not an array","fields[2]",o),bn(Array.isArray(l),"invalid network format: proofs not an array","fields[3]",l),bn(a.length===o.length,"invalid network format: blobs/commitments length mismatch","fields",t),bn(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]}bn(Array.isArray(t)&&(t.length===11||t.length===14),`invalid field count for transaction type: ${n}`,"data",Gr(e));const s={type:3,chainId:Va(t[0],"chainId"),nonce:d5(t[1],"nonce"),maxPriorityFeePerGas:Va(t[2],"maxPriorityFeePerGas"),maxFeePerGas:Va(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:Va(t[4],"gasLimit"),to:OA(t[5]),value:Va(t[6],"value"),data:Gr(t[7]),accessList:DB(t[8],"accessList"),maxFeePerBlobGas:Va(t[9],"maxFeePerBlobGas"),blobVersionedHashes:t[10]};r&&(s.blobs=r),bn(s.to!=null,`invalid address for transaction type: ${n}`,"data",e),bn(Array.isArray(s.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",e);for(let a=0;a<s.blobVersionedHashes.length;a++)bn(uo(s.blobVersionedHashes[a],32),`invalid blobVersionedHash at index ${a}: must be length 32`,"data",e);return t.length===11||$B(s,t.slice(11)),s}function Owt(e,t,n){const r=[na(e.chainId,"chainId"),na(e.nonce,"nonce"),na(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),na(e.maxFeePerGas||0,"maxFeePerGas"),na(e.gasLimit,"gasLimit"),e.to||cE,na(e.value,"value"),e.data,BB(e.accessList||[]),na(e.maxFeePerBlobGas||0,"maxFeePerBlobGas"),jwt(e.blobVersionedHashes||[],"blobVersionedHashes")];return t&&(r.push(na(t.yParity,"yParity")),r.push(ol(t.r)),r.push(ol(t.s)),n)?La(["0x03",o1([r,n.map(s=>s.data),n.map(s=>s.commitment),n.map(s=>s.proof)])]):La(["0x03",o1(r)])}function Mwt(e){const t=Bk(ps(e).slice(1));bn(Array.isArray(t)&&(t.length===10||t.length===13),"invalid field count for transaction type: 4","data",Gr(e));const n={type:4,chainId:Va(t[0],"chainId"),nonce:d5(t[1],"nonce"),maxPriorityFeePerGas:Va(t[2],"maxPriorityFeePerGas"),maxFeePerGas:Va(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:Va(t[4],"gasLimit"),to:OA(t[5]),value:Va(t[6],"value"),data:Gr(t[7]),accessList:DB(t[8],"accessList"),authorizationList:Nwt(t[9],"authorizationList")};return t.length===10||$B(n,t.slice(10)),n}function Rwt(e,t){const n=[na(e.chainId,"chainId"),na(e.nonce,"nonce"),na(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),na(e.maxFeePerGas||0,"maxFeePerGas"),na(e.gasLimit,"gasLimit"),e.to||"0x",na(e.value,"value"),e.data,BB(e.accessList||[]),Awt(e.authorizationList||[])];return t&&(n.push(na(t.yParity,"yParity")),n.push(ol(t.r)),n.push(ol(t.s))),La(["0x04",o1(n)])}var qp,H4,V4,W4,q4,G4,K4,Y4,X4,Q4,Z4,J4,Tw,Xb,u0,Qb,eS,tS,XF,Df;let mae=(Df=class{constructor(){On(this,tS);On(this,qp);On(this,H4);On(this,V4);On(this,W4);On(this,q4);On(this,G4);On(this,K4);On(this,Y4);On(this,X4);On(this,Q4);On(this,Z4);On(this,J4);On(this,Tw);On(this,Xb);On(this,u0);On(this,Qb);On(this,eS);Ht(this,qp,null),Ht(this,H4,null),Ht(this,W4,0),Ht(this,q4,jc),Ht(this,G4,null),Ht(this,K4,null),Ht(this,Y4,null),Ht(this,V4,"0x"),Ht(this,X4,jc),Ht(this,Q4,jc),Ht(this,Z4,null),Ht(this,J4,null),Ht(this,Tw,null),Ht(this,Xb,null),Ht(this,u0,null),Ht(this,Qb,null),Ht(this,eS,null)}get type(){return He(this,qp)}set type(t){switch(t){case null:Ht(this,qp,null);break;case 0:case"legacy":Ht(this,qp,0);break;case 1:case"berlin":case"eip-2930":Ht(this,qp,1);break;case 2:case"london":case"eip-1559":Ht(this,qp,2);break;case 3:case"cancun":case"eip-4844":Ht(this,qp,3);break;case 4:case"pectra":case"eip-7702":Ht(this,qp,4);break;default:bn(!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=He(this,H4);return t==null&&this.type===3?cE:t}set to(t){Ht(this,H4,t==null?null:ra(t))}get nonce(){return He(this,W4)}set nonce(t){Ht(this,W4,Bi(t,"value"))}get gasLimit(){return He(this,q4)}set gasLimit(t){Ht(this,q4,js(t))}get gasPrice(){const t=He(this,G4);return t==null&&(this.type===0||this.type===1)?jc:t}set gasPrice(t){Ht(this,G4,t==null?null:js(t,"gasPrice"))}get maxPriorityFeePerGas(){const t=He(this,K4);return t??(this.type===2||this.type===3?jc:null)}set maxPriorityFeePerGas(t){Ht(this,K4,t==null?null:js(t,"maxPriorityFeePerGas"))}get maxFeePerGas(){const t=He(this,Y4);return t??(this.type===2||this.type===3?jc:null)}set maxFeePerGas(t){Ht(this,Y4,t==null?null:js(t,"maxFeePerGas"))}get data(){return He(this,V4)}set data(t){Ht(this,V4,Gr(t))}get value(){return He(this,X4)}set value(t){Ht(this,X4,js(t,"value"))}get chainId(){return He(this,Q4)}set chainId(t){Ht(this,Q4,js(t))}get signature(){return He(this,Z4)||null}set signature(t){Ht(this,Z4,t==null?null:ru.from(t))}get accessList(){const t=He(this,J4)||null;return t??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(t){Ht(this,J4,t==null?null:u5(t))}get authorizationList(){const t=He(this,eS)||null;return t==null&&this.type===4?[]:t}set authorizationList(t){Ht(this,eS,t==null?null:t.map(n=>TTe(n)))}get maxFeePerBlobGas(){const t=He(this,Tw);return t==null&&this.type===3?jc:t}set maxFeePerBlobGas(t){Ht(this,Tw,t==null?null:js(t,"maxFeePerBlobGas"))}get blobVersionedHashes(){let t=He(this,Xb);return t==null&&this.type===3?[]:t}set blobVersionedHashes(t){if(t!=null){bn(Array.isArray(t),"blobVersionedHashes must be an Array","value",t),t=t.slice();for(let n=0;n<t.length;n++)bn(uo(t[n],32),"invalid blobVersionedHash",`value[${n}]`,t[n])}Ht(this,Xb,t)}get blobs(){return He(this,Qb)==null?null:He(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(TB(a)){Rr(He(this,u0),"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let o=ps(a);if(bn(o.length<=DH,"blob is too large",`blobs[${s}]`,a),o.length!==DH){const u=new Uint8Array(DH);u.set(o),o=u}const l=He(this,u0).blobToKzgCommitment(o),c=Gr(He(this,u0).computeBlobKzgProof(o,l));n.push({data:Gr(o),commitment:Gr(l),proof:c}),r.push(A0e(1,l))}else{const o=Gr(a.commitment);n.push({data:Gr(a.data),commitment:o,proof:Gr(a.proof)}),r.push(A0e(1,o))}}Ht(this,Qb,n),Ht(this,Xb,r)}get kzg(){return He(this,u0)}set kzg(t){t==null?Ht(this,u0,null):Ht(this,u0,Swt(t))}get hash(){return this.signature==null?null:co(wr(this,tS,XF).call(this,!0,!1))}get unsignedHash(){return co(this.unsignedSerialized)}get from(){return this.signature==null?null:gwt(this.unsignedHash,this.signature)}get fromPublicKey(){return this.signature==null?null:D0.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return this.signature!=null}get serialized(){return wr(this,tS,XF).call(this,!0,!0)}get unsignedSerialized(){return wr(this,tS,XF).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=He(this,Tw)!=null||He(this,Xb);this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&Rr(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),Rr(!n||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),Rr(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 Df.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 Df;if(typeof t=="string"){const r=ps(t);if(r[0]>=127)return Df.from(Ewt(r));switch(r[0]){case 1:return Df.from(Iwt(r));case 2:return Df.from(kwt(r));case 3:return Df.from(Fwt(r));case 4:return Df.from(Mwt(r))}Rr(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const n=new Df;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=ru.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&&(bn(n.isSigned(),"unsigned transaction cannot define '.hash'","tx",t),bn(n.hash===t.hash,"hash mismatch","tx",t)),t.from!=null&&(bn(n.isSigned(),"unsigned transaction cannot define '.from'","tx",t),bn(n.from.toLowerCase()===(t.from||"").toLowerCase(),"from mismatch","tx",t)),n}},qp=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,Z4=new WeakMap,J4=new WeakMap,Tw=new WeakMap,Xb=new WeakMap,u0=new WeakMap,Qb=new WeakMap,eS=new WeakMap,tS=new WeakSet,XF=function(t,n){Rr(!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 _wt(this,r);case 1:return Pwt(this,r);case 2:return Twt(this,r);case 3:return Owt(this,r,n?this.blobs:null);case 4:return Rwt(this,r)}Rr(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})},Df);function Lwt(e){return bn(typeof e.address=="string","invalid address for hashAuthorization","auth.address",e),co(La(["0x05",o1([e.chainId!=null?ol(e.chainId):"0x",ra(e.address),e.nonce!=null?ol(e.nonce):"0x"])]))}function l1(e){return co(fd(e))}var Dwt="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 j0e=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),E0e=4;function Bwt(e){let t=0;function n(){return e[t++]<<8|e[t++]}let r=n(),s=1,a=[0,1];for(let O=1;O<r;O++)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 O=0;O<f;O++)C=C<<1|d();let N=[],P=0,I=x;for(;;){let O=Math.floor(((C-P+1)*s-1)/I),U=0,L=r;for(;L-U>1;){let ne=U+L>>>1;O<a[ne]?L=ne:U=ne}if(U==0)break;N.push(U);let z=P+Math.floor(I*a[U]/s),X=P+Math.floor(I*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;P=z,I=1+X-z}let R=r-4;return N.map(O=>{switch(O-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 O-1}})}function $wt(e){let t=0;return()=>e[t++]}function ITe(e){return $wt(Bwt(Uwt(e)))}function Uwt(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 zwt(e){return e&1?~e>>1:e>>1}function Hwt(e,t){let n=Array(e);for(let r=0,s=0;r<e;r++)n[r]=s+=zwt(t());return n}function uE(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 PTe(e){return dE(()=>{let t=uE(e);if(t.length)return t})}function FTe(e){let t=[];for(;;){let n=e();if(n==0)break;t.push(Vwt(n,e))}for(;;){let n=e()-1;if(n<0)break;t.push(Wwt(n,e))}return t.flat()}function dE(e){let t=[];for(;;){let n=e(t.length);if(!n)break;t.push(n)}return t}function OTe(e,t,n){let r=Array(e).fill().map(()=>[]);for(let s=0;s<t;s++)Hwt(e,n).forEach((a,o)=>r[o].push(a));return r}function Vwt(e,t){let n=1+t(),r=t(),s=dE(t);return OTe(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 Wwt(e,t){let n=1+t();return OTe(n,1+e,t).map(s=>[s[0],s.slice(1)])}function qwt(e){let t=[],n=uE(e);return s(r([]),[]),t;function r(a){let o=e(),l=dE(()=>{let c=uE(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 Gwt(e){return e.toString(16).toUpperCase().padStart(2,"0")}function MTe(e){return`{${Gwt(e)}}`}function Kwt(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 US(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 Ywt(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 Xwt="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 fE=44032,yM=4352,vM=4449,wM=4519,RTe=19,LTe=21,zS=28,CM=LTe*zS,Qwt=RTe*CM,Zwt=fE+Qwt,Jwt=yM+RTe,e3t=vM+LTe,t3t=wM+zS;function mj(e){return e>>24&255}function DTe(e){return e&16777215}let kJ,_0e,TJ,QF;function n3t(){let e=ITe(Xwt);kJ=new Map(PTe(e).flatMap((t,n)=>t.map(r=>[r,n+1<<24]))),_0e=new Set(uE(e)),TJ=new Map,QF=new Map;for(let[t,n]of FTe(e)){if(!_0e.has(t)&&n.length==2){let[r,s]=n,a=QF.get(r);a||(a=new Map,QF.set(r,a)),a.set(s,t)}TJ.set(t,n.reverse())}}function BTe(e){return e>=fE&&e<Zwt}function r3t(e,t){if(e>=yM&&e<Jwt&&t>=vM&&t<e3t)return fE+(e-yM)*CM+(t-vM)*zS;if(BTe(e)&&t>wM&&t<t3t&&(e-fE)%zS==0)return e+(t-wM);{let n=QF.get(e);return n&&(n=n.get(t),n)?n:-1}}function $Te(e){kJ||n3t();let t=[],n=[],r=!1;function s(a){let o=kJ.get(a);o&&(r=!0,a|=o),t.push(a)}for(let a of e)for(;;){if(a<128)t.push(a);else if(BTe(a)){let o=a-fE,l=o/CM|0,c=o%CM/zS|0,u=o%zS;s(yM+l),s(vM+c),u>0&&s(wM+u)}else{let o=TJ.get(a);o?n.push(...o):s(a)}if(!n.length)break;a=n.pop()}if(r&&t.length>1){let a=mj(t[0]);for(let o=1;o<t.length;o++){let l=mj(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=mj(t[--c]),a<=l))break}a=mj(t[o])}}return t}function s3t(e){let t=[],n=[],r=-1,s=0;for(let a of e){let o=mj(a),l=DTe(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=r3t(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 UTe(e){return $Te(e).map(DTe)}function i3t(e){return s3t($Te(e))}const k0e=45,zTe=".",HTe=65039,VTe=1,SM=e=>Array.from(e);function hE(e,t){return e.P.has(t)||e.Q.has(t)}let a3t=class extends Array{get is_emoji(){return!0}},IJ,WTe,Kv,PJ,qTe,s4,BH,bC,Nv,T0e,FJ;function xae(){if(IJ)return;let e=ITe(Dwt);const t=()=>uE(e),n=()=>new Set(t()),r=(d,f)=>f.forEach(x=>d.add(x));IJ=new Map(FTe(e)),WTe=n(),Kv=t(),PJ=new Set(t().map(d=>Kv[d])),Kv=new Set(Kv),qTe=n(),n();let s=PTe(e),a=e();const o=()=>{let d=new Set;return t().forEach(f=>r(d,s[f])),r(d,t()),d};s4=dE(d=>{let f=dE(e).map(x=>x+96);if(f.length){let x=d>=a;f[0]-=32,f=US(f),x&&(f=`Restricted[${f}]`);let g=o(),v=o(),w=!e();return{N:f,P:g,Q:v,M:w,R:x}}}),BH=n(),bC=new Map;let l=t().concat(SM(BH)).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),BH.has(d)||bC.set(d,g)});for(let{V:d,M:f}of new Set(bC.values())){let x=[];for(let v of d){let w=s4.filter(N=>hE(N,v)),C=x.find(({G:N})=>w.some(P=>N.has(P)));C||(C={G:new Set,V:[]},x.push(C)),C.V.push(v),r(C.G,w)}let g=x.flatMap(v=>SM(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 s4){for(let f of d.P)u(f);for(let f of d.Q)u(f)}for(let d of Nv)!bC.has(d)&&!c.has(d)&&bC.set(d,VTe);r(Nv,UTe(Nv)),T0e=qwt(e).map(d=>a3t.from(d)).sort(Ywt),FJ=new Map;for(let d of T0e){let f=[FJ];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===HTe?f.push(...g):f=g}for(let x of f)x.V=d}}function gae(e){return(GTe(e)?"":`${bae(UB([e]))} `)+MTe(e)}function bae(e){return`"${e}"‎`}function o3t(e){if(e.length>=4&&e[2]==k0e&&e[3]==k0e)throw new Error(`invalid label extension: "${US(e.slice(0,4))}"`)}function l3t(e){for(let n=e.lastIndexOf(95);n>0;)if(e[--n]!==95)throw new Error("underscore allowed only at start")}function c3t(e){let t=e[0],n=j0e.get(t);if(n)throw Vj(`leading ${n}`);let r=e.length,s=-1;for(let a=1;a<r;a++){t=e[a];let o=j0e.get(t);if(o){if(s==a)throw Vj(`${n} + ${o}`);s=a+1,n=o}}if(s==r)throw Vj(`trailing ${n}`)}function UB(e,t=1/0,n=MTe){let r=[];u3t(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];GTe(l)&&(r.push(US(e.slice(s,o))),r.push(n(l)),s=o+1)}return r.push(US(e.slice(s,a))),r.join("")}function u3t(e){return xae(),Kv.has(e)}function GTe(e){return xae(),qTe.has(e)}function d3t(e){return m3t(f3t(e,i3t,b3t))}function f3t(e,t,n){if(!e)return[];xae();let r=0;return e.split(zTe).map(s=>{let a=Kwt(s),o={input:a,offset:r};r+=a.length+1;try{let l=o.tokens=g3t(a,t,n),c=l.length,u;if(!c)throw new Error("empty label");let d=o.output=l.flat();if(l3t(d),!(o.emoji=c>1||l[0].is_emoji)&&d.every(x=>x<128))o3t(d),u="ASCII";else{let x=l.flatMap(g=>g.is_emoji?[]:g);if(!x.length)u="Emoji";else{if(Kv.has(d[0]))throw Vj("leading combining mark");for(let w=1;w<c;w++){let C=l[w];if(!C.is_emoji&&Kv.has(C[0]))throw Vj(`emoji + combining mark: "${US(l[w-1])} + ${UB([C[0]])}"`)}c3t(d);let g=SM(new Set(x)),[v]=p3t(g);x3t(v,x),h3t(v,g),u=v.N}}o.type=u}catch(l){o.error=l}return o})}function h3t(e,t){let n,r=[];for(let s of t){let a=bC.get(s);if(a===VTe)return;if(a){let o=a.M.get(s);if(n=n?n.filter(l=>o.has(l)):SM(o),!n.length)return}else r.push(s)}if(n){for(let s of n)if(r.every(a=>hE(s,a)))throw new Error(`whole-script confusable: ${e.N}/${s.N}`)}}function p3t(e){let t=s4;for(let n of e){let r=t.filter(s=>hE(s,n));if(!r.length)throw s4.some(s=>hE(s,n))?YTe(t[0],n):KTe(n);if(t=r,r.length==1)break}return t}function m3t(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 ${bae(UB(t,63))}: ${s}`)}return US(r)}).join(zTe)}function KTe(e){return new Error(`disallowed character: ${gae(e)}`)}function YTe(e,t){let n=gae(t),r=s4.find(s=>s.P.has(t));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${e.N} + ${n}`)}function Vj(e){return new Error(`illegal placement: ${e}`)}function x3t(e,t){for(let n of t)if(!hE(e,n))throw YTe(e,n);if(e.M){let n=UTe(t);for(let r=1,s=n.length;r<s;r++)if(PJ.has(n[r])){let a=r+1;for(let o;a<s&&PJ.has(o=n[a]);a++)for(let l=r;l<a;l++)if(n[l]==o)throw new Error(`duplicate non-spacing marks: ${gae(o)}`);if(a-r>E0e)throw new Error(`excessive non-spacing marks: ${bae(UB(n.slice(r-1,a)))} (${a-r}/${E0e})`);r=a}}}function g3t(e,t,n){let r=[],s=[];for(e=e.slice().reverse();e.length;){let a=y3t(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=IJ.get(o);if(l)s.push(...l);else if(!WTe.has(o))throw KTe(o)}}}return s.length&&r.push(t(s)),r}function b3t(e){return e.filter(t=>t!=HTe)}function y3t(e,t){let n=FJ,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 XTe=new Uint8Array(32);XTe.fill(0);function I0e(e){return bn(e.length!==0,"invalid ENS name; empty component","comp",e),e}function QTe(e){const t=fd(v3t(e)),n=[];if(e.length===0)return n;let r=0;for(let s=0;s<t.length;s++)t[s]===46&&(n.push(I0e(t.slice(r,s))),r=s+1);return bn(r<t.length,"invalid ENS name; empty component","name",e),n.push(I0e(t.slice(r))),n}function v3t(e){try{if(e.length===0)throw new Error("empty label");return d3t(e)}catch(t){bn(!1,`invalid ENS name (${t.message})`,"name",e)}}function OJ(e){bn(typeof e=="string","invalid ENS name; not a string","name",e),bn(e.length,"invalid ENS name (empty label)","name",e);let t=XTe;const n=QTe(e);for(;n.length;)t=co(La([t,co(n.pop())]));return Gr(t)}function w3t(e,t){const n=t;return bn(n<=255,"DNS encoded label cannot exceed 255","length",n),Gr(La(QTe(e).map(r=>{bn(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 C3t(e){return typeof e=="string"&&(e=fd(e)),co(La([fd(Qvt),fd(String(e.length)),e]))}const ZTe=new Uint8Array(32);ZTe.fill(0);const S3t=BigInt(-1),JTe=BigInt(0),eIe=BigInt(1),N3t=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function A3t(e){const t=ps(e),n=t.length%32;return n?La([t,ZTe.slice(n)]):Gr(t)}const j3t=a1(eIe,32),E3t=a1(JTe,32),P0e={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},$H=["name","version","chainId","verifyingContract","salt"];function F0e(e){return function(t){return bn(typeof t=="string",`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const _3t={name:F0e("name"),version:F0e("version"),chainId:function(e){const t=js(e,"domain.chainId");return bn(t>=0,"invalid chain ID","domain.chainId",e),Number.isSafeInteger(t)?Number(t):tm(t)},verifyingContract:function(e){try{return ra(e).toLowerCase()}catch{}bn(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){const t=ps(e,"domain.salt");return bn(t.length===32,'invalid domain value "salt"',"domain.salt",e),Gr(t)}};function UH(e){{const t=e.match(/^(u?)int(\d+)$/);if(t){const n=t[1]==="",r=parseInt(t[2]);bn(r%8===0&&r!==0&&r<=256&&t[2]===String(r),"invalid numeric width","type",e);const s=hj(N3t,n?r-1:r),a=n?(s+eIe)*S3t:JTe;return function(o){const l=js(o,"value");return bn(l>=a&&l<=s,`value out-of-bounds for ${e}`,"value",l),a1(n?gke(l,256):l,32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const n=parseInt(t[1]);return bn(n!==0&&n<=32&&t[1]===String(n),"invalid bytes width","type",e),function(r){const s=ps(r);return bn(s.length===n,`invalid length for ${e}`,"value",r),A3t(r)}}}switch(e){case"address":return function(t){return i1(ra(t),32)};case"bool":return function(t){return t?j3t:E3t};case"bytes":return function(t){return co(t)};case"string":return function(t){return l1(t)}}return null}function O0e(e,t){return`${e}(${t.map(({name:n,type:r})=>r+" "+n).join(",")})`}function tP(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 tk,vg,nS,dD,tIe;const Fh=class Fh{constructor(t){On(this,dD);Dn(this,"primaryType");On(this,tk);On(this,vg);On(this,nS);Ht(this,vg,new Map),Ht(this,nS,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}=tP(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,tk,JSON.stringify(a));for(const c in a){const u=new Set;for(const d of a[c]){bn(!u.has(d.name),`duplicate variable name ${JSON.stringify(d.name)} in ${JSON.stringify(c)}`,"types",t),u.add(d.name);const f=tP(d.type).base;bn(f!==c,`circular type reference to ${JSON.stringify(f)}`,"types",t),!UH(f)&&(bn(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);bn(o.length!==0,"missing primary type","types",t),bn(o.length===1,`ambiguous primary types or unused types: ${o.map(c=>JSON.stringify(c)).join(", ")}`,"types",t),Bs(this,{primaryType:o[0]});function l(c,u){bn(!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(),He(this,vg).set(c,O0e(c,a[c])+d.map(f=>O0e(f,a[f])).join(""))}}get types(){return JSON.parse(He(this,tk))}getEncoder(t){let n=He(this,nS).get(t);return n||(n=wr(this,dD,tIe).call(this,t),He(this,nS).set(t,n)),n}encodeType(t){const n=He(this,vg).get(t);return bn(n,`unknown type: ${JSON.stringify(t)}`,"name",t),n}encodeData(t,n){return this.getEncoder(t)(n)}hashStruct(t,n){return co(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(UH(t))return r(t,n);const s=tP(t).array;if(s)return bn(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),{});bn(!1,`unknown type: ${t}`,"type",t)}visit(t,n){return this._visit(this.primaryType,t,n)}static from(t){return new Fh(t)}static getPrimaryType(t){return Fh.from(t).primaryType}static hashStruct(t,n,r){return Fh.from(n).hashStruct(t,r)}static hashDomain(t){const n=[];for(const r in t){if(t[r]==null)continue;const s=P0e[r];bn(s,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),n.push({name:r,type:s})}return n.sort((r,s)=>$H.indexOf(r.name)-$H.indexOf(s.name)),Fh.hashStruct("EIP712Domain",{EIP712Domain:n},t)}static encode(t,n,r){return La(["0x1901",Fh.hashDomain(t),Fh.from(n).hash(r)])}static hash(t,n,r){return co(Fh.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&&!uo(t.verifyingContract,20)&&(a[t.verifyingContract]="0x");const o=Fh.from(n);o.visit(r,(l,c)=>(l==="address"&&!uo(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){Fh.hashDomain(t);const s={},a=[];$H.forEach(c=>{const u=t[c];u!=null&&(s[c]=_3t[c](u),a.push({name:c,type:P0e[c]}))});const o=Fh.from(n);n=o.types;const l=Object.assign({},n);return bn(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 Gr(ps(u));if(c.match(/^u?int/))return js(u).toString();switch(c){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return bn(typeof u=="string","invalid string","value",u),u}bn(!1,"unsupported type","type",c)})}}};tk=new WeakMap,vg=new WeakMap,nS=new WeakMap,dD=new WeakSet,tIe=function(t){{const s=UH(t);if(s)return s}const n=tP(t).array;if(n){const s=n.prefix,a=this.getEncoder(s);return o=>{bn(n.count===-1||n.count===o.length,`array length mismatch; expected length ${n.count}`,"value",o);let l=o.map(a);return He(this,vg).has(s)&&(l=l.map(co)),co(La(l))}}const r=this.types[t];if(r){const s=l1(He(this,vg).get(t));return a=>{const o=r.map(({name:l,type:c})=>{const u=this.getEncoder(c)(a[l]);return He(this,vg).has(c)?co(u):u});return o.unshift(s),La(o)}}bn(!1,`unknown type: ${t}`,"type",t)};let HS=Fh;function ld(e){const t=new Set;return e.forEach(n=>t.add(n)),Object.freeze(t)}const k3t="external public payable override",T3t=ld(k3t.split(" ")),nIe="constant external internal payable private public pure view override",I3t=ld(nIe.split(" ")),rIe="constructor error event fallback function receive struct",sIe=ld(rIe.split(" ")),iIe="calldata memory storage payable indexed",P3t=ld(iIe.split(" ")),F3t="tuple returns",O3t=[rIe,iIe,F3t,nIe].join(" "),M3t=ld(O3t.split(" ")),R3t={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},L3t=new RegExp("^(\\s*)"),D3t=new RegExp("^([0-9]+)"),B3t=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),aIe=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),oIe=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var qc,Gp,nk,MJ;const fD=class fD{constructor(t){On(this,nk);On(this,qc);On(this,Gp);Ht(this,qc,0),Ht(this,Gp,t.slice())}get offset(){return He(this,qc)}get length(){return He(this,Gp).length-He(this,qc)}clone(){return new fD(He(this,Gp))}reset(){Ht(this,qc,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=wr(this,nk,MJ).call(this,He(this,qc)+1,t.match+1);return Ht(this,qc,t.match+1),n}popParams(){const t=this.peek();if(t.type!=="OPEN_PAREN")throw new Error("bad start");const n=[];for(;He(this,qc)<t.match-1;){const r=this.peek().linkNext;n.push(wr(this,nk,MJ).call(this,He(this,qc)+1,r)),Ht(this,qc,r)}return Ht(this,qc,t.match+1),n}peek(){if(He(this,qc)>=He(this,Gp).length)throw new Error("out-of-bounds");return He(this,Gp)[He(this,qc)]}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 ib(this,qc)._++,t}toString(){const t=[];for(let n=He(this,qc);n<He(this,Gp).length;n++){const r=He(this,Gp)[n];t.push(`${r.type}:${r.text}`)}return`<TokenString ${t.join(" ")}>`}};qc=new WeakMap,Gp=new WeakMap,nk=new WeakSet,MJ=function(t=0,n=0){return new fD(He(this,Gp).slice(t,n).map(r=>Object.freeze(Object.assign({},r,{match:r.match-t,linkBack:r.linkBack-t,linkNext:r.linkNext-t}))))};let ym=fD;function o2(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(L3t);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=R3t[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=Bi(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(B3t),l){if(c.text=l[1],a+=c.text.length,M3t.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(oIe)){c.type="TYPE";continue}c.type="ID";continue}if(l=o.match(D3t),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 ym(t.map(o=>Object.freeze(o)))}function M0e(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 zB(e,t){if(t.peekKeyword(sIe)){const n=t.pop().text;if(n!==e)throw new Error(`expected ${e}, got ${n}`)}return t.popType("ID")}function c1(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 lIe(e){let t=c1(e,I3t);return M0e(t,ld("constant payable nonpayable".split(" "))),M0e(t,ld("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 Wg(e,t){return e.popParams().map(n=>su.from(n,t))}function cIe(e){if(e.peekType("AT")){if(e.pop(),e.peekType("NUMBER"))return js(e.pop().text);throw new Error("invalid gas")}return null}function E3(e){if(e.length)throw new Error(`unexpected tokens at offset ${e.offset}: ${e.toString()}`)}const $3t=new RegExp(/^(.*)\[([0-9]*)\]$/);function R0e(e){const t=e.match(oIe);if(bn(t,"invalid type","type",e),e==="uint")return"uint256";if(e==="int")return"int256";if(t[2]){const n=parseInt(t[2]);bn(n!==0&&n<=32,"invalid bytes length","type",e)}else if(t[3]){const n=parseInt(t[3]);bn(n!==0&&n<=256&&n%8===0,"invalid numeric width","type",e)}return e}const Uo={},uf=Symbol.for("_ethers_internal"),L0e="_ParamTypeInternal",D0e="_ErrorInternal",B0e="_EventInternal",$0e="_ConstructorInternal",U0e="_FallbackInternal",z0e="_FunctionInternal",H0e="_StructInternal";var rS,ZF;const Oh=class Oh{constructor(t,n,r,s,a,o,l,c){On(this,rS);Dn(this,"name");Dn(this,"type");Dn(this,"baseType");Dn(this,"indexed");Dn(this,"components");Dn(this,"arrayLength");Dn(this,"arrayChildren");if(c5(t,Uo,"ParamType"),Object.defineProperty(this,uf,{value:L0e}),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("");Bs(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 wr(this,rS,ZF).call(this,r,t,n,a=>{s[0]=a}),r.length&&await Promise.all(r),s[0]}static from(t,n){if(Oh.isParamType(t))return t;if(typeof t=="string")try{return Oh.from(o2(t),n)}catch{bn(!1,"invalid param type","obj",t)}else if(t instanceof ym){let l="",c="",u=null;c1(t,ld(["tuple"])).has("tuple")||t.peekType("OPEN_PAREN")?(c="tuple",u=t.popParams().map(w=>Oh.from(w)),l=`tuple(${u.map(w=>w.format()).join(",")})`):(l=R0e(t.popType("TYPE")),c=l);let d=null,f=null;for(;t.length&&t.peekType("BRACKET");){const w=t.pop();d=new Oh(Uo,"",l,c,null,u,f,d),f=w.value,l+=w.text,c="array",u=null}let x=null;if(c1(t,P3t).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 Oh(Uo,v,l,c,x,u,f,d)}const r=t.name;bn(!r||typeof r=="string"&&r.match(aIe),"invalid name","obj.name",r);let s=t.indexed;s!=null&&(bn(n,"parameter cannot be indexed","obj.indexed",t.indexed),s=!!s);let a=t.type,o=a.match($3t);if(o){const l=parseInt(o[2]||"-1"),c=Oh.from({type:o[1],components:t.components});return new Oh(Uo,r||"",a,"array",s,null,l,c)}if(a==="tuple"||a.startsWith("tuple(")||a.startsWith("(")){const l=t.components!=null?t.components.map(u=>Oh.from(u)):null;return new Oh(Uo,r||"",a,"tuple",s,l,null,null)}return a=R0e(t.type),new Oh(Uo,r||"",a,a,s,null,null,null)}static isParamType(t){return t&&t[uf]===L0e}};rS=new WeakSet,ZF=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;wr(d=o,rS,ZF).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;wr(d=o[u],rS,ZF).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 su=Oh;class _3{constructor(t,n,r){Dn(this,"type");Dn(this,"inputs");c5(t,Uo,"Fragment"),r=Object.freeze(r.slice()),Bs(this,{type:n,inputs:r})}static from(t){if(typeof t=="string"){try{_3.from(JSON.parse(t))}catch{}return _3.from(o2(t))}if(t instanceof ym)switch(t.peekKeyword(sIe)){case"constructor":return Mg.from(t);case"error":return Gd.from(t);case"event":return C0.from(t);case"fallback":case"receive":return ug.from(t);case"function":return S0.from(t);case"struct":return Xw.from(t)}else if(typeof t=="object"){switch(t.type){case"constructor":return Mg.from(t);case"error":return Gd.from(t);case"event":return C0.from(t);case"fallback":case"receive":return ug.from(t);case"function":return S0.from(t);case"struct":return Xw.from(t)}Rr(!1,`unsupported type: ${t.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}bn(!1,"unsupported frgament object","obj",t)}static isConstructor(t){return Mg.isFragment(t)}static isError(t){return Gd.isFragment(t)}static isEvent(t){return C0.isFragment(t)}static isFunction(t){return S0.isFragment(t)}static isStruct(t){return Xw.isFragment(t)}}class HB extends _3{constructor(n,r,s,a){super(n,r,a);Dn(this,"name");bn(typeof s=="string"&&s.match(aIe),"invalid identifier","name",s),a=Object.freeze(a.slice()),Bs(this,{name:s})}}function pE(e,t){return"("+t.map(n=>n.format(e)).join(e==="full"?", ":",")+")"}class Gd extends HB{constructor(t,n,r){super(t,"error",n,r),Object.defineProperty(this,uf,{value:D0e})}get selector(){return l1(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+pE(t,this.inputs)),n.join(" ")}static from(t){if(Gd.isFragment(t))return t;if(typeof t=="string")return Gd.from(o2(t));if(t instanceof ym){const n=zB("error",t),r=Wg(t);return E3(t),new Gd(Uo,n,r)}return new Gd(Uo,t.name,t.inputs?t.inputs.map(su.from):[])}static isFragment(t){return t&&t[uf]===D0e}}class C0 extends HB{constructor(n,r,s,a){super(n,"event",r,s);Dn(this,"anonymous");Object.defineProperty(this,uf,{value:B0e}),Bs(this,{anonymous:a})}get topicHash(){return l1(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+pE(n,this.inputs)),n!=="sighash"&&this.anonymous&&r.push("anonymous"),r.join(" ")}static getTopicHash(n,r){return r=(r||[]).map(a=>su.from(a)),new C0(Uo,n,r,!1).topicHash}static from(n){if(C0.isFragment(n))return n;if(typeof n=="string")try{return C0.from(o2(n))}catch{bn(!1,"invalid event fragment","obj",n)}else if(n instanceof ym){const r=zB("event",n),s=Wg(n,!0),a=!!c1(n,ld(["anonymous"])).has("anonymous");return E3(n),new C0(Uo,r,s,a)}return new C0(Uo,n.name,n.inputs?n.inputs.map(r=>su.from(r,!0)):[],!!n.anonymous)}static isFragment(n){return n&&n[uf]===B0e}}class Mg extends _3{constructor(n,r,s,a,o){super(n,r,s);Dn(this,"payable");Dn(this,"gas");Object.defineProperty(this,uf,{value:$0e}),Bs(this,{payable:a,gas:o})}format(n){if(Rr(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${pE(n,this.inputs)}`];return this.payable&&r.push("payable"),this.gas!=null&&r.push(`@${this.gas.toString()}`),r.join(" ")}static from(n){if(Mg.isFragment(n))return n;if(typeof n=="string")try{return Mg.from(o2(n))}catch{bn(!1,"invalid constuctor fragment","obj",n)}else if(n instanceof ym){c1(n,ld(["constructor"]));const r=Wg(n),s=!!c1(n,T3t).has("payable"),a=cIe(n);return E3(n),new Mg(Uo,"constructor",r,s,a)}return new Mg(Uo,"constructor",n.inputs?n.inputs.map(su.from):[],!!n.payable,n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[uf]===$0e}}class ug extends _3{constructor(n,r,s){super(n,"fallback",r);Dn(this,"payable");Object.defineProperty(this,uf,{value:U0e}),Bs(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(ug.isFragment(n))return n;if(typeof n=="string")try{return ug.from(o2(n))}catch{bn(!1,"invalid fallback fragment","obj",n)}else if(n instanceof ym){const r=n.toString(),s=n.peekKeyword(ld(["fallback","receive"]));if(bn(s,"type must be fallback or receive","obj",r),n.popKeyword(ld(["fallback","receive"]))==="receive"){const c=Wg(n);return bn(c.length===0,"receive cannot have arguments","obj.inputs",c),c1(n,ld(["payable"])),E3(n),new ug(Uo,[],!0)}let o=Wg(n);o.length?bn(o.length===1&&o[0].type==="bytes","invalid fallback inputs","obj.inputs",o.map(c=>c.format("minimal")).join(", ")):o=[su.from("bytes")];const l=lIe(n);if(bn(l==="nonpayable"||l==="payable","fallback cannot be constants","obj.stateMutability",l),c1(n,ld(["returns"])).has("returns")){const c=Wg(n);bn(c.length===1&&c[0].type==="bytes","invalid fallback outputs","obj.outputs",c.map(u=>u.format("minimal")).join(", "))}return E3(n),new ug(Uo,o,l==="payable")}if(n.type==="receive")return new ug(Uo,[],!0);if(n.type==="fallback"){const r=[su.from("bytes")],s=n.stateMutability==="payable";return new ug(Uo,r,s)}bn(!1,"invalid fallback description","obj",n)}static isFragment(n){return n&&n[uf]===U0e}}class S0 extends HB{constructor(n,r,s,a,o,l){super(n,"function",r,a);Dn(this,"constant");Dn(this,"outputs");Dn(this,"stateMutability");Dn(this,"payable");Dn(this,"gas");Object.defineProperty(this,uf,{value:z0e}),o=Object.freeze(o.slice()),Bs(this,{constant:s==="view"||s==="pure",gas:l,outputs:o,payable:s==="payable",stateMutability:s})}get selector(){return l1(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+pE(n,this.inputs)),n!=="sighash"&&(this.stateMutability!=="nonpayable"&&r.push(this.stateMutability),this.outputs&&this.outputs.length&&(r.push("returns"),r.push(pE(n,this.outputs))),this.gas!=null&&r.push(`@${this.gas.toString()}`)),r.join(" ")}static getSelector(n,r){return r=(r||[]).map(a=>su.from(a)),new S0(Uo,n,"view",r,[],null).selector}static from(n){if(S0.isFragment(n))return n;if(typeof n=="string")try{return S0.from(o2(n))}catch{bn(!1,"invalid function fragment","obj",n)}else if(n instanceof ym){const s=zB("function",n),a=Wg(n),o=lIe(n);let l=[];c1(n,ld(["returns"])).has("returns")&&(l=Wg(n));const c=cIe(n);return E3(n),new S0(Uo,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 S0(Uo,n.name,r,n.inputs?n.inputs.map(su.from):[],n.outputs?n.outputs.map(su.from):[],n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[uf]===z0e}}class Xw extends HB{constructor(t,n,r){super(t,"struct",n,r),Object.defineProperty(this,uf,{value:H0e})}format(){throw new Error("@TODO")}static from(t){if(typeof t=="string")try{return Xw.from(o2(t))}catch{bn(!1,"invalid struct fragment","obj",t)}else if(t instanceof ym){const n=zB("struct",t),r=Wg(t);return E3(t),new Xw(Uo,n,r)}return new Xw(Uo,t.name,t.inputs?t.inputs.map(su.from):[])}static isFragment(t){return t&&t[uf]===H0e}}const Em=new Map;Em.set(0,"GENERIC_PANIC");Em.set(1,"ASSERT_FALSE");Em.set(17,"OVERFLOW");Em.set(18,"DIVIDE_BY_ZERO");Em.set(33,"ENUM_RANGE_ERROR");Em.set(34,"BAD_STORAGE_DATA");Em.set(49,"STACK_UNDERFLOW");Em.set(50,"ARRAY_RANGE_ERROR");Em.set(65,"OUT_OF_MEMORY");Em.set(81,"UNINITIALIZED_FUNCTION_CALL");const U3t=new RegExp(/^bytes([0-9]*)$/),z3t=new RegExp(/^(u?int)([0-9]*)$/);let zH=null,V0e=1024;function H3t(e,t,n,r){let s="missing revert data",a=null;const o=null;let l=null;if(n){s="execution reverted";const u=ps(n);if(n=Gr(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(Gr(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(Gr(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 ${Em.get(d)||"UNKNOWN"}(${d})`,s+=`: ${a}`}catch{s+=" (could not decode panic code)"}else s+=" (unknown custom error)"}const c={to:t.to?ra(t.to):null,data:t.data||"0x"};return t.from&&(c.from=ra(t.from)),ko(s,"CALL_EXCEPTION",{action:e,data:n,reason:a,transaction:c,invocation:o,revert:l})}var Zb,yC;const hD=class hD{constructor(){On(this,Zb)}getDefaultValue(t){const n=t.map(s=>wr(this,Zb,yC).call(this,su.from(s)));return new eP(n,"_").defaultValue()}encode(t,n){hke(n.length,t.length,"types/values length mismatch");const r=t.map(o=>wr(this,Zb,yC).call(this,su.from(o))),s=new eP(r,"_"),a=new wJ;return s.encode(a,n),a.data}decode(t,n,r){const s=t.map(o=>wr(this,Zb,yC).call(this,su.from(o)));return new eP(s,"_").decode(new CJ(n,r,V0e))}static _setDefaultMaxInflation(t){bn(typeof t=="number"&&Number.isInteger(t),"invalid defaultMaxInflation factor","value",t),V0e=t}static defaultAbiCoder(){return zH==null&&(zH=new hD),zH}static getBuiltinCallException(t,n,r){return H3t(t,n,r,hD.defaultAbiCoder())}};Zb=new WeakSet,yC=function(t){if(t.isArray())return new awt(wr(this,Zb,yC).call(this,t.arrayChildren),t.arrayLength,t.name);if(t.isTuple())return new eP(t.components.map(r=>wr(this,Zb,yC).call(this,r)),t.name);switch(t.baseType){case"address":return new swt(t.name);case"bool":return new owt(t.name);case"string":return new xwt(t.name);case"bytes":return new lwt(t.name);case"":return new dwt(t.name)}let n=t.type.match(z3t);if(n){let r=parseInt(n[2]||"256");return bn(r!==0&&r<=256&&r%8===0,"invalid "+n[1]+" bit length","param",t),new mwt(r/8,n[1]==="int",t.name)}if(n=t.type.match(U3t),n){let r=parseInt(n[1]);return bn(r!==0&&r<=32,"invalid bytes length","param",t),new cwt(r,t.name)}bn(!1,"invalid type","type",t.type)};let mE=hD;class V3t{constructor(t,n,r){Dn(this,"fragment");Dn(this,"name");Dn(this,"signature");Dn(this,"topic");Dn(this,"args");const s=t.name,a=t.format();Bs(this,{fragment:t,name:s,signature:a,topic:n,args:r})}}class W3t{constructor(t,n,r,s){Dn(this,"fragment");Dn(this,"name");Dn(this,"args");Dn(this,"signature");Dn(this,"selector");Dn(this,"value");const a=t.name,o=t.format();Bs(this,{fragment:t,name:a,args:r,signature:o,selector:n,value:s})}}class q3t{constructor(t,n,r){Dn(this,"fragment");Dn(this,"name");Dn(this,"args");Dn(this,"signature");Dn(this,"selector");const s=t.name,a=t.format();Bs(this,{fragment:t,name:s,args:r,signature:a,selector:n})}}class W0e{constructor(t){Dn(this,"hash");Dn(this,"_isIndexed");Bs(this,{hash:t,_isIndexed:!0})}static isIndexed(t){return!!(t&&t._isIndexed)}}const q0e={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"},G0e={"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&&q0e[e.toString()]&&(t=q0e[e.toString()]),`reverted with panic code 0x${e.toString(16)} (${t})`}}};var d0,f0,h0,vu,q0,JF,eO;const Bv=class Bv{constructor(t){On(this,q0);Dn(this,"fragments");Dn(this,"deploy");Dn(this,"fallback");Dn(this,"receive");On(this,d0);On(this,f0);On(this,h0);On(this,vu);let n=[];typeof t=="string"?n=JSON.parse(t):n=t,Ht(this,h0,new Map),Ht(this,d0,new Map),Ht(this,f0,new Map);const r=[];for(const o of n)try{r.push(_3.from(o))}catch(l){console.log(`[Warning] Invalid Fragment ${JSON.stringify(o)}:`,l.message)}Bs(this,{fragments:Object.freeze(r)});let s=null,a=!1;Ht(this,vu,this.getAbiCoder()),this.fragments.forEach((o,l)=>{let c;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}Bs(this,{deploy:o});return;case"fallback":o.inputs.length===0?a=!0:(bn(!s||o.payable!==s.payable,"conflicting fallback fragments",`fragments[${l}]`,o),s=o,a=s.payable);return;case"function":c=He(this,h0);break;case"event":c=He(this,f0);break;case"error":c=He(this,d0);break;default:return}const u=o.format();c.has(u)||c.set(u,o)}),this.deploy||Bs(this,{deploy:Mg.from("constructor()")}),Bs(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 mE.defaultAbiCoder()}getFunctionName(t){const n=wr(this,q0,JF).call(this,t,null,!1);return bn(n,"no matching function","key",t),n.name}hasFunction(t){return!!wr(this,q0,JF).call(this,t,null,!1)}getFunction(t,n){return wr(this,q0,JF).call(this,t,n||null,!0)}forEachFunction(t){const n=Array.from(He(this,h0).keys());n.sort((r,s)=>r.localeCompare(s));for(let r=0;r<n.length;r++){const s=n[r];t(He(this,h0).get(s),r)}}getEventName(t){const n=wr(this,q0,eO).call(this,t,null,!1);return bn(n,"no matching event","key",t),n.name}hasEvent(t){return!!wr(this,q0,eO).call(this,t,null,!1)}getEvent(t,n){return wr(this,q0,eO).call(this,t,n||null,!0)}forEachEvent(t){const n=Array.from(He(this,f0).keys());n.sort((r,s)=>r.localeCompare(s));for(let r=0;r<n.length;r++){const s=n[r];t(He(this,f0).get(s),r)}}getError(t,n){if(uo(t)){const s=t.toLowerCase();if(G0e[s])return Gd.from(G0e[s].signature);for(const a of He(this,d0).values())if(s===a.selector)return a;return null}if(t.indexOf("(")===-1){const s=[];for(const[a,o]of He(this,d0))a.split("(")[0]===t&&s.push(o);if(s.length===0)return t==="Error"?Gd.from("error Error(string)"):t==="Panic"?Gd.from("error Panic(uint256)"):null;if(s.length>1){const a=s.map(o=>JSON.stringify(o.format())).join(", ");bn(!1,`ambiguous error description (i.e. ${a})`,"name",t)}return s[0]}if(t=Gd.from(t).format(),t==="Error(string)")return Gd.from("error Error(string)");if(t==="Panic(uint256)")return Gd.from("error Panic(uint256)");const r=He(this,d0).get(t);return r||null}forEachError(t){const n=Array.from(He(this,d0).keys());n.sort((r,s)=>r.localeCompare(s));for(let r=0;r<n.length;r++){const s=n[r];t(He(this,d0).get(s),r)}}_decodeParams(t,n){return He(this,vu).decode(t,n)}_encodeParams(t,n){return He(this,vu).encode(t,n)}encodeDeploy(t){return this._encodeParams(this.deploy.inputs,t||[])}decodeErrorResult(t,n){if(typeof t=="string"){const r=this.getError(t);bn(r,"unknown error","fragment",t),t=r}return bn(bo(n,0,4)===t.selector,`data signature does not match error ${t.name}.`,"data",n),this._decodeParams(t.inputs,bo(n,4))}encodeErrorResult(t,n){if(typeof t=="string"){const r=this.getError(t);bn(r,"unknown error","fragment",t),t=r}return La([t.selector,this._encodeParams(t.inputs,n||[])])}decodeFunctionData(t,n){if(typeof t=="string"){const r=this.getFunction(t);bn(r,"unknown function","fragment",t),t=r}return bn(bo(n,0,4)===t.selector,`data signature does not match function ${t.name}.`,"data",n),this._decodeParams(t.inputs,bo(n,4))}encodeFunctionData(t,n){if(typeof t=="string"){const r=this.getFunction(t);bn(r,"unknown function","fragment",t),t=r}return La([t.selector,this._encodeParams(t.inputs,n||[])])}decodeFunctionResult(t,n){if(typeof t=="string"){const a=this.getFunction(t);bn(a,"unknown function","fragment",t),t=a}let r="invalid length for result data";const s=eu(n);if(s.length%32===0)try{return He(this,vu).decode(t.outputs,s)}catch{r="could not decode result data"}Rr(!1,r,"BAD_DATA",{value:Gr(s),info:{method:t.name,signature:t.format()}})}makeError(t,n){const r=ps(t,"data"),s=mE.getBuiltinCallException("call",n,r);if(s.message.startsWith("execution reverted (unknown custom error)")){const l=Gr(r.slice(0,4)),c=this.getError(l);if(c)try{const u=He(this,vu).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);bn(r,"unknown function","fragment",t),t=r}return Gr(He(this,vu).encode(t.outputs,n||[]))}encodeFilterTopics(t,n){if(typeof t=="string"){const a=this.getEvent(t);bn(a,"unknown event","eventFragment",t),t=a}Rr(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"?l1(o):a.type==="bytes"?co(Gr(o)):(a.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":a.type.match(/^u?int/)?o=a1(o):a.type.match(/^bytes/)?o=qyt(o,32):a.type==="address"&&He(this,vu).encode(["address"],[o]),i1(Gr(o),32));for(n.forEach((a,o)=>{const l=t.inputs[o];if(!l.indexed){bn(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"?bn(!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);bn(o,"unknown event","eventFragment",t),t=o}const r=[],s=[],a=[];return t.anonymous||r.push(t.topicHash),bn(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(l1(c));else if(o.type==="bytes")r.push(co(c));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");r.push(He(this,vu).encode([o.type],[c]))}else s.push(o),a.push(c)}),{data:He(this,vu).encode(s,a),topics:r}}decodeEventLog(t,n,r){if(typeof t=="string"){const g=this.getEvent(t);bn(g,"unknown event","eventFragment",t),t=g}if(r!=null&&!t.anonymous){const g=t.topicHash;bn(uo(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(su.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?He(this,vu).decode(s,La(r)):null,c=He(this,vu).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 W0e(null);else if(o[v])w=new W0e(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)}),bM.fromItems(u,d)}parseTransaction(t){const n=ps(t.data,"tx.data"),r=js(t.value!=null?t.value:0,"tx.value"),s=this.getFunction(Gr(n.slice(0,4)));if(!s)return null;const a=He(this,vu).decode(s.inputs,n.slice(4));return new W3t(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 V3t(n,n.topicHash,this.decodeEventLog(n,t.data,t.topics))}parseError(t){const n=Gr(t),r=this.getError(bo(n,0,4));if(!r)return null;const s=He(this,vu).decode(r.inputs,bo(n,4));return new q3t(r,r.selector,s)}static from(t){return t instanceof Bv?t:typeof t=="string"?new Bv(JSON.parse(t)):typeof t.formatJson=="function"?new Bv(t.formatJson()):typeof t.format=="function"?new Bv(t.format("json")):new Bv(t)}};d0=new WeakMap,f0=new WeakMap,h0=new WeakMap,vu=new WeakMap,q0=new WeakSet,JF=function(t,n,r){if(uo(t)){const a=t.toLowerCase();for(const o of He(this,h0).values())if(a===o.selector)return o;return null}if(t.indexOf("(")===-1){const a=[];for(const[o,l]of He(this,h0))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;Ru.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(Ru.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(", ");bn(!1,`ambiguous function description (i.e. matches ${o})`,"key",t)}return a[0]}const s=He(this,h0).get(S0.from(t).format());return s||null},eO=function(t,n,r){if(uo(t)){const a=t.toLowerCase();for(const o of He(this,f0).values())if(a===o.topicHash)return o;return null}if(t.indexOf("(")===-1){const a=[];for(const[o,l]of He(this,f0))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(Ru.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(", ");bn(!1,`ambiguous event description (i.e. matches ${o})`,"key",t)}return a[0]}const s=He(this,f0).get(C0.from(t).format());return s||null};let RJ=Bv;const uIe=BigInt(0);function i4(e){return e??null}function yl(e){return e==null?null:e.toString()}class K0e{constructor(t,n,r){Dn(this,"gasPrice");Dn(this,"maxFeePerGas");Dn(this,"maxPriorityFeePerGas");Bs(this,{gasPrice:i4(t),maxFeePerGas:i4(n),maxPriorityFeePerGas:i4(r)})}toJSON(){const{gasPrice:t,maxFeePerGas:n,maxPriorityFeePerGas:r}=this;return{_type:"FeeData",gasPrice:yl(t),maxFeePerGas:yl(n),maxPriorityFeePerGas:yl(r)}}}function xE(e){const t={};e.to&&(t.to=e.to),e.from&&(t.from=e.from),e.data&&(t.data=Gr(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]=js(e[s],`request.${s}`));const r="type,nonce".split(/,/);for(const s of r)!(s in e)||e[s]==null||(t[s]=Bi(e[s],`request.${s}`));return e.accessList&&(t.accessList=u5(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=>TB(s)?Gr(s):Object.assign({},s))),t}var wg;class G3t{constructor(t,n){Dn(this,"provider");Dn(this,"number");Dn(this,"hash");Dn(this,"timestamp");Dn(this,"parentHash");Dn(this,"parentBeaconBlockRoot");Dn(this,"nonce");Dn(this,"difficulty");Dn(this,"gasLimit");Dn(this,"gasUsed");Dn(this,"stateRoot");Dn(this,"receiptsRoot");Dn(this,"blobGasUsed");Dn(this,"excessBlobGas");Dn(this,"miner");Dn(this,"prevRandao");Dn(this,"extraData");Dn(this,"baseFeePerGas");On(this,wg);Ht(this,wg,t.transactions.map(r=>typeof r!="string"?new gE(r,n):r)),Bs(this,{provider:n,hash:i4(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:i4(t.prevRandao),extraData:t.extraData,baseFeePerGas:i4(t.baseFeePerGas),stateRoot:t.stateRoot,receiptsRoot:t.receiptsRoot})}get transactions(){return He(this,wg).map(t=>typeof t=="string"?t:t.hash)}get prefetchedTransactions(){const t=He(this,wg).slice();return t.length===0?[]:(Rr(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:yl(t),difficulty:yl(n),extraData:r,gasLimit:yl(s),gasUsed:yl(a),blobGasUsed:yl(this.blobGasUsed),excessBlobGas:yl(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 He(this,wg).length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(t){let n;if(typeof t=="number")n=He(this,wg)[t];else{const r=t.toLowerCase();for(const s of He(this,wg))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;bn(!1,"no matching transaction","indexOrHash",t)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return K3t(this)}}wg=new WeakMap;class zk{constructor(t,n){Dn(this,"provider");Dn(this,"transactionHash");Dn(this,"blockHash");Dn(this,"blockNumber");Dn(this,"removed");Dn(this,"address");Dn(this,"data");Dn(this,"topics");Dn(this,"index");Dn(this,"transactionIndex");this.provider=n;const r=Object.freeze(t.topics.slice());Bs(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 Rr(!!t,"failed to find transaction","UNKNOWN_ERROR",{}),t}async getTransaction(){const t=await this.provider.getTransaction(this.transactionHash);return Rr(!!t,"failed to find transaction","UNKNOWN_ERROR",{}),t}async getTransactionReceipt(){const t=await this.provider.getTransactionReceipt(this.transactionHash);return Rr(!!t,"failed to find transaction receipt","UNKNOWN_ERROR",{}),t}removedEvent(){return Y3t(this)}}var rk;class dIe{constructor(t,n){Dn(this,"provider");Dn(this,"to");Dn(this,"from");Dn(this,"contractAddress");Dn(this,"hash");Dn(this,"index");Dn(this,"blockHash");Dn(this,"blockNumber");Dn(this,"logsBloom");Dn(this,"gasUsed");Dn(this,"blobGasUsed");Dn(this,"cumulativeGasUsed");Dn(this,"gasPrice");Dn(this,"blobGasPrice");Dn(this,"type");Dn(this,"status");Dn(this,"root");On(this,rk);Ht(this,rk,Object.freeze(t.logs.map(s=>new zk(s,n))));let r=uIe;t.effectiveGasPrice!=null?r=t.effectiveGasPrice:t.gasPrice!=null&&(r=t.gasPrice),Bs(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 He(this,rk)}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:yl(this.cumulativeGasUsed),from:n,gasPrice:yl(this.gasPrice),blobGasUsed:yl(this.blobGasUsed),blobGasPrice:yl(this.blobGasPrice),gasUsed:yl(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 hIe(this)}reorderedEvent(t){return Rr(!t||t.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),fIe(this,t)}}rk=new WeakMap;var Jb;const Wue=class Wue{constructor(t,n){Dn(this,"provider");Dn(this,"blockNumber");Dn(this,"blockHash");Dn(this,"index");Dn(this,"hash");Dn(this,"type");Dn(this,"to");Dn(this,"from");Dn(this,"nonce");Dn(this,"gasLimit");Dn(this,"gasPrice");Dn(this,"maxPriorityFeePerGas");Dn(this,"maxFeePerGas");Dn(this,"maxFeePerBlobGas");Dn(this,"data");Dn(this,"value");Dn(this,"chainId");Dn(this,"signature");Dn(this,"accessList");Dn(this,"blobVersionedHashes");Dn(this,"authorizationList");On(this,Jb);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,Jb,-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:yl(this.chainId),data:u,from:l,gasLimit:yl(this.gasLimit),gasPrice:yl(this.gasPrice),hash:s,maxFeePerGas:yl(this.maxFeePerGas),maxPriorityFeePerGas:yl(this.maxPriorityFeePerGas),maxFeePerBlobGas:yl(this.maxFeePerBlobGas),nonce:c,signature:d,to:o,index:r,type:a,value:yl(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 Nu({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=He(this,Jb),o=-1,l=a===-1;const c=async()=>{if(l)return null;const{blockNumber:x,nonce:g}=await Nu({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<He(this,Jb)&&(o=He(this,Jb)));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 P=await this.provider.getTransactionReceipt(N.hash);if(P==null||x-P.blockNumber+1<r)return;let I="replaced";N.data===this.data&&N.to===this.to&&N.value===this.value?I="repriced":N.data==="0x"&&N.from===N.to&&N.value===uIe&&(I="cancelled"),Rr(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:I==="replaced"||I==="cancelled",reason:I,replacement:N.replaceableTransaction(a),hash:N.hash,receipt:P})}}o++}},u=x=>{if(x==null||x.status!==0)return x;Rr(!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(ko("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(P){g(P)}}};if(v.push(()=>{this.provider.off(this.hash,C)}),this.provider.on(this.hash,C),a>=0){const N=async()=>{try{await c()}catch(P){if(Jc(P,"TRANSACTION_REPLACED")){w(),g(P);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 Rr(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),hIe(this)}reorderedEvent(t){return Rr(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Rr(!t||t.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),fIe(this,t)}replaceableTransaction(t){bn(Number.isInteger(t)&&t>=0,"invalid startBlock","startBlock",t);const n=new Wue(this,this.provider);return Ht(n,Jb,t),n}};Jb=new WeakMap;let gE=Wue;function K3t(e){return{orphan:"drop-block",hash:e.hash,number:e.number}}function fIe(e,t){return{orphan:"reorder-transaction",tx:e,other:t}}function hIe(e){return{orphan:"drop-transaction",tx:e}}function Y3t(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 yae extends zk{constructor(n,r,s){super(n,n.provider);Dn(this,"interface");Dn(this,"fragment");Dn(this,"args");const a=r.decodeEventLog(s,n.data,n.topics);Bs(this,{args:a,fragment:s,interface:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class pIe extends zk{constructor(n,r){super(n,n.provider);Dn(this,"error");Bs(this,{error:r})}}var sS;class X3t extends dIe{constructor(n,r,s){super(s,r);On(this,sS);Ht(this,sS,n)}get logs(){return super.logs.map(n=>{const r=n.topics.length?He(this,sS).getEvent(n.topics[0]):null;if(r)try{return new yae(n,He(this,sS),r)}catch(s){return new pIe(n,s)}return n})}}sS=new WeakMap;var sk;class vae extends gE{constructor(n,r,s){super(s,r);On(this,sk);Ht(this,sk,n)}async wait(n,r){const s=await super.wait(n,r);return s==null?null:new X3t(He(this,sk),this.provider,s)}}sk=new WeakMap;class mIe extends yke{constructor(n,r,s,a){super(n,r,s);Dn(this,"log");Bs(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 Q3t extends mIe{constructor(t,n,r,s,a){super(t,n,r,new yae(a,t.interface,s));const o=t.interface.decodeEventLog(s,this.log.data,this.log.topics);Bs(this,{args:o,fragment:s})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const Y0e=BigInt(0);function xIe(e){return e&&typeof e.call=="function"}function gIe(e){return e&&typeof e.estimateGas=="function"}function VB(e){return e&&typeof e.resolveName=="function"}function bIe(e){return e&&typeof e.sendTransaction=="function"}function yIe(e){if(e!=null){if(VB(e))return e;if(e.provider)return e.provider}}var ik;class Z3t{constructor(t,n,r){On(this,ik);Dn(this,"fragment");if(Bs(this,{fragment:n}),n.inputs.length<r.length)throw new Error("too many arguments");const s=k3(t.runner,"resolveName"),a=VB(s)?s:null;Ht(this,ik,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=>Tc(x,a))):Tc(f,a):f)));return t.interface.encodeFilterTopics(n,o)}())}getTopicFilter(){return He(this,ik)}}ik=new WeakMap;function k3(e,t){return e==null?null:typeof e[t]=="function"?e:e.provider&&typeof e.provider[t]=="function"?e.provider:null}function Yv(e){return e==null?null:e.provider||null}async function vIe(e,t){const n=Ru.dereference(e,"overrides");bn(typeof n=="object","invalid overrides parameter","overrides",e);const r=xE(n);return bn(r.to==null||(t||[]).indexOf("to")>=0,"cannot override to","overrides.to",r.to),bn(r.data==null||(t||[]).indexOf("data")>=0,"cannot override data","overrides.data",r.data),r.from&&(r.from=r.from),r}async function J3t(e,t,n){const r=k3(e,"resolveName"),s=VB(r)?r:null;return await Promise.all(t.map((a,o)=>a.walkAsync(n[o],(l,c)=>(c=Ru.dereference(c,l),l==="address"?Tc(c,s):c))))}function e5t(e){const t=async function(o){const l=await vIe(o,["data"]);l.to=await e.getAddress(),l.from&&(l.from=await Tc(l.from,yIe(e.runner)));const c=e.interface,u=js(l.value||Y0e,"overrides.value")===Y0e,d=(l.data||"0x")==="0x";c.fallback&&!c.fallback.payable&&c.receive&&!d&&!u&&bn(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),bn(c.fallback||d,"cannot send data to receive-only contract","overrides.data",l.data);const f=c.receive||c.fallback&&c.fallback.payable;return bn(f||u,"cannot send value to non-payable fallback","overrides.value",l.value),bn(c.fallback||d,"cannot send data to receive-only contract","overrides.data",l.data),l},n=async function(o){const l=k3(e.runner,"call");Rr(xIe(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 nae(u)&&u.data?e.interface.makeError(u.data,c):u}},r=async function(o){const l=e.runner;Rr(bIe(l),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const c=await l.sendTransaction(await t(o)),u=Yv(e.runner);return new vae(e.interface,u,c)},s=async function(o){const l=k3(e.runner,"estimateGas");return Rr(gIe(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 Bs(a,{_contract:e,estimateGas:s,populateTransaction:t,send:r,staticCall:n}),a}function t5t(e,t){const n=function(...u){const d=e.interface.getFunction(t,u);return Rr(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 vIe(u.pop()),f.from&&(f.from=await Tc(f.from,yIe(e.runner)))),d.inputs.length!==u.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const x=await J3t(e.runner,d.inputs,u);return Object.assign({},f,await Nu({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;Rr(bIe(d),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const f=await d.sendTransaction(await r(...u)),x=Yv(e.runner);return new vae(e.interface,x,f)},o=async function(...u){const d=k3(e.runner,"estimateGas");return Rr(gIe(d),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await d.estimateGas(await r(...u))},l=async function(...u){const d=k3(e.runner,"call");Rr(xIe(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 nae(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 Bs(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 Rr(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),u}}),c}function n5t(e,t){const n=function(...s){const a=e.interface.getEvent(t,s);return Rr(a,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:s}}),a},r=function(...s){return new Z3t(e,n(...s),s)};return Bs(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 Rr(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),s}}),r}const NM=Symbol.for("_ethersInternal_contract"),wIe=new WeakMap;function r5t(e,t){wIe.set(e[NM],t)}function If(e){return wIe.get(e[NM])}function s5t(e){return e&&typeof e=="object"&&"getTopicFilter"in e&&typeof e.getTopicFilter=="function"&&e.fragment}async function wae(e,t){let n,r=null;if(Array.isArray(t)){const a=function(o){if(uo(o,32))return o;const l=e.interface.getEvent(o);return bn(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"?uo(t,32)?n=[t]:(r=e.interface.getEvent(t),bn(r,"unknown fragment","event",t),n=[r.topicHash]):s5t(t)?n=await t.getTopicFilter():"fragment"in t?(r=t.fragment,n=[r.topicHash]):bn(!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 xj(e,t){const{subs:n}=If(e);return n.get((await wae(e,t)).tag)||null}async function X0e(e,t,n){const r=Yv(e.runner);Rr(r,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:t});const{fragment:s,tag:a,topics:o}=await wae(e,n),{addr:l,subs:c}=If(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 P=N,I=s?e.interface.decodeEventLog(s,C.data,C.topics):[];DJ(e,n,I,R=>new Q3t(e,R,n,P,C))}else DJ(e,n,[],P=>new mIe(e,P,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 LJ=Promise.resolve();async function i5t(e,t,n,r){await LJ;const s=await xj(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(),If(e).subs.delete(s.tag)),a>0}async function DJ(e,t,n,r){try{await LJ}catch{}const s=i5t(e,t,n,r);return LJ=s,await s}const nP=["then"];var INe;INe=NM;const g9=class g9{constructor(t,n,r,s){Dn(this,"target");Dn(this,"interface");Dn(this,"runner");Dn(this,"filters");Dn(this,INe);Dn(this,"fallback");bn(typeof t=="string"||jTe(t),"invalid value for Contract target","target",t),r==null&&(r=null);const a=RJ.from(n);Bs(this,{target:t,runner:r,interface:a}),Object.defineProperty(this,NM,{value:{}});let o,l=null,c=null;if(s){const f=Yv(r);c=new vae(this.interface,f,s)}let u=new Map;if(typeof t=="string")if(uo(t))l=t,o=Promise.resolve(t);else{const f=k3(r,"resolveName");if(!VB(f))throw ko("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=f.resolveName(t).then(x=>{if(x==null)throw ko("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:t});return If(this).addr=x,x})}else o=t.getAddress().then(f=>{if(f==null)throw new Error("TODO");return If(this).addr=f,f});r5t(this,{addrPromise:o,addr:l,deployTx:c,subs:u});const d=new Proxy({},{get:(f,x,g)=>{if(typeof x=="symbol"||nP.indexOf(x)>=0)return Reflect.get(f,x,g);try{return this.getEvent(x)}catch(v){if(!Jc(v,"INVALID_ARGUMENT")||v.argument!=="key")throw v}},has:(f,x)=>nP.indexOf(x)>=0?Reflect.has(f,x):Reflect.has(f,x)||this.interface.hasEvent(String(x))});return Bs(this,{filters:d}),Bs(this,{fallback:a.receive||a.fallback?e5t(this):null}),new Proxy(this,{get:(f,x,g)=>{if(typeof x=="symbol"||x in f||nP.indexOf(x)>=0)return Reflect.get(f,x,g);try{return f.getFunction(x)}catch(v){if(!Jc(v,"INVALID_ARGUMENT")||v.argument!=="key")throw v}},has:(f,x)=>typeof x=="symbol"||x in f||nP.indexOf(x)>=0?Reflect.has(f,x):f.interface.hasFunction(x)})}connect(t){return new g9(this.target,this.interface,t)}attach(t){return new g9(t,this.interface,this.runner)}async getAddress(){return await If(this).addrPromise}async getDeployedCode(){const t=Yv(this.runner);Rr(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=Yv(this.runner);return Rr(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 If(this).deployTx}getFunction(t){return typeof t!="string"&&(t=t.format()),t5t(this,t)}getEvent(t){return typeof t!="string"&&(t=t.format()),n5t(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}=If(this),o=s||await a,{fragment:l,topics:c}=await wae(this,t),u={address:o,topics:c,fromBlock:n,toBlock:r},d=Yv(this.runner);return Rr(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 yae(f,this.interface,x)}catch(g){return new pIe(f,g)}return new zk(f,d)})}async on(t,n){const r=await X0e(this,"on",t);return r.listeners.push({listener:n,once:!1}),r.start(),this}async once(t,n){const r=await X0e(this,"once",t);return r.listeners.push({listener:n,once:!0}),r.start(),this}async emit(t,...n){return await DJ(this,t,n,null)}async listenerCount(t){if(t){const s=await xj(this,t);return s?s.listeners.length:0}const{subs:n}=If(this);let r=0;for(const{listeners:s}of n.values())r+=s.length;return r}async listeners(t){if(t){const s=await xj(this,t);return s?s.listeners.map(({listener:a})=>a):[]}const{subs:n}=If(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 xj(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(),If(this).subs.delete(r.tag)),this}async removeAllListeners(t){if(t){const n=await xj(this,t);if(!n)return this;n.stop(),If(this).subs.delete(n.tag)}else{const{subs:n}=If(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 g9{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 BJ=g9;function a5t(){return BJ}let Wj=class extends a5t(){};function HH(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):bn(!1,"unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}class o5t{constructor(t){Dn(this,"name");Bs(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 CIe=new RegExp("^(ipfs)://(.*)$","i"),Q0e=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),CIe,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var ey,Iw,ty,vC,pD,SIe;const GC=class GC{constructor(t,n,r){On(this,ty);Dn(this,"provider");Dn(this,"address");Dn(this,"name");On(this,ey);On(this,Iw);Bs(this,{provider:t,address:n,name:r}),Ht(this,ey,null),Ht(this,Iw,new Wj(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 He(this,ey)==null&&Ht(this,ey,(async()=>{try{return await He(this,Iw).supportsInterface("0x9061b923")}catch(t){if(Jc(t,"CALL_EXCEPTION"))return!1;throw Ht(this,ey,null),t}})()),await He(this,ey)}async getAddress(t){if(t==null&&(t=60),t===60)try{const a=await wr(this,ty,vC).call(this,"addr(bytes32)");return a==null||a===cE?null:a}catch(a){if(Jc(a,"CALL_EXCEPTION"))return null;throw a}if(t>=0&&t<2147483648){let a=t+2147483648;const o=await wr(this,ty,vC).call(this,"addr(bytes32,uint)",[a]);if(uo(o,20))return ra(o)}let n=null;for(const a of this.provider.plugins)if(a instanceof o5t&&a.supportsCoinType(t)){n=a;break}if(n==null)return null;const r=await wr(this,ty,vC).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;Rr(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${t})`,info:{coinType:t,data:r}})}async getText(t){const n=await wr(this,ty,vC).call(this,"text(bytes32,string)",[t]);return n==null||n==="0x"?null:n}async getContentHash(){const t=await wr(this,ty,vC).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}://${bke("0x"+n[2])}`}const r=t.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&r[1].length===64)return`bzz://${r[1]}`;Rr(!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<Q0e.length;r++){const s=n.match(Q0e[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=HH(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 Wj(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}",a1(u,32).substring(2)),t.push({type:"metadata-url-expanded",value:f})),f.match(/^ipfs:/i)&&(f=HH(f)),t.push({type:"metadata-url",value:f});let x={};const g=await new Hy(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:Gr(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(CIe)==null)return t.push({type:"!imageUrl-ipfs",value:v}),{url:null,linkage:t};t.push({type:"imageUrl-ipfs",value:v}),v=HH(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 Rr(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 wr(s=GC,pD,SIe).call(s,t,r);if(a!=null){const o=new GC(t,a,n);return r!==n&&!await o.supportsWildcard()?null:o}r=r.split(".").slice(1).join(".")}}};ey=new WeakMap,Iw=new WeakMap,ty=new WeakSet,vC=async function(t,n){n=(n||[]).slice();const r=He(this,Iw).interface;n.unshift(OJ(this.name));let s=null;await this.supportsWildcard()&&(s=r.getFunction(t),Rr(s,"missing fragment","UNKNOWN_ERROR",{info:{funcName:t}}),n=[w3t(this.name,255),r.encodeFunctionData(s,n)],t="resolve(bytes,bytes)"),n.push({enableCcipRead:!0});try{const a=await He(this,Iw)[t](...n);return s?r.decodeFunctionResult(s,a)[0]:a}catch(a){if(!Jc(a,"CALL_EXCEPTION"))throw a}return null},pD=new WeakSet,SIe=async function(t,n){const r=await GC.getEnsAddress(t);try{const a=await new Wj(r,["function resolver(bytes32) view returns (address)"],t).resolver(OJ(n),{enableCcipRead:!0});return a===cE?null:a}catch(s){throw s}return null},On(GC,pD);let AM=GC;const Z0e=BigInt(0);function ta(e,t){return function(n){return n==null?t:e(n)}}function bE(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 Hk(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";Rr(!1,`invalid value for value.${s} (${l})`,"BAD_DATA",{value:n})}}return r}}function l5t(e){switch(e){case!0:case"true":return!0;case!1:case"false":return!1}bn(!1,`invalid boolean; ${JSON.stringify(e)}`,"value",e)}function VS(e){return bn(uo(e,!0),"invalid data","value",e),e}function Zc(e){return bn(uo(e,32),"invalid hash","value",e),e}const c5t=Hk({address:ra,blockHash:Zc,blockNumber:Bi,data:VS,index:Bi,removed:ta(l5t,!1),topics:bE(Zc),transactionHash:Zc,transactionIndex:Bi},{index:["logIndex"]});function u5t(e){return c5t(e)}const d5t=Hk({hash:ta(Zc),parentHash:Zc,parentBeaconBlockRoot:ta(Zc,null),number:Bi,timestamp:Bi,nonce:ta(VS),difficulty:js,gasLimit:js,gasUsed:js,stateRoot:ta(Zc,null),receiptsRoot:ta(Zc,null),blobGasUsed:ta(js,null),excessBlobGas:ta(js,null),miner:ta(ra),prevRandao:ta(Zc,null),extraData:VS,baseFeePerGas:ta(js)},{prevRandao:["mixHash"]});function f5t(e){const t=d5t(e);return t.transactions=e.transactions.map(n=>typeof n=="string"?n:NIe(n)),t}const h5t=Hk({transactionIndex:Bi,blockNumber:Bi,transactionHash:Zc,address:ra,topics:bE(Zc),data:VS,index:Bi,blockHash:Zc},{index:["logIndex"]});function p5t(e){return h5t(e)}const m5t=Hk({to:ta(ra,null),from:ta(ra,null),contractAddress:ta(ra,null),index:Bi,root:ta(Gr),gasUsed:js,blobGasUsed:ta(js,null),logsBloom:ta(VS),blockHash:Zc,hash:Zc,logs:bE(p5t),blockNumber:Bi,cumulativeGasUsed:js,effectiveGasPrice:ta(js),blobGasPrice:ta(js,null),status:ta(Bi),type:ta(Bi,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function x5t(e){return m5t(e)}function NIe(e){e.to&&js(e.to)===Z0e&&(e.to="0x0000000000000000000000000000000000000000");const t=Hk({hash:Zc,index:ta(Bi,void 0),type:n=>n==="0x"||n==null?0:Bi(n),accessList:ta(u5,null),blobVersionedHashes:ta(bE(Zc,!0),null),authorizationList:ta(bE(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:ra(n.address),chainId:js(n.chainId),nonce:js(n.nonce),signature:ru.from(r)}},!1),null),blockHash:ta(Zc,null),blockNumber:ta(Bi,null),transactionIndex:ta(Bi,null),from:ra,gasPrice:ta(js),maxPriorityFeePerGas:ta(js),maxFeePerGas:ta(js),maxFeePerBlobGas:ta(js,null),gasLimit:js,to:ta(ra,null),value:js,nonce:Bi,data:VS,creates:ta(ra,null),chainId:ta(js,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(e);if(t.to==null&&t.creates==null&&(t.creates=rwt(t)),(e.type===1||e.type===2)&&e.accessList==null&&(t.accessList=[]),e.signature?t.signature=ru.from(e.signature):t.signature=ru.from(e),t.chainId==null){const n=t.signature.legacyChainId;n!=null&&(t.chainId=n)}return t.blockHash&&js(t.blockHash)===Z0e&&(t.blockHash=null),t}const g5t="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class Vk{constructor(t){Dn(this,"name");Bs(this,{name:t})}clone(){return new Vk(this.name)}}class WB extends Vk{constructor(n,r){n==null&&(n=0);super(`org.ethers.network.plugins.GasCost#${n||0}`);Dn(this,"effectiveBlock");Dn(this,"txBase");Dn(this,"txCreate");Dn(this,"txDataZero");Dn(this,"txDataNonzero");Dn(this,"txAccessListStorageKey");Dn(this,"txAccessListAddress");const s={effectiveBlock:n};function a(o,l){let c=(r||{})[o];c==null&&(c=l),bn(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),Bs(this,s)}clone(){return new WB(this.effectiveBlock,this)}}class qB extends Vk{constructor(n,r){super("org.ethers.plugins.network.Ens");Dn(this,"address");Dn(this,"targetNetwork");Bs(this,{address:n||g5t,targetNetwork:r??1})}clone(){return new qB(this.address,this.targetNetwork)}}var ak,ok;class b5t extends Vk{constructor(n,r){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");On(this,ak);On(this,ok);Ht(this,ak,n),Ht(this,ok,r)}get url(){return He(this,ak)}get processFunc(){return He(this,ok)}clone(){return this}}ak=new WeakMap,ok=new WeakMap;const VH=new Map;var iS,aS,ny,Ug;let hy=(Ug=class{constructor(t,n){On(this,iS);On(this,aS);On(this,ny);Ht(this,iS,t),Ht(this,aS,js(n)),Ht(this,ny,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return He(this,iS)}set name(t){Ht(this,iS,t)}get chainId(){return He(this,aS)}set chainId(t){Ht(this,aS,js(t,"chainId"))}matches(t){if(t==null)return!1;if(typeof t=="string"){try{return this.chainId===js(t)}catch{}return this.name===t}if(typeof t=="number"||typeof t=="bigint"){try{return this.chainId===js(t)}catch{}return!1}if(typeof t=="object"){if(t.chainId!=null){try{return this.chainId===js(t.chainId)}catch{}return!1}return t.name!=null?this.name===t.name:!1}return!1}get plugins(){return Array.from(He(this,ny).values())}attachPlugin(t){if(He(this,ny).get(t.name))throw new Error(`cannot replace existing plugin: ${t.name} `);return He(this,ny).set(t.name,t.clone()),this}getPlugin(t){return He(this,ny).get(t)||null}getPlugins(t){return this.plugins.filter(n=>n.name.split("#")[0]===t)}clone(){const t=new Ug(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 WB;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=u5(t.accessList);for(const a in s)r+=n.txAccessListAddress+n.txAccessListStorageKey*s[a].storageKeys.length}return r}static from(t){if(y5t(),t==null)return Ug.from("mainnet");if(typeof t=="number"&&(t=BigInt(t)),typeof t=="string"||typeof t=="bigint"){const n=VH.get(t);if(n)return n();if(typeof t=="bigint")return new Ug("unknown",t);bn(!1,"unknown network","network",t)}if(typeof t.clone=="function")return t.clone();if(typeof t=="object"){bn(typeof t.name=="string"&&typeof t.chainId=="number","invalid network object name or chainId","network",t);const n=new Ug(t.name,t.chainId);return(t.ensAddress||t.ensNetwork!=null)&&n.attachPlugin(new qB(t.ensAddress,t.ensNetwork)),n}bn(!1,"invalid network","network",t)}static register(t,n){typeof t=="number"&&(t=BigInt(t));const r=VH.get(t);r&&bn(!1,`conflicting network for ${JSON.stringify(r.name)}`,"nameOrChainId",t),VH.set(t,n)}},iS=new WeakMap,aS=new WeakMap,ny=new WeakMap,Ug);function J0e(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 exe(e){return new b5t(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:J0e(l.maxFee,9),maxPriorityFeePerGas:J0e(l.maxPriorityFee,9)}}catch(a){Rr(!1,`error encountered with polygon gas station (${JSON.stringify(r.url)})`,"SERVER_ERROR",{request:r,response:s,error:a})}})}let txe=!1;function y5t(){if(txe)return;txe=!0;function e(t,n,r){const s=function(){const a=new hy(t,n);return r.ensNetwork!=null&&a.attachPlugin(new qB(null,r.ensNetwork)),a.attachPlugin(new WB),(r.plugins||[]).forEach(o=>{a.attachPlugin(o)}),a};hy.register(t,s),hy.register(n,s),r.altNames&&r.altNames.forEach(a=>{hy.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:[exe("https://gasstation.polygon.technology/v2")]}),e("matic-amoy",80002,{}),e("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[exe("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 $J(e){return JSON.parse(JSON.stringify(e))}var Cg,Dh,ry,p0,oS,tO;class v5t{constructor(t){On(this,oS);On(this,Cg);On(this,Dh);On(this,ry);On(this,p0);Ht(this,Cg,t),Ht(this,Dh,null),Ht(this,ry,4e3),Ht(this,p0,-2)}get pollingInterval(){return He(this,ry)}set pollingInterval(t){Ht(this,ry,t)}start(){He(this,Dh)||(Ht(this,Dh,He(this,Cg)._setTimeout(wr(this,oS,tO).bind(this),He(this,ry))),wr(this,oS,tO).call(this))}stop(){He(this,Dh)&&(He(this,Cg)._clearTimeout(He(this,Dh)),Ht(this,Dh,null))}pause(t){this.stop(),t&&Ht(this,p0,-2)}resume(){this.start()}}Cg=new WeakMap,Dh=new WeakMap,ry=new WeakMap,p0=new WeakMap,oS=new WeakSet,tO=async function(){try{const t=await He(this,Cg).getBlockNumber();if(He(this,p0)===-2){Ht(this,p0,t);return}if(t!==He(this,p0)){for(let n=He(this,p0)+1;n<=t;n++){if(He(this,Dh)==null)return;await He(this,Cg).emit("block",n)}Ht(this,p0,t)}}catch{}He(this,Dh)!=null&&Ht(this,Dh,He(this,Cg)._setTimeout(wr(this,oS,tO).bind(this),He(this,ry)))};var Pw,Fw,sy;class Cae{constructor(t){On(this,Pw);On(this,Fw);On(this,sy);Ht(this,Pw,t),Ht(this,sy,!1),Ht(this,Fw,n=>{this._poll(n,He(this,Pw))})}async _poll(t,n){throw new Error("sub-classes must override this")}start(){He(this,sy)||(Ht(this,sy,!0),He(this,Fw).call(this,-2),He(this,Pw).on("block",He(this,Fw)))}stop(){He(this,sy)&&(Ht(this,sy,!1),He(this,Pw).off("block",He(this,Fw)))}pause(t){this.stop()}resume(){this.start()}}Pw=new WeakMap,Fw=new WeakMap,sy=new WeakMap;var lS,Sg;class w5t extends Cae{constructor(n,r){super(n);On(this,lS);On(this,Sg);Ht(this,lS,r),Ht(this,Sg,-2)}pause(n){n&&Ht(this,Sg,-2),super.pause(n)}async _poll(n,r){const s=await r.getBlock(He(this,lS));s!=null&&(He(this,Sg)===-2?Ht(this,Sg,s.number):s.number>He(this,Sg)&&(r.emit(He(this,lS),s.number),Ht(this,Sg,s.number)))}}lS=new WeakMap,Sg=new WeakMap;var mD;class C5t extends Cae{constructor(n,r){super(n);On(this,mD);Ht(this,mD,$J(r))}async _poll(n,r){throw new Error("@TODO")}}mD=new WeakMap;var cS;class S5t extends Cae{constructor(n,r){super(n);On(this,cS);Ht(this,cS,r)}async _poll(n,r){const s=await r.getTransactionReceipt(He(this,cS));s&&r.emit(He(this,cS),s)}}cS=new WeakMap;var Ng,uS,dS,iy,Bh,xD,AIe;class Sae{constructor(t,n){On(this,xD);On(this,Ng);On(this,uS);On(this,dS);On(this,iy);On(this,Bh);Ht(this,Ng,t),Ht(this,uS,$J(n)),Ht(this,dS,wr(this,xD,AIe).bind(this)),Ht(this,iy,!1),Ht(this,Bh,-2)}start(){He(this,iy)||(Ht(this,iy,!0),He(this,Bh)===-2&&He(this,Ng).getBlockNumber().then(t=>{Ht(this,Bh,t)}),He(this,Ng).on("block",He(this,dS)))}stop(){He(this,iy)&&(Ht(this,iy,!1),He(this,Ng).off("block",He(this,dS)))}pause(t){this.stop(),t&&Ht(this,Bh,-2)}resume(){this.start()}}Ng=new WeakMap,uS=new WeakMap,dS=new WeakMap,iy=new WeakMap,Bh=new WeakMap,xD=new WeakSet,AIe=async function(t){if(He(this,Bh)===-2)return;const n=$J(He(this,uS));n.fromBlock=He(this,Bh)+1,n.toBlock=t;const r=await He(this,Ng).getLogs(n);if(r.length===0){He(this,Bh)<t-60&&Ht(this,Bh,t-60);return}for(const s of r)He(this,Ng).emit(He(this,uS),s),Ht(this,Bh,s.blockNumber)};const N5t=BigInt(2),A5t=10;function rP(e){return e&&typeof e.then=="function"}function nO(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 jIe{constructor(t){Dn(this,"name");Bs(this,{name:t})}start(){}stop(){}pause(t){}resume(){}}function j5t(e){return JSON.parse(JSON.stringify(e))}function UJ(e){return e=Array.from(new Set(e).values()),e.sort(),e}async function WH(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(uo(e,32)){const n=e.toLowerCase();return{type:"transaction",tag:nO("tx",{hash:n}),hash:n}}if(e.orphan){const n=e;return{type:"orphan",tag:nO("orphan",n),filter:j5t(n)}}if(e.address||e.topics){const n=e,r={topics:(n.topics||[]).map(s=>s==null?null:Array.isArray(s)?UJ(s.map(a=>a.toLowerCase())):s.toLowerCase())};if(n.address){const s=[],a=[],o=l=>{uo(l)?s.push(l):a.push((async()=>{s.push(await Tc(l,t))})())};Array.isArray(n.address)?n.address.forEach(o):o(n.address),a.length&&await Promise.all(a),r.address=UJ(s.map(l=>l.toLowerCase()))}return{filter:r,tag:nO("event",r),type:"event"}}bn(!1,"unknown ProviderEvent","event",e)}function qH(){return new Date().getTime()}const E5t={cacheTimeout:250,pollingInterval:4e3};var wu,ay,Cu,fS,Rf,Ow,oy,Ag,lk,$h,hS,pS,Vi,_f,zJ,HJ,gj,VJ,bj,rO;class _5t{constructor(t,n){On(this,Vi);On(this,wu);On(this,ay);On(this,Cu);On(this,fS);On(this,Rf);On(this,Ow);On(this,oy);On(this,Ag);On(this,lk);On(this,$h);On(this,hS);On(this,pS);if(Ht(this,pS,Object.assign({},E5t,n||{})),t==="any")Ht(this,Ow,!0),Ht(this,Rf,null);else if(t){const r=hy.from(t);Ht(this,Ow,!1),Ht(this,Rf,Promise.resolve(r)),setTimeout(()=>{this.emit("network",r,null)},0)}else Ht(this,Ow,!1),Ht(this,Rf,null);Ht(this,Ag,-1),Ht(this,oy,new Map),Ht(this,wu,new Map),Ht(this,ay,new Map),Ht(this,Cu,null),Ht(this,fS,!1),Ht(this,lk,1),Ht(this,$h,new Map),Ht(this,hS,!1)}get pollingInterval(){return He(this,pS).pollingInterval}get provider(){return this}get plugins(){return Array.from(He(this,ay).values())}attachPlugin(t){if(He(this,ay).get(t.name))throw new Error(`cannot replace existing plugin: ${t.name} `);return He(this,ay).set(t.name,t.connect(this)),this}getPlugin(t){return He(this,ay).get(t)||null}get disableCcipRead(){return He(this,hS)}set disableCcipRead(t){Ht(this,hS,!!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 Hy(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{}Rr(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)}Rr(!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 G3t(f5t(t),this)}_wrapLog(t,n){return new zk(u5t(t),this)}_wrapTransactionReceipt(t,n){return new dIe(x5t(t),this)}_wrapTransactionResponse(t,n){return new gE(NIe(t),this)}_detectNetwork(){Rr(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(t){Rr(!1,`unsupported method: ${t.method}`,"UNSUPPORTED_OPERATION",{operation:t.method,info:t})}async getBlockNumber(){const t=Bi(await wr(this,Vi,_f).call(this,{method:"getBlockNumber"}),"%response");return He(this,Ag)>=0&&Ht(this,Ag,t),t}_getAddress(t){return Tc(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(uo(t))return uo(t,32)?t:tm(t);if(typeof t=="bigint"&&(t=Bi(t,"blockTag")),typeof t=="number")return t>=0?tm(t):He(this,Ag)>=0?tm(He(this,Ag)+t):this.getBlockNumber().then(n=>tm(n+t));bn(!1,"invalid blockTag","blockTag",t)}_getFilter(t){const n=(t.topics||[]).map(c=>c==null?null:Array.isArray(c)?UJ(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=xE(t),r=[];if(["to","from"].forEach(s=>{if(n[s]==null)return;const a=Tc(n[s],this);rP(a)?r.push(async function(){n[s]=await a}()):n[s]=a}),n.blockTag!=null){const s=this._getBlockTag(n.blockTag);rP(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(He(this,Rf)==null){const s=(async()=>{try{const a=await this._detectNetwork();return this.emit("network",a,null),a}catch(a){throw He(this,Rf)===s&&Ht(this,Rf,null),a}})();return Ht(this,Rf,s),(await s).clone()}const t=He(this,Rf),[n,r]=await Promise.all([t,this._detectNetwork()]);return n.chainId!==r.chainId&&(He(this,Ow)?(this.emit("network",r,n),He(this,Rf)===t&&Ht(this,Rf,Promise.resolve(r))):Rr(!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 Nu({_block:wr(this,Vi,VJ).call(this,"latest",!1),gasPrice:(async()=>{try{const d=await wr(this,Vi,_f).call(this,{method:"getGasPrice"});return js(d,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const d=await wr(this,Vi,_f).call(this,{method:"getPriorityFee"});return js(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*N5t+c),new K0e(a,l,c)},r=t.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(r){const s=new Hy(r.url),a=await r.processFunc(n,this,s);return new K0e(a.gasPrice,a.maxFeePerGas,a.maxPriorityFeePerGas)}return await n()}async estimateGas(t){let n=this._getTransactionRequest(t);return rP(n)&&(n=await n),js(await wr(this,Vi,_f).call(this,{method:"estimateGas",transaction:n}),"%response")}async call(t){const{tx:n,blockTag:r}=await Nu({tx:this._getTransactionRequest(t),blockTag:this._getBlockTag(t.blockTag)});return await wr(this,Vi,HJ).call(this,wr(this,Vi,zJ).call(this,n,r,t.enableCcipRead?0:-1))}async getBalance(t,n){return js(await wr(this,Vi,gj).call(this,{method:"getBalance"},t,n),"%response")}async getTransactionCount(t,n){return Bi(await wr(this,Vi,gj).call(this,{method:"getTransactionCount"},t,n),"%response")}async getCode(t,n){return Gr(await wr(this,Vi,gj).call(this,{method:"getCode"},t,n))}async getStorage(t,n,r){const s=js(n,"position");return Gr(await wr(this,Vi,gj).call(this,{method:"getStorage",position:s},t,r))}async broadcastTransaction(t){const{blockNumber:n,hash:r,network:s}=await Nu({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:t}),network:this.getNetwork()}),a=mae.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 Nu({network:this.getNetwork(),params:wr(this,Vi,VJ).call(this,t,!!n)});return s==null?null:this._wrapBlock(s,r)}async getTransaction(t){const{network:n,params:r}=await Nu({network:this.getNetwork(),params:wr(this,Vi,_f).call(this,{method:"getTransaction",hash:t})});return r==null?null:this._wrapTransactionResponse(r,n)}async getTransactionReceipt(t){const{network:n,params:r}=await Nu({network:this.getNetwork(),params:wr(this,Vi,_f).call(this,{method:"getTransactionReceipt",hash:t})});if(r==null)return null;if(r.gasPrice==null&&r.effectiveGasPrice==null){const s=await wr(this,Vi,_f).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 Nu({network:this.getNetwork(),result:wr(this,Vi,_f).call(this,{method:"getTransactionResult",hash:t})});return n==null?null:Gr(n)}async getLogs(t){let n=this._getFilter(t);rP(n)&&(n=await n);const{network:r,params:s}=await Nu({network:this.getNetwork(),params:wr(this,Vi,_f).call(this,{method:"getLogs",filter:n})});return s.map(a=>this._wrapLog(a,r))}_getProvider(t){Rr(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(t){return await AM.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=ra(t);const n=OJ(t.substring(2).toLowerCase()+".addr.reverse");try{const r=await AM.getEnsAddress(this),a=await new Wj(r,["function resolver(bytes32) view returns (address)"],this).resolver(n);if(a==null||a===cE)return null;const l=await new Wj(a,["function name(bytes32) view returns (string)"],this).name(n);return await this.resolveName(l)!==t?null:l}catch(r){if(Jc(r,"BAD_DATA")&&r.value==="0x"||Jc(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(ko("timeout","TIMEOUT",{reason:"timeout"})))},r)),c(await this.getBlockNumber())})}async waitForBlock(t){Rr(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(t){const n=He(this,$h).get(t);n&&(n.timer&&clearTimeout(n.timer),He(this,$h).delete(t))}_setTimeout(t,n){n==null&&(n=0);const r=ib(this,lk)._++,s=()=>{He(this,$h).delete(r),t()};if(this.paused)He(this,$h).set(r,{timer:null,func:s,time:n});else{const a=setTimeout(s,n);He(this,$h).set(r,{timer:a,func:s,time:qH()})}return r}_forEachSubscriber(t){for(const n of He(this,wu).values())t(n.subscriber)}_getSubscriber(t){switch(t.type){case"debug":case"error":case"network":return new jIe(t.type);case"block":{const n=new v5t(this);return n.pollingInterval=this.pollingInterval,n}case"safe":case"finalized":return new w5t(this,t.type);case"event":return new Sae(this,t.filter);case"transaction":return new S5t(this,t.hash);case"orphan":return new C5t(this,t.filter)}throw new Error(`unsupported event: ${t.type}`)}_recoverSubscriber(t,n){for(const r of He(this,wu).values())if(r.subscriber===t){r.started&&r.subscriber.stop(),r.subscriber=n,r.started&&n.start(),He(this,Cu)!=null&&n.pause(He(this,Cu));break}}async on(t,n){const r=await wr(this,Vi,rO).call(this,t);return r.listeners.push({listener:n,once:!1}),r.started||(r.subscriber.start(),r.started=!0,He(this,Cu)!=null&&r.subscriber.pause(He(this,Cu))),this}async once(t,n){const r=await wr(this,Vi,rO).call(this,t);return r.listeners.push({listener:n,once:!0}),r.started||(r.subscriber.start(),r.started=!0,He(this,Cu)!=null&&r.subscriber.pause(He(this,Cu))),this}async emit(t,...n){const r=await wr(this,Vi,bj).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 yke(this,o?null:a,t);try{a.call(this,...n,l)}catch{}return!o}),r.listeners.length===0&&(r.started&&r.subscriber.stop(),He(this,wu).delete(r.tag)),s>0}async listenerCount(t){if(t){const r=await wr(this,Vi,bj).call(this,t);return r?r.listeners.length:0}let n=0;for(const{listeners:r}of He(this,wu).values())n+=r.length;return n}async listeners(t){if(t){const r=await wr(this,Vi,bj).call(this,t);return r?r.listeners.map(({listener:s})=>s):[]}let n=[];for(const{listeners:r}of He(this,wu).values())n=n.concat(r.map(({listener:s})=>s));return n}async off(t,n){const r=await wr(this,Vi,bj).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(),He(this,wu).delete(r.tag)),this}async removeAllListeners(t){if(t){const{tag:n,started:r,subscriber:s}=await wr(this,Vi,rO).call(this,t);r&&s.stop(),He(this,wu).delete(n)}else for(const[n,{started:r,subscriber:s}]of He(this,wu))r&&s.stop(),He(this,wu).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 He(this,fS)}destroy(){this.removeAllListeners();for(const t of He(this,$h).keys())this._clearTimeout(t);Ht(this,fS,!0)}get paused(){return He(this,Cu)!=null}set paused(t){!!t!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(t){if(Ht(this,Ag,-1),He(this,Cu)!=null){if(He(this,Cu)==!!t)return;Rr(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(n=>n.pause(t)),Ht(this,Cu,!!t);for(const n of He(this,$h).values())n.timer&&clearTimeout(n.timer),n.time=qH()-n.time}resume(){if(He(this,Cu)!=null){this._forEachSubscriber(t=>t.resume()),Ht(this,Cu,null);for(const t of He(this,$h).values()){let n=t.time;n<0&&(n=0),t.time=qH(),setTimeout(t.func,n)}}}}wu=new WeakMap,ay=new WeakMap,Cu=new WeakMap,fS=new WeakMap,Rf=new WeakMap,Ow=new WeakMap,oy=new WeakMap,Ag=new WeakMap,lk=new WeakMap,$h=new WeakMap,hS=new WeakMap,pS=new WeakMap,Vi=new WeakSet,_f=async function(t){const n=He(this,pS).cacheTimeout;if(n<0)return await this._perform(t);const r=nO(t.method,t);let s=He(this,oy).get(r);return s||(s=this._perform(t),He(this,oy).set(r,s),setTimeout(()=>{He(this,oy).get(r)===s&&He(this,oy).delete(r)},n)),await s},zJ=async function(t,n,r){Rr(r<A5t,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},t,{blockTag:n,enableCcipRead:!0})});const s=xE(t);try{return Gr(await this._perform({method:"call",transaction:s,blockTag:n}))}catch(a){if(!this.disableCcipRead&&nae(a)&&a.data&&r>=0&&n==="latest"&&s.to!=null&&bo(a.data,0,4)==="0x556f1830"){const o=a.data,l=await Tc(s.to,this);let c;try{c=F5t(bo(a.data,4))}catch(f){Rr(!1,f.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:s,info:{data:o}})}Rr(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);Rr(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:La([c.selector,P5t([u,c.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:d});try{const f=await wr(this,Vi,zJ).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}},HJ=async function(t){const{value:n}=await Nu({network:this.getNetwork(),value:t});return n},gj=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 wr(this,Vi,HJ).call(this,wr(this,Vi,_f).call(this,Object.assign(t,{address:s,blockTag:a})))},VJ=async function(t,n){if(uo(t,32))return await wr(this,Vi,_f).call(this,{method:"getBlock",blockHash:t,includeTransactions:n});let r=this._getBlockTag(t);return typeof r!="string"&&(r=await r),await wr(this,Vi,_f).call(this,{method:"getBlock",blockTag:r,includeTransactions:n})},bj=async function(t,n){let r=await WH(t,this);return r.type==="event"&&n&&n.length>0&&n[0].removed===!0&&(r=await WH({orphan:"drop-log",log:n[0]},this)),He(this,wu).get(r.tag)||null},rO=async function(t){const n=await WH(t,this),r=n.tag;let s=He(this,wu).get(r);return s||(s={subscriber:this._getSubscriber(n),tag:r,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},He(this,wu).set(r,s)),s};function k5t(e,t){try{const n=WJ(e,t);if(n)return gM(n)}catch{}return null}function WJ(e,t){if(e==="0x")return null;try{const n=Bi(bo(e,t,t+32)),r=Bi(bo(e,n,n+32));return bo(e,n+32,n+32+r)}catch{}return null}function nxe(e){const t=ol(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 T5t(e){if(e.length%32===0)return e;const t=new Uint8Array(Math.ceil(e.length/32)*32);return t.set(e),t}const I5t=new Uint8Array([]);function P5t(e){const t=[];let n=0;for(let r=0;r<e.length;r++)t.push(I5t),n+=32;for(let r=0;r<e.length;r++){const s=ps(e[r]);t[r]=nxe(n),t.push(nxe(s.length)),t.push(T5t(s)),n+=32+Math.ceil(s.length/32)*32}return La(t)}const rxe="0x0000000000000000000000000000000000000000000000000000000000000000";function F5t(e){const t={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};Rr(n4(e)>=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const n=bo(e,0,32);Rr(bo(n,0,12)===bo(rxe,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),t.sender=bo(n,12);try{const r=[],s=Bi(bo(e,32,64)),a=Bi(bo(e,s,s+32)),o=bo(e,s+32);for(let l=0;l<a;l++){const c=k5t(o,l*32);if(c==null)throw new Error("abort");r.push(c)}t.urls=r}catch{Rr(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{const r=WJ(e,64);if(r==null)throw new Error("abort");t.calldata=r}catch{Rr(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}Rr(bo(e,100,128)===bo(rxe,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),t.selector=bo(e,96,100);try{const r=WJ(e,128);if(r==null)throw new Error("abort");t.extraData=r}catch{Rr(!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 ov(e,t){if(e.provider)return e.provider;Rr(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:t})}async function sxe(e,t){let n=xE(t);if(n.to!=null&&(n.to=Tc(n.to,e)),n.from!=null){const r=n.from;n.from=Promise.all([e.getAddress(),Tc(r,e)]).then(([s,a])=>(bn(s.toLowerCase()===a.toLowerCase(),"transaction from mismatch","tx.from",a),s))}else n.from=e.getAddress();return await Nu(n)}class Nae{constructor(t){Dn(this,"provider");Bs(this,{provider:t||null})}async getNonce(t){return ov(this,"getTransactionCount").getTransactionCount(await this.getAddress(),t)}async populateCall(t){return await sxe(this,t)}async populateTransaction(t){const n=ov(this,"populateTransaction"),r=await sxe(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=js(r.chainId);bn(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)?bn(!1,"eip-1559 transaction do not support gasPrice","tx",t):(r.type===0||r.type===1)&&a&&bn(!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();Rr(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?(Rr(!a,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice),r.type=0):Rr(!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 Nu(r)}async populateAuthorization(t){const n=Object.assign({},t);return n.chainId==null&&(n.chainId=(await ov(this,"getNetwork").getNetwork()).chainId),n.nonce==null&&(n.nonce=await this.getNonce()),n}async estimateGas(t){return ov(this,"estimateGas").estimateGas(await this.populateCall(t))}async call(t){return ov(this,"call").call(await this.populateCall(t))}async resolveName(t){return await ov(this,"resolveName").resolveName(t)}async sendTransaction(t){const n=ov(this,"sendTransaction"),r=await this.populateTransaction(t);delete r.from;const s=mae.from(r);return await n.broadcastTransaction(await this.signTransaction(s))}authorize(t){Rr(!1,"authorization not implemented for this signer","UNSUPPORTED_OPERATION",{operation:"authorize"})}}var mS,sO;const que=class que extends Nae{constructor(n,r){super(r);On(this,mS);Dn(this,"address");Bs(this,{address:n})}async getAddress(){return this.address}connect(n){return new que(this.address,n)}async signTransaction(n){wr(this,mS,sO).call(this,"transactions","signTransaction")}async signMessage(n){wr(this,mS,sO).call(this,"messages","signMessage")}async signTypedData(n,r,s){wr(this,mS,sO).call(this,"typed-data","signTypedData")}};mS=new WeakSet,sO=function(n,r){Rr(!1,`VoidSigner cannot sign ${n}`,"UNSUPPORTED_OPERATION",{operation:r})};let qJ=que;function O5t(e){return JSON.parse(JSON.stringify(e))}var Zu,m0,Mw,ly,Rw,xS,Jy,GJ,KJ;class EIe{constructor(t){On(this,Jy);On(this,Zu);On(this,m0);On(this,Mw);On(this,ly);On(this,Rw);On(this,xS);Ht(this,Zu,t),Ht(this,m0,null),Ht(this,Mw,wr(this,Jy,GJ).bind(this)),Ht(this,ly,!1),Ht(this,Rw,null),Ht(this,xS,!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(){He(this,ly)||(Ht(this,ly,!0),wr(this,Jy,GJ).call(this,-2))}stop(){He(this,ly)&&(Ht(this,ly,!1),Ht(this,xS,!0),wr(this,Jy,KJ).call(this),He(this,Zu).off("block",He(this,Mw)))}pause(t){t&&wr(this,Jy,KJ).call(this),He(this,Zu).off("block",He(this,Mw))}resume(){this.start()}}Zu=new WeakMap,m0=new WeakMap,Mw=new WeakMap,ly=new WeakMap,Rw=new WeakMap,xS=new WeakMap,Jy=new WeakSet,GJ=async function(t){try{He(this,m0)==null&&Ht(this,m0,this._subscribe(He(this,Zu)));let n=null;try{n=await He(this,m0)}catch(a){if(!Jc(a,"UNSUPPORTED_OPERATION")||a.operation!=="eth_newFilter")throw a}if(n==null){Ht(this,m0,null),He(this,Zu)._recoverSubscriber(this,this._recover(He(this,Zu)));return}const r=await He(this,Zu).getNetwork();if(He(this,Rw)||Ht(this,Rw,r),He(this,Rw).chainId!==r.chainId)throw new Error("chaid changed");if(He(this,xS))return;const s=await He(this,Zu).send("eth_getFilterChanges",[n]);await this._emitResults(He(this,Zu),s)}catch(n){console.log("@TODO",n)}He(this,Zu).once("block",He(this,Mw))},KJ=function(){const t=He(this,m0);t&&(Ht(this,m0,null),t.then(n=>{He(this,Zu).destroyed||He(this,Zu).send("eth_uninstallFilter",[n])}))};var Lw;class M5t extends EIe{constructor(n,r){super(n);On(this,Lw);Ht(this,Lw,O5t(r))}_recover(n){return new Sae(n,He(this,Lw))}async _subscribe(n){return await n.send("eth_newFilter",[He(this,Lw)])}async _emitResults(n,r){for(const s of r)n.emit(He(this,Lw),n._wrapLog(s,n._network))}}Lw=new WeakMap;class R5t extends EIe{async _subscribe(t){return await t.send("eth_newPendingTransactionFilter",[])}async _emitResults(t,n){for(const r of n)t.emit("pending",r)}}const L5t="bigint,boolean,function,number,string,symbol".split(/,/g);function iO(e){if(e==null||L5t.indexOf(typeof e)>=0||typeof e.getAddress=="function")return e;if(Array.isArray(e))return e.map(iO);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 D5t(e){return new Promise(t=>{setTimeout(t,e)})}function $6(e){return e&&e.toLowerCase()}function ixe(e){return e&&typeof e.pollingInterval=="number"}const _Ie={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class GH extends Nae{constructor(n,r){super(n);Dn(this,"address");r=ra(r),Bs(this,{address:r})}connect(n){Rr(!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=iO(n),s=[];if(r.from){const o=r.from;s.push((async()=>{const l=await Tc(o,this.provider);bn(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 Tc(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(Jc(d,"CANCELLED")||Jc(d,"BAD_DATA")||Jc(d,"NETWORK_ERROR")||Jc(d,"UNSUPPORTED_OPERATION")){d.info==null&&(d.info={}),d.info.sendTransactionHash=s,o(d);return}if(Jc(d,"INVALID_ARGUMENT")&&(c++,d.info==null&&(d.info={}),d.info.sendTransactionHash=s,c>10)){o(d);return}this.provider.emit("error",ko("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=iO(n);if(r.from){const a=await Tc(r.from,this.provider);bn(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"?fd(n):n;return await this.provider.send("personal_sign",[Gr(r),this.address.toLowerCase()])}async signTypedData(n,r,s){const a=iO(s),o=await HS.resolveNames(n,r,a,async l=>{const c=await Tc(l);return bn(c!=null,"TypedData does not support null address","value",l),c});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(HS.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"?fd(n):n;return await this.provider.send("eth_sign",[this.address.toLowerCase(),Gr(r)])}}var Dw,gS,jg,x0,Kp,Uh,zd,ck,YJ;class B5t extends _5t{constructor(n,r){super(n,r);On(this,ck);On(this,Dw);On(this,gS);On(this,jg);On(this,x0);On(this,Kp);On(this,Uh);On(this,zd);Ht(this,gS,1),Ht(this,Dw,Object.assign({},_Ie,r||{})),Ht(this,jg,[]),Ht(this,x0,null),Ht(this,Uh,null),Ht(this,zd,null);{let a=null;const o=new Promise(l=>{a=l});Ht(this,Kp,{promise:o,resolve:a})}const s=this._getOption("staticNetwork");typeof s=="boolean"?(bn(!s||n!=="any","staticNetwork cannot be used on special network 'any'","options",r),s&&n!=null&&Ht(this,Uh,hy.from(n))):s&&(bn(n==null||s.matches(n),"staticNetwork MUST match network object","options",r),Ht(this,Uh,s))}_getOption(n){return He(this,Dw)[n]}get _network(){return Rr(He(this,Uh),"network is not available yet","NETWORK_ERROR"),He(this,Uh)}async _perform(n){if(n.method==="call"||n.method==="estimateGas"){let s=n.transaction;if(s&&s.type!=null&&js(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(He(this,Uh))return He(this,Uh)}else return n;return He(this,zd)?await He(this,zd):this.ready?(Ht(this,zd,(async()=>{try{const r=hy.from(js(await this.send("eth_chainId",[])));return Ht(this,zd,null),r}catch(r){throw Ht(this,zd,null),r}})()),await He(this,zd)):(Ht(this,zd,(async()=>{const r={id:ib(this,gS)._++,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,zd,null)}catch(a){throw Ht(this,zd,null),this.emit("debug",{action:"receiveRpcError",error:a}),a}if(this.emit("debug",{action:"receiveRpcResult",result:s}),"result"in s)return hy.from(js(s.result));throw this.getRpcError(r,s)})()),await He(this,zd))}_start(){He(this,Kp)==null||He(this,Kp).resolve==null||(He(this,Kp).resolve(),Ht(this,Kp,null),(async()=>{for(;He(this,Uh)==null&&!this.destroyed;)try{Ht(this,Uh,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",ko("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:n}})),await D5t(1e3)}wr(this,ck,YJ).call(this)})())}async _waitUntilReady(){if(He(this,Kp)!=null)return await He(this,Kp).promise}_getSubscriber(n){return n.type==="pending"?new R5t(this):n.type==="event"?this._getOption("polling")?new Sae(this,n.filter):new M5t(this,n.filter):n.type==="orphan"&&n.filter.orphan==="drop-log"?new jIe("orphan"):super._getSubscriber(n)}get ready(){return He(this,Kp)==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]=tm(js(n[s],`tx.${s}`))}),["from","to","data"].forEach(s=>{n[s]!=null&&(r[s]=Gr(n[s]))}),n.accessList&&(r.accessList=u5(n.accessList)),n.blobVersionedHashes&&(r.blobVersionedHashes=n.blobVersionedHashes.map(s=>s.toLowerCase())),n.authorizationList&&(r.authorizationList=n.authorizationList.map(s=>{const a=TTe(s);return{address:a.address,nonce:tm(a.nonce),chainId:tm(a.chainId),yParity:tm(a.signature.yParity),r:tm(a.signature.r),s:tm(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:[$6(n.address),n.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[$6(n.address),n.blockTag]};case"getCode":return{method:"eth_getCode",args:[$6(n.address),n.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[$6(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($6):n.filter.address=$6(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 ko("insufficient funds","INSUFFICIENT_FUNDS",{transaction:n.params[0],info:{payload:n,error:a}});if(c.match(/nonce/i)&&c.match(/too low/i))return ko("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=XJ(a),u=mE.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(U5t(a));if(typeof a.message=="string"&&a.message.match(/user denied|ethers-user-denied/i))return ko("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 ko("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:c,info:{error:a}});if(o.match(/nonce/i)&&o.match(/too low/i))return ko("nonce has already been used","NONCE_EXPIRED",{transaction:c,info:{error:a}});if(o.match(/replacement transaction/i)&&o.match(/underpriced/i))return ko("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:c,info:{error:a}});if(o.match(/only replay-protected/i))return ko("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?ko("unsupported operation","UNSUPPORTED_OPERATION",{operation:n.method,info:{error:a,payload:n}}):ko("could not coalesce error","UNKNOWN_ERROR",{error:a,payload:n})}send(n,r){if(this.destroyed)return Promise.reject(ko("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n}));const s=ib(this,gS)._++,a=new Promise((o,l)=>{He(this,jg).push({resolve:o,reject:l,payload:{method:n,params:r,id:s,jsonrpc:"2.0"}})});return wr(this,ck,YJ).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 GH(this,a[n])}const{accounts:s}=await Nu({network:this.getNetwork(),accounts:r});n=ra(n);for(const a of s)if(ra(a)===n)return new GH(this,n);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(r=>new GH(this,r))}destroy(){He(this,x0)&&(clearTimeout(He(this,x0)),Ht(this,x0,null));for(const{payload:n,reject:r}of He(this,jg))r(ko("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n.method}));Ht(this,jg,[]),super.destroy()}}Dw=new WeakMap,gS=new WeakMap,jg=new WeakMap,x0=new WeakMap,Kp=new WeakMap,Uh=new WeakMap,zd=new WeakMap,ck=new WeakSet,YJ=function(){if(He(this,x0))return;const n=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");Ht(this,x0,setTimeout(()=>{Ht(this,x0,null);const r=He(this,jg);for(Ht(this,jg,[]);r.length;){const s=[r.shift()];for(;r.length&&s.length!==He(this,Dw).batchMaxCount;)if(s.push(r.shift()),JSON.stringify(s.map(o=>o.payload)).length>He(this,Dw).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(ko("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=ko("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 cy;class $5t extends B5t{constructor(n,r){super(n,r);On(this,cy);let s=this._getOption("pollingInterval");s==null&&(s=_Ie.pollingInterval),Ht(this,cy,s)}_getSubscriber(n){const r=super._getSubscriber(n);return ixe(r)&&(r.pollingInterval=He(this,cy)),r}get pollingInterval(){return He(this,cy)}set pollingInterval(n){if(!Number.isInteger(n)||n<0)throw new Error("invalid interval");Ht(this,cy,n),this._forEachSubscriber(r=>{ixe(r)&&(r.pollingInterval=He(this,cy))})}}cy=new WeakMap;function XJ(e){if(e==null)return null;if(typeof e.message=="string"&&e.message.match(/revert/i)&&uo(e.data))return{message:e.message,data:e.data};if(typeof e=="object"){for(const t in e){const n=XJ(e[t]);if(n)return n}return null}if(typeof e=="string")try{return XJ(JSON.parse(e))}catch{}return null}function QJ(e,t){if(e!=null){if(typeof e.message=="string"&&t.push(e.message),typeof e=="object")for(const n in e)QJ(e[n],t);if(typeof e=="string")try{return QJ(JSON.parse(e),t)}catch{}}}function U5t(e){const t=[];return QJ(e,t),t}var bS,yS;const $v=class $v extends $5t{constructor(n,r,s){const a=Object.assign({},s??{},{batchMaxCount:1});bn(n&&n.request,"invalid EIP-1193 provider","ethereum",n);super(r,a);On(this,bS);On(this,yS);Ht(this,yS,null),s&&s.providerInfo&&Ht(this,yS,s.providerInfo),Ht(this,bS,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 He(this,yS)}async send(n,r){return await this._start(),await super.send(n,r)}async _send(n){bn(!Array.isArray(n),"EIP-1193 does not support batch request","payload",n);try{const r=await He(this,bS).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 He(this,bS).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 $v(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 $v(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 $v)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 $v(v,void 0,{providerInfo:w}))}else l(ko("filter returned unknown info","UNSUPPORTED_OPERATION",{value:x}))}}else{const{provider:x,info:g}=c[0];o(new $v(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"))})}};bS=new WeakMap,yS=new WeakMap;let jM=$v;var vS;const Gue=class Gue extends Nae{constructor(n,r){super(r);Dn(this,"address");On(this,vS);bn(n&&typeof n.sign=="function","invalid private key","privateKey","[ REDACTED ]"),Ht(this,vS,n);const s=Uk(this.signingKey.publicKey);Bs(this,{address:s})}get signingKey(){return He(this,vS)}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(n){return new Gue(He(this,vS),n)}async signTransaction(n){n=xE(n);const{to:r,from:s}=await Nu({to:n.to?Tc(n.to,this):void 0,from:n.from?Tc(n.from,this):void 0});r!=null&&(n.to=r),s!=null&&(n.from=s),n.from!=null&&(bn(ra(n.from)===this.address,"transaction from address mismatch","tx.from",n.from),delete n.from);const a=mae.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(C3t(n)).serialized}authorizeSync(n){bn(typeof n.address=="string","invalid address for authorizeSync","auth.address",n);const r=this.signingKey.sign(Lwt(n));return Object.assign({},{address:ra(n.address),nonce:js(n.nonce||0),chainId:js(n.chainId||0)},{signature:r})}async authorize(n){return n=Object.assign({},n,{address:await Tc(n.address,this)}),this.authorizeSync(await this.populateAuthorization(n))}async signTypedData(n,r,s){const a=await HS.resolveNames(n,r,s,async o=>{Rr(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 Rr(l!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:o}),l});return this.signingKey.sign(HS.hash(a.domain,r,a.value)).serialized}};vS=new WeakMap;let EM=Gue;const _M=" !#$%&'()*+,-./<=>?@[]^_`{|}~",z5t=/^[a-z]*$/i;function axe(e,t){let n=97;return e.reduce((r,s)=>(s===t?n++:s.match(z5t)?r.push(String.fromCharCode(n)+s):(n=97,r.push(s)),r),[])}function H5t(e,t){for(let s=_M.length-1;s>=0;s--)e=e.split(_M[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 axe(axe(n,";"),":")}function V5t(e){return bn(e[0]==="0","unsupported auwl data","data",e),H5t(e.substring(1+2*_M.length),e.substring(1,1+2*_M.length))}class W5t{constructor(t){Dn(this,"locale");Bs(this,{locale:t})}split(t){return t.toLowerCase().split(/\s+/g)}join(t){return t.join(" ")}}var wS,uk,Bw,dk,ZJ;class q5t extends W5t{constructor(n,r,s){super(n);On(this,dk);On(this,wS);On(this,uk);On(this,Bw);Ht(this,wS,r),Ht(this,uk,s),Ht(this,Bw,null)}get _data(){return He(this,wS)}_decodeWords(){return V5t(He(this,wS))}getWord(n){const r=wr(this,dk,ZJ).call(this);return bn(n>=0&&n<r.length,`invalid word index: ${n}`,"index",n),r[n]}getWordIndex(n){return wr(this,dk,ZJ).call(this).indexOf(n)}}wS=new WeakMap,uk=new WeakMap,Bw=new WeakMap,dk=new WeakSet,ZJ=function(){if(He(this,Bw)==null){const n=this._decodeWords();if(l1(n.join(`
`)+`
`)!==He(this,uk))throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);Ht(this,Bw,n)}return He(this,Bw)};const G5t="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",K5t="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60";let KH=null;class T3 extends q5t{constructor(){super("en",G5t,K5t)}static wordlist(){return KH==null&&(KH=new T3),KH}}function kIe(e){return(1<<e)-1<<8-e&255}function Y5t(e){return(1<<e)-1&255}function YH(e,t){pke("NFKD"),t==null&&(t=T3.wordlist());const n=t.split(e);bn(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"));bn(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=kIe(o),c=ps(op(r.slice(0,a/8)))[0]&l;return bn(c===(r[r.length-1]&l),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),Gr(r.slice(0,a/8))}function XH(e,t){bn(e.length%4===0&&e.length>=16&&e.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),t==null&&(t=T3.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]&Y5t(8-r)),r+=3);const s=e.length/4,a=parseInt(op(e).substring(2,4),16)&kIe(s);return n[n.length-1]<<=s,n[n.length-1]|=a>>8-s,t.join(n.map(o=>t.getWord(o)))}const QH={};class WS{constructor(t,n,r,s,a){Dn(this,"phrase");Dn(this,"password");Dn(this,"wordlist");Dn(this,"entropy");s==null&&(s=""),a==null&&(a=T3.wordlist()),c5(t,QH,"Mnemonic"),Bs(this,{phrase:r,password:s,wordlist:a,entropy:n})}computeSeed(){const t=fd("mnemonic"+this.password,"NFKD");return a2(fd(this.phrase,"NFKD"),t,2048,64,"sha512")}static fromPhrase(t,n,r){const s=YH(t,r);return t=XH(ps(s),r),new WS(QH,s,t,n,r)}static fromEntropy(t,n,r){const s=ps(t,"entropy"),a=XH(s,r);return new WS(QH,Gr(s),a,n,r)}static entropyToPhrase(t,n){const r=ps(t,"entropy");return XH(r,n)}static phraseToEntropy(t,n){return YH(t,n)}static isValidMnemonic(t,n){try{return YH(t,n),!0}catch{}return!1}}/*! MIT License. Copyright 2015-2022 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */var Wc=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)},ZH=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},aO,_h,n0;const X5t={16:10,24:12,32:14},Q5t=[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],bh=[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],sP=[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],Z5t=[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],J5t=[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],e6t=[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],t6t=[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],n6t=[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],r6t=[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],s6t=[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],i6t=[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],a6t=[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],o6t=[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],l6t=[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],c6t=[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 JH(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 Aae{get key(){return Wc(this,aO,"f").slice()}constructor(t){if(aO.set(this,void 0),_h.set(this,void 0),n0.set(this,void 0),!(this instanceof Aae))throw Error("AES must be instanitated with `new`");ZH(this,aO,new Uint8Array(t),"f");const n=X5t[this.key.length];if(n==null)throw new TypeError("invalid key size (must be 16, 24 or 32 bytes)");ZH(this,n0,[],"f"),ZH(this,_h,[],"f");for(let d=0;d<=n;d++)Wc(this,n0,"f").push([0,0,0,0]),Wc(this,_h,"f").push([0,0,0,0]);const r=(n+1)*4,s=this.key.length/4,a=JH(this.key);let o;for(let d=0;d<s;d++)o=d>>2,Wc(this,n0,"f")[o][d%4]=a[d],Wc(this,_h,"f")[n-o][d%4]=a[d];let l=0,c=s,u;for(;c<r;){if(u=a[s-1],a[0]^=bh[u>>16&255]<<24^bh[u>>8&255]<<16^bh[u&255]<<8^bh[u>>24&255]^Q5t[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]^=bh[u&255]^bh[u>>8&255]<<8^bh[u>>16&255]<<16^bh[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,Wc(this,n0,"f")[f][x]=a[d],Wc(this,_h,"f")[n-f][x]=a[d++],c++}for(let d=1;d<n;d++)for(let f=0;f<4;f++)u=Wc(this,_h,"f")[d][f],Wc(this,_h,"f")[d][f]=a6t[u>>24&255]^o6t[u>>16&255]^l6t[u>>8&255]^c6t[u&255]}encrypt(t){if(t.length!=16)throw new TypeError("invalid plaintext size (must be 16 bytes)");const n=Wc(this,n0,"f").length-1,r=[0,0,0,0];let s=JH(t);for(let l=0;l<4;l++)s[l]^=Wc(this,n0,"f")[0][l];for(let l=1;l<n;l++){for(let c=0;c<4;c++)r[c]=Z5t[s[c]>>24&255]^J5t[s[(c+1)%4]>>16&255]^e6t[s[(c+2)%4]>>8&255]^t6t[s[(c+3)%4]&255]^Wc(this,n0,"f")[l][c];s=r.slice()}const a=new Uint8Array(16);let o=0;for(let l=0;l<4;l++)o=Wc(this,n0,"f")[n][l],a[4*l]=(bh[s[l]>>24&255]^o>>24)&255,a[4*l+1]=(bh[s[(l+1)%4]>>16&255]^o>>16)&255,a[4*l+2]=(bh[s[(l+2)%4]>>8&255]^o>>8)&255,a[4*l+3]=(bh[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=Wc(this,_h,"f").length-1,r=[0,0,0,0];let s=JH(t);for(let l=0;l<4;l++)s[l]^=Wc(this,_h,"f")[0][l];for(let l=1;l<n;l++){for(let c=0;c<4;c++)r[c]=n6t[s[c]>>24&255]^r6t[s[(c+3)%4]>>16&255]^s6t[s[(c+2)%4]>>8&255]^i6t[s[(c+1)%4]&255]^Wc(this,_h,"f")[l][c];s=r.slice()}const a=new Uint8Array(16);let o=0;for(let l=0;l<4;l++)o=Wc(this,_h,"f")[n][l],a[4*l]=(sP[s[l]>>24&255]^o>>24)&255,a[4*l+1]=(sP[s[(l+3)%4]>>16&255]^o>>16)&255,a[4*l+2]=(sP[s[(l+2)%4]>>8&255]^o>>8)&255,a[4*l+3]=(sP[s[(l+1)%4]&255]^o)&255;return a}}aO=new WeakMap,_h=new WeakMap,n0=new WeakMap;class TIe{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 Aae(n)},name:{enumerable:!0,value:t}})}}var iP=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},U6=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,rg;class jae extends TIe{constructor(t,n){if(super("ECC",t,jae),yj.set(this,void 0),rg.set(this,void 0),n){if(n.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");iP(this,yj,new Uint8Array(n),"f")}else iP(this,yj,new Uint8Array(16),"f");iP(this,rg,this.iv,"f")}get iv(){return new Uint8Array(U6(this,yj,"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++)U6(this,rg,"f")[s]^=t[r+s];iP(this,rg,this.aes.encrypt(U6(this,rg,"f")),"f"),n.set(U6(this,rg,"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]^U6(this,rg,"f")[a],U6(this,rg,"f")[a]=t[r+a]}return n}}yj=new WeakMap,rg=new WeakMap;var z6=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},yh=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)},vj,Av,kh;class qS extends TIe{constructor(t,n){super("CTR",t,qS),vj.set(this,void 0),Av.set(this,void 0),kh.set(this,void 0),z6(this,kh,new Uint8Array(16),"f"),yh(this,kh,"f").fill(0),z6(this,vj,yh(this,kh,"f"),"f"),z6(this,Av,16,"f"),n==null&&(n=1),typeof n=="number"?this.setCounterValue(n):this.setCounterBytes(n)}get counter(){return new Uint8Array(yh(this,kh,"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)yh(this,kh,"f")[n]=t%256,t=Math.floor(t/256)}setCounterBytes(t){if(t.length!==16)throw new TypeError("invalid counter initial Uint8Array value length");yh(this,kh,"f").set(t)}increment(){for(let t=15;t>=0;t--)if(yh(this,kh,"f")[t]===255)yh(this,kh,"f")[t]=0;else{yh(this,kh,"f")[t]++;break}}encrypt(t){var n,r;const s=new Uint8Array(t);for(let a=0;a<s.length;a++)yh(this,Av,"f")===16&&(z6(this,vj,this.aes.encrypt(yh(this,kh,"f")),"f"),z6(this,Av,0,"f"),this.increment()),s[a]^=yh(this,vj,"f")[z6(this,Av,(r=yh(this,Av,"f"),n=r++,r),"f"),n];return s}decrypt(t){return this.encrypt(t)}}vj=new WeakMap,Av=new WeakMap,kh=new WeakMap;function u6t(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 IIe(e){return typeof e=="string"&&!e.startsWith("0x")&&(e="0x"+e),eu(e)}function N7(e,t){for(e=String(e);e.length<t;)e="0"+e;return e}function Wk(e){return typeof e=="string"?fd(e,"NFKC"):eu(e)}function bl(e,t){const n=t.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);bn(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(bn(!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 IIe(o);if(s==="array"&&Array.isArray(o)||s===typeof o)return o;bn(!1,`wrong type found for ${s} `,"path",r)}return o}const PIe="m/44'/60'/0'/0/0";function oxe(e){try{const t=JSON.parse(e);if((t.version!=null?parseInt(t.version):0)===3)return!0}catch{}return!1}function d6t(e,t,n){if(bl(e,"crypto.cipher:string")==="aes-128-ctr"){const s=bl(e,"crypto.cipherparams.iv:data!"),a=new qS(t,s);return Gr(a.decrypt(n))}Rr(!1,"unsupported cipher","UNSUPPORTED_OPERATION",{operation:"decrypt"})}function kM(e,t){const n=ps(t),r=bl(e,"crypto.ciphertext:data!"),s=Gr(co(La([n.slice(16,32),r]))).substring(2);bn(s===bl(e,"crypto.mac:string!").toLowerCase(),"incorrect password","password","[ REDACTED ]");const a=d6t(e,n.slice(0,16),r),o=Uk(a);if(e.address){let u=e.address.toLowerCase();u.startsWith("0x")||(u="0x"+u),bn(ra(u)===o,"keystore address/privateKey mismatch","address",e.address)}const l={address:o,privateKey:a};if(bl(e,"x-ethers.version:string")==="0.1"){const u=n.slice(32,64),d=bl(e,"x-ethers.mnemonicCiphertext:data!"),f=bl(e,"x-ethers.mnemonicCounter:data!"),x=new qS(u,f);l.mnemonic={path:bl(e,"x-ethers.path:string")||PIe,locale:bl(e,"x-ethers.locale:string")||"en",entropy:Gr(ps(x.decrypt(d)))}}return l}function FIe(e){const t=bl(e,"crypto.kdf:string");if(t&&typeof t=="string"){if(t.toLowerCase()==="scrypt"){const n=bl(e,"crypto.kdfparams.salt:data!"),r=bl(e,"crypto.kdfparams.n:int!"),s=bl(e,"crypto.kdfparams.r:int!"),a=bl(e,"crypto.kdfparams.p:int!");bn(r>0&&(r&r-1)===0,"invalid kdf.N","kdf.N",r),bn(s>0&&a>0,"invalid kdf","kdf",t);const o=bl(e,"crypto.kdfparams.dklen:int!");return bn(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=bl(e,"crypto.kdfparams.salt:data!"),r=bl(e,"crypto.kdfparams.prf:string!"),s=r.split("-").pop();bn(s==="sha256"||s==="sha512","invalid kdf.pdf","kdf.pdf",r);const a=bl(e,"crypto.kdfparams.c:int!"),o=bl(e,"crypto.kdfparams.dklen:int!");return bn(o===32,"invalid kdf.dklen","kdf.dklen",o),{name:"pbkdf2",salt:n,count:a,dkLen:o,algorithm:s}}}bn(!1,"unsupported key-derivation function","kdf",t)}function f6t(e,t){const n=JSON.parse(e),r=Wk(t),s=FIe(n);if(s.name==="pbkdf2"){const{salt:f,count:x,dkLen:g,algorithm:v}=s,w=a2(r,f,x,g,v);return kM(n,w)}Rr(s.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:s});const{salt:a,N:o,r:l,p:c,dkLen:u}=s,d=FA(r,a,o,l,c,u);return kM(n,d)}function lxe(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}async function h6t(e,t,n){const r=JSON.parse(e),s=Wk(t),a=FIe(r);if(a.name==="pbkdf2"){n&&(n(0),await lxe(0));const{salt:x,count:g,dkLen:v,algorithm:w}=a,C=a2(s,x,g,v,w);return n&&(n(1),await lxe(0)),kM(r,C)}Rr(a.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:a});const{salt:o,N:l,r:c,p:u,dkLen:d}=a,f=await PA(s,o,l,c,u,d,n);return kM(r,f)}function OIe(e){const t=e.salt!=null?ps(e.salt,"options.salt"):Vg(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)),bn(typeof n=="number"&&n>0&&Number.isSafeInteger(n)&&(BigInt(n)&BigInt(n-1))===BigInt(0),"invalid scrypt N parameter","options.N",n),bn(typeof r=="number"&&r>0&&Number.isSafeInteger(r),"invalid scrypt r parameter","options.r",r),bn(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 MIe(e,t,n,r){const s=ps(n.privateKey,"privateKey"),a=r.iv!=null?ps(r.iv,"options.iv"):Vg(16);bn(a.length===16,"invalid options.iv length","options.iv",r.iv);const o=r.uuid!=null?ps(r.uuid,"options.uuid"):Vg(16);bn(o.length===16,"invalid options.uuid length","options.uuid",r.iv);const l=e.slice(0,16),c=e.slice(16,32),u=new qS(l,a),d=ps(u.encrypt(s)),f=co(La([c,d])),x={address:n.address.substring(2).toLowerCase(),id:h2t(o),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:Gr(a).substring(2)},ciphertext:Gr(d).substring(2),kdf:"scrypt",kdfparams:{salt:Gr(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/${fke}`,v=n.mnemonic.path||PIe,w=n.mnemonic.locale||"en",C=e.slice(32,64),N=ps(n.mnemonic.entropy,"account.mnemonic.entropy"),P=Vg(16),I=new qS(C,P),R=ps(I.encrypt(N)),O=new Date,L="UTC--"+(O.getUTCFullYear()+"-"+N7(O.getUTCMonth()+1,2)+"-"+N7(O.getUTCDate(),2)+"T"+N7(O.getUTCHours(),2)+"-"+N7(O.getUTCMinutes(),2)+"-"+N7(O.getUTCSeconds(),2)+".0Z")+"--"+x.address;x["x-ethers"]={client:g,gethFilename:L,path:v,locale:w,mnemonicCounter:Gr(P).substring(2),mnemonicCiphertext:Gr(R).substring(2),version:"0.1"}}return JSON.stringify(x)}function RIe(e,t,n){n==null&&(n={});const r=Wk(t),s=OIe(n),a=FA(r,s.salt,s.N,s.r,s.p,64);return MIe(ps(a),s,e,n)}async function LIe(e,t,n){n==null&&(n={});const r=Wk(t),s=OIe(n),a=await PA(r,s.salt,s.N,s.r,s.p,64,n.progressCallback);return MIe(ps(a),s,e,n)}const eV="m/44'/60'/0'/0/0",p6t=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),a4=2147483648,m6t=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),x6t="0123456789abcdef";function TM(e,t){let n="";for(;e;)n=x6t[e%16]+n,e=Math.trunc(e/16);for(;n.length<t*2;)n="0"+n;return"0x"+n}function JJ(e){const t=ps(e),n=bo(op(op(t)),0,4),r=La([t,n]);return bke(r)}const r0={};function DIe(e,t,n,r){const s=new Uint8Array(37);e&a4?(Rr(r!=null,"cannot derive child of neutered node","UNSUPPORTED_OPERATION",{operation:"deriveChild"}),s.set(ps(r),1)):s.set(ps(n));for(let o=24;o>=0;o-=8)s[33+(o>>3)]=e>>24-o&255;const a=ps(TA("sha512",t,s));return{IL:a.slice(0,32),IR:a.slice(32)}}function BIe(e,t){const n=t.split("/");bn(n.length>0,"invalid path","path",t),n[0]==="m"&&(bn(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));bn(o<a4,"invalid path index",`path[${s}]`,a),r=r.deriveChild(a4+o)}else if(a.match(/^[0-9]+$/)){const o=parseInt(a);bn(o<a4,"invalid path index",`path[${s}]`,a),r=r.deriveChild(o)}else bn(!1,"invalid path component",`path[${s}]`,a)}return r}var fk,eee,$w,wj;const Dp=class Dp extends EM{constructor(n,r,s,a,o,l,c,u,d){super(r,d);On(this,fk);Dn(this,"publicKey");Dn(this,"fingerprint");Dn(this,"parentFingerprint");Dn(this,"mnemonic");Dn(this,"chainCode");Dn(this,"path");Dn(this,"index");Dn(this,"depth");c5(n,r0,"HDNodeWallet"),Bs(this,{publicKey:r.compressedPublicKey});const f=bo(IA(op(this.publicKey)),0,4);Bs(this,{parentFingerprint:s,fingerprint:f,chainCode:a,path:o,index:l,depth:c}),Bs(this,{mnemonic:u})}connect(n){return new Dp(r0,this.signingKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.mnemonic,n)}async encrypt(n,r){return await LIe(wr(this,fk,eee).call(this),n,{progressCallback:r})}encryptSync(n){return RIe(wr(this,fk,eee).call(this),n)}get extendedKey(){return Rr(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),JJ(La(["0x0488ADE4",TM(this.depth,1),this.parentFingerprint,TM(this.index,4),this.chainCode,La(["0x00",this.privateKey])]))}hasPath(){return this.path!=null}neuter(){return new yE(r0,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.provider)}deriveChild(n){const r=Bi(n,"index");bn(r<=4294967295,"invalid index","index",r);let s=this.path;s&&(s+="/"+(r&2147483647),r&a4&&(s+="'"));const{IR:a,IL:o}=DIe(r,this.chainCode,this.publicKey,this.privateKey),l=new D0(a1((FB(o)+BigInt(this.privateKey))%m6t,32));return new Dp(r0,l,this.fingerprint,Gr(a),s,r,this.depth+1,this.mnemonic,this.provider)}derivePath(n){return BIe(this,n)}static fromExtendedKey(n){const r=ol(Qyt(n));bn(r.length===82||JJ(r.slice(0,78))===n,"invalid extended key","extendedKey","[ REDACTED ]");const s=r[4],a=Gr(r.slice(5,9)),o=parseInt(Gr(r.slice(9,13)).substring(2),16),l=Gr(r.slice(13,45)),c=r.slice(45,78);switch(Gr(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":{const u=Gr(c);return new yE(r0,Uk(u),u,a,l,null,o,s,null)}case"0x0488ade4":case"0x04358394 ":if(c[0]!==0)break;return new Dp(r0,new D0(c.slice(1)),a,l,null,o,s,null,null)}bn(!1,"invalid extended key prefix","extendedKey","[ REDACTED ]")}static createRandom(n,r,s){var o;n==null&&(n=""),r==null&&(r=eV),s==null&&(s=T3.wordlist());const a=WS.fromEntropy(Vg(16),n,s);return wr(o=Dp,$w,wj).call(o,a.computeSeed(),a).derivePath(r)}static fromMnemonic(n,r){var s;return r||(r=eV),wr(s=Dp,$w,wj).call(s,n.computeSeed(),n).derivePath(r)}static fromPhrase(n,r,s,a){var l;r==null&&(r=""),s==null&&(s=eV),a==null&&(a=T3.wordlist());const o=WS.fromPhrase(n,r,a);return wr(l=Dp,$w,wj).call(l,o.computeSeed(),o).derivePath(s)}static fromSeed(n){var r;return wr(r=Dp,$w,wj).call(r,n,null)}};fk=new WeakSet,eee=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},$w=new WeakSet,wj=function(n,r){bn(TB(n),"invalid seed","seed","[REDACTED]");const s=ps(n,"seed");bn(s.length>=16&&s.length<=64,"invalid seed","seed","[REDACTED]");const a=ps(TA("sha512",p6t,s)),o=new D0(Gr(a.slice(0,32)));return new Dp(r0,o,"0x00000000",Gr(a.slice(32)),"m",0,0,r,null)},On(Dp,$w);let qj=Dp;class yE extends qJ{constructor(n,r,s,a,o,l,c,u,d){super(r,d);Dn(this,"publicKey");Dn(this,"fingerprint");Dn(this,"parentFingerprint");Dn(this,"chainCode");Dn(this,"path");Dn(this,"index");Dn(this,"depth");c5(n,r0,"HDNodeVoidWallet"),Bs(this,{publicKey:s});const f=bo(IA(op(s)),0,4);Bs(this,{publicKey:s,fingerprint:f,parentFingerprint:a,chainCode:o,path:l,index:c,depth:u})}connect(n){return new yE(r0,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,n)}get extendedKey(){return Rr(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),JJ(La(["0x0488B21E",TM(this.depth,1),this.parentFingerprint,TM(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return this.path!=null}deriveChild(n){const r=Bi(n,"index");bn(r<=4294967295,"invalid index","index",r);let s=this.path;s&&(s+="/"+(r&2147483647),r&a4&&(s+="'"));const{IR:a,IL:o}=DIe(r,this.chainCode,this.publicKey,null),l=D0.addPoints(o,this.publicKey,!0),c=Uk(l);return new yE(r0,c,l,this.fingerprint,Gr(a),s,r,this.depth+1,this.provider)}derivePath(n){return BIe(this,n)}}function cxe(e){try{if(JSON.parse(e).encseed)return!0}catch{}return!1}function uxe(e,t){const n=JSON.parse(e),r=Wk(t),s=ra(bl(n,"ethaddr:string!")),a=IIe(bl(n,"encseed:string!"));bn(a&&a.length%16===0,"invalid encseed","json",e);const o=ps(a2(r,r,2e3,32,"sha256")).slice(0,16),l=a.slice(0,16),c=a.slice(16),u=new jae(o,l),d=u6t(ps(u.decrypt(c)));let f="";for(let x=0;x<d.length;x++)f+=String.fromCharCode(d[x]);return{address:s,privateKey:l1(f)}}function dxe(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}var hk,O0,tee;let Eae=(O0=class extends EM{constructor(t,n){typeof t=="string"&&!t.startsWith("0x")&&(t="0x"+t);let r=typeof t=="string"?new D0(t):t;super(r,n)}connect(t){return new O0(this.signingKey,t)}async encrypt(t,n){const r={address:this.address,privateKey:this.privateKey};return await LIe(r,t,{progressCallback:n})}encryptSync(t){const n={address:this.address,privateKey:this.privateKey};return RIe(n,t)}static async fromEncryptedJson(t,n,r){var a;let s=null;return oxe(t)?s=await h6t(t,n,r):cxe(t)&&(r&&(r(0),await dxe(0)),s=uxe(t,n),r&&(r(1),await dxe(0))),wr(a=O0,hk,tee).call(a,s)}static fromEncryptedJsonSync(t,n){var s;let r=null;return oxe(t)?r=f6t(t,n):cxe(t)?r=uxe(t,n):bn(!1,"invalid JSON wallet","json","[ REDACTED ]"),wr(s=O0,hk,tee).call(s,r)}static createRandom(t){const n=qj.createRandom();return t?n.connect(t):n}static fromPhrase(t,n){const r=qj.fromPhrase(t);return n?r.connect(n):r}},hk=new WeakSet,tee=function(t){if(bn(t,"invalid JSON wallet","json","[ REDACTED ]"),"mnemonic"in t&&t.mnemonic&&t.mnemonic.locale==="en"){const r=WS.fromEntropy(t.mnemonic.entropy),s=qj.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 O0(t.privateKey);return bn(n.address===t.address,"address/privateKey mismatch","json","[ REDACTED ]"),n},On(O0,hk),O0);async function fxe(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=ru.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 IM=({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 $Ie={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},hxe=Ae.createContext&&Ae.createContext($Ie),g6t=["attr","size","title"];function b6t(e,t){if(e==null)return{};var n=y6t(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 y6t(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 PM(){return PM=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},PM.apply(this,arguments)}function pxe(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 FM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pxe(Object(n),!0).forEach(function(r){v6t(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pxe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function v6t(e,t,n){return t=w6t(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w6t(e){var t=C6t(e,"string");return typeof t=="symbol"?t:t+""}function C6t(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 UIe(e){return e&&e.map((t,n)=>Ae.createElement(t.tag,FM({key:n},t.attr),UIe(t.child)))}function _l(e){return t=>Ae.createElement(S6t,PM({attr:FM({},e.attr)},t),UIe(e.child))}function S6t(e){var t=n=>{var{attr:r,size:s,title:a}=e,o=b6t(e,g6t),l=s||n.size||"1em",c;return n.className&&(c=n.className),e.className&&(c=(c?c+" ":"")+e.className),Ae.createElement("svg",PM({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,o,{className:c,style:FM(FM({color:e.color||n.color},n.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),a&&Ae.createElement("title",null,a),e.children)};return hxe!==void 0?Ae.createElement(hxe.Consumer,null,n=>t(n)):t($Ie)}function N6t(e){return _l({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 qk(e){return _l({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 A6t(e){return _l({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 _ae(e){return _l({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 ca(e){return _l({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 ua(e){return _l({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 j6t(e){return _l({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 E6t(e){return _l({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 _6t(e){return _l({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 k6t(e){return _l({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 T6t(e){return _l({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 I3(e){return _l({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 P3(e){return _l({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 F3(e){return _l({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 zIe(e){return _l({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 I6t=({handleListRequest:e,isLighterInfoValue:t,handleLighterWalletInfo:n})=>{var he;const r="https://dextrabothypev2.nftinit.io",{setSignModalOpen:s}=m.useContext(Qr),[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,P]=m.useState(""),[I,R]=m.useState(""),[O,U]=m.useState(!0),[L,z]=m.useState({}),X=Q=>/^\d*$/.test(Q),ne=Q=>{["e","E","+","-"].includes(Q.key)&&Q.preventDefault()},J=a.trim()!==""&&l.trim()!==""&&u.trim()!==""&&f.trim()!=="",K=async()=>{if(!J){P("Please fill in all fields.");return}try{C(!0),P(""),R("");const Q=window.localStorage.getItem("hyperToken"),ie=window.localStorage.getItem("hyperAddress");if(!Q||!ie){s(!0),C(!1);return}const oe={address:ie.toLowerCase(),token:Q,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?(tn.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(""),P(""),R(V==null?void 0:V.message)):P((V==null?void 0:V.error_message)||"An error has occurred.")}catch(Q){P(Q.message||"An error has occurred.")}finally{C(!1)}},re=async(Q,ie)=>{console.log("id :>> ",Q);const oe=`${Q}_${ie}`;try{z(Ne=>({...Ne,[oe]:!0})),P(""),R("");const G=window.localStorage.getItem("hyperToken"),V=window.localStorage.getItem("hyperAddress");if(!G||!V){s(!0),z(Ne=>({...Ne,[oe]:!1}));return}const te={address:V.toLowerCase(),token:G,wallet_id:Number(Q)},fe=await(await fetch(`${r}/api/wallet/delete-lighter`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(te)})).json();fe!=null&&fe.success?(tn.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),P(""),R(fe==null?void 0:fe.message)):P((fe==null?void 0:fe.error_message)||"An error has occurred.")}catch(G){P(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(Ba,{})}),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:Q=>o(Q.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:Q=>c(Q.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:Q=>d(Q.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(Q=>!Q),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(ca,{size:14}):i.jsx(ua,{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:Q=>{const ie=Q.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&&K()},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(!O),children:[i.jsx("span",{className:"text-white text-sm font-medium font-['Inter'] leading-normal",children:"Lighter Wallets"}),i.jsx(nse,{className:`w-3.5 h-3.5 transition-transform text-white ${O?"":"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:O&&((he=[...t].sort((Q,ie)=>(ie==null?void 0:ie.wallet_created_data)-(Q==null?void 0:Q.wallet_created_data)))==null?void 0:he.map((Q,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=Q==null?void 0:Q.wallet_name)==null?void 0:oe.length)>18?((G=Q==null?void 0:Q.wallet_name)==null?void 0:G.slice(0,18))+"...":Q==null?void 0:Q.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:(Q==null?void 0:Q.wallet_address.slice(0,6))+"..."+(Q==null?void 0:Q.wallet_address.slice(-4))}),i.jsx("img",{onClick:V=>{V.stopPropagation(),navigator.clipboard.writeText(Q==null?void 0:Q.wallet_address),tn.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:Co,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:iu(Q==null?void 0:Q.wallet_created_data)}),L[`${Q==null?void 0:Q.wallet_id}_${Q==null?void 0:Q.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(Q==null?void 0:Q.wallet_id,Q==null?void 0:Q.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:ec,alt:"Dextrabot"}),i.jsx("p",{className:"text-[#ff7171] text-[13px] font-normal font-['Inter'] leading-4",children:N})]}),I&&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:Jie,alt:"Dextrabot",className:"w-4 h-4"}),i.jsx("p",{className:"text-[#67FFBD] text-[13px] font-normal font-['Inter'] leading-4",children:I})]})]})},mxe=({handleListRequest:e,isExtendedInfoValue:t,handleExtendedWalletInfo:n})=>{var me;const r="https://dextrabothypev2.nftinit.io",{setSignModalOpen:s}=m.useContext(Qr),[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,P]=m.useState(!1),[I,R]=m.useState(!1),[O,U]=m.useState(!1),[L,z]=m.useState(!1),[X,ne]=m.useState(!1),[J,K]=m.useState(""),[re,he]=m.useState(""),[Q,ie]=m.useState(!0),[oe,G]=m.useState({}),V=we=>/^\d*$/.test(we),te=we=>{["e","E","+","-"].includes(we.key)&&we.preventDefault()},ae=a.trim()!==""&&l.trim()!==""&&u.trim()!==""&&f.trim()!==""&&g.trim()!==""&&w.trim()!=="",fe=async()=>{if(!ae){K("Please fill in all fields.");return}try{ne(!0),K(""),he("");const we=window.localStorage.getItem("hyperToken"),xe=window.localStorage.getItem("hyperAddress");if(!we||!xe){s(!0),ne(!1);return}const ye={address:xe.toLowerCase(),token:we,wallet_name:a,main_wallet:l,api_key:f,stark_public:u,stark_private:g,vault_number:w},Pe=await(await fetch(`${r}/api/wallet/generate-extended`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(ye)})).json();Pe!=null&&Pe.success?(tn.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(xe),o(""),c(""),d(""),x(""),v(""),C(""),K(""),he(Pe==null?void 0:Pe.message)):K((Pe==null?void 0:Pe.error_message)||"An error has occurred.")}catch(we){K(we.message||"An error has occurred.")}finally{ne(!1)}},Ne=async(we,xe)=>{console.log("id :>> ",we);const ye=`${we}_${xe}`;try{G(ut=>({...ut,[ye]:!0})),K(""),he("");const je=window.localStorage.getItem("hyperToken"),Pe=window.localStorage.getItem("hyperAddress");if(!je||!Pe){s(!0),G(ut=>({...ut,[ye]:!1}));return}const Re={address:Pe.toLowerCase(),token:je,wallet_id:Number(we)},Ke=await(await fetch(`${r}/api/wallet/delete-extended`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(Re)})).json();Ke!=null&&Ke.success?(e(),tn.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(Pe),K(""),he(Ke==null?void 0:Ke.message)):K((Ke==null?void 0:Ke.error_message)||"An error has occurred.")}catch(je){K(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(Ba,{})}),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:we=>o(we.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:we=>c(we.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:we=>x(we.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:()=>P(we=>!we),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(ca,{size:14}):i.jsx(ua,{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:we=>d(we.target.value),autoComplete:"off",placeholder:"STARK_KEY_PUBLIC",type:I?"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(we=>!we),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:I?i.jsx(ca,{size:14}):i.jsx(ua,{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:we=>v(we.target.value),autoComplete:"off",placeholder:"STARK_KEY_PRIVATE",type:O?"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(we=>!we),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:O?i.jsx(ca,{size:14}):i.jsx(ua,{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:we=>{const xe=we.target.value.trim();if(xe==="")return C("");V(xe)&&C(xe)},onKeyDown:te,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(we=>!we),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(ca,{size:14}):i.jsx(ua,{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(!Q),children:[i.jsx("span",{className:"text-white text-sm font-medium font-['Inter'] leading-normal",children:"Extended Wallets"}),i.jsx(nse,{className:`w-3.5 h-3.5 transition-transform text-white ${Q?"":"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:Q&&((me=[...t].sort((we,xe)=>(xe==null?void 0:xe.wallet_created_data)-(we==null?void 0:we.wallet_created_data)))==null?void 0:me.map((we,xe)=>{var ye,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:((ye=we==null?void 0:we.wallet_name)==null?void 0:ye.length)>18?((je=we==null?void 0:we.wallet_name)==null?void 0:je.slice(0,18))+"...":we==null?void 0:we.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:(we==null?void 0:we.wallet_address.slice(0,6))+"..."+(we==null?void 0:we.wallet_address.slice(-4))}),i.jsx("img",{onClick:Pe=>{Pe.stopPropagation(),navigator.clipboard.writeText(we==null?void 0:we.wallet_address),tn.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:Co,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:iu(we==null?void 0:we.wallet_created_data)}),oe[`${we==null?void 0:we.wallet_id}_${we==null?void 0:we.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:()=>{Ne(we==null?void 0:we.wallet_id,we==null?void 0:we.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"})})]})},xe)}))})]}):""}),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:ec,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:Jie,alt:"Dextrabot",className:"w-4 h-4"}),i.jsx("p",{className:"text-[#67FFBD] text-[13px] font-normal font-['Inter'] leading-4",children:re})]})]})},P6t=({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"})}),F6t=({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:P,isPacificaInfoValue:I,handlePacificaWalletInfo:R,isSelectAPIMenu:O,setIsSelectAPIMenu:U})=>{var me,we;const{setSignModalOpen:L}=m.useContext(Qr),{address:z}=ts(),X=oc(),[ne,J]=m.useState(!0),[K,re]=m.useState(!1),[he,Q]=m.useState(!1);m.useEffect(()=>{const xe=X.hash,ye=localStorage.getItem("isWalletSelectMenu");if(xe){const je=xe.split("#").filter(Boolean);je[2]&&U(je[2].toUpperCase()),ye==="LIGHTER"?U("LIGHTER"):ye==="EXTENDED"?U("EXTENDED"):ye==="PACIFICA"?U("PACIFICA"):ye==="HYPER"&&U("HYPERLIQUID")}},[X.hash]),m.useEffect(()=>{(async()=>{var Pe;const ye=window.localStorage.getItem("hyperToken"),je=(Pe=z||window.localStorage.getItem("hyperAddress"))==null?void 0:Pe.toLowerCase();if(!ye){L(!0);return}if(je&&ye)try{const Re=await _i(je,ye);re(!!(Re!=null&&Re.is_generated))}catch{re(!1)}finally{Q(!0)}})()},[z,L]);const ie=xe=>{var Xe,Ke,ut,et,tt,Le;const ye=(xe==null?void 0:xe.code)||((Xe=xe==null?void 0:xe.error)==null?void 0:Xe.code)||((ut=(Ke=xe==null?void 0:xe.info)==null?void 0:Ke.error)==null?void 0:ut.code)||((et=xe==null?void 0:xe.cause)==null?void 0:et.code)||"",je=typeof ye=="string"?ye.toUpperCase():String(ye).toUpperCase(),Pe=String((xe==null?void 0:xe.message)||"").toUpperCase();if(je==="ACTION_REJECTED"||je==="4001"||Pe.includes("USER REJECT")||Pe.includes("USER DENIED")){t("Request cancelled by user.");return}if([typeof xe=="string"?xe:"",xe==null?void 0:xe.message,xe==null?void 0:xe.code,xe==null?void 0:xe.name,xe==null?void 0:xe.shortMessage,(tt=xe==null?void 0:xe.cause)==null?void 0:tt.message,(Le=xe==null?void 0:xe.cause)==null?void 0:Le.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 xe=="string"?xe:(xe==null?void 0:xe.message)||"Something went wrong.")},oe=()=>{if(!window.ethereum)throw new Error("MetaMask not found.");return window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0xa4b1"}]})},G=async xe=>{var Pe,Re;if(K)return;const ye=window.localStorage.getItem("hyperToken");if(!ye||!z){L(!0);return}r(!0),t("");const je=window.localStorage.getItem("hyperAddress");try{await window.ethereum.request({method:"eth_chainId"})!=="0xa4b1"&&await oe();const ut=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:z?z.toLowerCase():je,token:ye})})).json();if(!(ut!=null&&ut.success)){ie((ut==null?void 0:ut.error_message)||"Agent could not be produced.");return}if(!window.ethereum)throw new Error("MetaMask not found.");const tt=await new jM(window.ethereum).getSigner(),Le=await fxe(xe,ut,tt),ht=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:Le.signature,action:Le.action,nonce:Le.nonce,address:z?z.toLowerCase():je,token:ye})})).json();if(ht!=null&&ht.success){if(((Pe=ht==null?void 0:ht.result)==null?void 0:Pe.status)==="err"){ie(((Re=ht==null?void 0:ht.result)==null?void 0:Re.response)||"Approval failed."),r(!1);return}s(),a(1),d(z||je)}else ie((ht==null?void 0:ht.error_message)||"Approval failed.")}catch(Xe){ie(Xe)}finally{r(!1)}},V=async xe=>{var Pe,Re;if(K)return;const ye=window.localStorage.getItem("hyperToken");if(!ye||!z){L(!0);return}r(!0),t("");const je=window.localStorage.getItem("hyperAddress");try{await window.ethereum.request({method:"eth_chainId"})!=="0xa4b1"&&await oe();const ut=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:z?z.toLowerCase():je,token:ye})})).json();if(!(ut!=null&&ut.success))throw new Error((ut==null?void 0:ut.error_message)||"Generate builder fee failed");if(!window.ethereum)throw new Error("MetaMask not found.");const tt=await new jM(window.ethereum).getSigner(),Le=await fxe(xe,ut,tt),ht=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:Le.signature,action:Le.action,nonce:Le.nonce,address:z?z.toLowerCase():je,token:ye})})).json();if(ht!=null&&ht.success){if(((Pe=ht==null?void 0:ht.result)==null?void 0:Pe.status)==="err"){ie(((Re=ht==null?void 0:ht.result)==null?void 0:Re.response)||"Approve builder fee failed"),r(!1);return}G(1),v(z||je)}else ie((ht==null?void 0:ht.error_message)||"Approval failed."),r(!1)}catch(Xe){ie(Xe),r(!1)}},te=m.useMemo(()=>u?u.some(xe=>{var ye;return((ye=(xe==null?void 0:xe.name)??"")==null?void 0:ye.trim().toLowerCase())==="dextrabot"}):!1,[u]),ae=Number(((me=o==null?void 0:o.marginSummary)==null?void 0:me.accountValue)??0),fe=`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.`,Ne=n||c||l||f||!he&&z;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(tV,{title:"HYPERLIQUID",set_click:()=>U("HYPERLIQUID"),isSelectAPIMenu:O}),i.jsx(tV,{title:"LIGHTER",set_click:()=>U("LIGHTER"),isSelectAPIMenu:O}),i.jsx(tV,{title:"EXTENDED",set_click:()=>U("EXTENDED"),isSelectAPIMenu:O})]}),O==="EXTENDED"&&i.jsxs("button",{onClick:()=>window.open("https://app.extended.exchange/join/DEXTRABOT","_blank"),className:"group px-1.5 py-1 rounded-full border border-[#3ec78c] text-[#3ec78c] text-[11px] font-bold flex items-center gap-1 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(P6t,{className:"w-4 h-4"})]})]})}),Ne?i.jsx("div",{role:"status",className:"flex justify-center items-center w-full my-[30px]",children:i.jsx(Ba,{})}):O==="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:[z&&i.jsx("img",{src:Wme,alt:"agent icon"}),z||"--"]}),!K&&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(jS,{className:"w-4 h-4 text-[#929292] hover:text-white"})}),i.jsx("span",{className:`${ae>=5?"text-[#1DE674]":"text-[#929292]"} `,children:ae===0||ae?"$"+Er(ae):"--"})]})]}),(ae===0&&!te||ae<5&&!te)&&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?te?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:Wme,alt:"agent icon"}),"You’re ready to trade!"]}):"":ae>0?ae>=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(IM,{className:"text-[#FFB14B] w-[18px] h-[18px] min-w-[18px] min-h-[18px]"}),"Your Hyperliquid perps balance is $",Er(ae)," 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(IM,{className:"text-[#FFB14B] w-[18px] h-[18px] min-w-[18px] min-h-[18px]"}),"Please fund your Hyperliquid Perpetual balance to start trading"]})})]})]}),K?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:ec,alt:"Dextrabot"}),i.jsx("p",{className:"whitespace-pre-line text-[#ff7171] text-[13px] font-normal font-['Inter'] leading-4",children:fe})]}):i.jsxs(i.Fragment,{children:[x!=null&&Number(x)>0?te?"":i.jsx("div",{onClick:()=>{G(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:xe=>{xe.preventDefault(),ae>=5&&!l&&V(2)},className:`${ae>=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:()=>J(!ne),children:[i.jsx("span",{className:"text-white text-sm font-medium font-['Inter'] leading-normal",children:"API Wallets"}),i.jsx(nse,{className:`w-3.5 h-3.5 transition-transform text-white ${ne?"":"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:ne&&((we=[...u].sort((xe,ye)=>(ye==null?void 0:ye.validUntil)-(xe==null?void 0:xe.validUntil)))==null?void 0:we.map((xe,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:`${(xe==null?void 0:xe.name)==="dextrabot"?"text-white":"text-[#929292]"}  text-[11px] font-normal min-w-[110px]`,children:xe==null?void 0:xe.name})}),i.jsxs("span",{className:`${(xe==null?void 0:xe.name)==="dextrabot"?"text-white":"text-[#929292]"} text-[11px] font-normal font-['Inter'] leading-4 min-w-max`,children:["Valid until:"," ",Qlt(xe==null?void 0:xe.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:ec,alt:"Dextrabot"}),i.jsx("p",{className:"text-[#ff7171] text-[13px] font-normal font-['Inter'] leading-4",children:e})]})]})]}):O==="LIGHTER"?i.jsx("div",{className:"flex items-center justify-start w-full",children:i.jsx(I6t,{handleListRequest:s,isLighterInfoValue:w,handleLighterWalletInfo:C})}):O==="EXTENDED"?i.jsx("div",{className:"flex items-center justify-start w-full",children:i.jsx(mxe,{handleListRequest:s,isExtendedInfoValue:N,handleExtendedWalletInfo:P})}):i.jsx("div",{className:"flex items-center justify-start w-full",children:i.jsx(mxe,{handleListRequest:s,isExtendedInfoValue:N,handleExtendedWalletInfo:P})})]})},tV=({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 f5({open:e,setOpen:t,handleListRequest:n,handlePageChange:r,source:s}){const{isConnected:a,address:o}=ts(),{hyperToken:l}=m.useContext(Qr);oc();const[c,u]=m.useState("HYPERLIQUID");m.useEffect(()=>{e&&s&&u(s)},[e,s]);const[d,f]=m.useState([]),[x,g]=m.useState(""),[v,w]=m.useState(!1),[C,N]=m.useState(""),[P,I]=m.useState(!1),[R,O]=m.useState(!1),[U,L]=m.useState(!1),[z,X]=m.useState("account"),[ne,J]=m.useState(!1),K=m.useRef(null),[re,he]=m.useState([]),[Q,ie]=m.useState(""),[oe,G]=m.useState(""),[V,te]=m.useState(!1),[ae,fe]=m.useState(""),[Ne,me]=m.useState(""),[we,xe]=m.useState(""),[ye,je]=m.useState(!1),[Pe,Re]=m.useState(!1),[Xe,Ke]=m.useState(null),[ut,et]=m.useState(!1),[tt,Le]=m.useState([]),[$e,ht]=m.useState([]),[pt,Kt]=m.useState([]),[wt,nn]=m.useState([]),[cn,zn]=m.useState(!1),[Xt,on]=m.useState(null),Zt=[{id:"account",name:"Add API Wallet",href:"#account",icon:xxe},{id:"generate",name:"Generate HL Wallet",href:"#generate",icon:xxe}];function Ye(...De){return De.filter(Boolean).join(" ")}const Ze=async(De,_t)=>{try{_t===1&&Re(!0);const ze=await fetch("https://api-ui.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"clearinghouseState",user:De})});if(!ze.ok)throw new Error("Network response was not ok");const nt=await ze.json();nt&&(Ke(nt),Re(!1))}catch(ze){console.error("Error fetching user balance info:",ze),Re(!1)}},Ft=async De=>{try{et(!0);const _t=await fetch("https://api-ui.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"extraAgents",user:De})});if(!_t.ok)throw new Error("Network response was not ok");const ze=await _t.json();ze&&(Le(ze),et(!1))}catch(_t){console.error("Error fetching user balance info:",_t),et(!1)}},dn=async De=>{const _t=window.localStorage.getItem("hyperToken"),ze=window.localStorage.getItem("hyperAddress");if(!(!_t||!De))try{const nt=await fetch("https://dextrabothypev2.nftinit.io/api/wallet/list-lighter",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:De?De.toLowerCase():ze,token:_t})});if(!nt.ok)throw new Error("Network response was not ok");const mt=await nt.json();mt.success&&ht((mt==null?void 0:mt.data)||[])}catch(nt){console.error("Error fetching user balance info:",nt)}},Yt=async De=>{const _t=window.localStorage.getItem("hyperToken"),ze=window.localStorage.getItem("hyperAddress");if(!(!_t||!De))try{const nt=await fetch("https://dextrabothypev2.nftinit.io/api/wallet/list-extended",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:De?De.toLowerCase():ze,token:_t})});if(!nt.ok)throw new Error("Network response was not ok");const mt=await nt.json();mt.success&&Kt((mt==null?void 0:mt.data)||[])}catch(nt){console.error("Error fetching user balance info:",nt)}},Bt=async De=>{try{zn(!0);const _t=await fetch("https://api-ui.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"maxBuilderFee",user:De,builder:"0x49ae63056b3a0be0b166813ee687309ab653c07c"})});if(!_t.ok)throw new Error("Network response was not ok");const ze=await _t.text(),nt=parseInt(ze,10);on(nt),zn(!1)}catch(_t){console.error("Error fetching user balance info:",_t),zn(!1)}};m.useEffect(()=>{window.localStorage.getItem("hyperToken")&&o&&e&&(Ze(o,1),Ft(o),dn(o),Yt(o),Bt(o))},[e]),m.useEffect(()=>{var ze;return!e||z!="account"||(tt==null?void 0:tt.some(nt=>((nt==null?void 0:nt.name)??"").trim().toLowerCase()==="dextrabot"))?void 0:(Number(((ze=Xe==null?void 0:Xe.marginSummary)==null?void 0:ze.accountValue)??0)<5?K.current||(K.current=setInterval(()=>{Ze(o,2)},1e4)):K.current&&(clearInterval(K.current),K.current=null),()=>{K.current&&(clearInterval(K.current),K.current=null)})},[Xe,e,z,o]),m.useEffect(()=>{const De=window.localStorage.getItem("hyperToken");(!o||!a||!De)&&(t(!1),g(""),N(""),xe(""))},[o,a,l]);const ot=()=>{window.localStorage.getItem("hyperToken")&&o&&e?(Ze(o,1),Ft(o),Bt(o)):tn.error("Please connect wallet")};return m.useEffect(()=>{if(e&&!ne)if((tt==null?void 0:tt.length)>0){const De=tt==null?void 0:tt.some(ze=>((ze==null?void 0:ze.name)??"").trim().toLowerCase()==="dextrabot"),_t=localStorage.getItem("isWalletSelectMenu");X(_t==="LIGHTER"||_t==="EXTENDED"||_t==="PACIFICA"?"account":_t==="HYPER"?De?"generate":"account":De&&($e==null?void 0:$e.length)>0&&(pt==null?void 0:pt.length)>0&&(wt==null?void 0:wt.length)>0?"generate":"account"),J(!0)}else X("account"),J(!0)},[tt,ne]),i.jsxs(i.Fragment,{children:[i.jsx($yt,{open:U,setOpen:L,setGenModalOpen:t,setGenWalletSuccess:O,setGenWalletData:f,setShowPrivateKey:I}),i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-[9999999998] font-manrope",children:[i.jsx(ja,{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(ga,{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:`${R&&Object.keys(d).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:De=>{De.preventDefault(),v&&z==="generate"||z==="account"&&ye?tn.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"}}):z==="generate"&&R&&Object.keys(d).length>0?(L(!0),I(!1)):(t(!1),g(""),N(""),xe(""),Le([]),on(null),J(!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:$a})})}),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:z,onChange:De=>{const _t=De.target.value;if(!v){if(z==="generate"&&_t!=="generate"&&R&&Object.keys(d).length>0){I(!1),L(!0);return}if(z==="account"&&_t!=="account"&&ye){tn.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}X(_t),g("")}},"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:Zt==null?void 0:Zt.map(De=>i.jsx("option",{value:De==null?void 0:De.id,children:De==null?void 0:De.name},De==null?void 0:De.id))}),i.jsx(A9,{"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:Zt==null?void 0:Zt.map(De=>{const _t=(De==null?void 0:De.id)===z;return i.jsxs("a",{href:De==null?void 0:De.href,onClick:ze=>{ze.preventDefault();const nt=De==null?void 0:De.id;if(v)return;if(z==="generate"&&nt!=="generate"&&R&&Object.keys(d).length>0){I(!1),L(!0);return}if(z==="account"&&nt!=="account"&&ye){tn.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}X(nt);const mt=document.querySelector(De.href);mt&&mt.scrollIntoView({behavior:"smooth",block:"start"}),g("")},"aria-current":_t?"page":void 0,className:Ye(_t?"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(De.icon,{"aria-hidden":"true",className:Ye(_t?"text-white group-hover:text-white":"text-[#878787] group-hover:text-white","-ml-0.5 mr-2 size-[18px]")}),i.jsx("span",{children:De==null?void 0:De.name})]},De==null?void 0:De.id)})})})]}),z==="generate"?i.jsx(zyt,{loading:v,genWalletSuccess:R,genWalletData:d,showPrivateKey:P,genWalletName:x,setGenWalletName:g,errorMessage:C,setShowPrivateKey:I,setErrorMessage:N,setLoading:w,setGenWalletData:f,setGenWalletSuccess:O,handleListRequest:n,handlePageChange:r}):z==="agent"?i.jsx(Hyt,{agentWalletData:re,setAgentWalletData:he,agentWalletName:Q,setAgentWalletName:ie,errorAgentMessage:oe,setErrorAgentMessage:G,loadingAgent:V,setLoadingAgent:te,handleListRequest:n,handlePageChange:r,agentWalletAddress:ae,setAgentWalletAddress:fe,agentWalletPkey:Ne,setAgentWalletPkey:me}):z==="account"?i.jsx(F6t,{errorConnectMessage:we,setErrorConnectMessage:xe,loadingConnect:ye,setLoadingConnect:je,handleListRequest:n,handlePageChange:r,isBalanceValue:Xe,isBalanceLoading:Pe,isAgentInfoLoading:ut,isAgentInfoValue:tt,handleAgentWalletInfo:Ft,isBuilderFeeLoading:cn,isBuilderFeeValue:Xt,refreshAgent:ot,handleBuilderFeeInfo:Bt,isLighterInfoValue:$e,handleLighterWalletInfo:dn,isExtendedInfoValue:pt,handleExtendedWalletInfo:Yt,isPacificaInfoValue:wt,handlePacificaWalletInfo:Yt,isSelectAPIMenu:c,setIsSelectAPIMenu:u}):""]})})})})})]})]})}var sf="top",lp="bottom",cp="right",af="left",kae="auto",Gk=[sf,lp,cp,af],GS="start",vE="end",O6t="clippingParents",HIe="viewport",A7="popper",M6t="reference",gxe=Gk.reduce(function(e,t){return e.concat([t+"-"+GS,t+"-"+vE])},[]),VIe=[].concat(Gk,[kae]).reduce(function(e,t){return e.concat([t,t+"-"+GS,t+"-"+vE])},[]),R6t="beforeRead",L6t="read",D6t="afterRead",B6t="beforeMain",$6t="main",U6t="afterMain",z6t="beforeWrite",H6t="write",V6t="afterWrite",W6t=[R6t,L6t,D6t,B6t,$6t,U6t,z6t,H6t,V6t];function tx(e){return e?(e.nodeName||"").toLowerCase():null}function Yf(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function O3(e){var t=Yf(e).Element;return e instanceof t||e instanceof Element}function ep(e){var t=Yf(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Tae(e){if(typeof ShadowRoot>"u")return!1;var t=Yf(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function q6t(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];!ep(a)||!tx(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 G6t(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},{});!ep(s)||!tx(s)||(Object.assign(s.style,l),Object.keys(a).forEach(function(c){s.removeAttribute(c)}))})}}const WIe={name:"applyStyles",enabled:!0,phase:"write",fn:q6t,effect:G6t,requires:["computeStyles"]};function B0(e){return e.split("-")[0]}var Qw=Math.max,OM=Math.min,KS=Math.round;function nee(){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 qIe(){return!/^((?!chrome|android).)*safari/i.test(nee())}function YS(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),s=1,a=1;t&&ep(e)&&(s=e.offsetWidth>0&&KS(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&KS(r.height)/e.offsetHeight||1);var o=O3(e)?Yf(e):window,l=o.visualViewport,c=!qIe()&&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 Iae(e){var t=YS(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 GIe(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Tae(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function u1(e){return Yf(e).getComputedStyle(e)}function K6t(e){return["table","td","th"].indexOf(tx(e))>=0}function l2(e){return((O3(e)?e.ownerDocument:e.document)||window.document).documentElement}function GB(e){return tx(e)==="html"?e:e.assignedSlot||e.parentNode||(Tae(e)?e.host:null)||l2(e)}function bxe(e){return!ep(e)||u1(e).position==="fixed"?null:e.offsetParent}function Y6t(e){var t=/firefox/i.test(nee()),n=/Trident/i.test(nee());if(n&&ep(e)){var r=u1(e);if(r.position==="fixed")return null}var s=GB(e);for(Tae(s)&&(s=s.host);ep(s)&&["html","body"].indexOf(tx(s))<0;){var a=u1(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 Kk(e){for(var t=Yf(e),n=bxe(e);n&&K6t(n)&&u1(n).position==="static";)n=bxe(n);return n&&(tx(n)==="html"||tx(n)==="body"&&u1(n).position==="static")?t:n||Y6t(e)||t}function Pae(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Gj(e,t,n){return Qw(e,OM(t,n))}function X6t(e,t,n){var r=Gj(e,t,n);return r>n?n:r}function KIe(){return{top:0,right:0,bottom:0,left:0}}function YIe(e){return Object.assign({},KIe(),e)}function XIe(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var Q6t=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,YIe(typeof t!="number"?t:XIe(t,Gk))};function Z6t(e){var t,n=e.state,r=e.name,s=e.options,a=n.elements.arrow,o=n.modifiersData.popperOffsets,l=B0(n.placement),c=Pae(l),u=[af,cp].indexOf(l)>=0,d=u?"height":"width";if(!(!a||!o)){var f=Q6t(s.padding,n),x=Iae(a),g=c==="y"?sf:af,v=c==="y"?lp:cp,w=n.rects.reference[d]+n.rects.reference[c]-o[c]-n.rects.popper[d],C=o[c]-n.rects.reference[c],N=Kk(a),P=N?c==="y"?N.clientHeight||0:N.clientWidth||0:0,I=w/2-C/2,R=f[g],O=P-x[d]-f[v],U=P/2-x[d]/2+I,L=Gj(R,U,O),z=c;n.modifiersData[r]=(t={},t[z]=L,t.centerOffset=L-U,t)}}function J6t(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)||GIe(t.elements.popper,s)&&(t.elements.arrow=s))}const eCt={name:"arrow",enabled:!0,phase:"main",fn:Z6t,effect:J6t,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function XS(e){return e.split("-")[1]}var tCt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function nCt(e,t){var n=e.x,r=e.y,s=t.devicePixelRatio||1;return{x:KS(n*s)/s||0,y:KS(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"),P=o.hasOwnProperty("y"),I=af,R=sf,O=window;if(u){var U=Kk(n),L="clientHeight",z="clientWidth";if(U===Yf(n)&&(U=l2(n),u1(U).position!=="static"&&l==="absolute"&&(L="scrollHeight",z="scrollWidth")),U=U,s===sf||(s===af||s===cp)&&a===vE){R=lp;var X=f&&U===O&&O.visualViewport?O.visualViewport.height:U[L];w-=X-r.height,w*=c?1:-1}if(s===af||(s===sf||s===lp)&&a===vE){I=cp;var ne=f&&U===O&&O.visualViewport?O.visualViewport.width:U[z];g-=ne-r.width,g*=c?1:-1}}var J=Object.assign({position:l},u&&tCt),K=d===!0?nCt({x:g,y:w},Yf(n)):{x:g,y:w};if(g=K.x,w=K.y,c){var re;return Object.assign({},J,(re={},re[R]=P?"0":"",re[I]=N?"0":"",re.transform=(O.devicePixelRatio||1)<=1?"translate("+g+"px, "+w+"px)":"translate3d("+g+"px, "+w+"px, 0)",re))}return Object.assign({},J,(t={},t[R]=P?w+"px":"",t[I]=N?g+"px":"",t.transform="",t))}function rCt(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:B0(t.placement),variation:XS(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 sCt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:rCt,data:{}};var aP={passive:!0};function iCt(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=Yf(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&u.forEach(function(d){d.addEventListener("scroll",n.update,aP)}),l&&c.addEventListener("resize",n.update,aP),function(){a&&u.forEach(function(d){d.removeEventListener("scroll",n.update,aP)}),l&&c.removeEventListener("resize",n.update,aP)}}const aCt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:iCt,data:{}};var oCt={left:"right",right:"left",bottom:"top",top:"bottom"};function oO(e){return e.replace(/left|right|bottom|top/g,function(t){return oCt[t]})}var lCt={start:"end",end:"start"};function vxe(e){return e.replace(/start|end/g,function(t){return lCt[t]})}function Fae(e){var t=Yf(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Oae(e){return YS(l2(e)).left+Fae(e).scrollLeft}function cCt(e,t){var n=Yf(e),r=l2(e),s=n.visualViewport,a=r.clientWidth,o=r.clientHeight,l=0,c=0;if(s){a=s.width,o=s.height;var u=qIe();(u||!u&&t==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}return{width:a,height:o,x:l+Oae(e),y:c}}function uCt(e){var t,n=l2(e),r=Fae(e),s=(t=e.ownerDocument)==null?void 0:t.body,a=Qw(n.scrollWidth,n.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=Qw(n.scrollHeight,n.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),l=-r.scrollLeft+Oae(e),c=-r.scrollTop;return u1(s||n).direction==="rtl"&&(l+=Qw(n.clientWidth,s?s.clientWidth:0)-a),{width:a,height:o,x:l,y:c}}function Mae(e){var t=u1(e),n=t.overflow,r=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+s+r)}function QIe(e){return["html","body","#document"].indexOf(tx(e))>=0?e.ownerDocument.body:ep(e)&&Mae(e)?e:QIe(GB(e))}function Kj(e,t){var n;t===void 0&&(t=[]);var r=QIe(e),s=r===((n=e.ownerDocument)==null?void 0:n.body),a=Yf(r),o=s?[a].concat(a.visualViewport||[],Mae(r)?r:[]):r,l=t.concat(o);return s?l:l.concat(Kj(GB(o)))}function ree(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function dCt(e,t){var n=YS(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===HIe?ree(cCt(e,n)):O3(t)?dCt(t,n):ree(uCt(l2(e)))}function fCt(e){var t=Kj(GB(e)),n=["absolute","fixed"].indexOf(u1(e).position)>=0,r=n&&ep(e)?Kk(e):e;return O3(r)?t.filter(function(s){return O3(s)&&GIe(s,r)&&tx(s)!=="body"}):[]}function hCt(e,t,n,r){var s=t==="clippingParents"?fCt(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=Qw(d.top,c.top),c.right=OM(d.right,c.right),c.bottom=OM(d.bottom,c.bottom),c.left=Qw(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 ZIe(e){var t=e.reference,n=e.element,r=e.placement,s=r?B0(r):null,a=r?XS(r):null,o=t.x+t.width/2-n.width/2,l=t.y+t.height/2-n.height/2,c;switch(s){case sf:c={x:o,y:t.y-n.height};break;case lp:c={x:o,y:t.y+t.height};break;case cp:c={x:t.x+t.width,y:l};break;case af:c={x:t.x-n.width,y:l};break;default:c={x:t.x,y:t.y}}var u=s?Pae(s):null;if(u!=null){var d=u==="y"?"height":"width";switch(a){case GS:c[u]=c[u]-(t[d]/2-n[d]/2);break;case vE:c[u]=c[u]+(t[d]/2-n[d]/2);break}}return c}function wE(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?O6t:l,u=n.rootBoundary,d=u===void 0?HIe:u,f=n.elementContext,x=f===void 0?A7:f,g=n.altBoundary,v=g===void 0?!1:g,w=n.padding,C=w===void 0?0:w,N=YIe(typeof C!="number"?C:XIe(C,Gk)),P=x===A7?M6t:A7,I=e.rects.popper,R=e.elements[v?P:x],O=hCt(O3(R)?R:R.contextElement||l2(e.elements.popper),c,d,o),U=YS(e.elements.reference),L=ZIe({reference:U,element:I,strategy:"absolute",placement:s}),z=ree(Object.assign({},I,L)),X=x===A7?z:U,ne={top:O.top-X.top+N.top,bottom:X.bottom-O.bottom+N.bottom,left:O.left-X.left+N.left,right:X.right-O.right+N.right},J=e.modifiersData.offset;if(x===A7&&J){var K=J[s];Object.keys(ne).forEach(function(re){var he=[cp,lp].indexOf(re)>=0?1:-1,Q=[sf,lp].indexOf(re)>=0?"y":"x";ne[re]+=K[Q]*he})}return ne}function pCt(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?VIe:c,d=XS(r),f=d?l?gxe:gxe.filter(function(v){return XS(v)===d}):Gk,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]=wE(e,{placement:w,boundary:s,rootBoundary:a,padding:o})[B0(w)],v},{});return Object.keys(g).sort(function(v,w){return g[v]-g[w]})}function mCt(e){if(B0(e)===kae)return[];var t=oO(e);return[vxe(e),t,vxe(t)]}function xCt(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=B0(C),P=N===C,I=c||(P||!v?[oO(C)]:mCt(C)),R=[C].concat(I).reduce(function(me,we){return me.concat(B0(we)===kae?pCt(t,{placement:we,boundary:d,rootBoundary:f,padding:u,flipVariations:v,allowedAutoPlacements:w}):we)},[]),O=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],K=B0(J),re=XS(J)===GS,he=[sf,lp].indexOf(K)>=0,Q=he?"width":"height",ie=wE(t,{placement:J,boundary:d,rootBoundary:f,altBoundary:x,padding:u}),oe=he?re?cp:af:re?lp:sf;O[Q]>U[Q]&&(oe=oO(oe));var G=oO(oe),V=[];if(a&&V.push(ie[K]<=0),l&&V.push(ie[oe]<=0,ie[G]<=0),V.every(function(me){return me})){X=J,z=!1;break}L.set(J,V)}if(z)for(var te=v?3:1,ae=function(we){var xe=R.find(function(ye){var je=L.get(ye);if(je)return je.slice(0,we).every(function(Pe){return Pe})});if(xe)return X=xe,"break"},fe=te;fe>0;fe--){var Ne=ae(fe);if(Ne==="break")break}t.placement!==X&&(t.modifiersData[r]._skip=!0,t.placement=X,t.reset=!0)}}const gCt={name:"flip",enabled:!0,phase:"main",fn:xCt,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[sf,cp,lp,af].some(function(t){return e[t]>=0})}function bCt(e){var t=e.state,n=e.name,r=t.rects.reference,s=t.rects.popper,a=t.modifiersData.preventOverflow,o=wE(t,{elementContext:"reference"}),l=wE(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 yCt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:bCt};function vCt(e,t,n){var r=B0(e),s=[af,sf].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,[af,cp].indexOf(r)>=0?{x:l,y:o}:{x:o,y:l}}function wCt(e){var t=e.state,n=e.options,r=e.name,s=n.offset,a=s===void 0?[0,0]:s,o=VIe.reduce(function(d,f){return d[f]=vCt(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 CCt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:wCt};function SCt(e){var t=e.state,n=e.name;t.modifiersData[n]=ZIe({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const NCt={name:"popperOffsets",enabled:!0,phase:"read",fn:SCt,data:{}};function ACt(e){return e==="x"?"y":"x"}function jCt(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=wE(t,{boundary:c,rootBoundary:u,padding:f,altBoundary:d}),N=B0(t.placement),P=XS(t.placement),I=!P,R=Pae(N),O=ACt(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,K={x:0,y:0};if(U){if(a){var re,he=R==="y"?sf:af,Q=R==="y"?lp:cp,ie=R==="y"?"height":"width",oe=U[R],G=oe+C[he],V=oe-C[Q],te=g?-z[ie]/2:0,ae=P===GS?L[ie]:z[ie],fe=P===GS?-z[ie]:-L[ie],Ne=t.elements.arrow,me=g&&Ne?Iae(Ne):{width:0,height:0},we=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:KIe(),xe=we[he],ye=we[Q],je=Gj(0,L[ie],me[ie]),Pe=I?L[ie]/2-te-je-xe-ne.mainAxis:ae-je-xe-ne.mainAxis,Re=I?-L[ie]/2+te+je+ye+ne.mainAxis:fe+je+ye+ne.mainAxis,Xe=t.elements.arrow&&Kk(t.elements.arrow),Ke=Xe?R==="y"?Xe.clientTop||0:Xe.clientLeft||0:0,ut=(re=J==null?void 0:J[R])!=null?re:0,et=oe+Pe-ut-Ke,tt=oe+Re-ut,Le=Gj(g?OM(G,et):G,oe,g?Qw(V,tt):V);U[R]=Le,K[R]=Le-oe}if(l){var $e,ht=R==="x"?sf:af,pt=R==="x"?lp:cp,Kt=U[O],wt=O==="y"?"height":"width",nn=Kt+C[ht],cn=Kt-C[pt],zn=[sf,af].indexOf(N)!==-1,Xt=($e=J==null?void 0:J[O])!=null?$e:0,on=zn?nn:Kt-L[wt]-z[wt]-Xt+ne.altAxis,Zt=zn?Kt+L[wt]+z[wt]-Xt-ne.altAxis:cn,Ye=g&&zn?X6t(on,Kt,Zt):Gj(g?on:nn,Kt,g?Zt:cn);U[O]=Ye,K[O]=Ye-Kt}t.modifiersData[r]=K}}const ECt={name:"preventOverflow",enabled:!0,phase:"main",fn:jCt,requiresIfExists:["offset"]};function _Ct(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function kCt(e){return e===Yf(e)||!ep(e)?Fae(e):_Ct(e)}function TCt(e){var t=e.getBoundingClientRect(),n=KS(t.width)/e.offsetWidth||1,r=KS(t.height)/e.offsetHeight||1;return n!==1||r!==1}function ICt(e,t,n){n===void 0&&(n=!1);var r=ep(t),s=ep(t)&&TCt(t),a=l2(t),o=YS(e,s,n),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((tx(t)!=="body"||Mae(a))&&(l=kCt(t)),ep(t)?(c=YS(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):a&&(c.x=Oae(a))),{x:o.left+l.scrollLeft-c.x,y:o.top+l.scrollTop-c.y,width:o.width,height:o.height}}function PCt(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 FCt(e){var t=PCt(e);return W6t.reduce(function(n,r){return n.concat(t.filter(function(s){return s.phase===r}))},[])}function OCt(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function MCt(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 RCt(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 P=typeof N=="function"?N(d.options):N;w(),d.options=Object.assign({},a,d.options,P),d.scrollParents={reference:O3(l)?Kj(l):l.contextElement?Kj(l.contextElement):[],popper:Kj(c)};var I=FCt(MCt([].concat(r,d.options.modifiers)));return d.orderedModifiers=I.filter(function(R){return R.enabled}),v(),g.update()},forceUpdate:function(){if(!x){var N=d.elements,P=N.reference,I=N.popper;if(Axe(P,I)){d.rects={reference:ICt(P,Kk(I),d.options.strategy==="fixed"),popper:Iae(I)},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 O=d.orderedModifiers[R],U=O.fn,L=O.options,z=L===void 0?{}:L,X=O.name;typeof U=="function"&&(d=U({state:d,options:z,name:X,instance:g})||d)}}}},update:OCt(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,P=C.options,I=P===void 0?{}:P,R=C.effect;if(typeof R=="function"){var O=R({state:d,name:N,instance:g,options:I}),U=function(){};f.push(O||U)}})}function w(){f.forEach(function(C){return C()}),f=[]}return g}}var LCt=[aCt,NCt,sCt,WIe,CCt,gCt,ECt,eCt,yCt],DCt=RCt({defaultModifiers:LCt}),BCt="tippy-box",JIe="tippy-content",$Ct="tippy-backdrop",ePe="tippy-arrow",tPe="tippy-svg-arrow",jv={passive:!0,capture:!0},nPe=function(){return document.body};function nV(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function Rae(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function rPe(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 UCt(e){return e.split(/\s+/).filter(Boolean)}function wC(e){return[].concat(e)}function Exe(e,t){e.indexOf(t)===-1&&e.push(t)}function zCt(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function HCt(e){return e.split("-")[0]}function MM(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 Yj(){return document.createElement("div")}function KB(e){return["Element","Fragment"].some(function(t){return Rae(e,t)})}function VCt(e){return Rae(e,"NodeList")}function sPe(e){return Rae(e,"MouseEvent")}function WCt(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function qCt(e){return KB(e)?[e]:VCt(e)?MM(e):Array.isArray(e)?e:MM(document.querySelectorAll(e))}function rV(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 iPe(e){var t,n=wC(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function GCt(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=HCt(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,P=n-a.right-v>c;return w||C||N||P})}function sV(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 y0={isTouch:!1},Ixe=0;function KCt(){y0.isTouch||(y0.isTouch=!0,window.performance&&document.addEventListener("mousemove",aPe))}function aPe(){var e=performance.now();e-Ixe<20&&(y0.isTouch=!1,document.removeEventListener("mousemove",aPe)),Ixe=e}function YCt(){var e=document.activeElement;if(WCt(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function XCt(){document.addEventListener("touchstart",KCt,jv),window.addEventListener("blur",YCt)}var QCt=typeof window<"u"&&typeof document<"u",ZCt=QCt?!!window.msCrypto:!1,JCt={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},e4t={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},om=Object.assign({appendTo:nPe,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},JCt,e4t),t4t=Object.keys(om),n4t=function(t){var n=Object.keys(t);n.forEach(function(r){om[r]=t[r]})};function oPe(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=om[a])!=null?l:o}return r},{});return Object.assign({},e,n)}function r4t(e,t){var n=t?Object.keys(oPe(Object.assign({},om,{plugins:t}))):t4t,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:rPe(t.content,[e])},t.ignoreAttributes?{}:r4t(e,t.plugins));return n.aria=Object.assign({},om.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 s4t=function(){return"innerHTML"};function see(e,t){e[s4t()]=t}function Fxe(e){var t=Yj();return e===!0?t.className=ePe:(t.className=tPe,KB(e)?t.appendChild(e):see(t,e)),t}function Oxe(e,t){KB(t.content)?(see(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?see(e,t.content):e.textContent=t.content)}function iee(e){var t=e.firstElementChild,n=MM(t.children);return{box:t,content:n.find(function(r){return r.classList.contains(JIe)}),arrow:n.find(function(r){return r.classList.contains(ePe)||r.classList.contains(tPe)}),backdrop:n.find(function(r){return r.classList.contains($Ct)})}}function lPe(e){var t=Yj(),n=Yj();n.className=BCt,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Yj();r.className=JIe,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=iee(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}}lPe.$$tippy=!0;var i4t=1,oP=[],iV=[];function a4t(e,t){var n=Pxe(e,Object.assign({},om,oPe(_xe(t)))),r,s,a,o=!1,l=!1,c=!1,u=!1,d,f,x,g=[],v=jxe(et,n.interactiveDebounce),w,C=i4t++,N=null,P=zCt(n.plugins),I={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},R={id:C,reference:e,popper:Yj(),popperInstance:N,props:n,state:I,plugins:P,clearDelayTimeouts:on,setProps:Zt,setContent:Ye,show:Ze,hide:Ft,hideWithInteractivity:dn,enable:zn,disable:Xt,unmount:Yt,destroy:Bt};if(!n.render)return R;var O=n.render(R),U=O.popper,L=O.onUpdate;U.setAttribute("data-tippy-root",""),U.id="tippy-"+R.id,R.popper=U,e._tippy=R,U._tippy=R;var z=P.map(function(ot){return ot.fn(R)}),X=e.hasAttribute("aria-expanded");return Xe(),te(),oe(),G("onCreate",[R]),n.showOnCreate&&nn(),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 ot=R.props.touch;return Array.isArray(ot)?ot:[ot,0]}function J(){return ne()[0]==="hold"}function K(){var ot;return!!((ot=R.props.render)!=null&&ot.$$tippy)}function re(){return w||e}function he(){var ot=re().parentNode;return ot?iPe(ot):document}function Q(){return iee(U)}function ie(ot){return R.state.isMounted&&!R.state.isVisible||y0.isTouch||d&&d.type==="focus"?0:nV(R.props.delay,ot?0:1,om.delay)}function oe(ot){ot===void 0&&(ot=!1),U.style.pointerEvents=R.props.interactive&&!ot?"":"none",U.style.zIndex=""+R.props.zIndex}function G(ot,De,_t){if(_t===void 0&&(_t=!0),z.forEach(function(nt){nt[ot]&&nt[ot].apply(nt,De)}),_t){var ze;(ze=R.props)[ot].apply(ze,De)}}function V(){var ot=R.props.aria;if(ot.content){var De="aria-"+ot.content,_t=U.id,ze=wC(R.props.triggerTarget||e);ze.forEach(function(nt){var mt=nt.getAttribute(De);if(R.state.isVisible)nt.setAttribute(De,mt?mt+" "+_t:_t);else{var $t=mt&&mt.replace(_t,"").trim();$t?nt.setAttribute(De,$t):nt.removeAttribute(De)}})}}function te(){if(!(X||!R.props.aria.expanded)){var ot=wC(R.props.triggerTarget||e);ot.forEach(function(De){R.props.interactive?De.setAttribute("aria-expanded",R.state.isVisible&&De===re()?"true":"false"):De.removeAttribute("aria-expanded")})}}function ae(){he().removeEventListener("mousemove",v),oP=oP.filter(function(ot){return ot!==v})}function fe(ot){if(!(y0.isTouch&&(c||ot.type==="mousedown"))){var De=ot.composedPath&&ot.composedPath()[0]||ot.target;if(!(R.props.interactive&&Txe(U,De))){if(wC(R.props.triggerTarget||e).some(function(_t){return Txe(_t,De)})){if(y0.isTouch||R.state.isVisible&&R.props.trigger.indexOf("click")>=0)return}else G("onClickOutside",[R,ot]);R.props.hideOnClick===!0&&(R.clearDelayTimeouts(),R.hide(),l=!0,setTimeout(function(){l=!1}),R.state.isMounted||xe())}}}function Ne(){c=!0}function me(){c=!1}function we(){var ot=he();ot.addEventListener("mousedown",fe,!0),ot.addEventListener("touchend",fe,jv),ot.addEventListener("touchstart",me,jv),ot.addEventListener("touchmove",Ne,jv)}function xe(){var ot=he();ot.removeEventListener("mousedown",fe,!0),ot.removeEventListener("touchend",fe,jv),ot.removeEventListener("touchstart",me,jv),ot.removeEventListener("touchmove",Ne,jv)}function ye(ot,De){Pe(ot,function(){!R.state.isVisible&&U.parentNode&&U.parentNode.contains(U)&&De()})}function je(ot,De){Pe(ot,De)}function Pe(ot,De){var _t=Q().box;function ze(nt){nt.target===_t&&(sV(_t,"remove",ze),De())}if(ot===0)return De();sV(_t,"remove",f),sV(_t,"add",ze),f=ze}function Re(ot,De,_t){_t===void 0&&(_t=!1);var ze=wC(R.props.triggerTarget||e);ze.forEach(function(nt){nt.addEventListener(ot,De,_t),g.push({node:nt,eventType:ot,handler:De,options:_t})})}function Xe(){J()&&(Re("touchstart",ut,{passive:!0}),Re("touchend",tt,{passive:!0})),UCt(R.props.trigger).forEach(function(ot){if(ot!=="manual")switch(Re(ot,ut),ot){case"mouseenter":Re("mouseleave",tt);break;case"focus":Re(ZCt?"focusout":"blur",Le);break;case"focusin":Re("focusout",Le);break}})}function Ke(){g.forEach(function(ot){var De=ot.node,_t=ot.eventType,ze=ot.handler,nt=ot.options;De.removeEventListener(_t,ze,nt)}),g=[]}function ut(ot){var De,_t=!1;if(!(!R.state.isEnabled||$e(ot)||l)){var ze=((De=d)==null?void 0:De.type)==="focus";d=ot,w=ot.currentTarget,te(),!R.state.isVisible&&sPe(ot)&&oP.forEach(function(nt){return nt(ot)}),ot.type==="click"&&(R.props.trigger.indexOf("mouseenter")<0||o)&&R.props.hideOnClick!==!1&&R.state.isVisible?_t=!0:nn(ot),ot.type==="click"&&(o=!_t),_t&&!ze&&cn(ot)}}function et(ot){var De=ot.target,_t=re().contains(De)||U.contains(De);if(!(ot.type==="mousemove"&&_t)){var ze=wt().concat(U).map(function(nt){var mt,$t=nt._tippy,Pt=(mt=$t.popperInstance)==null?void 0:mt.state;return Pt?{popperRect:nt.getBoundingClientRect(),popperState:Pt,props:n}:null}).filter(Boolean);GCt(ze,ot)&&(ae(),cn(ot))}}function tt(ot){var De=$e(ot)||R.props.trigger.indexOf("click")>=0&&o;if(!De){if(R.props.interactive){R.hideWithInteractivity(ot);return}cn(ot)}}function Le(ot){R.props.trigger.indexOf("focusin")<0&&ot.target!==re()||R.props.interactive&&ot.relatedTarget&&U.contains(ot.relatedTarget)||cn(ot)}function $e(ot){return y0.isTouch?J()!==ot.type.indexOf("touch")>=0:!1}function ht(){pt();var ot=R.props,De=ot.popperOptions,_t=ot.placement,ze=ot.offset,nt=ot.getReferenceClientRect,mt=ot.moveTransition,$t=K()?iee(U).arrow:null,Pt=nt?{getBoundingClientRect:nt,contextElement:nt.contextElement||re()}:e,un={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(An){var kn=An.state;if(K()){var yn=Q(),Vn=yn.box;["placement","reference-hidden","escaped"].forEach(function(Gn){Gn==="placement"?Vn.setAttribute("data-placement",kn.placement):kn.attributes.popper["data-popper-"+Gn]?Vn.setAttribute("data-"+Gn,""):Vn.removeAttribute("data-"+Gn)}),kn.attributes.popper={}}}},an=[{name:"offset",options:{offset:ze}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!mt}},un];K()&&$t&&an.push({name:"arrow",options:{element:$t,padding:3}}),an.push.apply(an,(De==null?void 0:De.modifiers)||[]),R.popperInstance=DCt(Pt,U,Object.assign({},De,{placement:_t,onFirstUpdate:x,modifiers:an}))}function pt(){R.popperInstance&&(R.popperInstance.destroy(),R.popperInstance=null)}function Kt(){var ot=R.props.appendTo,De,_t=re();R.props.interactive&&ot===nPe||ot==="parent"?De=_t.parentNode:De=rPe(ot,[_t]),De.contains(U)||De.appendChild(U),R.state.isMounted=!0,ht()}function wt(){return MM(U.querySelectorAll("[data-tippy-root]"))}function nn(ot){R.clearDelayTimeouts(),ot&&G("onTrigger",[R,ot]),we();var De=ie(!0),_t=ne(),ze=_t[0],nt=_t[1];y0.isTouch&&ze==="hold"&&nt&&(De=nt),De?r=setTimeout(function(){R.show()},De):R.show()}function cn(ot){if(R.clearDelayTimeouts(),G("onUntrigger",[R,ot]),!R.state.isVisible){xe();return}if(!(R.props.trigger.indexOf("mouseenter")>=0&&R.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(ot.type)>=0&&o)){var De=ie(!1);De?s=setTimeout(function(){R.state.isVisible&&R.hide()},De):a=requestAnimationFrame(function(){R.hide()})}}function zn(){R.state.isEnabled=!0}function Xt(){R.hide(),R.state.isEnabled=!1}function on(){clearTimeout(r),clearTimeout(s),cancelAnimationFrame(a)}function Zt(ot){if(!R.state.isDestroyed){G("onBeforeUpdate",[R,ot]),Ke();var De=R.props,_t=Pxe(e,Object.assign({},De,_xe(ot),{ignoreAttributes:!0}));R.props=_t,Xe(),De.interactiveDebounce!==_t.interactiveDebounce&&(ae(),v=jxe(et,_t.interactiveDebounce)),De.triggerTarget&&!_t.triggerTarget?wC(De.triggerTarget).forEach(function(ze){ze.removeAttribute("aria-expanded")}):_t.triggerTarget&&e.removeAttribute("aria-expanded"),te(),oe(),L&&L(De,_t),R.popperInstance&&(ht(),wt().forEach(function(ze){requestAnimationFrame(ze._tippy.popperInstance.forceUpdate)})),G("onAfterUpdate",[R,ot])}}function Ye(ot){R.setProps({content:ot})}function Ze(){var ot=R.state.isVisible,De=R.state.isDestroyed,_t=!R.state.isEnabled,ze=y0.isTouch&&!R.props.touch,nt=nV(R.props.duration,0,om.duration);if(!(ot||De||_t||ze)&&!re().hasAttribute("disabled")&&(G("onShow",[R],!1),R.props.onShow(R)!==!1)){if(R.state.isVisible=!0,K()&&(U.style.visibility="visible"),oe(),we(),R.state.isMounted||(U.style.transition="none"),K()){var mt=Q(),$t=mt.box,Pt=mt.content;rV([$t,Pt],0)}x=function(){var an;if(!(!R.state.isVisible||u)){if(u=!0,U.offsetHeight,U.style.transition=R.props.moveTransition,K()&&R.props.animation){var xn=Q(),An=xn.box,kn=xn.content;rV([An,kn],nt),kxe([An,kn],"visible")}V(),te(),Exe(iV,R),(an=R.popperInstance)==null||an.forceUpdate(),G("onMount",[R]),R.props.animation&&K()&&je(nt,function(){R.state.isShown=!0,G("onShown",[R])})}},Kt()}}function Ft(){var ot=!R.state.isVisible,De=R.state.isDestroyed,_t=!R.state.isEnabled,ze=nV(R.props.duration,1,om.duration);if(!(ot||De||_t)&&(G("onHide",[R],!1),R.props.onHide(R)!==!1)){if(R.state.isVisible=!1,R.state.isShown=!1,u=!1,o=!1,K()&&(U.style.visibility="hidden"),ae(),xe(),oe(!0),K()){var nt=Q(),mt=nt.box,$t=nt.content;R.props.animation&&(rV([mt,$t],ze),kxe([mt,$t],"hidden"))}V(),te(),R.props.animation?K()&&ye(ze,R.unmount):R.unmount()}}function dn(ot){he().addEventListener("mousemove",v),Exe(oP,v),v(ot)}function Yt(){R.state.isVisible&&R.hide(),R.state.isMounted&&(pt(),wt().forEach(function(ot){ot._tippy.unmount()}),U.parentNode&&U.parentNode.removeChild(U),iV=iV.filter(function(ot){return ot!==R}),R.state.isMounted=!1,G("onHidden",[R]))}function Bt(){R.state.isDestroyed||(R.clearDelayTimeouts(),R.unmount(),Ke(),delete e._tippy,R.state.isDestroyed=!0,G("onDestroy",[R]))}}function Yk(e,t){t===void 0&&(t={});var n=om.plugins.concat(t.plugins||[]);XCt();var r=Object.assign({},t,{plugins:n}),s=qCt(e),a=s.reduce(function(o,l){var c=l&&a4t(l,r);return c&&o.push(c),o},[]);return KB(e)?a[0]:a}Yk.defaultProps=om;Yk.setDefaultProps=n4t;Yk.currentInput=y0;Object.assign({},WIe,{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 aee={clientX:0,clientY:0},lP=[];function cPe(e){var t=e.clientX,n=e.clientY;aee={clientX:t,clientY:n}}function o4t(e){e.addEventListener("mousemove",cPe)}function l4t(e){e.removeEventListener("mousemove",cPe)}var c4t={name:"followCursor",defaultValue:!1,fn:function(t){var n=t.reference,r=iPe(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,P=w.clientX,I=w.clientY,R=n.getBoundingClientRect(),O=P-R.left,U=I-R.top;(C||!t.props.interactive)&&t.setProps({getReferenceClientRect:function(){var z=n.getBoundingClientRect(),X=P,ne=I;N==="initial"&&(X=z.left+O,ne=z.top+U);var J=N==="horizontal"?z.top:ne,K=N==="vertical"?z.right:X,re=N==="horizontal"?z.bottom:ne,he=N==="vertical"?z.left:X;return{width:K-he,height:re-J,top:J,right:K,bottom:re,left:he}}})}function g(){t.props.followCursor&&(lP.push({instance:t,doc:r}),o4t(r))}function v(){lP=lP.filter(function(w){return w.instance!==t}),lP.filter(function(w){return w.doc===r}).length===0&&l4t(r)}return{onCreate:g,onDestroy:v,onBeforeUpdate:function(){l=t.props},onAfterUpdate:function(C,N){var P=N.followCursor;s||P!==void 0&&l.followCursor!==P&&(v(),P?(g(),t.state.isMounted&&!a&&!c()&&u()):(d(),f()))},onMount:function(){t.props.followCursor&&!a&&(o&&(x(aee),o=!1),c()||u())},onTrigger:function(C,N){sPe(N)&&(aee={clientX:N.clientX,clientY:N.clientY}),a=N.type==="focus"},onHidden:function(){t.props.followCursor&&(f(),d(),o=!0)}}}};Yk.setDefaultProps({render:lPe});function xi({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=ONe.createRoot(s.current),a.current.render(e));const c=Yk(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:[c4t],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 Qh;(function(e){e.NUMBER="NUMBER_NUMBER",e.HEX="NUMBER_HEX",e.STR="NUMBER_STR",e.BIGINT="NUMBER_BIGINT"})(Qh||(Qh={}));var d1;(function(e){e.HEX="BYTES_HEX",e.UINT8ARRAY="BYTES_UINT8ARRAY"})(d1||(d1={}));const hd={number:Qh.BIGINT,bytes:d1.HEX},mi={number:Qh.HEX,bytes:d1.HEX};var kg;(function(e){e.EARLIEST="earliest",e.LATEST="latest",e.PENDING="pending",e.SAFE="safe",e.FINALIZED="finalized",e.COMMITTED="committed"})(kg||(kg={}));var Xj;(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"})(Xj||(Xj={}));const Lae=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 Xk{static isWeb3Provider(t){return t instanceof Xk||!!(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 u4t extends Array{constructor(t){super(),this._accountProvider=t}}const d4t=100,f4t=101,h4t=201,p4t=202,m4t=203,x4t=204,g4t=205,b4t=206,y4t=207,v4t=208,w4t=300,C4t=301,S4t=310,N4t=311,A4t=400,j4t=402,E4t=405,_4t=407,k4t=408,T4t=410,I4t=411,P4t=412,F4t=413,O4t=414,M4t=415,R4t=416,L4t=417,D4t=418,B4t=419,$4t=420,U4t=421,z4t=422,H4t=423,V4t=424,W4t=425,q4t=426,G4t=427,K4t=428,Y4t=429,X4t=430,Q4t=431,Z4t=432,J4t=433,eSt=434,tSt=435,nSt=436,rSt=437,sSt=438,iSt=439,aSt=440,oSt=441,lSt=500,cSt=503,uSt=505,dSt=506,fSt=507,hSt=600,pSt=602,mSt=603,xSt=604,gSt=701,bSt=702,ySt=703,vSt=704,wSt=705,CSt=706,SSt=707,NSt=709,ASt=801,jSt=802,ESt=4001,_St=4100,kSt=4200,TSt=4900,ISt=4901,PSt=902,FSt=903,OSt=1001,MSt=1002,RSt=1003,LSt=1004,DSt=1005,BSt=1006,$St=1008,USt=1009,zSt=1010,HSt=1011,VSt=1012,WSt=1014,qSt=1015,GSt=1100,uPe=1101,KSt=1200,RM=-32700,LM=-32600,DM=-32601,BM=-32602,$M=-32603,UM=-32e3,zM=-32001,HM=-32002,VM=-32003,WM=-32004,qM=-32005,GM=-32006;class fi extends Error{get innerError(){return this.cause instanceof Qj?this.cause.errors:this.cause}set innerError(t){Array.isArray(t)?this.cause=new Qj(t):this.cause=t}constructor(t,n){super(t),Array.isArray(n)?this.cause=new Qj(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 Qj extends fi{constructor(t){super(`Multiple errors occurred: [${t.map(n=>n.message).join("], [")}]`),this.code=v4t,this.errors=t}}class zi extends fi{constructor(t,n){super(`Invalid value given "${fi.convertToString(t,!0)}". Error: ${n}.`),this.name=this.constructor.name}}class Lxe extends fi{constructor(){super("Private key must be 32 bytes."),this.code=gSt}}class YSt extends fi{constructor(){super("Invalid Private Key, Not a valid string or uint8Array"),this.code=bSt}}class XSt extends fi{constructor(t){super(`"${t}"`),this.code=jSt}}class dPe extends fi{constructor(){super("Invalid key derivation function"),this.code=ySt}}class QSt extends fi{constructor(){super("Key derivation failed - possibly wrong password"),this.code=vSt}}class ZSt extends fi{constructor(){super("Unsupported key store version"),this.code=wSt}}class JSt extends fi{constructor(){super("Password cannot be empty"),this.code=CSt}}class eNt extends fi{constructor(){super("Initialization vector must be 16 bytes"),this.code=SSt}}class tNt extends fi{constructor(){super("c > 1000, pbkdf2 is less secure with less iterations"),this.code=NSt}}class Qk extends fi{constructor(t,n){super(t),this.code=lSt,n&&(this.errorCode=n.code,this.errorReason=n.reason)}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{errorCode:this.errorCode,errorReason:this.errorReason})}}class oee extends Qk{constructor(t){super("Connection not open",t),this.code=cSt}}class nNt extends Qk{constructor(t){super(`Maximum number of reconnect attempts reached! (${t})`),this.code=uSt}}class rNt extends Qk{constructor(){super("CONNECTION ERROR: Provider started to reconnect before the response got received!"),this.code=dSt}}class sNt extends Qk{constructor(t){super(`Request already sent with following id: ${t}`),this.code=fSt}}class pd extends fi{constructor(t,n){super(t),this.code=w4t,this.receipt=n}}class Dxe extends fi{constructor(t,n){super(`The resolver at ${t} does not implement requested method: "${n}".`),this.address=t,this.name=n,this.code=C4t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{address:this.address,name:this.name})}}class YB extends pd{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 YB(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 Zw extends pd{constructor(t){super("Error happened while trying to execute a function inside a smart contract"),this.code=S4t,this.cause=new YB(t)}}class iNt extends zi{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=N4t}}class aNt extends fi{constructor(t){super(`ENS is not supported on network ${t}`),this.code=PSt}}class oNt extends fi{constructor(){super("Network not synced"),this.code=FSt}}class Bxe extends fi{constructor(t){super(`Invalid parameters passed. "${typeof t<"u"?t:""}"`),this.hint=t,this.code=y4t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{hint:this.hint})}}class lee extends fi{constructor(){super(...arguments),this.code=h4t}}class $x extends fi{constructor(){super("The method you're trying to call is not implemented."),this.code=p4t}}class fPe extends fi{constructor(){super(...arguments),this.code=m4t}}class lNt extends fi{constructor(){super(...arguments),this.code=x4t}}class Yi extends fi{constructor(t,n){super(t),this.code=g4t,this.props=n??{}}}class cNt extends fi{constructor(t){super(`A plugin with the namespace: ${t} has already been registered.`),this.code=b4t}}class lO extends fi{constructor(){super(...arguments),this.code=hSt}}class cee extends fi{constructor(t){super(`Client URL "${t}" is invalid.`),this.code=pSt}}class og extends fi{constructor(){super(...arguments),this.code=mSt}}class uNt extends fi{constructor(){super(...arguments),this.code=xSt}}class dNt extends zi{constructor(){super(...arguments),this.code=ASt}}class Dae extends fi{constructor(t,n){super(t),this.receipt=n,this.code=A4t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{receipt:this.receipt})}}class KM extends fi{constructor(t,n,r,s){super(`Transaction has been reverted by the EVM${r===void 0?"":`:
 ${fi.convertToString(r)}`}`),this.reason=t,this.signature=n,this.receipt=r,this.data=s,this.code=j4t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reason:this.reason,signature:this.signature,receipt:this.receipt,data:this.data})}}class hPe extends KM{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=sSt}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 pPe extends Dae{constructor(t){super(`Transaction has been reverted by the EVM${t===void 0?"":`:
 ${fi.convertToString(t)}`}`,t),this.code=E4t}}class fNt extends Dae{constructor(){super("Raw transaction undefined"),this.code=_4t}}class $xe extends Dae{constructor(){super("Transaction not found"),this.code=X4t}}class hNt extends zi{constructor(t){super(t,"invalid transaction with invalid sender"),this.code=k4t}}class pNt extends zi{constructor(t){super(t,"invalid transaction with invalid receiver"),this.code=rSt}}class mNt extends zi{constructor(){super("MissingCustomChainError","If tx.common is provided it must have tx.common.customChain"),this.code=T4t}}class xNt extends zi{constructor(){super("MissingCustomChainIdError","If tx.common is provided it must have tx.common.customChain and tx.common.customChain.chainId"),this.code=I4t}}class gNt extends zi{constructor(t){super(JSON.stringify(t),"Chain Id doesnt match in tx.chainId tx.common.customChain.chainId"),this.code=P4t}}class bNt extends zi{constructor(t){super(JSON.stringify(t),"Chain doesnt match in tx.chain tx.common.basechain"),this.code=tSt}}class yNt extends zi{constructor(t){super(JSON.stringify(t),"hardfork doesnt match in tx.hardfork tx.common.hardfork"),this.code=nSt}}class vNt extends zi{constructor(){super("CommonOrChainAndHardforkError","Please provide the common object or the chain and hardfork property but not all together."),this.code=F4t}}class wNt extends zi{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=O4t}}class CNt extends fi{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=aSt}}class SNt extends zi{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=M4t,this.cause=new CNt}}class NNt extends fi{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=oSt}}class ANt extends zi{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=eSt,this.cause=new NNt}}class jNt extends zi{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=R4t}}class ENt extends zi{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=L4t}}class _Nt extends zi{constructor(t){super(t,"eip-1559 transactions don't support gasPrice"),this.code=D4t}}class mPe extends zi{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=B4t}}class kNt extends zi{constructor(t){super(t,"invalid transaction object"),this.code=$4t}}class TNt extends zi{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=U4t}}class INt extends zi{constructor(){super("UnableToPopulateNonceError","unable to populate nonce, no from address available"),this.code=z4t}}class PNt extends zi{constructor(){super("Eip1559NotSupportedError","Network doesn't support eip-1559"),this.code=H4t}}class Uxe extends zi{constructor(t){super(t,"unsupported transaction type"),this.code=V4t}}class xPe extends zi{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=W4t}}class FNt extends fi{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=Q4t}}function gPe(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 bPe extends fi{constructor(t){super(`Transaction was not mined within ${t.numberOfSeconds} seconds. ${gPe(t.transactionHash)}`),this.code=q4t}}class yPe extends fi{constructor(t){super(`Transaction started at ${t.starterBlockNumber} but was not mined within ${t.numberOfBlocks} blocks. ${gPe(t.transactionHash)}`),this.code=Z4t}}class ONt extends zi{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=G4t}}class MNt extends zi{constructor(t){super(`receipt: ${JSON.stringify(t.receipt)}`,"Receipt missing block number"),this.code=K4t}}class uee extends fi{constructor(t){super(`Invalid signature. "${t}"`),this.code=J4t}}class zxe extends zi{constructor(){super("LocalWalletNotAvailableError","Attempted to index account in local wallet, but no wallet is available"),this.code=Y4t}}class RNt extends fi{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=iSt}}class o4 extends zi{constructor(t){super(t,"can not parse as byte data"),this.code=MSt}}class Bae extends zi{constructor(t){super(t,"can not parse as number data"),this.code=RSt}}class $ae extends zi{constructor(t){super(t,"invalid ethereum address"),this.code=DSt}}class LNt extends zi{constructor(t){super(t,"not a valid string"),this.code=OSt}}class vPe extends zi{constructor(t){super(t,"invalid unit"),this.code=LSt}}class wPe extends zi{constructor(t){super(t,"not a valid unit. Must be a positive integer"),this.code=qSt}}class DNt extends zi{constructor(t){super(t,"can not be converted to hex"),this.code=BSt}}class CPe extends zi{constructor(t){super(t,"value greater than the nibble width"),this.code=WSt}}class Uae extends zi{constructor(t){super(t,"not a valid boolean."),this.code=$St}}class BNt extends zi{constructor(t){super(t,"not a valid unsigned integer."),this.code=USt}}class Hxe extends zi{constructor(t){super(t,"invalid size given."),this.code=zSt}}class Vxe extends zi{constructor(t){super(t,"value is larger than size."),this.code=HSt}}class $Nt extends zi{constructor(t){super(t,"invalid string given"),this.code=VSt}}const UNt=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=>UNt(e)?e.error.message:"";class N0 extends fi{constructor(t,n,r,s){var a;super(n??`Returned error: ${Array.isArray(t)?t.map(l=>Wxe(l)).join(","):Wxe(t)}`),this.code=d4t,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 Qj(o):this.cause=o}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{data:this.data,request:this.request,statusCode:this.statusCode})}}class XB extends N0{constructor(t,n){super(t,void 0,n),this.code=f4t;let r;"error"in t?r=t.error:t instanceof Array&&(r=t.map(s=>s.error)),Array.isArray(r)?this.cause=new Qj(r):this.cause=r}}class qxe extends fi{constructor(t,n){super(`Web3Config hardfork doesnt match in defaultHardfork ${t} and common.hardfork ${n}`),this.code=uPe}}class Gxe extends fi{constructor(t,n){super(`Web3Config chain doesnt match in defaultHardfork ${t} and common.hardfork ${n}`),this.code=uPe}}const SPe="An Rpc error has occured with a code of *code*",Fu={[RM]:{message:"Parse error",description:"Invalid JSON"},[LM]:{message:"Invalid request",description:"JSON is not a valid request object	"},[DM]:{message:"Method not found",description:"Method does not exist	"},[BM]:{message:"Invalid params",description:"Invalid method parameters"},[$M]:{message:"Internal error",description:"Internal JSON-RPC error"},[UM]:{message:"Invalid input",description:"Missing or invalid parameters"},[zM]:{message:"Resource not found",description:"Requested resource not found"},[HM]:{message:"Resource unavailable",description:"Requested resource not available"},[VM]:{message:"Transaction rejected",description:"Transaction creation failed"},[WM]:{message:"Method not supported",description:"Method is not implemented"},[qM]:{message:"Limit exceeded",description:"Request exceeds defined limit"},[GM]:{message:"JSON-RPC version not supported",description:"Version of JSON-RPC protocol is not supported"},[ESt]:{name:"User Rejected Request",message:"The user rejected the request."},[_St]:{name:"Unauthorized",message:"The requested method and/or account has not been authorized by the user."},[kSt]:{name:"Unsupported Method",message:"The Provider does not support the requested method."},[TSt]:{name:"Disconnected",message:"The Provider is disconnected from all chains."},[ISt]:{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 eh extends fi{constructor(t,n){super(n??SPe.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 zNt extends fi{constructor(t,n){var r,s,a,o;if(!t)super();else if(!((r=Fu[t])===null||r===void 0)&&r.message)super(Fu[t].message);else{const l=Object.keys(Fu).find(c=>typeof c=="string"&&t>=parseInt(c.split("-")[0],10)&&t<=parseInt(c.split("-")[1],10));super((a=(s=Fu[l??""])===null||s===void 0?void 0:s.message)!==null&&a!==void 0?a:SPe.replace("*code*",(o=t==null?void 0:t.toString())!==null&&o!==void 0?o:'""'))}this.code=t,this.data=n}}class HNt extends eh{constructor(t){super(t,Fu[RM].message),this.code=RM}}class VNt extends eh{constructor(t){super(t,Fu[LM].message),this.code=LM}}class WNt extends eh{constructor(t){super(t,Fu[DM].message),this.code=DM}}class qNt extends eh{constructor(t){super(t,Fu[BM].message),this.code=BM}}class GNt extends eh{constructor(t){super(t,Fu[$M].message),this.code=$M}}class KNt extends eh{constructor(t){super(t,Fu[UM].message),this.code=UM}}class YNt extends eh{constructor(t){super(t,Fu[WM].message),this.code=WM}}class XNt extends eh{constructor(t){super(t,Fu[HM].message),this.code=HM}}class QNt extends eh{constructor(t){super(t,Fu[zM].message),this.code=zM}}class ZNt extends eh{constructor(t){super(t,Fu[GM].message),this.code=GM}}class JNt extends eh{constructor(t){super(t,Fu[VM].message),this.code=VM}}class eAt extends eh{constructor(t){super(t,Fu[qM].message),this.code=qM}}const gd=new Map;gd.set(RM,{error:HNt});gd.set(LM,{error:VNt});gd.set(DM,{error:WNt});gd.set(BM,{error:qNt});gd.set($M,{error:GNt});gd.set(UM,{error:KNt});gd.set(WM,{error:YNt});gd.set(HM,{error:XNt});gd.set(VM,{error:JNt});gd.set(zM,{error:QNt});gd.set(GM,{error:ZNt});gd.set(qM,{error:eAt});class tAt extends fi{constructor(t){super(`Format for the type ${t} is unsupported`),this.type=t,this.code=KSt}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type})}}function Kd(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function nAt(e){if(typeof e!="boolean")throw new Error(`boolean expected, not ${e}`)}function rAt(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function MA(e,...t){if(!rAt(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 zae(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Kd(e.outputLen),Kd(e.blockLen)}function M3(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 Hae(e,t){MA(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const NPe={number:Kd,bool:nAt,bytes:MA,hash:zae,exists:M3,output:Hae},cP=BigInt(2**32-1),Kxe=BigInt(32);function sAt(e,t=!1){return t?{h:Number(e&cP),l:Number(e>>Kxe&cP)}:{h:Number(e>>Kxe&cP)|0,l:Number(e&cP)|0}}function iAt(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}=sAt(e[s],t);[n[s],r[s]]=[a,o]}return[n,r]}const aAt=(e,t,n)=>e<<n|t>>>32-n,oAt=(e,t,n)=>t<<n|e>>>32-n,lAt=(e,t,n)=>t<<n-32|e>>>64-n,cAt=(e,t,n)=>e<<n-32|t>>>64-n,cO=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const uO=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),dO=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Zm=(e,t)=>e<<32-t|e>>>t,ma=(e,t)=>e<<t|e>>>32-t>>>0,YM=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,uAt=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;function XM(e){for(let t=0;t<e.length;t++)e[t]=uAt(e[t])}function QS(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function ZS(e){return typeof e=="string"&&(e=QS(e)),MA(e),e}function QM(...e){let t=0;for(let r=0;r<e.length;r++){const s=e[r];MA(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 Vae{clone(){return this._cloneInto()}}const dAt={}.toString;function APe(e,t){if(t!==void 0&&dAt.call(t)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(e,t)}function jPe(e){const t=r=>e().update(ZS(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function EPe(e=32){if(cO&&typeof cO.getRandomValues=="function")return cO.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}const _Pe=[],kPe=[],TPe=[],fAt=BigInt(0),j7=BigInt(1),hAt=BigInt(2),pAt=BigInt(7),mAt=BigInt(256),xAt=BigInt(113);for(let e=0,t=j7,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],_Pe.push(2*(5*r+n)),kPe.push((e+1)*(e+2)/2%64);let s=fAt;for(let a=0;a<7;a++)t=(t<<j7^(t>>pAt)*xAt)%mAt,t&hAt&&(s^=j7<<(j7<<BigInt(a))-j7);TPe.push(s)}const[gAt,bAt]=iAt(TPe,!0),Yxe=(e,t,n)=>n>32?lAt(e,t,n):aAt(e,t,n),Xxe=(e,t,n)=>n>32?cAt(e,t,n):oAt(e,t,n);function yAt(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=kPe[o],c=Yxe(s,a,l),u=Xxe(s,a,l),d=_Pe[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]^=gAt[r],e[1]^=bAt[r]}n.fill(0)}class Wae extends Vae{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,Kd(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=uO(this.state)}keccak(){YM||XM(this.state32),yAt(this.state32,this.rounds),YM||XM(this.state32),this.posOut=0,this.pos=0}update(t){M3(this);const{blockLen:n,state:r}=this;t=ZS(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){M3(this,!1),MA(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 Kd(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Hae(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 Wae(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 vAt=(e,t,n)=>jPe(()=>new Wae(t,e,n)),Qxe=vAt(1,136,256/8),ZM=NPe.bytes;function IPe(e){if(!(e instanceof Uint8Array))throw new TypeError(`bytesToUtf8 expected Uint8Array, got ${typeof e}`);return new TextDecoder().decode(e)}function wAt(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 CAt(e){return t=>(NPe.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 cd=(()=>{const e=CAt(Qxe);return e.create=Qxe.create,e})();var da;(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})(da||(da={}));var dee;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(dee||(dee={}));const ws=da.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),dg=e=>{switch(typeof e){case"undefined":return ws.undefined;case"string":return ws.string;case"number":return Number.isNaN(e)?ws.nan:ws.number;case"boolean":return ws.boolean;case"function":return ws.function;case"bigint":return ws.bigint;case"symbol":return ws.symbol;case"object":return Array.isArray(e)?ws.array:e===null?ws.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ws.promise:typeof Map<"u"&&e instanceof Map?ws.map:typeof Set<"u"&&e instanceof Set?ws.set:typeof Date<"u"&&e instanceof Date?ws.date:ws.object;default:return ws.unknown}},qr=da.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"]),SAt=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Gf 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 Gf))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,da.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()}}Gf.create=e=>new Gf(e);const JS=(e,t)=>{let n;switch(e.code){case qr.invalid_type:e.received===ws.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case qr.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,da.jsonStringifyReplacer)}`;break;case qr.unrecognized_keys:n=`Unrecognized key(s) in object: ${da.joinValues(e.keys,", ")}`;break;case qr.invalid_union:n="Invalid input";break;case qr.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${da.joinValues(e.options)}`;break;case qr.invalid_enum_value:n=`Invalid enum value. Expected ${da.joinValues(e.options)}, received '${e.received}'`;break;case qr.invalid_arguments:n="Invalid function arguments";break;case qr.invalid_return_type:n="Invalid function return type";break;case qr.invalid_date:n="Invalid date";break;case qr.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}"`:da.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case qr.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 qr.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 qr.custom:n="Invalid input";break;case qr.invalid_intersection_types:n="Intersection results could not be merged";break;case qr.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case qr.not_finite:n="Number must be finite";break;default:n=t.defaultError,da.assertNever(e)}return{message:n}};let PPe=JS;function NAt(e){PPe=e}function JM(){return PPe}const eR=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}},AAt=[];function us(e,t){const n=JM(),r=eR({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===JS?void 0:JS].filter(s=>!!s)});e.common.issues.push(r)}class Du{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 si;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 Du.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 si;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 si=Object.freeze({status:"aborted"}),RC=e=>({status:"dirty",value:e}),bd=e=>({status:"valid",value:e}),fee=e=>e.status==="aborted",hee=e=>e.status==="dirty",R3=e=>e.status==="valid",CE=e=>typeof Promise<"u"&&e instanceof Promise;var Ds;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ds||(Ds={}));class nx{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(R3(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 Gf(e.common.issues);return this._error=n,this._error}}};function Ti(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 $i{get description(){return this._def.description}_getType(t){return dg(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:dg(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Du,ctx:{common:t.parent.common,data:t.data,parsedType:dg(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(CE(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:dg(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:dg(t)};if(!this["~standard"].async)try{const a=this._parseSync({data:t,path:[],parent:n});return R3(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=>R3(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:dg(t)},s=this._parse({data:t,path:r.path,parent:r}),a=await(CE(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:qr.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 vm({schema:this,typeName:oi.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 $0.create(this,this._def)}nullable(){return Gy.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fm.create(this)}promise(){return tN.create(this,this._def)}or(t){return jE.create([this,t],this._def)}and(t){return EE.create(this,t,this._def)}transform(t){return new vm({...Ti(this._def),schema:this,typeName:oi.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new PE({...Ti(this._def),innerType:this,defaultValue:n,typeName:oi.ZodDefault})}brand(){return new qae({typeName:oi.ZodBranded,type:this,...Ti(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new FE({...Ti(this._def),innerType:this,catchValue:n,typeName:oi.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Zk.create(this,t)}readonly(){return OE.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const jAt=/^c[^\s-]{8,}$/i,EAt=/^[0-9a-z]+$/,_At=/^[0-9A-HJKMNP-TV-Z]{26}$/i,kAt=/^[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,TAt=/^[a-z0-9_-]{21}$/i,IAt=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,PAt=/^[-+]?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)?)??$/,FAt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,OAt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let aV;const 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])$/,RAt=/^(?:(?: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])$/,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]))$/,DAt=/^(([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])$/,BAt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,$At=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,FPe="((\\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])))",UAt=new RegExp(`^${FPe}$`);function OPe(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 zAt(e){return new RegExp(`^${OPe(e)}$`)}function MPe(e){let t=`${FPe}T${OPe(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 HAt(e,t){return!!((t==="v4"||!t)&&MAt.test(e)||(t==="v6"||!t)&&LAt.test(e))}function VAt(e,t){if(!IAt.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 WAt(e,t){return!!((t==="v4"||!t)&&RAt.test(e)||(t==="v6"||!t)&&DAt.test(e))}class lm extends $i{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ws.string){const a=this._getOrReturnCtx(t);return us(a,{code:qr.invalid_type,expected:ws.string,received:a.parsedType}),si}const r=new Du;let s;for(const a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(s=this._getOrReturnCtx(t,s),us(s,{code:qr.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),us(s,{code:qr.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?us(s,{code:qr.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):l&&us(s,{code:qr.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")FAt.test(t.data)||(s=this._getOrReturnCtx(t,s),us(s,{validation:"email",code:qr.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")aV||(aV=new RegExp(OAt,"u")),aV.test(t.data)||(s=this._getOrReturnCtx(t,s),us(s,{validation:"emoji",code:qr.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")kAt.test(t.data)||(s=this._getOrReturnCtx(t,s),us(s,{validation:"uuid",code:qr.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")TAt.test(t.data)||(s=this._getOrReturnCtx(t,s),us(s,{validation:"nanoid",code:qr.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")jAt.test(t.data)||(s=this._getOrReturnCtx(t,s),us(s,{validation:"cuid",code:qr.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")EAt.test(t.data)||(s=this._getOrReturnCtx(t,s),us(s,{validation:"cuid2",code:qr.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")_At.test(t.data)||(s=this._getOrReturnCtx(t,s),us(s,{validation:"ulid",code:qr.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),us(s,{validation:"url",code:qr.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),us(s,{validation:"regex",code:qr.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),us(s,{code:qr.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),us(s,{code:qr.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(s=this._getOrReturnCtx(t,s),us(s,{code:qr.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?MPe(a).test(t.data)||(s=this._getOrReturnCtx(t,s),us(s,{code:qr.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?UAt.test(t.data)||(s=this._getOrReturnCtx(t,s),us(s,{code:qr.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?zAt(a).test(t.data)||(s=this._getOrReturnCtx(t,s),us(s,{code:qr.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?PAt.test(t.data)||(s=this._getOrReturnCtx(t,s),us(s,{validation:"duration",code:qr.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?HAt(t.data,a.version)||(s=this._getOrReturnCtx(t,s),us(s,{validation:"ip",code:qr.invalid_string,message:a.message}),r.dirty()):a.kind==="jwt"?VAt(t.data,a.alg)||(s=this._getOrReturnCtx(t,s),us(s,{validation:"jwt",code:qr.invalid_string,message:a.message}),r.dirty()):a.kind==="cidr"?WAt(t.data,a.version)||(s=this._getOrReturnCtx(t,s),us(s,{validation:"cidr",code:qr.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?BAt.test(t.data)||(s=this._getOrReturnCtx(t,s),us(s,{validation:"base64",code:qr.invalid_string,message:a.message}),r.dirty()):a.kind==="base64url"?$At.test(t.data)||(s=this._getOrReturnCtx(t,s),us(s,{validation:"base64url",code:qr.invalid_string,message:a.message}),r.dirty()):da.assertNever(a);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(s=>t.test(s),{validation:n,code:qr.invalid_string,...Ds.errToObj(r)})}_addCheck(t){return new lm({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ds.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ds.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ds.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ds.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ds.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ds.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ds.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ds.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ds.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Ds.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Ds.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ds.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Ds.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,...Ds.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,...Ds.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Ds.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ds.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Ds.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ds.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ds.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ds.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ds.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ds.errToObj(n)})}nonempty(t){return this.min(1,Ds.errToObj(t))}trim(){return new lm({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new lm({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new lm({...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}}lm.create=e=>new lm({checks:[],typeName:oi.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...Ti(e)});function qAt(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 Vy extends $i{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)!==ws.number){const a=this._getOrReturnCtx(t);return us(a,{code:qr.invalid_type,expected:ws.number,received:a.parsedType}),si}let r;const s=new Du;for(const a of this._def.checks)a.kind==="int"?da.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),us(r,{code:qr.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),us(r,{code:qr.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),us(r,{code:qr.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?qAt(t.data,a.value)!==0&&(r=this._getOrReturnCtx(t,r),us(r,{code:qr.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),us(r,{code:qr.not_finite,message:a.message}),s.dirty()):da.assertNever(a);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ds.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ds.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ds.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ds.toString(n))}setLimit(t,n,r,s){return new Vy({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ds.toString(s)}]})}_addCheck(t){return new Vy({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ds.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ds.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ds.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ds.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ds.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ds.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ds.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ds.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ds.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"&&da.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)}}Vy.create=e=>new Vy({checks:[],typeName:oi.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Ti(e)});class Wy extends $i{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)!==ws.bigint)return this._getInvalidInput(t);let r;const s=new Du;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),us(r,{code:qr.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),us(r,{code:qr.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),us(r,{code:qr.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):da.assertNever(a);return{status:s.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return us(n,{code:qr.invalid_type,expected:ws.bigint,received:n.parsedType}),si}gte(t,n){return this.setLimit("min",t,!0,Ds.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ds.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ds.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ds.toString(n))}setLimit(t,n,r,s){return new Wy({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ds.toString(s)}]})}_addCheck(t){return new Wy({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ds.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ds.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ds.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ds.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ds.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}}Wy.create=e=>new Wy({checks:[],typeName:oi.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...Ti(e)});class SE extends $i{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ws.boolean){const r=this._getOrReturnCtx(t);return us(r,{code:qr.invalid_type,expected:ws.boolean,received:r.parsedType}),si}return bd(t.data)}}SE.create=e=>new SE({typeName:oi.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Ti(e)});class L3 extends $i{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ws.date){const a=this._getOrReturnCtx(t);return us(a,{code:qr.invalid_type,expected:ws.date,received:a.parsedType}),si}if(Number.isNaN(t.data.getTime())){const a=this._getOrReturnCtx(t);return us(a,{code:qr.invalid_date}),si}const r=new Du;let s;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(s=this._getOrReturnCtx(t,s),us(s,{code:qr.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),us(s,{code:qr.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):da.assertNever(a);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new L3({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ds.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ds.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}}L3.create=e=>new L3({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:oi.ZodDate,...Ti(e)});class tR extends $i{_parse(t){if(this._getType(t)!==ws.symbol){const r=this._getOrReturnCtx(t);return us(r,{code:qr.invalid_type,expected:ws.symbol,received:r.parsedType}),si}return bd(t.data)}}tR.create=e=>new tR({typeName:oi.ZodSymbol,...Ti(e)});class NE extends $i{_parse(t){if(this._getType(t)!==ws.undefined){const r=this._getOrReturnCtx(t);return us(r,{code:qr.invalid_type,expected:ws.undefined,received:r.parsedType}),si}return bd(t.data)}}NE.create=e=>new NE({typeName:oi.ZodUndefined,...Ti(e)});class AE extends $i{_parse(t){if(this._getType(t)!==ws.null){const r=this._getOrReturnCtx(t);return us(r,{code:qr.invalid_type,expected:ws.null,received:r.parsedType}),si}return bd(t.data)}}AE.create=e=>new AE({typeName:oi.ZodNull,...Ti(e)});class eN extends $i{constructor(){super(...arguments),this._any=!0}_parse(t){return bd(t.data)}}eN.create=e=>new eN({typeName:oi.ZodAny,...Ti(e)});class Jw extends $i{constructor(){super(...arguments),this._unknown=!0}_parse(t){return bd(t.data)}}Jw.create=e=>new Jw({typeName:oi.ZodUnknown,...Ti(e)});class f1 extends $i{_parse(t){const n=this._getOrReturnCtx(t);return us(n,{code:qr.invalid_type,expected:ws.never,received:n.parsedType}),si}}f1.create=e=>new f1({typeName:oi.ZodNever,...Ti(e)});class nR extends $i{_parse(t){if(this._getType(t)!==ws.undefined){const r=this._getOrReturnCtx(t);return us(r,{code:qr.invalid_type,expected:ws.void,received:r.parsedType}),si}return bd(t.data)}}nR.create=e=>new nR({typeName:oi.ZodVoid,...Ti(e)});class fm extends $i{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==ws.array)return us(n,{code:qr.invalid_type,expected:ws.array,received:n.parsedType}),si;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,l=n.data.length<s.exactLength.value;(o||l)&&(us(n,{code:o?qr.too_big:qr.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&&(us(n,{code:qr.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&&(us(n,{code:qr.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 nx(n,o,n.path,l)))).then(o=>Du.mergeArray(r,o));const a=[...n.data].map((o,l)=>s.type._parseSync(new nx(n,o,n.path,l)));return Du.mergeArray(r,a)}get element(){return this._def.type}min(t,n){return new fm({...this._def,minLength:{value:t,message:Ds.toString(n)}})}max(t,n){return new fm({...this._def,maxLength:{value:t,message:Ds.toString(n)}})}length(t,n){return new fm({...this._def,exactLength:{value:t,message:Ds.toString(n)}})}nonempty(t){return this.min(1,t)}}fm.create=(e,t)=>new fm({type:e,minLength:null,maxLength:null,exactLength:null,typeName:oi.ZodArray,...Ti(t)});function CC(e){if(e instanceof $o){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=$0.create(CC(r))}return new $o({...e._def,shape:()=>t})}else return e instanceof fm?new fm({...e._def,type:CC(e.element)}):e instanceof $0?$0.create(CC(e.unwrap())):e instanceof Gy?Gy.create(CC(e.unwrap())):e instanceof rx?rx.create(e.items.map(t=>CC(t))):e}class $o extends $i{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=da.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==ws.object){const u=this._getOrReturnCtx(t);return us(u,{code:qr.invalid_type,expected:ws.object,received:u.parsedType}),si}const{status:r,ctx:s}=this._processInputParams(t),{shape:a,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof f1&&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 nx(s,f,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof f1){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&&(us(s,{code:qr.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 nx(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=>Du.mergeObjectSync(r,u)):Du.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return Ds.errToObj,new $o({...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:Ds.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new $o({...this._def,unknownKeys:"strip"})}passthrough(){return new $o({...this._def,unknownKeys:"passthrough"})}extend(t){return new $o({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new $o({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:oi.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new $o({...this._def,catchall:t})}pick(t){const n={};for(const r of da.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new $o({...this._def,shape:()=>n})}omit(t){const n={};for(const r of da.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new $o({...this._def,shape:()=>n})}deepPartial(){return CC(this)}partial(t){const n={};for(const r of da.objectKeys(this.shape)){const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}return new $o({...this._def,shape:()=>n})}required(t){const n={};for(const r of da.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof $0;)a=a._def.innerType;n[r]=a}return new $o({...this._def,shape:()=>n})}keyof(){return RPe(da.objectKeys(this.shape))}}$o.create=(e,t)=>new $o({shape:()=>e,unknownKeys:"strip",catchall:f1.create(),typeName:oi.ZodObject,...Ti(t)});$o.strictCreate=(e,t)=>new $o({shape:()=>e,unknownKeys:"strict",catchall:f1.create(),typeName:oi.ZodObject,...Ti(t)});$o.lazycreate=(e,t)=>new $o({shape:e,unknownKeys:"strip",catchall:f1.create(),typeName:oi.ZodObject,...Ti(t)});class jE extends $i{_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 Gf(l.ctx.common.issues));return us(n,{code:qr.invalid_union,unionErrors:o}),si}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 Gf(c));return us(n,{code:qr.invalid_union,unionErrors:l}),si}}get options(){return this._def.options}}jE.create=(e,t)=>new jE({options:e,typeName:oi.ZodUnion,...Ti(t)});const sg=e=>e instanceof kE?sg(e.schema):e instanceof vm?sg(e.innerType()):e instanceof TE?[e.value]:e instanceof qy?e.options:e instanceof IE?da.objectValues(e.enum):e instanceof PE?sg(e._def.innerType):e instanceof NE?[void 0]:e instanceof AE?[null]:e instanceof $0?[void 0,...sg(e.unwrap())]:e instanceof Gy?[null,...sg(e.unwrap())]:e instanceof qae||e instanceof OE?sg(e.unwrap()):e instanceof FE?sg(e._def.innerType):[];class QB extends $i{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ws.object)return us(n,{code:qr.invalid_type,expected:ws.object,received:n.parsedType}),si;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}):(us(n,{code:qr.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),si)}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=sg(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 QB({typeName:oi.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:s,...Ti(r)})}}function pee(e,t){const n=dg(e),r=dg(t);if(e===t)return{valid:!0,data:e};if(n===ws.object&&r===ws.object){const s=da.objectKeys(t),a=da.objectKeys(e).filter(l=>s.indexOf(l)!==-1),o={...e,...t};for(const l of a){const c=pee(e[l],t[l]);if(!c.valid)return{valid:!1};o[l]=c.data}return{valid:!0,data:o}}else if(n===ws.array&&r===ws.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=pee(o,l);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return n===ws.date&&r===ws.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class EE extends $i{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=(a,o)=>{if(fee(a)||fee(o))return si;const l=pee(a.value,o.value);return l.valid?((hee(a)||hee(o))&&n.dirty(),{status:n.value,value:l.data}):(us(r,{code:qr.invalid_intersection_types}),si)};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}))}}EE.create=(e,t,n)=>new EE({left:e,right:t,typeName:oi.ZodIntersection,...Ti(n)});class rx extends $i{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ws.array)return us(r,{code:qr.invalid_type,expected:ws.array,received:r.parsedType}),si;if(r.data.length<this._def.items.length)return us(r,{code:qr.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),si;!this._def.rest&&r.data.length>this._def.items.length&&(us(r,{code:qr.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 nx(r,o,r.path,l)):null}).filter(o=>!!o);return r.common.async?Promise.all(a).then(o=>Du.mergeArray(n,o)):Du.mergeArray(n,a)}get items(){return this._def.items}rest(t){return new rx({...this._def,rest:t})}}rx.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new rx({items:e,typeName:oi.ZodTuple,rest:null,...Ti(t)})};class _E extends $i{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!==ws.object)return us(r,{code:qr.invalid_type,expected:ws.object,received:r.parsedType}),si;const s=[],a=this._def.keyType,o=this._def.valueType;for(const l in r.data)s.push({key:a._parse(new nx(r,l,r.path,l)),value:o._parse(new nx(r,r.data[l],r.path,l)),alwaysSet:l in r.data});return r.common.async?Du.mergeObjectAsync(n,s):Du.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof $i?new _E({keyType:t,valueType:n,typeName:oi.ZodRecord,...Ti(r)}):new _E({keyType:lm.create(),valueType:t,typeName:oi.ZodRecord,...Ti(n)})}}class rR extends $i{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!==ws.map)return us(r,{code:qr.invalid_type,expected:ws.map,received:r.parsedType}),si;const s=this._def.keyType,a=this._def.valueType,o=[...r.data.entries()].map(([l,c],u)=>({key:s._parse(new nx(r,l,r.path,[u,"key"])),value:a._parse(new nx(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 si;(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 si;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),l.set(u.value,d.value)}return{status:n.value,value:l}}}}rR.create=(e,t,n)=>new rR({valueType:t,keyType:e,typeName:oi.ZodMap,...Ti(n)});class D3 extends $i{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ws.set)return us(r,{code:qr.invalid_type,expected:ws.set,received:r.parsedType}),si;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(us(r,{code:qr.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&&(us(r,{code:qr.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 si;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 nx(r,c,r.path,u)));return r.common.async?Promise.all(l).then(c=>o(c)):o(l)}min(t,n){return new D3({...this._def,minSize:{value:t,message:Ds.toString(n)}})}max(t,n){return new D3({...this._def,maxSize:{value:t,message:Ds.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}D3.create=(e,t)=>new D3({valueType:e,minSize:null,maxSize:null,typeName:oi.ZodSet,...Ti(t)});class l4 extends $i{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ws.function)return us(n,{code:qr.invalid_type,expected:ws.function,received:n.parsedType}),si;function r(l,c){return eR({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,JM(),JS].filter(u=>!!u),issueData:{code:qr.invalid_arguments,argumentsError:c}})}function s(l,c){return eR({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,JM(),JS].filter(u=>!!u),issueData:{code:qr.invalid_return_type,returnTypeError:c}})}const a={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof tN){const l=this;return bd(async function(...c){const u=new Gf([]),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 bd(function(...c){const u=l._def.args.safeParse(c,a);if(!u.success)throw new Gf([r(c,u.error)]);const d=Reflect.apply(o,this,u.data),f=l._def.returns.safeParse(d,a);if(!f.success)throw new Gf([s(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new l4({...this._def,args:rx.create(t).rest(Jw.create())})}returns(t){return new l4({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new l4({args:t||rx.create([]).rest(Jw.create()),returns:n||Jw.create(),typeName:oi.ZodFunction,...Ti(r)})}}class kE extends $i{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})}}kE.create=(e,t)=>new kE({getter:e,typeName:oi.ZodLazy,...Ti(t)});class TE extends $i{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return us(n,{received:n.data,code:qr.invalid_literal,expected:this._def.value}),si}return{status:"valid",value:t.data}}get value(){return this._def.value}}TE.create=(e,t)=>new TE({value:e,typeName:oi.ZodLiteral,...Ti(t)});function RPe(e,t){return new qy({values:e,typeName:oi.ZodEnum,...Ti(t)})}class qy extends $i{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return us(n,{expected:da.joinValues(r),received:n.parsedType,code:qr.invalid_type}),si}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 us(n,{received:n.data,code:qr.invalid_enum_value,options:r}),si}return bd(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 qy.create(t,{...this._def,...n})}exclude(t,n=this._def){return qy.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}qy.create=RPe;class IE extends $i{_parse(t){const n=da.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==ws.string&&r.parsedType!==ws.number){const s=da.objectValues(n);return us(r,{expected:da.joinValues(s),received:r.parsedType,code:qr.invalid_type}),si}if(this._cache||(this._cache=new Set(da.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=da.objectValues(n);return us(r,{received:r.data,code:qr.invalid_enum_value,options:s}),si}return bd(t.data)}get enum(){return this._def.values}}IE.create=(e,t)=>new IE({values:e,typeName:oi.ZodNativeEnum,...Ti(t)});class tN extends $i{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ws.promise&&n.common.async===!1)return us(n,{code:qr.invalid_type,expected:ws.promise,received:n.parsedType}),si;const r=n.parsedType===ws.promise?n.data:Promise.resolve(n.data);return bd(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}tN.create=(e,t)=>new tN({type:e,typeName:oi.ZodPromise,...Ti(t)});class vm extends $i{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===oi.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=>{us(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 si;const c=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return c.status==="aborted"?si:c.status==="dirty"||n.value==="dirty"?RC(c.value):c});{if(n.value==="aborted")return si;const l=this._def.schema._parseSync({data:o,path:r.path,parent:r});return l.status==="aborted"?si:l.status==="dirty"||n.value==="dirty"?RC(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"?si:(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"?si:(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(!R3(o))return si;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=>R3(o)?Promise.resolve(s.transform(o.value,a)).then(l=>({status:n.value,value:l})):si);da.assertNever(s)}}vm.create=(e,t,n)=>new vm({schema:e,typeName:oi.ZodEffects,effect:t,...Ti(n)});vm.createWithPreprocess=(e,t,n)=>new vm({schema:t,effect:{type:"preprocess",transform:e},typeName:oi.ZodEffects,...Ti(n)});class $0 extends $i{_parse(t){return this._getType(t)===ws.undefined?bd(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}$0.create=(e,t)=>new $0({innerType:e,typeName:oi.ZodOptional,...Ti(t)});class Gy extends $i{_parse(t){return this._getType(t)===ws.null?bd(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Gy.create=(e,t)=>new Gy({innerType:e,typeName:oi.ZodNullable,...Ti(t)});class PE extends $i{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===ws.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}PE.create=(e,t)=>new PE({innerType:e,typeName:oi.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ti(t)});class FE extends $i{_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 CE(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Gf(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Gf(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}FE.create=(e,t)=>new FE({innerType:e,typeName:oi.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ti(t)});class sR extends $i{_parse(t){if(this._getType(t)!==ws.nan){const r=this._getOrReturnCtx(t);return us(r,{code:qr.invalid_type,expected:ws.nan,received:r.parsedType}),si}return{status:"valid",value:t.data}}}sR.create=e=>new sR({typeName:oi.ZodNaN,...Ti(e)});const GAt=Symbol("zod_brand");class qae extends $i{_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 Zk extends $i{_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"?si:a.status==="dirty"?(n.dirty(),RC(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"?si: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 Zk({in:t,out:n,typeName:oi.ZodPipeline})}}class OE extends $i{_parse(t){const n=this._def.innerType._parse(t),r=s=>(R3(s)&&(s.value=Object.freeze(s.value)),s);return CE(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}OE.create=(e,t)=>new OE({innerType:e,typeName:oi.ZodReadonly,...Ti(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 LPe(e,t={},n){return e?eN.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})}}):eN.create()}const KAt={object:$o.lazycreate};var oi;(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"})(oi||(oi={}));const YAt=(e,t={message:`Input not instance of ${e.name}`})=>LPe(n=>n instanceof e,t),DPe=lm.create,BPe=Vy.create,XAt=sR.create,QAt=Wy.create,$Pe=SE.create,ZAt=L3.create,JAt=tR.create,e8t=NE.create,t8t=AE.create,mee=eN.create,n8t=Jw.create,r8t=f1.create,s8t=nR.create,UPe=fm.create,fO=$o.create,i8t=$o.strictCreate,zPe=jE.create,a8t=QB.create,o8t=EE.create,HPe=rx.create,l8t=_E.create,c8t=rR.create,u8t=D3.create,d8t=l4.create,f8t=kE.create,h8t=TE.create,p8t=qy.create,m8t=IE.create,x8t=tN.create,ege=vm.create,g8t=$0.create,b8t=Gy.create,y8t=vm.createWithPreprocess,v8t=Zk.create,w8t=()=>DPe().optional(),C8t=()=>BPe().optional(),S8t=()=>$Pe().optional(),N8t={string:e=>lm.create({...e,coerce:!0}),number:e=>Vy.create({...e,coerce:!0}),boolean:e=>SE.create({...e,coerce:!0}),bigint:e=>Wy.create({...e,coerce:!0}),date:e=>L3.create({...e,coerce:!0})},A8t=si,tge=Object.freeze(Object.defineProperty({__proto__:null,BRAND:GAt,DIRTY:RC,EMPTY_PATH:AAt,INVALID:si,NEVER:A8t,OK:bd,ParseStatus:Du,Schema:$i,ZodAny:eN,ZodArray:fm,ZodBigInt:Wy,ZodBoolean:SE,ZodBranded:qae,ZodCatch:FE,ZodDate:L3,ZodDefault:PE,ZodDiscriminatedUnion:QB,ZodEffects:vm,ZodEnum:qy,ZodError:Gf,get ZodFirstPartyTypeKind(){return oi},ZodFunction:l4,ZodIntersection:EE,ZodIssueCode:qr,ZodLazy:kE,ZodLiteral:TE,ZodMap:rR,ZodNaN:sR,ZodNativeEnum:IE,ZodNever:f1,ZodNull:AE,ZodNullable:Gy,ZodNumber:Vy,ZodObject:$o,ZodOptional:$0,ZodParsedType:ws,ZodPipeline:Zk,ZodPromise:tN,ZodReadonly:OE,ZodRecord:_E,ZodSchema:$i,ZodSet:D3,ZodString:lm,ZodSymbol:tR,ZodTransformer:vm,ZodTuple:rx,ZodType:$i,ZodUndefined:NE,ZodUnion:jE,ZodUnknown:Jw,ZodVoid:nR,addIssueToContext:us,any:mee,array:UPe,bigint:QAt,boolean:$Pe,coerce:N8t,custom:LPe,date:ZAt,datetimeRegex:MPe,defaultErrorMap:JS,discriminatedUnion:a8t,effect:ege,enum:p8t,function:d8t,getErrorMap:JM,getParsedType:dg,instanceof:YAt,intersection:o8t,isAborted:fee,isAsync:CE,isDirty:hee,isValid:R3,late:KAt,lazy:f8t,literal:h8t,makeIssue:eR,map:c8t,nan:XAt,nativeEnum:m8t,never:r8t,null:t8t,nullable:b8t,number:BPe,object:fO,get objectUtil(){return dee},oboolean:S8t,onumber:C8t,optional:g8t,ostring:w8t,pipeline:v8t,preprocess:y8t,promise:x8t,quotelessJson:SAt,record:l8t,set:u8t,setErrorMap:NAt,strictObject:i8t,string:DPe,symbol:JAt,transformer:ege,tuple:HPe,undefined:e8t,union:zPe,unknown:n8t,get util(){return da},void:s8t},Symbol.toStringTag,{value:"Module"})),j8t=e=>e.message?e.message:"unspecified error";class nN extends fi{constructor(t){super(),this.code=GSt,this.errors=t,super.message=`Web3 validator found ${t.length} error[s]:
${this._compileErrors().join(`
`)}`}_compileErrors(){return this.errors.map(j8t)}}const E8t=["bool","int","uint","bytes","string","address","tuple"],VPe=e=>typeof e=="object"&&"type"in e&&"name"in e,Gae=e=>typeof e=="string",Aa=e=>typeof e=="string"&&/^((-)?0x[0-9a-f]+|(0x))$/i.test(e);function WPe(e,t){return!(typeof e!="string"||!e.match(/^0x[0-9A-Fa-f]*$/))}const iR=e=>typeof e=="number"||typeof e=="bigint"||typeof e=="string"&&/^((-0x|0x|-)?[0-9a-f]+|(0x))$/i.test(e);function Kae(e){if(typeof e!="string")throw new Error(`[isHexPrefixed] input must be type 'string', received type ${typeof e}`);return e.startsWith("0x")}const Yae=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()}`)},_8t=["hex","number","blockNumber","blockNumberOrTag","filter","bloom"],h5=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),E8t.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}},oV=(e,t={})=>{if(Object.keys(t).includes("type"))throw new nN([{keyword:"eth",message:'Either "eth" or "type" can be presented in schema',params:{eth:e},instancePath:"",schemaPath:""}]);const{baseType:r,baseTypeSize:s}=h5(e);if(!r&&!_8t.includes(e))throw new nN([{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}:{}},aR=(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=[];VPe(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}=h5(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=aR(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:aR(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:oV(a)},g>=0&&{minItems:g,maxItems:g});x.items.push(v)}else Array.isArray(x.items)?x.items.push(Object.assign({$id:o},oV(a))):x.items.push(Object.assign({$id:o},oV(a)));x=n}return n},Xae=e=>aR(e),Qae=(e,t)=>t===1?e:Qae(e[0],t-1),Zj=(e,t,n)=>{const r=[];for(const[s,a]of e.entries()){let o,l,c=[];VPe(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}=h5(o),x=Array.isArray(t)?t[s]:t[l];if(u==="tuple"&&!d)r.push(Zj(c,x,n));else if(u==="tuple"&&d){const g=[];for(const v of x)if(f.length>1){const w=Qae(v,f.length-1),C=[];for(const N of w)C.push(Zj(c,N,n));g.push(C)}else g.push(Zj(c,v,n));r.push(g)}else r.push(x)}return n=n??[],n.push(...r),n},qPe=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}`)},ZB=e=>{if(!Aa(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)},JB=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"&&Aa(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"&&!Aa(e))return JB(BigInt(e));throw new Bae(e)},oR=(e,t,n="0")=>{if(typeof e=="string"&&!Aa(e))return e.padStart(t,n);const r=typeof e=="string"&&Aa(e)?e:JB(e),[s,a]=r.startsWith("-")?["-0x",r.slice(3)]:["0x",r.slice(2)];return`${s}${a.padStart(t,n)}`};function A1(e){let t="0x";for(const n of e){const r=n.toString(16);t+=r.length===1?`0${r}`:r}return t}const Ux={zero:48,nine:57,A:65,F:70,a:97,f:102};function nge(e){if(e>=Ux.zero&&e<=Ux.nine)return e-Ux.zero;if(e>=Ux.A&&e<=Ux.F)return e-(Ux.A-10);if(e>=Ux.a&&e<=Ux.f)return e-(Ux.a-10)}function p5(e){let t=0;if(e.startsWith("0")&&(e[1]==="x"||e[1]==="X")&&(t=2),e.length%2!==0)throw new o4(`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 o4(`Invalid byte sequence ("${e[a-2]}${e[a-1]}" in "${e}").`);r[s]=o*16+l}return r}function e$(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 GPe=Object.freeze(Object.defineProperty({__proto__:null,abiSchemaToJsonSchema:aR,codePointToInt:qPe,ensureIfUint8Array:e$,ethAbiToJsonSchema:Xae,fetchArrayElement:Qae,hexToNumber:ZB,hexToUint8Array:p5,numberToHex:JB,padLeft:oR,parseBaseType:h5,transformJsonDataToAbiFormat:Zj,uint8ArrayToHexString:A1},Symbol.toStringTag,{value:"Module"})),xee=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"},c2=(e,t={abiType:"bytes"})=>{if(typeof e!="string"&&!Array.isArray(e)&&!xee(e)||typeof e=="string"&&Aa(e)&&e.startsWith("-")||typeof e=="string"&&!Aa(e))return!1;let n;if(typeof e=="string"){if(e.length%2!==0)return!1;n=p5(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}=h5(t.abiType);return r?n.length===r:!0}return t!=null&&t.size?n.length===(t==null?void 0:t.size):!0},KPe=e=>{if(!/^(0x)?[0-9a-f]{40}$/i.test(e))return!1;const t=e.slice(2),n=QS(t.toLowerCase()),r=A1(cd(e$(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},Xf=(e,t=!0)=>{if(typeof e!="string"&&!xee(e))return!1;let n;return xee(e)?n=A1(e):typeof e=="string"&&!Aa(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?KPe(n):!0:!1},B3=(e,t)=>{if(t===BigInt(0))return BigInt(1);let n=e;for(let r=1;r<t;r+=1)n*=e;return n},h1=(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}=h5(t.abiType);s&&(n=s)}else t.bitSize&&(n=t.bitSize);const r=B3(BigInt(2),BigInt(n??256))-BigInt(1);try{const s=typeof e=="string"&&Aa(e)?BigInt(ZB(e)):BigInt(e);return s>=0&&s<=r}catch{return!1}},ME=(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}=h5(t.abiType);if(o!=="int")return!1;a&&(n=a)}else t.bitSize&&(n=t.bitSize);const r=B3(BigInt(2),BigInt((n??256)-1)),s=BigInt(-1)*B3(BigInt(2),BigInt((n??256)-1));try{const a=typeof e=="string"&&Aa(e)?BigInt(ZB(e)):BigInt(e);return a>=s&&a<=r}catch{return!1}},YPe=e=>!!(ME(e)||typeof e=="string"&&/[0-9.]/.test(e)&&e.indexOf(".")===e.lastIndexOf(".")||typeof e=="number"),XPe=e=>h1(e),Rc=e=>Object.values(kg).includes(e),gee=e=>Rc(e)||XPe(e),RA=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)),t$=(e,t)=>{if(typeof t=="string"&&!Aa(t)||!RA(e))return!1;const n=typeof t=="string"?p5(t):t,r=A1(cd(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=qPe(e.charCodeAt(e.length-1-Math.floor(a/4))),l=1<<a%4;if((o&l)!==l)return!1}return!0},k8t=(e,t)=>{if(!RA(e)||!Xf(t))return!1;const n=oR(t,64);return t$(e,n)},T8t=(e,t)=>!RA(e)||!Xf(t)?!1:t$(e,t),I8t=e=>["number","string","boolean"].includes(typeof e)?typeof e=="boolean"?!0:typeof e=="string"&&!Aa(e)?e==="1"||e==="0":typeof e=="string"&&Aa(e)?e==="0x1"||e==="0x0":e===1||e===0:!1,xr=e=>e==null,rN=e=>typeof e=="object"&&!xr(e)&&!Array.isArray(e)&&!(e instanceof Lae),lR=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)),P8t=(e,t)=>!RA(e)||!lR(t)?!1:t$(e,t),F8t=e=>{const t=["fromBlock","toBlock","address","topics","blockHash"];if(xr(e)||typeof e!="object"||!Object.keys(e).every(n=>t.includes(n))||!xr(e.fromBlock)&&!gee(e.fromBlock)||!xr(e.toBlock)&&!gee(e.toBlock))return!1;if(!xr(e.address)){if(Array.isArray(e.address)){if(!e.address.every(n=>Xf(n)))return!1}else if(!Xf(e.address))return!1}return!(!xr(e.topics)&&!e.topics.every(n=>xr(n)?!0:Array.isArray(n)?n.every(r=>lR(r)):!!lR(n)))},$3={address:e=>Xf(e),bloom:e=>RA(e),blockNumber:e=>XPe(e),blockTag:e=>Rc(e),blockNumberOrTag:e=>gee(e),bool:e=>I8t(e),bytes:e=>c2(e),filter:e=>F8t(e),hex:e=>Aa(e),uint:e=>h1(e),int:e=>ME(e),number:e=>YPe(e),string:e=>Gae(e)};for(let e=8;e<=256;e+=8)$3[`int${e}`]=t=>ME(t,{bitSize:e}),$3[`uint${e}`]=t=>h1(t,{bitSize:e});for(let e=1;e<=32;e+=1)$3[`bytes${e}`]=t=>c2(t,{size:e});$3.bytes256=$3.bytes;const Cj=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=Cj(e.properties[n]);r&&(t[n]=r)}return Array.isArray(e.required)?fO(t).partial().required(e.required.reduce((n,r)=>Object.assign(Object.assign({},n),{[r]:!0}),{})):fO(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=Cj(s);a&&r.push(a)}return HPe(r)}const t=Array.isArray(e.items)?e.items[0]:e.items;let n=UPe(Cj(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 zPe(e.oneOf.map(t=>Cj(t)));if(e!=null&&e.format){if(!$3[e.format])throw new tAt(e.format);return mee().refine($3[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)]():fO({data:mee()}).partial()};class LC{static factory(){return LC.validatorInstance||(LC.validatorInstance=new LC),LC.validatorInstance}validate(t,n,r){var s,a;const l=Cj(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 nN(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===qr.too_big)a="maxItems",l=`${u}/maxItems`,o={limit:n.maximum},s=`must NOT have more than ${n.maximum} items`;else if(n.code===qr.too_small)a="minItems",l=`${u}/minItems`,o={limit:n.minimum},s=`must NOT have fewer than ${n.minimum} items`;else if(n.code===qr.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 O8t{constructor(){this._validator=LC.factory()}validateJSONSchema(t,n,r){return this._validator.validate(t,n,r)}validate(t,n,r={silent:!1}){var s,a;const o=Xae(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 nN([{instancePath:"/0",schemaPath:"/",keyword:"required",message:"empty schema against data can not be validated",params:n}]);return this._validator.validate(o,n,r)}}}const Gs=new O8t;function u2(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 yd(...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 n$(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 r$={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")},bee="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",sx=e=>{if(Gs.validate(["bytes"],[e]),u2(e))return e;if(Array.isArray(e))return new Uint8Array(e);if(typeof e=="string")return p5(e);throw new o4(e)},{uint8ArrayToHexString:M8t}=GPe,qi=e=>M8t(sx(e)),lo=e=>typeof e=="string"&&e.slice(0,2).toLowerCase()!=="0x"?sx(`0x${e}`):sx(e),Jk=e=>(Gs.validate(["hex"],[e]),ZB(e)),R8t=Jk,nc=(e,t)=>{typeof e!="bigint"&&Gs.validate(["int"],[e]);let n=JB(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},L8t=nc,D8t=e=>Jk(e).toString(),wm=e=>{Gs.validate(["string"],[e]);let t=e.replace(/^(?:\u0000)/,"");return t=t.replace(/(?:\u0000)$/,""),qi(new TextEncoder().encode(t))},QPe=wm,B8t=wm,s$=e=>IPe(lo(e)),$8t=e=>typeof e=="string"?s$(e):(Gs.validate(["bytes"],[e]),IPe(e)),Zae=QS,U8t=s$,ZPe=e=>{Gs.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}`},z8t=ZPe,JPe=e=>new TextDecoder("ascii").decode(lo(e)),H8t=JPe,p1=(e,t)=>{if(typeof e=="string"&&Xf(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":nc(e);if(typeof e=="bigint")return t?"bigint":nc(e);if(u2(e))return t?"bytes":qi(e);if(typeof e=="object"&&e)return t?"string":wm(JSON.stringify(e));if(typeof e=="string"){if(e.startsWith("-0x")||e.startsWith("-0X"))return t?"int256":nc(e);if(Aa(e))return t?"bytes":e;if(iR(e)&&!ME(e)&&!h1(e))return t?"bytes":`0x${e}`;if(iR(e)&&!ME(e)&&h1(e))return t?"uint":nc(e);if(!Number.isFinite(e))return t?"string":wm(e)}throw new DNt(e)},Zd=e=>{if(typeof e=="number")return e>1e20?(console.warn(bee),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"&&Aa(e))return Jk(e);try{return Zd(BigInt(e))}catch{throw new Bae(e)}},Xv=e=>{if(typeof e=="number")return BigInt(e);if(typeof e=="bigint")return e;if(typeof e=="string"&&iR(e))return e.startsWith("-")?-BigInt(e.substring(1)):BigInt(e);throw new Bae(e)},V8t=(e,t)=>{let n;if(typeof t=="string"){if(n=r$[t],!n)throw new vPe(t)}else{if(t<0||!Number.isInteger(t))throw new wPe(t);n=B3(BigInt(10),BigInt(t))}const r=String(Zd(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)},W8t=(e,t)=>{Gs.validate(["number"],[e]);let n;if(typeof t=="string"){if(n=r$[t],!n)throw new vPe(t)}else{if(t<0||!Number.isInteger(t))throw new wPe(t);n=B3(BigInt(10),BigInt(t))}let r=e;typeof r=="number"&&(r<1e-15&&console.warn(bee),r>1e20?(console.warn(bee),r=BigInt(r)):r=r.toLocaleString("fullwide",{useGrouping:!1,maximumFractionDigits:20}));const[s,a]=String(typeof r=="string"&&!Aa(r)?r:Zd(r)).split(".").concat(""),l=BigInt(`${s}${a}`)*n,c=a.length;return c===0?l.toString():l.toString().slice(0,-c)},fx=e=>{if(!Xf(e,!1))throw new $ae(e);const t=e.toLowerCase().replace(/^0x/i,""),n=A1(cd(e$(Zae(t))));if(xr(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},eFe=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"&&!Aa(e)&&(e==="1"||e==="0"||e==="false"||e==="true"))return e==="true"?!0:e==="false"?!1:!!Number(e);if(typeof e=="string"&&Aa(e)&&(e==="0x1"||e==="0x0"))return!!Zd(e);throw new Uae(e)};let Jae=class extends Lie{constructor(){super(...arguments),this.maxListeners=Number.MAX_SAFE_INTEGER}setMaxListeners(t){return this.maxListeners=t,this}getMaxListeners(){return this.maxListeners}};const q8t=Aa,G8t=iR,K8t=KPe,Y8t=Xf,X8t=RA,Q8t=t$,Z8t=k8t,J8t=T8t,e7t=lR,t7t=P8t,n7t=(e,t)=>{const n=typeof e=="string"&&Rc(e),r=typeof t=="string"&&Rc(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={[kg.EARLIEST]:1,[kg.FINALIZED]:2,[kg.SAFE]:3,[kg.LATEST]:4,[kg.PENDING]:5};return o[e]<o[t]?-1:1}if(n&&!r||!n&&r)throw new $Nt("Cannot compare blocktag with provided non-blocktag input.");const s=BigInt(e),a=BigInt(t);return s<a?-1:s===a?0:1},py=e=>typeof e=="object"&&!xr(e)&&Object.keys(e).length!==0&&["input","data","from","gas","gasPrice","gasLimit","address","jsonInterface","syncWithContext","dataInputFill"].some(t=>t in e),ri=xr,rge=e=>typeof e=="object"&&!xr(e)&&!Array.isArray(e)&&!(e instanceof Lae),d2=(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]=d2(n[s],r[s])):!xr(r[s])&&Object.hasOwnProperty.call(r,s)&&(Array.isArray(r[s])||r[s]instanceof Lae?n[s]=r[s].slice(0):n[s]=r[s]);return n},sN=(e,t,n="0")=>typeof e=="string"?Aa(e)?oR(e,t,n):e.padStart(t,n):(Gs.validate(["int"],[e]),oR(e,t,n)),tFe=(e,t,n="0")=>{if(typeof e=="string"&&!Aa(e))return e.padEnd(t,n);const r=typeof e=="string"&&Aa(e)?e:nc(e),s=r.startsWith("-")?3:2;return Gs.validate([r.startsWith("-")?"int":"uint"],[e]),r.padEnd(t+s,n)},nFe=tFe,RE=sN,rFe=(e,t=64)=>{Gs.validate(["int"],[e]);const n=Zd(e);if(n>=0)return sN(p1(n),t);const r=B3(BigInt(2),BigInt(t*4));if(-n>=r)throw new CPe(`value: ${e}, nibbleWidth: ${t}`);const a=BigInt(n)+r;return sN(nc(a),t)},r7t=(e,t=64)=>{Gs.validate(["int"],[e]);const n=Zd(e);if(n<0)return n;const r=Math.ceil(Math.log(Number(n))/Math.log(2));if(r>t*4)throw new CPe(`value: "${e}", nibbleWidth: "${t}"`);if(t*4!==r)return n;const s=B3(BigInt(2),BigInt(t)*BigInt(4));return Zd(BigInt(n)-s)},{parseBaseType:s7t}=GPe,fg=e=>typeof e=="object"&&!xr(e)&&"number"in e&&"bytes"in e,i7t=(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&&rN(r.items)?r=r.items:r.items&&Array.isArray(r.items)&&(r=r.items[parseInt(a,10)]),r&&a&&(s=a)}return r},LE=(e,t,n)=>{try{const{baseType:r,baseTypeSize:s}=s7t(t);if(r==="int"||r==="uint")switch(n.number){case Qh.NUMBER:return Number(Xv(e));case Qh.HEX:return nc(Xv(e));case Qh.STR:return Xv(e).toString();case Qh.BIGINT:return Xv(e);default:throw new lee(`Invalid format: ${String(n.number)}`)}if(r==="bytes"){let a;switch(s?typeof e=="string"?a=sN(e,s*2):u2(e)&&(a=yd(new Uint8Array(s-e.length),e)):a=e,n.bytes){case d1.HEX:return qi(sx(a));case d1.UINT8ARRAY:return sx(a);default:throw new lee(`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]))}),xr(d==null?void 0:d.items))return delete r[s],a.pop(),!0;if(rN(d.items)&&!xr(d.items.format)){for(let f=0;f<e.length;f+=1)r[s][f]=LE(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)i$(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]=LE(e[f],d.items[f].format,o);return a.pop(),!0}}return!1},i$=(e,t,n,r,s=[])=>{var a;if(!rN(e)&&!Array.isArray(e))return LE(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=i7t(t,n,s);if(xr(u)){delete o[l],n.pop();continue}if(rN(c)){i$(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]=LE(c,u.format,r),n.pop()}}return o},Wr=(e,t,n=hd)=>{let r;rN(t)?r=d2({},t):Array.isArray(t)?r=[...t]:r=t;const s=rN(e)?e:Xae(e);if(!s.properties&&!s.items&&!s.format)throw new lee("Invalid json schema for formatting");return i$(r,s,[],n)},sFe="0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",iN=e=>{let t;return typeof e=="bigint"||typeof e=="number"?t=QS(e.toString()):Array.isArray(e)?t=new Uint8Array(e):typeof e=="string"&&!Aa(e)?t=QS(e):t=sx(e),qi(cd(e$(t)))},eT=e=>{let t;typeof e=="string"?e.startsWith("0x")&&Aa(e)?t=lo(e):t=QS(e):t=e;const n=iN(t);return n===sFe?void 0:n},Qf=e=>{const t=eT(e);return xr(t)?sFe:t},a7t=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=p1(e,!0),n=p1(e),!t.startsWith("int")&&!t.startsWith("uint")&&(t="bytes")}return(t.startsWith("int")||t.startsWith("uint"))&&typeof n=="string"&&!/^(-)?0x/i.test(n)&&(n=Xv(n)),[t,n]},o7t=e=>e.startsWith("int[")?`int256${e.slice(3)}`:e==="int"?"int256":e.startsWith("uint[")?`uint256'${e.slice(4)}`:e==="uint"?"uint256":e,lV=(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 wm(t);throw new LNt(t)}if(e==="bool"||e==="boolean"){if(typeof t=="boolean")return t?"01":"00";throw new Uae(t)}if(e==="address"){if(!Xf(n))throw new $ae(n);return n}const r=o7t(e);if(e.startsWith("uint")){const s=lV(r,4);if(s%8||s<8||s>256)throw new Hxe(n);const a=Zd(n);if(ige(a)>s)throw new Vxe(n);if(a<BigInt(0))throw new BNt(n);return s?RE(a.toString(16),s/8*2):a.toString(16)}if(e.startsWith("int")){const s=lV(r,3);if(s%8||s<8||s>256)throw new Hxe(e);const a=Zd(n);if(ige(a)>s)throw new Vxe(n);return a<BigInt(0)?rFe(a.toString(),s/8*2):s?RE(a.toString(16),s/4):a.toString(16)}if(r==="bytes"){if(n.replace(/^0x/i,"").length%2!==0)throw new o4(n);return n}if(e.startsWith("bytes")){if(n.replace(/^0x/i,"").length%2!==0)throw new o4(n);const s=lV(e,5);if(!s||s<1||s>64||s<n.replace(/^0x/i,"").length/2)throw new o4(n);return nFe(n,s*2)}return""},iFe=e=>{const[t,n]=a7t(e);return Array.isArray(n)?n.map(a=>age(t,a).replace("0x","")).join(""):age(t,n).replace("0x","")},eoe=(...e)=>`0x${e.map(iFe).join("").toLowerCase()}`,l7t=(...e)=>eT(eoe(...e)),c7t=(...e)=>Qf(eoe(...e)),u7t=e=>eT(`0x${(typeof e=="number"?e.toString():e).padStart(64,"0")}`);function d7t(e){return EPe(e)}const DE=e=>d7t(e),f7t=e=>qi(DE(e));var a$=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 aFe(e){return(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function oFe(e,t,n){return a$(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 toe(e,t){let n;return[new Promise((s,a)=>{n=setInterval(function o(){return a$(this,void 0,void 0,function*(){try{const l=yield oFe(e,t);xr(l)||(clearInterval(n),s(l))}catch(l){clearInterval(n),a(l)}}),o}(),t)}),n]}function h7t(e,t){return a$(this,void 0,void 0,function*(){return toe(e,t)[0]})}function noe(e,t){let n;const r=new Promise((s,a)=>{n=setTimeout(()=>{a(t)},e)});return[n,r]}function lFe(e,t){let n;const r=new Promise((s,a)=>{n=setInterval(()=>{a$(this,void 0,void 0,function*(){const o=yield e();o&&(clearInterval(n),a(o))})},t)});return[n,r]}const roe=()=>{const e=DE(16);e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=qi(e);return[t.substring(2,10),t.substring(10,14),t.substring(14,18),t.substring(18,22),t.substring(22,34)].join("-")},soe=e=>{const t=e.error.code;return gd.has(t)||t>=-32099&&t<=-32e3},jy=e=>!Array.isArray(e)&&!!e&&e.jsonrpc==="2.0"&&"result"in e&&xr(e.error)&&(typeof e.id=="number"||typeof e.id=="string"),Ey=e=>!Array.isArray(e)&&e.jsonrpc==="2.0"&&!!e&&xr(e.result)&&"error"in e&&(typeof e.id=="number"||typeof e.id=="string"),o$=e=>!Array.isArray(e)&&!!e&&e.jsonrpc==="2.0"&&!xr(e.params)&&!xr(e.method),cFe=e=>!Array.isArray(e)&&!!e&&e.jsonrpc==="2.0"&&"id"in e&&"result"in e,cR=e=>jy(e)||Ey(e),ioe=e=>Array.isArray(e)?e.every(cR):cR(e),BE=e=>Array.isArray(e)&&e.length>0&&ioe(e);let hO;const uFe=e=>{hO=e},U3=e=>{var t,n,r,s;return typeof hO<"u"&&(hO+=1),{jsonrpc:(t=e.jsonrpc)!==null&&t!==void 0?t:"2.0",id:(r=(n=e.id)!==null&&n!==void 0?n:hO)!==null&&r!==void 0?r:roe(),method:e.method,params:(s=e.params)!==null&&s!==void 0?s:void 0}},aoe=e=>e.map(t=>U3(t)),s0=e=>Array.isArray(e)&&e.length>0,p7t=Object.freeze(Object.defineProperty({__proto__:null,isBatchRequest:s0,isBatchResponse:BE,isResponseRpcError:soe,isResponseWithError:Ey,isResponseWithNotification:o$,isResponseWithResult:jy,isSubscriptionResult:cFe,isValidResponse:ioe,setRequestIdStart:uFe,toBatchPayload:aoe,toPayload:U3,validateResponse:cR},Symbol.toStringTag,{value:"Module"}));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())})},dFe;class uR{constructor({timeout:t,eagerStart:n,timeoutMessage:r}={timeout:0,eagerStart:!1,timeoutMessage:"DeferredPromise timed out"}){this[dFe]="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 cV(this,void 0,void 0,function*(){return this._promise.then(t,n)})}catch(t){return cV(this,void 0,void 0,function*(){return this._promise.catch(t)})}finally(t){return cV(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 fPe(this._timeoutMessage))}_clearTimeout(){this._timeoutId&&clearTimeout(this._timeoutId)}}dFe=Symbol.toStringTag;class fFe{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 XB({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 ooe extends Xk{constructor(){super(...arguments),this._eventEmitter=new Lie,this._chainId="",this._accounts=[]}_getChainId(){return oge(this,void 0,void 0,function*(){var t;const n=yield this.request(U3({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(U3({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 zNt(t,n))}_onAccountsChanged(){this._eventEmitter.emit("accountsChanged",this._accounts)}}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())})};const m7t={autoReconnect:!0,delay:5e3,maxAttempts:5},x7t=1e3;class hFe extends ooe{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 cee(t);this._socketPath=t,this._socketOptions=n,this._reconnectOptions=Object.assign(Object.assign({},m7t),r??{}),this._pendingRequestsQueue=new Map,this._sentRequestsQueue=new Map,this._init(),this.connect(),this.chunkResponseParser=new fFe(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 Qk(`Error while connecting to ${this._socketPath}. Reason: ${t.message}`):new cee(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??x7t;this._removeSocketListeners(),this.getStatus()!=="disconnected"&&this._closeSocketConnection(r,n),this._onDisconnect(r,n)}safeDisconnect(t,n){return uV(this,arguments,void 0,function*(r,s,a=!1,o=1e3){let l=0;yield uV(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 rNt),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 nNt(this._reconnectOptions.maxAttempts))))}request(t){return uV(this,void 0,void 0,function*(){if(ri(this._socketConnection))throw new Error("Connection is undefined");this.getStatus()==="disconnected"&&this.connect();const n=s0(t)?t[0].id:t.id;if(!n)throw new uNt("Request Id not defined");if(this._sentRequestsQueue.has(n))throw new sNt(n);const r=new uR;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(!(ri(n)||n.length===0))for(const r of n){if(o$(r)&&r.method.endsWith("_subscription")){this._eventEmitter.emit("message",r);return}const s=BE(r)?r[0].id:r.id,a=this._sentRequestsQueue.get(s);if(!a)return;(BE(r)||jy(r)||Ey(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 oee(t)),this._pendingRequestsQueue.delete(r)}),this._sentRequestsQueue.size>0&&this._sentRequestsQueue.forEach((n,r)=>{n.deferredPromise.reject(new oee(t)),this._sentRequestsQueue.delete(r)}),this._removeSocketListeners()}}const pFe=Object.freeze(Object.defineProperty({__proto__:null,ChunkResponseParser:fFe,Eip1193Provider:ooe,EventEmitter:Jae,SocketProvider:hFe,Web3DeferredPromise:uR,asciiToHex:ZPe,bytesToHex:qi,bytesToUint8Array:sx,checkAddressCheckSum:K8t,compareBlockNumbers:n7t,convert:i$,convertScalarValue:LE,encodePacked:eoe,ethUnitMap:r$,format:Wr,fromAscii:z8t,fromDecimal:L8t,fromTwosComplement:r7t,fromUtf8:QPe,fromWei:V8t,getStorageSlotNumForLongString:u7t,hexToAscii:JPe,hexToBytes:lo,hexToNumber:Jk,hexToNumberString:D8t,hexToString:U8t,hexToUtf8:s$,isAddress:Y8t,isBatchRequest:s0,isBatchResponse:BE,isBloom:X8t,isContractAddressInBloom:J8t,isContractInitOptions:py,isDataFormat:fg,isHex:G8t,isHexStrict:q8t,isInBloom:Q8t,isNullish:ri,isPromise:aFe,isResponseRpcError:soe,isResponseWithError:Ey,isResponseWithNotification:o$,isResponseWithResult:jy,isSubscriptionResult:cFe,isTopic:e7t,isTopicInBloom:t7t,isUint8Array:u2,isUserEthereumAddressInBloom:Z8t,isValidResponse:ioe,jsonRpc:p7t,keccak256:iN,keccak256Wrapper:iN,leftPad:RE,mergeDeep:d2,numberToHex:nc,padLeft:sN,padRight:tFe,pollTillDefined:h7t,pollTillDefinedAndReturnIntervalId:toe,processSolidityEncodePackedArgs:iFe,randomBytes:DE,randomHex:f7t,rejectIfConditionAtInterval:lFe,rejectIfTimeout:noe,rightPad:nFe,setRequestIdStart:uFe,sha3:eT,sha3Raw:Qf,soliditySha3:l7t,soliditySha3Raw:c7t,stringToHex:B8t,toAscii:H8t,toBatchPayload:aoe,toBigInt:Xv,toBool:eFe,toChecksumAddress:fx,toDecimal:R8t,toHex:p1,toNumber:Zd,toPayload:U3,toTwosComplement:rFe,toUtf8:$8t,toWei:W8t,uint8ArrayConcat:yd,uint8ArrayEquals:n$,utf8ToBytes:Zae,utf8ToHex:wm,uuidV4:roe,validateResponse:cR,waitWithTimeout:oFe},Symbol.toStringTag,{value:"Module"}));class l${constructor(){this._emitter=new Jae}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 z3;(function(e){e.CONFIG_CHANGE="CONFIG_CHANGE"})(z3||(z3={}));class g7t extends l${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:p1(25e8),enableExperimentalFeatures:{useSubscriptionWhenCheckingBlockTimeout:!1,useRpcCallSpecification:!1},transactionBuilder:void 0,transactionTypeParser:void 0,customTransactionSchema:void 0,defaultReturnFormat:hd,ignoreGasPricing:!1},this.setConfig(t??{})}setConfig(t){const n=Object.keys(t);for(const r of n)this._triggerConfigChange(r,t[r]),!ri(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(!ri(this.config.defaultCommon)&&!ri(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(!ri(this.config.defaultCommon)&&!ri(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(!ri(this.config.defaultHardfork)&&!ri(t)&&!ri(t.hardfork)&&this.config.defaultHardfork!==t.hardfork)throw new qxe(this.config.defaultHardfork,t.hardfork);if(!ri(this.config.defaultChain)&&!ri(t)&&!ri(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(z3.CONFIG_CHANGE,{name:t,oldValue:this.config[t],newValue:n})}}var uP={exports:{}},lge;function b7t(){return lge||(lge=1,function(e,t){var n=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof Iu<"u"&&Iu,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(Q){return Q&&DataView.prototype.isPrototypeOf(Q)}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(Q){return Q&&d.indexOf(Object.prototype.toString.call(Q))>-1};function x(Q){if(typeof Q!="string"&&(Q=String(Q)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(Q)||Q==="")throw new TypeError('Invalid character in header field name: "'+Q+'"');return Q.toLowerCase()}function g(Q){return typeof Q!="string"&&(Q=String(Q)),Q}function v(Q){var ie={next:function(){var oe=Q.shift();return{done:oe===void 0,value:oe}}};return c.iterable&&(ie[Symbol.iterator]=function(){return ie}),ie}function w(Q){this.map={},Q instanceof w?Q.forEach(function(ie,oe){this.append(oe,ie)},this):Array.isArray(Q)?Q.forEach(function(ie){this.append(ie[0],ie[1])},this):Q&&Object.getOwnPropertyNames(Q).forEach(function(ie){this.append(ie,Q[ie])},this)}w.prototype.append=function(Q,ie){Q=x(Q),ie=g(ie);var oe=this.map[Q];this.map[Q]=oe?oe+", "+ie:ie},w.prototype.delete=function(Q){delete this.map[x(Q)]},w.prototype.get=function(Q){return Q=x(Q),this.has(Q)?this.map[Q]:null},w.prototype.has=function(Q){return this.map.hasOwnProperty(x(Q))},w.prototype.set=function(Q,ie){this.map[x(Q)]=g(ie)},w.prototype.forEach=function(Q,ie){for(var oe in this.map)this.map.hasOwnProperty(oe)&&Q.call(ie,this.map[oe],oe,this)},w.prototype.keys=function(){var Q=[];return this.forEach(function(ie,oe){Q.push(oe)}),v(Q)},w.prototype.values=function(){var Q=[];return this.forEach(function(ie){Q.push(ie)}),v(Q)},w.prototype.entries=function(){var Q=[];return this.forEach(function(ie,oe){Q.push([oe,ie])}),v(Q)},c.iterable&&(w.prototype[Symbol.iterator]=w.prototype.entries);function C(Q){if(Q.bodyUsed)return Promise.reject(new TypeError("Already read"));Q.bodyUsed=!0}function N(Q){return new Promise(function(ie,oe){Q.onload=function(){ie(Q.result)},Q.onerror=function(){oe(Q.error)}})}function P(Q){var ie=new FileReader,oe=N(ie);return ie.readAsArrayBuffer(Q),oe}function I(Q){var ie=new FileReader,oe=N(ie);return ie.readAsText(Q),oe}function R(Q){for(var ie=new Uint8Array(Q),oe=new Array(ie.length),G=0;G<ie.length;G++)oe[G]=String.fromCharCode(ie[G]);return oe.join("")}function O(Q){if(Q.slice)return Q.slice(0);var ie=new Uint8Array(Q.byteLength);return ie.set(new Uint8Array(Q)),ie.buffer}function U(){return this.bodyUsed=!1,this._initBody=function(Q){this.bodyUsed=this.bodyUsed,this._bodyInit=Q,Q?typeof Q=="string"?this._bodyText=Q:c.blob&&Blob.prototype.isPrototypeOf(Q)?this._bodyBlob=Q:c.formData&&FormData.prototype.isPrototypeOf(Q)?this._bodyFormData=Q:c.searchParams&&URLSearchParams.prototype.isPrototypeOf(Q)?this._bodyText=Q.toString():c.arrayBuffer&&c.blob&&u(Q)?(this._bodyArrayBuffer=O(Q.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(Q)||f(Q))?this._bodyArrayBuffer=O(Q):this._bodyText=Q=Object.prototype.toString.call(Q):this._bodyText="",this.headers.get("content-type")||(typeof Q=="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(Q)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},c.blob&&(this.blob=function(){var Q=C(this);if(Q)return Q;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 Q=C(this);return Q||(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(P)}),this.text=function(){var Q=C(this);if(Q)return Q;if(this._bodyBlob)return I(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(Q){var ie=Q.toUpperCase();return L.indexOf(ie)>-1?ie:Q}function X(Q,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(Q instanceof X){if(Q.bodyUsed)throw new TypeError("Already read");this.url=Q.url,this.credentials=Q.credentials,ie.headers||(this.headers=new w(Q.headers)),this.method=Q.method,this.mode=Q.mode,this.signal=Q.signal,!oe&&Q._bodyInit!=null&&(oe=Q._bodyInit,Q.bodyUsed=!0)}else this.url=String(Q);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(Q){var ie=new FormData;return Q.trim().split("&").forEach(function(oe){if(oe){var G=oe.split("="),V=G.shift().replace(/\+/g," "),te=G.join("=").replace(/\+/g," ");ie.append(decodeURIComponent(V),decodeURIComponent(te))}}),ie}function J(Q){var ie=new w,oe=Q.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(":"),te=V.shift().trim();if(te){var ae=V.join(":").trim();ie.append(te,ae)}}),ie}U.call(X.prototype);function K(Q,ie){if(!(this instanceof K))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(Q)}U.call(K.prototype),K.prototype.clone=function(){return new K(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new w(this.headers),url:this.url})},K.error=function(){var Q=new K(null,{status:0,statusText:""});return Q.type="error",Q};var re=[301,302,303,307,308];K.redirect=function(Q,ie){if(re.indexOf(ie)===-1)throw new RangeError("Invalid status code");return new K(null,{status:ie,headers:{location:Q}})},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(Q,ie){return new Promise(function(oe,G){var V=new X(Q,ie);if(V.signal&&V.signal.aborted)return G(new o.DOMException("Aborted","AbortError"));var te=new XMLHttpRequest;function ae(){te.abort()}te.onload=function(){var Ne={status:te.status,statusText:te.statusText,headers:J(te.getAllResponseHeaders()||"")};Ne.url="responseURL"in te?te.responseURL:Ne.headers.get("X-Request-URL");var me="response"in te?te.response:te.responseText;setTimeout(function(){oe(new K(me,Ne))},0)},te.onerror=function(){setTimeout(function(){G(new TypeError("Network request failed"))},0)},te.ontimeout=function(){setTimeout(function(){G(new TypeError("Network request failed"))},0)},te.onabort=function(){setTimeout(function(){G(new o.DOMException("Aborted","AbortError"))},0)};function fe(Ne){try{return Ne===""&&l.location.href?l.location.href:Ne}catch{return Ne}}te.open(V.method,fe(V.url),!0),V.credentials==="include"?te.withCredentials=!0:V.credentials==="omit"&&(te.withCredentials=!1),"responseType"in te&&(c.blob?te.responseType="blob":c.arrayBuffer&&V.headers.get("Content-Type")&&V.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(te.responseType="arraybuffer")),ie&&typeof ie.headers=="object"&&!(ie.headers instanceof w)?Object.getOwnPropertyNames(ie.headers).forEach(function(Ne){te.setRequestHeader(Ne,g(ie.headers[Ne]))}):V.headers.forEach(function(Ne,me){te.setRequestHeader(me,Ne)}),V.signal&&(V.signal.addEventListener("abort",ae),te.onreadystatechange=function(){te.readyState===4&&V.signal.removeEventListener("abort",ae)}),te.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=K),o.Headers=w,o.Request=X,o.Response=K,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}(uP,uP.exports)),uP.exports}var y7t=b7t();const v7t=Ii(y7t);var w7t=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 c$ extends Xk{constructor(t,n){if(super(),!c$.validateClientUrl(t))throw new cee(t);this.clientUrl=t,this.httpProviderOptions=n}static validateClientUrl(t){return typeof t=="string"?/^http(s)?:\/\//i.test(t):!1}getStatus(){throw new $x}supportsSubscriptions(){return!1}request(t,n){var r;return w7t(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 v7t(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 N0(yield a.json(),void 0,void 0,a.status);return yield a.json()})}on(){throw new $x}removeListener(){throw new $x}once(){throw new $x}removeAllListeners(){throw new $x}connect(){throw new $x}disconnect(){throw new $x}reset(){throw new $x}reconnect(){throw new $x}}var SC=null;typeof WebSocket<"u"?SC=WebSocket:typeof MozWebSocket<"u"?SC=MozWebSocket:typeof global<"u"?SC=global.WebSocket||global.MozWebSocket:typeof window<"u"?SC=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(SC=self.WebSocket||self.MozWebSocket);const C7t=SC;class mFe extends hFe{constructor(t,n,r){super(t,n,r)}_validateProviderPath(t){return typeof t=="string"?/^ws(s)?:\/\//i.test(t):!1}getStatus(){if(this._socketConnection&&!ri(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 C7t(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 oee;(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 xFe=e=>Xk.isWeb3Provider(e),gFe=e=>typeof e!="string"&&"request"in e&&e.request.constructor.name==="Function",bFe=e=>typeof e!="string"&&"request"in e&&e.request.constructor.name==="AsyncFunction",yFe=e=>typeof e!="string"&&"send"in e,vFe=e=>typeof e!="string"&&"sendAsync"in e,dR=e=>e&&(xFe(e)||bFe(e)||gFe(e)||vFe(e)||yFe(e)),S7t=e=>e&&"supportsSubscriptions"in e?e.supportsSubscriptions():!!(e&&typeof e!="string"&&"on"in e);var dV=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())})},aN;(function(e){e.PROVIDER_CHANGED="PROVIDER_CHANGED",e.BEFORE_PROVIDER_CHANGE="BEFORE_PROVIDER_CHANGE"})(aN||(aN={}));const cge={HttpProvider:c$,WebsocketProvider:mFe};class e3 extends l${constructor(t,n,r){super(),ri(t)||this.setProvider(t),this.useRpcCallSpecification=n,ri(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 lO(`Can't autodetect provider for "${t}"`);else ri(t)?n=void 0:n=t;return this.emit(aN.BEFORE_PROVIDER_CHANGE,this._provider),this._provider=n,this.emit(aN.PROVIDER_CHANGED,this._provider),!0}setMiddleware(t){this.middleware=t}send(t){return dV(this,void 0,void 0,function*(){const n=Object.assign({},t);let r=yield this._sendRequest(n);if(ri(this.middleware)||(r=yield this.middleware.processResponse(r)),jy(r))return r.result;throw new N0(r)})}sendBatch(t){return dV(this,void 0,void 0,function*(){return yield this._sendRequest(t)})}_sendRequest(t){return dV(this,void 0,void 0,function*(){const{provider:n}=this;if(ri(n))throw new lO("Provider not available. Use `.setProvider` or `.provider=` to initialize the provider.");let r=s0(t)?aoe(t):U3(t);if(ri(this.middleware)||(r=yield this.middleware.processRequest(r)),xFe(n)){let s;try{s=yield n.request(r)}catch(a){s=a}return this._processJsonRpcResponse(r,s,{legacy:!1,error:!1})}if(bFe(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(gFe(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));aFe(c)&&c.then(l).catch(d=>{try{const f=this._processJsonRpcResponse(r,d,{legacy:!0,error:!0});a(f)}catch(f){a(f)}})});if(yFe(n))return new Promise((s,a)=>{n.send(r,(o,l)=>{if(o)return a(this._processJsonRpcResponse(r,o,{legacy:!0,error:!0}));if(ri(l))throw new N0({},'Got a "nullish" response from provider.');return s(this._processJsonRpcResponse(r,l,{legacy:!0,error:!1}))})});if(vFe(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 lO("Provider does not have a request or send method to use.")})}_processJsonRpcResponse(t,n,{legacy:r,error:s}){if(ri(n))return this._buildResponse(t,null,s);if(Ey(n)){if(this.useRpcCallSpecification&&soe(n)){const a=n;if(gd.get(a.error.code)){const o=gd.get(a.error.code).error;throw new o(a)}else throw new eh(a)}else if(!e3._isReverted(n))throw new XB(n,t)}if(jy(n))return n;if(n instanceof Error)throw e3._isReverted(n),n;if(!r&&s0(t)&&BE(n)||r&&!s&&s0(t))return n;if(r&&s&&s0(t))throw n;if(r&&!Ey(n)&&!jy(n))return this._buildResponse(t,n,s);throw s0(t)&&!Array.isArray(n)?new N0(n,"Got normal response for a batch request."):!s0(t)&&Array.isArray(n)?new N0(n,"Got batch response for a normal request."):new N0(n,"Invalid response")}static _isReverted(t){let n;if(Ey(t)?n=t.error:t instanceof Error&&(n=t),n!=null&&n.message.includes("revert"))throw new Zw(n);return!1}_buildResponse(t,n,r){const s={jsonrpc:"2.0",id:s0(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 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 fR{constructor(t,n,r=!1){this.requestManager=t,this.registeredSubscriptions=n,this.tolerateUnlinkedSubscription=r,this._subscriptions=new Map,this.requestManager.on(aN.BEFORE_PROVIDER_CHANGE,()=>E7(this,void 0,void 0,function*(){yield this.unsubscribe()})),this.requestManager.on(aN.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 og("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 E7(this,arguments,void 0,function*(r,s,a=hd){const o=this.registeredSubscriptions[r];if(!o)throw new og("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 E7(this,void 0,void 0,function*(){if(!this.requestManager.provider)throw new lO("Provider not available");if(!this.supportsSubscriptions())throw new og("The current provider does not support subscriptions");if(t.id&&this._subscriptions.has(t.id))throw new og(`Subscription with id "${t.id}" already exists`);if(yield t.sendSubscriptionRequest(),ri(t.id))throw new og("Subscription is not subscribed yet.");return this._subscriptions.set(t.id,t),t.id})}removeSubscription(t){return E7(this,void 0,void 0,function*(){const{id:n}=t;if(ri(n))throw new og("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 og(`Subscription with id "${n.toString()}" does not exists`);return yield t.sendUnsubscribeRequest(),this._subscriptions.delete(n),n})}unsubscribe(t){return E7(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 ri(this.requestManager.provider)?!1:S7t(this.requestManager.provider)}}var _7=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 tT extends l${constructor(t,n){var r;super(),this.args=t;const{requestManager:s}=n,{subscriptionManager:a}=n;s?this._subscriptionManager=new fR(s,{},!0):this._subscriptionManager=a,this._returnFormat=(r=n==null?void 0:n.returnFormat)!==null&&r!==void 0?r:hd}get id(){return this._id}get lastBlock(){return this._lastBlock}subscribe(){return _7(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&&o$(t)&&this._processSubscriptionResult(t==null?void 0:t.params.result)}sendSubscriptionRequest(){return _7(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 _7(this,void 0,void 0,function*(){yield this.unsubscribe(),yield this.subscribe()})}unsubscribe(){return _7(this,void 0,void 0,function*(){this.id&&(yield this._subscriptionManager.removeSubscription(this))})}sendUnsubscribeRequest(){return _7(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 H6=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 hR extends u4t{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")&&!xr(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 xr(n)?void 0:this[n]}return this[t]}remove(t){if(typeof t=="string"){const n=this._addressMap.get(t.toLowerCase());return xr(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 H6(this,void 0,void 0,function*(){return Promise.all(this.map(r=>H6(this,void 0,void 0,function*(){return r.encrypt(t,n)})))})}decrypt(t,n,r){return H6(this,void 0,void 0,function*(){const s=yield Promise.all(t.map(a=>H6(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 H6(this,void 0,void 0,function*(){const r=hR.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 H6(this,void 0,void 0,function*(){const r=hR.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 k0={web:cO};function wFe(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 CFe(e,t,n){if(!k0.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 k0.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 loe(e,t,n,r="aes-128-ctr",s=!0){if(wFe(t,n,r),k0.web){const[a,o]=await CFe(r,t,n),l=await k0.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(k0.node){const a=k0.node.createCipheriv(r,t,n);return a.setAutoPadding(s),QM(a.update(e),a.final())}else throw new Error("The environment doesn't have AES module")}async function N7t(e,t,n,r){const s=e.slice(-16);for(let o=0;o<16;o++)s[o]^=n[o]^16;return(await loe(s,t,n,r)).slice(0,16)}async function A7t(e,t,n,r="aes-128-ctr",s=!0){if(wFe(t,n,r),k0.web){const[a,o]=await CFe(r,t,n);if(!s&&o.name==="aes-cbc"){const u=await N7t(e,t,n,r);e=QM(e,u)}const l=await k0.web.subtle.decrypt(o,a,e),c=new Uint8Array(l);if(o.name==="aes-cbc"){const u=await loe(c,t,n,r);if(!wAt(u,e))throw new Error("AES: wrong padding")}return c}else if(k0.node){const a=k0.node.createDecipheriv(r,t,n);return a.setAutoPadding(s),QM(a.update(e),a.final())}else throw new Error("The environment doesn't have AES module")}class SFe extends Vae{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,zae(t);const r=ZS(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 M3(this),this.iHash.update(t),this}digestInto(t){M3(this),MA(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 coe=(e,t,n)=>new SFe(e,t).update(n).digest();coe.create=(e,t)=>new SFe(e,t);function j7t(e,t,n,r){zae(e);const s=APe({dkLen:32,asyncTick:10},r),{c:a,dkLen:o,asyncTick:l}=s;if(Kd(a),Kd(o),Kd(l),a<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const c=ZS(t),u=ZS(n),d=new Uint8Array(o),f=coe.create(e,c),x=f._cloneInto().update(u);return{c:a,dkLen:o,asyncTick:l,DK:d,PRF:f,PRFSalt:x}}function E7t(e,t,n,r,s){return e.destroy(),t.destroy(),r&&r.destroy(),s.fill(0),n}function uoe(e,t,n,r){const{c:s,dkLen:a,DK:o,PRF:l,PRFSalt:c}=j7t(e,t,n,r);let u;const d=new Uint8Array(4),f=dO(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 E7t(l,c,o,u,x)}function _7t(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 k7t=(e,t,n)=>e&t^~e&n,T7t=(e,t,n)=>e&t^e&n^t&n;class I7t extends Vae{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=dO(this.buffer)}update(t){M3(this);const{view:n,buffer:r,blockLen:s}=this;t=ZS(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=dO(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){M3(this),Hae(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;_7t(r,s-8,BigInt(this.length*8),a),this.process(r,0);const l=dO(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 P7t=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]),fb=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),hb=new Uint32Array(64);class F7t extends I7t{constructor(){super(64,32,8,!1),this.A=fb[0]|0,this.B=fb[1]|0,this.C=fb[2]|0,this.D=fb[3]|0,this.E=fb[4]|0,this.F=fb[5]|0,this.G=fb[6]|0,this.H=fb[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)hb[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const x=hb[f-15],g=hb[f-2],v=Zm(x,7)^Zm(x,18)^x>>>3,w=Zm(g,17)^Zm(g,19)^g>>>10;hb[f]=w+hb[f-7]+v+hb[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=Zm(l,6)^Zm(l,11)^Zm(l,25),g=d+x+k7t(l,c,u)+P7t[f]+hb[f]|0,w=(Zm(r,2)^Zm(r,13)^Zm(r,22))+T7t(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(){hb.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const u$=jPe(()=>new F7t);function NFe(e,t,n,r,s){if(!["sha256","sha512"].includes(s))throw new Error("Only sha256 and sha512 are supported");return ZM(e),ZM(t),uoe(u$,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++],P=e[t++]^n[r++],I=e[t++]^n[r++],R=e[t++]^n[r++],O=e[t++]^n[r++],U=o,L=l,z=c,X=u,ne=d,J=f,K=x,re=g,he=v,Q=w,ie=C,oe=N,G=P,V=I,te=R,ae=O;for(let fe=0;fe<8;fe+=2)ne^=ma(U+G|0,7),he^=ma(ne+U|0,9),G^=ma(he+ne|0,13),U^=ma(G+he|0,18),Q^=ma(J+L|0,7),V^=ma(Q+J|0,9),L^=ma(V+Q|0,13),J^=ma(L+V|0,18),te^=ma(ie+K|0,7),z^=ma(te+ie|0,9),K^=ma(z+te|0,13),ie^=ma(K+z|0,18),X^=ma(ae+oe|0,7),re^=ma(X+ae|0,9),oe^=ma(re+X|0,13),ae^=ma(oe+re|0,18),L^=ma(U+X|0,7),z^=ma(L+U|0,9),X^=ma(z+L|0,13),U^=ma(X+z|0,18),K^=ma(J+ne|0,7),re^=ma(K+J|0,9),ne^=ma(re+K|0,13),J^=ma(ne+re|0,18),oe^=ma(ie+Q|0,7),he^=ma(oe+ie|0,9),Q^=ma(he+oe|0,13),ie^=ma(Q+he|0,18),G^=ma(ae+te|0,7),V^=ma(G+ae|0,9),te^=ma(V+G|0,13),ae^=ma(te+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+K|0,s[a++]=g+re|0,s[a++]=v+he|0,s[a++]=w+Q|0,s[a++]=C+ie|0,s[a++]=N+oe|0,s[a++]=P+G|0,s[a++]=I+V|0,s[a++]=R+te|0,s[a++]=O+ae|0}function fV(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 O7t(e,t,n){const r=APe({dkLen:32,asyncTick:10,maxmem:1073742848},n),{N:s,r:a,p:o,dkLen:l,asyncTick:c,maxmem:u,onProgress:d}=r;if(Kd(s),Kd(a),Kd(o),Kd(l),Kd(c),Kd(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=uoe(u$,e,t,{c:1,dkLen:f*o}),w=uO(v),C=uO(new Uint8Array(f*s)),N=uO(new Uint8Array(f));let P=()=>{};if(d){const I=2*s*o,R=Math.max(Math.floor(I/1e4),1);let O=0;P=()=>{O++,d&&(!(O%R)||O===I)&&d(O/I)}}return{N:s,r:a,p:o,dkLen:l,blockSize32:x,V:C,B32:w,B:v,tmp:N,blockMixCb:P,asyncTick:c}}function M7t(e,t,n,r,s){const a=uoe(u$,e,n,{c:1,dkLen:t});return n.fill(0),r.fill(0),s.fill(0),a}function R7t(e,t,n){const{N:r,r:s,p:a,dkLen:o,blockSize32:l,V:c,B32:u,B:d,tmp:f,blockMixCb:x}=O7t(e,t,n);YM||XM(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++)fV(c,C,c,C+=l,s),x();fV(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];fV(f,0,u,v,s),x()}}return YM||XM(u),M7t(e,o,d,c,f)}function AFe(e,t,n,r,s,a,o){return ZM(e),ZM(t),R7t(e,t,{N:n,r:s,p:r,dkLen:a,onProgress:o})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const jFe=BigInt(0),d$=BigInt(1),L7t=BigInt(2);function H3(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function nT(e){if(!H3(e))throw new Error("Uint8Array expected")}const D7t=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function oN(e){nT(e);let t="";for(let n=0;n<e.length;n++)t+=D7t[e[n]];return t}function EFe(e){const t=e.toString(16);return t.length&1?`0${t}`:t}function doe(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return BigInt(e===""?"0":`0x${e}`)}const zx={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function dge(e){if(e>=zx._0&&e<=zx._9)return e-zx._0;if(e>=zx._A&&e<=zx._F)return e-(zx._A-10);if(e>=zx._a&&e<=zx._f)return e-(zx._a-10)}function lN(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 t3(e){return doe(oN(e))}function foe(e){return nT(e),doe(oN(Uint8Array.from(e).reverse()))}function cN(e,t){return lN(e.toString(16).padStart(t*2,"0"))}function hoe(e,t){return cN(e,t).reverse()}function B7t(e){return lN(EFe(e))}function Up(e,t,n){let r;if(typeof t=="string")try{r=lN(t)}catch(a){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${a}`)}else if(H3(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 $E(...e){let t=0;for(let r=0;r<e.length;r++){const s=e[r];nT(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 $7t(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 U7t(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function z7t(e){let t;for(t=0;e>jFe;e>>=d$,t+=1);return t}function H7t(e,t){return e>>BigInt(t)&d$}function V7t(e,t,n){return e|(n?d$:jFe)<<BigInt(t)}const poe=e=>(L7t<<BigInt(e-1))-d$,hV=e=>new Uint8Array(e),fge=e=>Uint8Array.from(e);function _Fe(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=hV(e),s=hV(e),a=0;const o=()=>{r.fill(1),s.fill(0),a=0},l=(...f)=>n(s,r,...f),c=(f=hV())=>{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 $E(...x)};return(f,x)=>{o(),c(f);let g;for(;!(g=x(u()));)c();return o(),g}}const W7t={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"||H3(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 rT(e,t,n={}){const r=(s,a,o)=>{const l=W7t[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 q7t=Object.freeze(Object.defineProperty({__proto__:null,abytes:nT,bitGet:H7t,bitLen:z7t,bitMask:poe,bitSet:V7t,bytesToHex:oN,bytesToNumberBE:t3,bytesToNumberLE:foe,concatBytes:$E,createHmacDrbg:_Fe,ensureBytes:Up,equalBytes:$7t,hexToBytes:lN,hexToNumber:doe,isBytes:H3,numberToBytesBE:cN,numberToBytesLE:hoe,numberToHexUnpadded:EFe,numberToVarBytesBE:B7t,utf8ToBytes:U7t,validateObject:rT},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ic=BigInt(0),Cl=BigInt(1),Lv=BigInt(2),G7t=BigInt(3),yee=BigInt(4),hge=BigInt(5),pge=BigInt(8);BigInt(9);BigInt(16);function Wd(e,t){const n=e%t;return n>=Ic?n:t+n}function K7t(e,t,n){if(n<=Ic||t<Ic)throw new Error("Expected power/modulo > 0");if(n===Cl)return Ic;let r=Cl;for(;t>Ic;)t&Cl&&(r=r*e%n),e=e*e%n,t>>=Cl;return r}function vh(e,t,n){let r=e;for(;t-- >Ic;)r*=r,r%=n;return r}function vee(e,t){if(e===Ic||t<=Ic)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=Wd(e,t),r=t,s=Ic,a=Cl;for(;n!==Ic;){const l=r/n,c=r%n,u=s-a*l;r=n,n=c,s=a,a=u}if(r!==Cl)throw new Error("invert: does not exist");return Wd(s,t)}function Y7t(e){const t=(e-Cl)/Lv;let n,r,s;for(n=e-Cl,r=0;n%Lv===Ic;n/=Lv,r++);for(s=Lv;s<e&&K7t(s,t,e)!==e-Cl;s++);if(r===1){const o=(e+Cl)/yee;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+Cl)/Lv;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,Cl<<BigInt(u-g-1));d=l.sqr(v),f=l.mul(f,v),x=l.mul(x,d),u=g}return f}}function X7t(e){if(e%yee===G7t){const t=(e+Cl)/yee;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,Lv),o=r.pow(a,t),l=r.mul(s,o),c=r.mul(r.mul(l,Lv),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 Y7t(e)}const Q7t=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Z7t(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=Q7t.reduce((r,s)=>(r[s]="function",r),t);return rT(e,n)}function J7t(e,t,n){if(n<Ic)throw new Error("Expected power > 0");if(n===Ic)return e.ONE;if(n===Cl)return t;let r=e.ONE,s=t;for(;n>Ic;)n&Cl&&(r=e.mul(r,s)),s=e.sqr(s),n>>=Cl;return r}function ejt(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 kFe(e,t){const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function tjt(e,t,n=!1,r={}){if(e<=Ic)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:a}=kFe(e,t);if(a>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=X7t(e),l=Object.freeze({ORDER:e,BITS:s,BYTES:a,MASK:poe(s),ZERO:Ic,ONE:Cl,create:c=>Wd(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Ic<=c&&c<e},is0:c=>c===Ic,isOdd:c=>(c&Cl)===Cl,neg:c=>Wd(-c,e),eql:(c,u)=>c===u,sqr:c=>Wd(c*c,e),add:(c,u)=>Wd(c+u,e),sub:(c,u)=>Wd(c-u,e),mul:(c,u)=>Wd(c*u,e),pow:(c,u)=>J7t(l,c,u),div:(c,u)=>Wd(c*vee(u,e),e),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>vee(c,e),sqrt:r.sqrt||(c=>o(l,c)),invertBatch:c=>ejt(l,c),cmov:(c,u,d)=>d?u:c,toBytes:c=>n?hoe(c,a):cN(c,a),fromBytes:c=>{if(c.length!==a)throw new Error(`Fp.fromBytes: expected ${a}, got ${c.length}`);return n?foe(c):t3(c)}});return Object.freeze(l)}function TFe(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 IFe(e){const t=TFe(e);return t+Math.ceil(t/2)}function njt(e,t,n=!1){const r=e.length,s=TFe(t),a=IFe(t);if(r<16||r<a||r>1024)throw new Error(`expected ${a}-1024 bytes of input, got ${r}`);const o=n?t3(e):foe(e),l=Wd(o,t-Cl)+Cl;return n?hoe(l,s):cN(l,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const rjt=BigInt(0),pV=BigInt(1);function sjt(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>rjt;)a&pV&&(o=o.add(l)),l=l.double(),a>>=pV;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+=pV);const N=w,P=w+Math.abs(C)-1,I=v%2!==0,R=C<0;C===0?d=d.add(n(I,a[N])):u=u.add(n(R,a[P]))}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 PFe(e){return Z7t(e.Fp),rT(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...kFe(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function ijt(e){const t=PFe(e);rT(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:ajt,hexToBytes:ojt}=q7t,Qv={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){const{Err:t}=Qv;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:ajt(r),l:e.subarray(n+2)}},toSig(e){const{Err:t}=Qv,n=typeof e=="string"?ojt(e):e;nT(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}=Qv._parseInt(n.subarray(2)),{d:o,l}=Qv._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}`}},Tg=BigInt(0),Vh=BigInt(1);BigInt(2);const mge=BigInt(3);BigInt(4);function ljt(e){const t=ijt(e),{Fp:n}=t,r=t.toBytes||((v,w,C)=>{const N=w.toAffine();return $E(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),P=n.mul(N,v);return n.add(n.add(P,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"&&Tg<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:P}=t;if(w&&typeof v!="bigint"){if(H3(v)&&(v=oN(v)),typeof v!="string"||!w.includes(v.length))throw new Error("Invalid key");v=v.padStart(C*2,"0")}let I;try{I=typeof v=="bigint"?v:t3(Up("private key",v,C))}catch{throw new Error(`private key must be ${C} bytes, hex or bigint, not ${typeof v}`)}return N&&(I=Wd(I,P)),l(I),I}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 P=I=>n.eql(I,n.ZERO);return P(C)&&P(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,P)=>N.toAffine(C[P])).map(f.fromAffine)}static fromHex(w){const C=f.fromAffine(s(Up("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),P=a(w);if(!n.eql(N,P))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:P}=this,{px:I,py:R,pz:O}=w,U=n.eql(n.mul(C,O),n.mul(I,P)),L=n.eql(n.mul(N,O),n.mul(R,P));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:P,py:I,pz:R}=this;let O=n.ZERO,U=n.ZERO,L=n.ZERO,z=n.mul(P,P),X=n.mul(I,I),ne=n.mul(R,R),J=n.mul(P,I);return J=n.add(J,J),L=n.mul(P,R),L=n.add(L,L),O=n.mul(w,L),U=n.mul(N,ne),U=n.add(O,U),O=n.sub(X,U),U=n.add(X,U),U=n.mul(O,U),O=n.mul(J,O),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(I,R),ne=n.add(ne,ne),z=n.mul(ne,J),O=n.sub(O,z),L=n.mul(ne,X),L=n.add(L,L),L=n.add(L,L),new f(O,U,L)}add(w){d(w);const{px:C,py:N,pz:P}=this,{px:I,py:R,pz:O}=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,I),K=n.mul(N,R),re=n.mul(P,O),he=n.add(C,N),Q=n.add(I,R);he=n.mul(he,Q),Q=n.add(J,K),he=n.sub(he,Q),Q=n.add(C,P);let ie=n.add(I,O);return Q=n.mul(Q,ie),ie=n.add(J,re),Q=n.sub(Q,ie),ie=n.add(N,P),U=n.add(R,O),ie=n.mul(ie,U),U=n.add(K,re),ie=n.sub(ie,U),z=n.mul(X,Q),U=n.mul(ne,re),z=n.add(U,z),U=n.sub(K,z),z=n.add(K,z),L=n.mul(U,z),K=n.add(J,J),K=n.add(K,J),re=n.mul(X,re),Q=n.mul(ne,Q),K=n.add(K,re),re=n.sub(J,re),re=n.mul(X,re),Q=n.add(Q,re),J=n.mul(K,Q),L=n.add(L,J),J=n.mul(ie,Q),U=n.mul(he,U),U=n.sub(U,J),J=n.mul(he,K),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(P=>P.pz));return C.map((P,I)=>P.toAffine(N[I])).map(f.fromAffine)})}multiplyUnsafe(w){const C=f.ZERO;if(w===Tg)return C;if(l(w),w===Vh)return this;const{endo:N}=t;if(!N)return g.unsafeLadder(this,w);let{k1neg:P,k1:I,k2neg:R,k2:O}=N.splitScalar(w),U=C,L=C,z=this;for(;I>Tg||O>Tg;)I&Vh&&(U=U.add(z)),O&Vh&&(L=L.add(z)),z=z.double(),I>>=Vh,O>>=Vh;return P&&(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,P;const{endo:I}=t;if(I){const{k1neg:R,k1:O,k2neg:U,k2:L}=I.splitScalar(C);let{p:z,f:X}=this.wNAF(O),{p:ne,f:J}=this.wNAF(L);z=g.constTimeNegate(R,z),ne=g.constTimeNegate(U,ne),ne=new f(n.mul(ne.px,I.beta),ne.py,ne.pz),N=z.add(ne),P=X.add(J)}else{const{p:R,f:O}=this.wNAF(C);N=R,P=O}return f.normalizeZ([N,P])[0]}multiplyAndAddUnsafe(w,C,N){const P=f.BASE,I=(O,U)=>U===Tg||U===Vh||!O.equals(P)?O.multiplyUnsafe(U):O.multiply(U),R=I(this,C).add(I(w,N));return R.is0()?void 0:R}toAffine(w){const{px:C,py:N,pz:P}=this,I=this.is0();w==null&&(w=I?n.ONE:n.inv(P));const R=n.mul(C,w),O=n.mul(N,w),U=n.mul(P,w);if(I)return{x:n.ZERO,y:n.ZERO};if(!n.eql(U,n.ONE))throw new Error("invZ was invalid");return{x:R,y:O}}isTorsionFree(){const{h:w,isTorsionFree:C}=t;if(w===Vh)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===Vh?this:C?C(f,this):this.multiplyUnsafe(t.h)}toRawBytes(w=!0){return this.assertValidity(),r(f,this,w)}toHex(w=!0){return oN(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=sjt(f,t.endo?Math.ceil(x/2):x);return{CURVE:t,ProjectivePoint:f,normPrivateKeyToScalar:c,weierstrassEquation:a,isWithinCurveOrder:o}}function cjt(e){const t=PFe(e);return rT(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function ujt(e){const t=cjt(e),{Fp:n,n:r}=t,s=n.BYTES+1,a=2*n.BYTES+1;function o(Q){return Tg<Q&&Q<n.ORDER}function l(Q){return Wd(Q,r)}function c(Q){return vee(Q,r)}const{ProjectivePoint:u,normPrivateKeyToScalar:d,weierstrassEquation:f,isWithinCurveOrder:x}=ljt({...t,toBytes(Q,ie,oe){const G=ie.toAffine(),V=n.toBytes(G.x),te=$E;return oe?te(Uint8Array.from([ie.hasEvenY()?2:3]),V):te(Uint8Array.from([4]),V,n.toBytes(G.y))},fromBytes(Q){const ie=Q.length,oe=Q[0],G=Q.subarray(1);if(ie===s&&(oe===2||oe===3)){const V=t3(G);if(!o(V))throw new Error("Point is not on curve");const te=f(V);let ae;try{ae=n.sqrt(te)}catch(me){const we=me instanceof Error?": "+me.message:"";throw new Error("Point is not on curve"+we)}const fe=(ae&Vh)===Vh;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)),te=n.fromBytes(G.subarray(n.BYTES,2*n.BYTES));return{x:V,y:te}}else throw new Error(`Point of length ${ie} was invalid. Expected ${s} compressed bytes or ${a} uncompressed bytes`)}}),g=Q=>oN(cN(Q,t.nByteLength));function v(Q){const ie=r>>Vh;return Q>ie}function w(Q){return v(Q)?l(-Q):Q}const C=(Q,ie,oe)=>t3(Q.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=Up("compactSignature",ie,oe*2),new N(C(ie,0,oe),C(ie,oe,2*oe))}static fromDER(ie){const{r:oe,s:G}=Qv.toSig(Up("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,te=L(Up("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",Ne=u.fromHex(fe+g(ae)),me=c(ae),we=l(-te*me),xe=l(G*me),ye=u.BASE.multiplyAndAddUnsafe(Ne,we,xe);if(!ye)throw new Error("point at infinify");return ye.assertValidity(),ye}hasHighS(){return v(this.s)}normalizeS(){return this.hasHighS()?new N(this.r,l(-this.s),this.recovery):this}toDERRawBytes(){return lN(this.toDERHex())}toDERHex(){return Qv.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return lN(this.toCompactHex())}toCompactHex(){return g(this.r)+g(this.s)}}const P={isValidPrivateKey(Q){try{return d(Q),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const Q=IFe(t.n);return njt(t.randomBytes(Q),t.n)},precompute(Q=8,ie=u.BASE){return ie._setWindowSize(Q),ie.multiply(BigInt(3)),ie}};function I(Q,ie=!0){return u.fromPrivateKey(Q).toRawBytes(ie)}function R(Q){const ie=H3(Q),oe=typeof Q=="string",G=(ie||oe)&&Q.length;return ie?G===s||G===a:oe?G===2*s||G===2*a:Q instanceof u}function O(Q,ie,oe=!0){if(R(Q))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(Q)).toRawBytes(oe)}const U=t.bits2int||function(Q){const ie=t3(Q),oe=Q.length*8-t.nBitLength;return oe>0?ie>>BigInt(oe):ie},L=t.bits2int_modN||function(Q){return l(U(Q))},z=poe(t.nBitLength);function X(Q){if(typeof Q!="bigint")throw new Error("bigint expected");if(!(Tg<=Q&&Q<z))throw new Error(`bigint expected < 2^${t.nBitLength}`);return cN(Q,t.nByteLength)}function ne(Q,ie,oe=J){if(["recovered","canonical"].some(Pe=>Pe in oe))throw new Error("sign() legacy options not supported");const{hash:G,randomBytes:V}=t;let{lowS:te,prehash:ae,extraEntropy:fe}=oe;te==null&&(te=!0),Q=Up("msgHash",Q),ae&&(Q=Up("prehashed msgHash",G(Q)));const Ne=L(Q),me=d(ie),we=[X(me),X(Ne)];if(fe!=null&&fe!==!1){const Pe=fe===!0?V(n.BYTES):fe;we.push(Up("extraEntropy",Pe))}const xe=$E(...we),ye=Ne;function je(Pe){const Re=U(Pe);if(!x(Re))return;const Xe=c(Re),Ke=u.BASE.multiply(Re).toAffine(),ut=l(Ke.x);if(ut===Tg)return;const et=l(Xe*l(ye+ut*me));if(et===Tg)return;let tt=(Ke.x===ut?0:2)|Number(Ke.y&Vh),Le=et;return te&&v(et)&&(Le=w(et),tt^=1),new N(ut,Le,tt)}return{seed:xe,k2sig:je}}const J={lowS:t.lowS,prehash:!1},K={lowS:t.lowS,prehash:!1};function re(Q,ie,oe=J){const{seed:G,k2sig:V}=ne(Q,ie,oe),te=t;return _Fe(te.hash.outputLen,te.nByteLength,te.hmac)(G,V)}u.BASE._setWindowSize(8);function he(Q,ie,oe,G=K){var Ke;const V=Q;if(ie=Up("msgHash",ie),oe=Up("publicKey",oe),"strict"in G)throw new Error("options.strict was renamed to lowS");const{lowS:te,prehash:ae}=G;let fe,Ne;try{if(typeof V=="string"||H3(V))try{fe=N.fromDER(V)}catch(ut){if(!(ut instanceof Qv.Err))throw ut;fe=N.fromCompact(V)}else if(typeof V=="object"&&typeof V.r=="bigint"&&typeof V.s=="bigint"){const{r:ut,s:et}=V;fe=new N(ut,et)}else throw new Error("PARSE");Ne=u.fromHex(oe)}catch(ut){if(ut.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(te&&fe.hasHighS())return!1;ae&&(ie=t.hash(ie));const{r:me,s:we}=fe,xe=L(ie),ye=c(we),je=l(xe*ye),Pe=l(me*ye),Re=(Ke=u.BASE.multiplyAndAddUnsafe(Ne,je,Pe))==null?void 0:Ke.toAffine();return Re?l(Re.x)===me:!1}return{CURVE:t,getPublicKey:I,getSharedSecret:O,sign:re,verify:he,ProjectivePoint:u,Signature:N,utils:P}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function djt(e){return{hash:e,hmac:(t,...n)=>coe(e,t,QM(...n)),randomBytes:EPe}}function fjt(e,t){const n=r=>ujt({...e,...djt(r)});return Object.freeze({...n(t),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const FFe=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),xge=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),hjt=BigInt(1),wee=BigInt(2),gge=(e,t)=>(e+t/wee)/t;function pjt(e){const t=FFe,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=vh(d,n,t)*d%t,x=vh(f,n,t)*d%t,g=vh(x,wee,t)*u%t,v=vh(g,s,t)*g%t,w=vh(v,a,t)*v%t,C=vh(w,l,t)*w%t,N=vh(C,c,t)*C%t,P=vh(N,l,t)*w%t,I=vh(P,n,t)*d%t,R=vh(I,o,t)*v%t,O=vh(R,r,t)*u%t,U=vh(O,wee,t);if(!Cee.eql(Cee.sqr(U),e))throw new Error("Cannot find square root");return U}const Cee=tjt(FFe,void 0,void 0,{sqrt:pjt}),moe=fjt({a:BigInt(0),b:BigInt(7),Fp:Cee,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=-hjt*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=n,o=BigInt("0x100000000000000000000000000000000"),l=gge(a*e,t),c=gge(-r*e,t);let u=Wd(e-l*n-c*s,t),d=Wd(-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}}}},u$);BigInt(0);moe.ProjectivePoint;const mjt=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:moe},Symbol.toStringTag,{value:"Module"}));var mV;const j1=(mV=moe)!==null&&mV!==void 0?mV:mjt,bge=BigInt("0xffffffffffffffff"),UE=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),xjt=j1.CURVE.n,gjt=xjt/BigInt(2),bjt={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 pR;(function(e){e[e.Mainnet=1]="Mainnet",e[e.Goerli=5]="Goerli",e[e.Sepolia=11155111]="Sepolia"})(pR||(pR={}));var io;(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"})(io||(io={}));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 gu;(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"})(gu||(gu={}));var Kh;(function(e){e[e.Number=0]="Number",e[e.BigInt=1]="BigInt",e[e.Uint8Array=2]="Uint8Array",e[e.PrefixedHexString=3]="PrefixedHexString"})(Kh||(Kh={}));const OFe=e=>{if(typeof e!="string")throw new Error(`[stripHexPrefix] input must be type 'string', received ${typeof e}`);return Kae(e)?e.slice(2):e};function yjt(e){return!e||e==="0x0"?"0x0000000000000000":Kae(e)?`0x${OFe(e).padStart(16,"0")}`:`0x${e.padStart(16,"0")}`}const MFe=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Received an invalid integer type: ${e}`);return`0x${e.toString(16)}`};function vjt(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"),Kae(x)||(x=MFe(parseInt(x))),g.length!==18&&(g=yjt(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={[io.Homestead]:{name:"homesteadBlock"},[io.Dao]:{name:"daoForkBlock"},[io.TangerineWhistle]:{name:"eip150Block"},[io.SpuriousDragon]:{name:"eip155Block"},[io.Byzantium]:{name:"byzantiumBlock"},[io.Constantinople]:{name:"constantinopleBlock"},[io.Petersburg]:{name:"petersburgBlock"},[io.Istanbul]:{name:"istanbulBlock"},[io.MuirGlacier]:{name:"muirGlacierBlock"},[io.Berlin]:{name:"berlinBlock"},[io.London]:{name:"londonBlock"},[io.MergeForkIdTransition]:{name:"mergeForkBlock",postMerge:t},[io.Shanghai]:{name:"shanghaiTime",postMerge:!0,isTimestamp:!0},[io.ShardingForkDev]:{name:"shardingForkTime",postMerge:!0,isTimestamp:!0}},P=Object.keys(N).reduce((O,U)=>(O[N[U].name]=U,O),{}),I=Object.keys(a).filter(O=>P[O]!==void 0&&a[O]!==void 0&&a[O]!==null);if(C.hardforks=I.map(O=>({name:P[O],block:N[P[O]].isTimestamp===!0||typeof a[O]!="number"?null:a[O],timestamp:N[P[O]].isTimestamp===!0&&typeof a[O]=="number"?a[O]:void 0})).filter(O=>O.block!==null||O.timestamp!==void 0),C.hardforks.sort((O,U)=>{var L,z;return((L=O.block)!==null&&L!==void 0?L:1/0)-((z=U.block)!==null&&z!==void 0?z:1/0)}),C.hardforks.sort((O,U)=>{var L,z;return((L=O.timestamp)!==null&&L!==void 0?L:v)-((z=U.timestamp)!==null&&z!==void 0?z:v)}),a.terminalTotalDifficulty!==void 0){const O={name:io.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,O):C.hardforks.push(O)}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:io.Chainstart,block:0}),C}function wjt(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),vjt(e,n)}catch(r){throw new Error(`Error parsing parameters file: ${r.message}`)}}function RFe(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 Cjt=function(e){const t=MFe(e);return lo(`0x${RFe(t.slice(2))}`)},To=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(!WPe(e))throw new Error(`Cannot convert string to Uint8Array. only supports 0x-prefixed hex strings and this string was given: ${e}`);return lo(RFe(OFe(e)))}if(typeof e=="number")return To(nc(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}`),To(`0x${n}`)}if(e.toArray)return Uint8Array.from(e.toArray());throw new Error("invalid type")};function Ya(e){const t=qi(e);return BigInt(t==="0x"?0:t)}function Sjt(e){return To(`0x${e.toString(16)}`)}const LFe=function(e){return new Uint8Array(e).fill(0)},Njt=function(e,t,n){const r=LFe(t);return e.length<t?(r.set(e,t-e.length),r):e.subarray(-t)};function xoe(e){if(!u2(e)){const t=`This method only supports Uint8Array but input was: ${e}`;throw new Error(t)}}const wge=function(e,t){return xoe(e),Njt(e,t)};function Ajt(e){let t=e[0];for(;e.length>0&&t.toString()==="0";)e=e.slice(1),t=e[0];return e}const mR=function(e){return xoe(e),Ajt(e)},Io=e=>`0x${e.toString(16)}`;function la(e){return mR(Sjt(e))}function jjt(e,t){return e===BigInt(0)||e===BigInt(1)?e:t===void 0?e-BigInt(27):e-(t*BigInt(2)+BigInt(35))}function Ejt(e){return e===BigInt(0)||e===BigInt(1)}const goe=function(e,t,n,r,s){const a=jjt(t,s);if(!Ejt(a))throw new Error("Invalid signature v value");return new j1.Signature(Ya(n),Ya(r)).addRecoveryBit(Number(a)).recoverPublicKey(e).toRawBytes(!1).slice(1)};function V6(e,t){if(e===null)return null;if(e===void 0)return;if(typeof e=="string"&&!WPe(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=To(e);switch(t){case Kh.Uint8Array:return n;case Kh.BigInt:return Ya(n);case Kh.Number:{const r=Ya(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 Kh.PrefixedHexString:return qi(n);default:throw new Error("unknown outputType")}}var Ip={},Cge;function _jt(){if(Cge)return Ip;Cge=1,Object.defineProperty(Ip,"__esModule",{value:!0}),Ip.RLP=Ip.utils=Ip.decode=Ip.encode=void 0;function e(N){if(Array.isArray(N)){const I=[];let R=0;for(let O=0;O<N.length;O++){const U=e(N[O]);I.push(U),R+=U.length}return d(r(R,192),...I)}const P=C(N);return P.length===1&&P[0]<128?P:d(r(P.length,128),P)}Ip.encode=e;function t(N,P,I){if(I>N.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return N.slice(P,I)}function n(N){if(N[0]===0)throw new Error("invalid RLP: extra zeros");return c(l(N))}function r(N,P){if(N<56)return Uint8Array.from([N+P]);const I=x(N),R=I.length/2,O=x(P+55+R);return Uint8Array.from(u(O+I))}function s(N,P=!1){if(typeof N>"u"||N===null||N.length===0)return Uint8Array.from([]);const I=C(N),R=a(I);if(P)return R;if(R.remainder.length!==0)throw new Error("invalid RLP: remainder must be zero");return R.data}Ip.decode=s;function a(N){let P,I,R,O,U;const L=[],z=N[0];if(z<=127)return{data:N.slice(0,1),remainder:N.slice(1)};if(z<=183){if(P=z-127,z===128?R=Uint8Array.from([]):R=t(N,1,P),P===2&&R[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:R,remainder:N.slice(P)}}else if(z<=191){if(I=z-182,N.length-1<I)throw new Error("invalid RLP: not enough bytes for string length");if(P=n(t(N,1,I)),P<=55)throw new Error("invalid RLP: expected string length to be greater than 55");return R=t(N,I,P+I),{data:R,remainder:N.slice(P+I)}}else if(z<=247){for(P=z-191,O=t(N,1,P);O.length;)U=a(O),L.push(U.data),O=U.remainder;return{data:L,remainder:N.slice(P)}}else{if(I=z-246,P=n(t(N,1,I)),P<56)throw new Error("invalid RLP: encoded list too short");const X=I+P;if(X>N.length)throw new Error("invalid RLP: total length is larger than the data");for(O=t(N,I,X);O.length;)U=a(O),L.push(U.data),O=U.remainder;return{data:L,remainder:N.slice(X)}}}const o=Array.from({length:256},(N,P)=>P.toString(16).padStart(2,"0"));function l(N){let P="";for(let I=0;I<N.length;I++)P+=o[N[I]];return P}function c(N){const P=Number.parseInt(N,16);if(Number.isNaN(P))throw new Error("Invalid byte sequence");return P}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 P=new Uint8Array(N.length/2);for(let I=0;I<P.length;I++){const R=I*2;P[I]=c(N.slice(R,R+2))}return P}function d(...N){if(N.length===1)return N[0];const P=N.reduce((R,O)=>R+O.length,0),I=new Uint8Array(P);for(let R=0,O=0;R<N.length;R++){const U=N[R];I.set(U,O),O+=U.length}return I}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 P=N.toString(16);return P.length%2?`0${P}`:P}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 Ip.utils={bytesToHex:l,concatBytes:d,hexToBytes:u,utf8ToBytes:f},Ip.RLP={encode:e,decode:s},Ip}var Yh=_jt(),xV={};/*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */var Sge;function kjt(){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,K=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(J=0;J!=256;++J)K[J]=z[J];for(J=0;J!=256;++J)for(ne=z[J],X=256+J;X<4096;X+=256)ne=K[X]=ne>>>8^z[ne&255];var re=[];for(J=1;J!=16;++J)re[J-1]=typeof Int32Array<"u"?K.subarray(J*256,J*256+256):K.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],P=a[12],I=a[13],R=a[14];function O(z,X){for(var ne=X^-1,J=0,K=z.length;J<K;)ne=ne>>>8^r[(ne^z.charCodeAt(J++))&255];return~ne}function U(z,X){for(var ne=X^-1,J=z.length-15,K=0;K<J;)ne=R[z[K++]^ne&255]^I[z[K++]^ne>>8&255]^P[z[K++]^ne>>16&255]^N[z[K++]^ne>>>24]^C[z[K++]]^w[z[K++]]^v[z[K++]]^g[z[K++]]^x[z[K++]]^f[z[K++]]^d[z[K++]]^u[z[K++]]^c[z[K++]]^l[z[K++]]^o[z[K++]]^r[z[K++]];for(J+=15;K<J;)ne=ne>>>8^r[(ne^z[K++])&255];return~ne}function L(z,X){for(var ne=X^-1,J=0,K=z.length,re=0,he=0;J<K;)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=O,t.buf=U,t.str=L})}(xV)),xV}var Tjt=kjt();const Ijt=Ii(Tjt),Pjt={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"]},Fjt={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"]},Ojt={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"]},Mjt={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:{}},Rjt={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:{}},Ljt={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:{}},Djt={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:{}},Bjt={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:{}},$jt={name:"EIP-2718",comment:"Typed Transaction Envelope",url:"https://eips.ethereum.org/EIPS/eip-2718",status:"Final",minimumHardfork:"chainstart",gasConfig:{},gasPrices:{},vm:{},pow:{}},Ujt={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:{}},zjt={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:{}},Hjt={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:{}},Vjt={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:{}},Wjt={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:{}},qjt={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:{}},Gjt={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"}}},Kjt={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:{}},Yjt={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:{}},Xjt={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:{}},Qjt={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:{}},Zjt={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:{}},Jjt={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:{}},e9t={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"}}},t9t={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:{}},n9t={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"}}},W6={1153:Mjt,1559:Rjt,2315:Ljt,2537:Djt,2565:Bjt,2718:$jt,2929:Ujt,2930:zjt,3198:Hjt,3529:Vjt,3540:Wjt,3541:qjt,3554:Gjt,3607:Kjt,3651:Yjt,3670:Xjt,3675:Qjt,3855:Zjt,3860:Jjt,4345:e9t,4399:t9t,5133:n9t},r9t={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"}}},s9t={name:"dao",comment:"DAO rescue hardfork",url:"https://eips.ethereum.org/EIPS/eip-779",status:"Final",gasConfig:{},gasPrices:{},vm:{},pow:{}},i9t={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:{}},a9t={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:{}},o9t={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:{}},l9t={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"}}},c9t={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"}}},u9t={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:{}},d9t={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:{}},f9t={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"}}},h9t={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]},p9t={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]},m9t={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]},x9t={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:{}},g9t={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:{}},b9t={name:"mergeForkIdTransition",comment:"Pre-merge hardfork to fork off non-upgraded clients",url:"https://eips.ethereum.org/EIPS/eip-3675",status:"Draft",eips:[]},y9t={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]},v9t={chainstart:r9t,homestead:i9t,dao:s9t,tangerineWhistle:a9t,spuriousDragon:o9t,byzantium:l9t,constantinople:c9t,petersburg:u9t,istanbul:d9t,muirGlacier:f9t,berlin:h9t,london:p9t,shanghai:m9t,arrowGlacier:x9t,grayGlacier:g9t,mergeForkIdTransition:b9t,merge:y9t},{buf:w9t}=Ijt;class Zl extends Jae{static custom(t,n={}){var r;const s=(r=n.baseChain)!==null&&r!==void 0?r:"mainnet",a=Object.assign({},Zl._getChainParams(s));if(a.name="custom-chain",typeof t!="string")return new Zl(Object.assign({chain:Object.assign(Object.assign({},a),t)},n));if(t===gu.PolygonMainnet)return Zl.custom({name:gu.PolygonMainnet,chainId:137,networkId:137},n);if(t===gu.PolygonMumbai)return Zl.custom({name:gu.PolygonMumbai,chainId:80001,networkId:80001},n);if(t===gu.ArbitrumRinkebyTestnet)return Zl.custom({name:gu.ArbitrumRinkebyTestnet,chainId:421611,networkId:421611},n);if(t===gu.ArbitrumOne)return Zl.custom({name:gu.ArbitrumOne,chainId:42161,networkId:42161},n);if(t===gu.xDaiChain)return Zl.custom({name:gu.xDaiChain,chainId:100,networkId:100},n);if(t===gu.OptimisticKovan)return Zl.custom({name:gu.OptimisticKovan,chainId:69,networkId:69},Object.assign({hardfork:io.Berlin},n));if(t===gu.OptimisticEthereum)return Zl.custom({name:gu.OptimisticEthereum,chainId:10,networkId:10},Object.assign({hardfork:io.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=wjt(t,n,o),u=new Zl({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:io.Merge,this.HARDFORK_CHANGES=this.hardforks().map(s=>[s.name,v9t[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=Zl._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=V6(t,Kh.BigInt),a=V6(n,Kh.BigInt),o=V6(r,Kh.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 W6))throw new Error(`${n} not supported`);const r=this.gteHardfork(W6[n].minimumHardfork);if(!r)throw new Error(`${n} cannot be activated on hardfork ${this.hardfork()}, minimumHardfork: ${r}`);if(W6[n].requiredEIPs!==void 0){for(const s of W6[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 W6))throw new Error(`${r} not supported`);const s=W6[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=V6(n,Kh.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=V6(t,Kh.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===io.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!==io.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===io.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=V6(t,Kh.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!==io.Merge){const x=lo(f.toString(16).padStart(16,"0"));r=yd(r,x),s=f}if(l.name===t)break}const a=yd(n,r);return qi(Cjt(w9t(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(pR))n[a]=s.toLowerCase();const r={mainnet:Fjt,goerli:Pjt,sepolia:Ojt};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 A0;(function(e){e[e.EIP155ReplayProtection=155]="EIP155ReplayProtection",e[e.EIP1559FeeMarket=1559]="EIP1559FeeMarket",e[e.EIP2718TypedTransaction=2718]="EIP2718TypedTransaction",e[e.EIP2930AccessLists=2930]="EIP2930AccessLists"})(A0||(A0={}));function C9t(e){if(e.length===0)return!0;const t=e[0];return!!Array.isArray(t)}function S9t(e){return!C9t(e)}class c4{constructor(t){if(t.length!==20)throw new Error("Invalid address length");this.buf=t}static zero(){return new c4(LFe(20))}equals(t){return n$(this.buf,t.buf)}isZero(){return this.equals(c4.zero())}toString(){return qi(this.buf)}toArray(){return this.buf}static publicToAddress(t,n=!1){let r=t;if(xoe(r),n&&r.length!==64&&(r=j1.ProjectivePoint.fromHex(r).toRawBytes(!1).slice(1)),r.length!==64)throw new Error("Expected pubKey to be of length 64");return cd(r).slice(-20)}}const N9t=(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")}`)},DFe=e=>{let t,n;if(S9t(e)){t=e;const r=[];for(let s=0;s<e.length;s+=1){const a=e[s],o=To(a.address),l=[];for(let c=0;c<a.storageKeys.length;c+=1)l.push(To(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=qi(a[0]),l=[];for(let u=0;u<a[1].length;u+=1)l.push(qi(a[1][u]));const c={address:o,storageKeys:l};r.push(c)}t=r}return{AccessListJSON:t,accessList:n}},BFe=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")}},$Fe=e=>{const t=[];for(let n=0;n<e.length;n+=1){const r=e[n],s={address:qi(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(qi(wge(l,32)))}t.push(s)}return t},UFe=(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 uN{constructor(t,n){var r,s;this.cache={hash:void 0,dataFee:void 0},this.activeCapabilities=[],this.DEFAULT_CHAIN=pR.Mainnet,this.DEFAULT_HARDFORK=io.Merge;const{nonce:a,gasLimit:o,to:l,value:c,data:u,v:d,r:f,s:x,type:g}=t;this._type=Number(Ya(To(g))),this.txOptions=n;const v=To(l===""?"0x":l),w=To(d===""?"0x":d),C=To(f===""?"0x":f),N=To(x===""?"0x":x);this.nonce=Ya(To(a===""?"0x":a)),this.gasLimit=Ya(To(o===""?"0x":o)),this.to=v.length>0?new c4(v):void 0,this.value=Ya(To(c===""?"0x":c)),this.data=To(u===""?"0x":u),this.v=w.length>0?Ya(w):void 0,this.r=C.length>0?Ya(C):void 0,this.s=N.length>0?Ya(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 P=this.to===void 0||this.to===null,I=(r=n.allowUnlimitedInitCodeSize)!==null&&r!==void 0?r:!1,R=(s=n.common)!==null&&s!==void 0?s:this._getCommon();P&&R.isActivatedEIP(3860)&&!I&&N9t(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>gjt){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 mR(t).length!==0}catch{return!1}}getSenderAddress(){return new c4(c4.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(A0.EIP155ReplayProtection)&&(this.activeCapabilities.push(A0.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(A0.EIP155ReplayProtection);c>-1&&this.activeCapabilities.splice(c,1)}return l}_getCommon(t,n){var r,s,a,o;if(n!==void 0){const l=Ya(To(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 Zl.isSupportedChainId(l)?new Zl({chain:l,hardfork:this.DEFAULT_HARDFORK}):Zl.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 Zl.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 Zl({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>=UE){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>UE){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()?qi(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=j1.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 See=2,gV=lo(See.toString(16).padStart(2,"0"));class Zv extends uN{static fromTxData(t,n={}){return new Zv(t,n)}static fromSerializedTx(t,n={}){if(!n$(t.subarray(0,1),gV))throw new Error(`Invalid serialized tx input: not an EIP-1559 transaction (wrong tx type, expected: ${See}, received: ${qi(t.subarray(0,1))}`);const r=Yh.RLP.decode(t.subarray(1));if(!Array.isArray(r))throw new Error("Invalid serialized tx input: must be array");return Zv.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}),Yae({nonce:s,maxPriorityFeePerGas:a,maxFeePerGas:o,gasLimit:l,value:u,v:x,r:g,s:v}),new Zv({chainId:Ya(r),nonce:s,maxPriorityFeePerGas:a,maxFeePerGas:o,gasLimit:l,to:c,value:u,data:d,accessList:f??[],v:x!==void 0?Ya(x):void 0,r:g,s:v},n)}constructor(t,n={}){var r;super(Object.assign(Object.assign({},t),{type:See}),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=DFe(a??[]);if(this.accessList=c.accessList,this.AccessListJSON=c.AccessListJSON,BFe(this.accessList),this.maxFeePerGas=Ya(To(o===""?"0x":o)),this.maxPriorityFeePerGas=Ya(To(l===""?"0x":l)),this._validateCannotExceedMaxInteger({maxFeePerGas:this.maxFeePerGas,maxPriorityFeePerGas:this.maxPriorityFeePerGas}),uN._validateNotArray(t),this.gasLimit*this.maxFeePerGas>UE){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(UFe(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[la(this.chainId),la(this.nonce),la(this.maxPriorityFeePerGas),la(this.maxFeePerGas),la(this.gasLimit),this.to!==void 0?this.to.buf:Uint8Array.from([]),la(this.value),this.data,this.accessList,this.v!==void 0?la(this.v):Uint8Array.from([]),this.r!==void 0?la(this.r):Uint8Array.from([]),this.s!==void 0?la(this.s):Uint8Array.from([])]}serialize(){const t=this.raw();return yd(gV,Yh.RLP.encode(t))}getMessageToSign(t=!0){const n=this.raw().slice(0,9),r=yd(gV,Yh.RLP.encode(n));return t?cd(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=cd(this.serialize())),this.cache.hash):cd(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 goe(t,n+BigInt(27),la(r),la(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 Zv.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:Ya(n),s:Ya(r)},s)}toJSON(){const t=$Fe(this.accessList);return{chainId:Io(this.chainId),nonce:Io(this.nonce),maxPriorityFeePerGas:Io(this.maxPriorityFeePerGas),maxFeePerGas:Io(this.maxFeePerGas),gasLimit:Io(this.gasLimit),to:this.to!==void 0?this.to.toString():void 0,value:Io(this.value),data:qi(this.data),accessList:t,v:this.v!==void 0?Io(this.v):void 0,r:this.r!==void 0?Io(this.r):void 0,s:this.s!==void 0?Io(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 Nee=1,bV=lo(Nee.toString(16).padStart(2,"0"));class Jv extends uN{static fromTxData(t,n={}){return new Jv(t,n)}static fromSerializedTx(t,n={}){if(!n$(t.subarray(0,1),bV))throw new Error(`Invalid serialized tx input: not an EIP-2930 transaction (wrong tx type, expected: ${Nee}, received: ${qi(t.subarray(0,1))}`);const r=Yh.RLP.decode(Uint8Array.from(t.subarray(1)));if(!Array.isArray(r))throw new Error("Invalid serialized tx input: must be array");return Jv.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}),Yae({nonce:s,gasPrice:a,gasLimit:o,value:c,v:f,r:x,s:g});const v=[];return new Jv({chainId:Ya(r),nonce:s,gasPrice:a,gasLimit:o,to:l,value:c,data:u,accessList:d??v,v:f!==void 0?Ya(f):void 0,r:x,s:g},n)}constructor(t,n={}){var r;super(Object.assign(Object.assign({},t),{type:Nee}),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=DFe(a??[]);if(this.accessList=l.accessList,this.AccessListJSON=l.AccessListJSON,BFe(this.accessList),this.gasPrice=Ya(To(o===""?"0x":o)),this._validateCannotExceedMaxInteger({gasPrice:this.gasPrice}),uN._validateNotArray(t),this.gasPrice*this.gasLimit>UE){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(UFe(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[la(this.chainId),la(this.nonce),la(this.gasPrice),la(this.gasLimit),this.to!==void 0?this.to.buf:Uint8Array.from([]),la(this.value),this.data,this.accessList,this.v!==void 0?la(this.v):Uint8Array.from([]),this.r!==void 0?la(this.r):Uint8Array.from([]),this.s!==void 0?la(this.s):Uint8Array.from([])]}serialize(){const t=this.raw();return yd(bV,Yh.RLP.encode(t))}getMessageToSign(t=!0){const n=this.raw().slice(0,8),r=yd(bV,Yh.RLP.encode(n));return t?cd(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=cd(this.serialize())),this.cache.hash):cd(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 goe(t,n+BigInt(27),la(r),la(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 Jv.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:Ya(n),s:Ya(r)},s)}toJSON(){const t=$Fe(this.accessList);return{chainId:Io(this.chainId),nonce:Io(this.nonce),gasPrice:Io(this.gasPrice),gasLimit:Io(this.gasLimit),to:this.to!==void 0?this.to.toString():void 0,value:Io(this.value),data:qi(this.data),accessList:t,v:this.v!==void 0?Io(this.v):void 0,r:this.r!==void 0?Io(this.r):void 0,s:this.s!==void 0?Io(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 A9t=0;function Nge(e,t){const n=Number(e),r=Number(t)*2;return n===r+35||n===r+36}class my extends uN{static fromTxData(t,n={}){return new my(t,n)}static fromSerializedTx(t,n={}){const r=Yh.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 Yae({nonce:r,gasPrice:s,gasLimit:a,value:l,v:u,r:d,s:f}),new my({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:A9t}),n),this.common=this._validateTxV(this.v,n.common),this.gasPrice=Ya(To(t.gasPrice===""?"0x":t.gasPrice)),this.gasPrice*this.gasLimit>UE){const a=this._errorMsg("gas limit * gasPrice cannot exceed MAX_INTEGER (2^256-1)");throw new Error(a)}this._validateCannotExceedMaxInteger({gasPrice:this.gasPrice}),uN._validateNotArray(t),this.common.gteHardfork("spuriousDragon")&&(this.isSigned()?Nge(this.v,this.common.chainId())&&this.activeCapabilities.push(A0.EIP155ReplayProtection):this.activeCapabilities.push(A0.EIP155ReplayProtection)),((r=n==null?void 0:n.freeze)!==null&&r!==void 0?r:!0)&&Object.freeze(this)}raw(){return[la(this.nonce),la(this.gasPrice),la(this.gasLimit),this.to!==void 0?this.to.buf:Uint8Array.from([]),la(this.value),this.data,this.v!==void 0?la(this.v):Uint8Array.from([]),this.r!==void 0?la(this.r):Uint8Array.from([]),this.s!==void 0?la(this.s):Uint8Array.from([])]}serialize(){return Yh.RLP.encode(this.raw())}_getMessageToSign(){const t=[la(this.nonce),la(this.gasPrice),la(this.gasLimit),this.to!==void 0?this.to.buf:Uint8Array.from([]),la(this.value),this.data];return this.supports(A0.EIP155ReplayProtection)&&(t.push(To(this.common.chainId())),t.push(mR(To(0))),t.push(mR(To(0)))),t}getMessageToSign(t=!0){const n=this._getMessageToSign();return t?cd(Yh.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=cd(Yh.RLP.encode(this.raw()))),this.cache.hash):cd(Yh.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 cd(Yh.RLP.encode(t))}getSenderPublicKey(){const t=this.getMessageToVerifySignature(),{v:n,r,s}=this;this._validateHighS();try{return goe(t,n,la(r),la(s),this.supports(A0.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(A0.EIP155ReplayProtection)&&(s+=this.common.chainId()*BigInt(2)+BigInt(8));const a=Object.assign(Object.assign({},this.txOptions),{common:this.common});return my.fromTxData({nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,v:s,r:Ya(n),s:Ya(r)},a)}toJSON(){return{nonce:Io(this.nonce),gasPrice:Io(this.gasPrice),gasLimit:Io(this.gasLimit),to:this.to!==void 0?this.to.toString():void 0,value:Io(this.value),data:qi(this.data),v:this.v!==void 0?Io(this.v):void 0,r:this.r!==void 0?Io(this.r):void 0,s:this.s!==void 0?Io(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 yV=new Map;class V3{constructor(){}static typeToInt(t){return Number(Ya(To(t)))}static registerTransactionType(t,n){const r=V3.typeToInt(t);yV.set(r,n)}static fromTxData(t,n={}){if(!("type"in t)||t.type===void 0)return my.fromTxData(t,n);const r=V3.typeToInt(t.type);if(r===0)return my.fromTxData(t,n);if(r===1)return Jv.fromTxData(t,n);if(r===2)return Zv.fromTxData(t,n);const s=yV.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 Jv.fromSerializedTx(t,n);case 2:return Zv.fromSerializedTx(t,n);default:{const r=yV.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 my.fromSerializedTx(t,n)}static fromBlockBodyData(t,n={}){if(u2(t))return this.fromSerializedData(t,n);if(Array.isArray(t))return my.fromValuesArray(t,n);throw new Error("Cannot decode transaction: unknown type input")}}var f$=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 LA=(e,t)=>{let n;if(!t&&typeof e=="string"&&Aa(e)&&e.length!==66)throw new Lxe;try{n=u2(e)?e:sx(e)}catch{throw new YSt}if(!t&&n.byteLength!==32)throw new Lxe;return n},boe=(e,t=!1)=>{const n=Aa(e)?e:wm(e),r=lo(n),s=lo(QPe(`Ethereum Signed Message:
${r.byteLength}`)),a=t?r:yd(s,r);return Qf(a)},j9t=(e,t)=>{const n=LA(t),r=j1.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:nc(l),r:`0x${a}`,s:`0x${o}`,signature:`${qi(s)}${l.toString(16)}`}},zFe=(e,t)=>{const n=boe(e),{messageHash:r,v:s,r:a,s:o,signature:l}=j9t(n,t);return{message:e,messageHash:r,v:s,r:a,s:o,signature:l}},E9t=(e,t)=>f$(void 0,void 0,void 0,function*(){const n=e.sign(lo(t));if(xr(n.v)||xr(n.r)||xr(n.s))throw new uee("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 uee(o)}const s=qi(n.serialize()),a=Qf(s);return{messageHash:qi(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:qi(a)}}),_9t=e=>{if(xr(e))throw new fNt;const t=V3.fromSerializedData(lo(e));return fx(t.getSenderAddress().toString())},Aee=(e,t,n,r,s)=>{if(typeof e=="object"){const f=`${e.r}${e.s.slice(2)}${e.v.slice(2)}`;return Aee(e.messageHash,f,n)}if(typeof t=="string"&&typeof n=="string"&&!xr(r)){const f=`${n}${r.slice(2)}${t.slice(2)}`;return Aee(e,f,s)}if(xr(t))throw new XSt("signature string undefined");const a=130,o=n?e:boe(e);let l=parseInt(t.substring(a),16);l>26&&(l-=27);const c=j1.Signature.fromCompact(t.slice(2,a)).addRecoveryBit(l).recoverPublicKey(o.replace("0x","")).toRawBytes(!1),u=Qf(c.subarray(1));return fx(`0x${u.slice(-40)}`)},h$=e=>{const t=LA(e),n=j1.getPublicKey(t,!1),s=Qf(n.slice(1)).slice(-40);return fx(`0x${s}`)},k9t=(e,t)=>{const n=LA(e);return`0x${qi(j1.getPublicKey(n,t)).slice(4)}`},HFe=(e,t,n)=>f$(void 0,void 0,void 0,function*(){var r,s,a,o,l,c,u;const d=LA(e);let f;if(n!=null&&n.salt?f=typeof n.salt=="string"?lo(n.salt):n.salt:f=DE(32),!(Gae(t)||u2(t)))throw new JSt;const x=typeof t=="string"?lo(wm(t)):t;let g;if(n!=null&&n.iv){if(g=typeof n.iv=="string"?lo(n.iv):n.iv,g.length!==16)throw new eNt}else g=DE(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:qi(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 tNt;w=NFe(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:qi(f).replace("0x","")},w=AFe(x,f,C.n,C.p,C.r,C.dklen);else throw new dPe;const N=yield loe(d,w.slice(0,16),g,"aes-128-ctr"),P=qi(N).slice(2),I=Qf(yd(w.slice(16,32),N)).replace("0x","");return{version:3,id:roe(),address:h$(d).toLowerCase().replace("0x",""),crypto:{ciphertext:P,cipherparams:{iv:qi(g).replace("0x","")},cipher:"aes-128-ctr",kdf:v,kdfparams:C,mac:I}}}),yoe=(e,t)=>{const n=LA(e,t);return{address:h$(n),privateKey:qi(n),signTransaction:r=>{throw new uee("Do not have network access to sign the transaction")},sign:r=>zFe(typeof r=="string"?r:JSON.stringify(r),n),encrypt:(r,s)=>f$(void 0,void 0,void 0,function*(){return HFe(n,r,s)})}},T9t=()=>{const e=j1.utils.randomPrivateKey();return yoe(`${qi(e)}`)},I9t=(e,t,n)=>f$(void 0,void 0,void 0,function*(){const r=typeof e=="object"?e:JSON.parse(n?e.toLowerCase():e);if(Gs.validateJSONSchema(bjt,r),r.version!==3)throw new ZSt;const s=typeof t=="string"?lo(wm(t)):t;Gs.validate(["bytes"],[s]);let a;if(r.crypto.kdf==="scrypt"){const u=r.crypto.kdfparams,d=typeof u.salt=="string"?lo(u.salt):u.salt;a=AFe(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"?lo(u.salt):u.salt;a=NFe(s,d,u.c,u.dklen,"sha256")}else throw new dPe;const o=lo(r.crypto.ciphertext);if(Qf(yd(a.slice(16,32),o)).replace("0x","")!==r.crypto.mac)throw new QSt;const c=yield A7t(lo(r.crypto.ciphertext),a.slice(0,16),lo(r.crypto.cipherparams.iv));return yoe(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 P9t=1e3;class F9t{constructor(t){this._requestManager=t,this._requests=new Map}get requests(){return[...this._requests.values()].map(t=>t.payload)}add(t){const n=U3(t),r=new uR;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 uR({timeout:(n=t==null?void 0:t.timeout)!==null&&n!==void 0?n:P9t,eagerStart:!0,timeoutMessage:"Batch request timeout"});return this._processBatchRequest(r).catch(s=>r.reject(s)),r.catch(s=>{s instanceof fPe&&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 N0(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 N0(s,`Batch request mismatch the results. Requests: [${a.join()}], Responses: [${o.join()}]`);for(const l of s)jy(l)?(n=this._requests.get(l.id))===null||n===void 0||n.promise.resolve(l.result):Ey(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 lNt(t))}}var O9t=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 Jd extends g7t{constructor(t){var n;if(super(),this.providers=e3.providers,ri(t)||typeof t=="string"&&t.trim()!==""||dR(t)){this._requestManager=new e3(t),this._subscriptionManager=new fR(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 e3(s,(n=r==null?void 0:r.enableExperimentalFeatures)===null||n===void 0?void 0:n.useSubscriptionWhenCheckingBlockTimeout,d),o?this._subscriptionManager=o:this._subscriptionManager=new fR(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(z3.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(z3.CONFIG_CHANGE,n=>{this.setConfig({[n.name]:n.newValue})})}registerPlugin(t){if(this[t.pluginNamespace]!==void 0)throw new cNt(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 Jd.givenProvider}setProvider(t){return this.provider=t,!0}setRequestManagerMiddleware(t){this.requestManager.setMiddleware(t)}get BatchRequest(){return F9t.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)=>O9t(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}}Jd.providers=e3.providers;class Ml{constructor(t){if(this.toAddress=()=>{if(this.isDirect()){const n=this._iban.slice(4),r=Ml._parseInt(n,36),s=RE(r,40);return fx(s)}throw new Error("Iban is indirect and cannot be converted. Must be length of 34 or 35")},Ml.isIndirect(t)||Ml.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 Ml.isDirect(this._iban)}static isIndirect(t){return t.length===20}isIndirect(){return Ml.isIndirect(this._iban)}static isValid(t){return/^XE[0-9]{2}(ETH[0-9A-Z]{13}|[0-9A-Z]{30,31})$/.test(t)&&Ml._mod9710(Ml._iso13616Prepare(t))===1}isValid(){return Ml.isValid(this._iban)}static fromBban(t){const n="XE",s=`0${(98-this._mod9710(this._iso13616Prepare(`${n}00${t}`))).toString()}`.slice(-2);return new Ml(`${n}${s}${t}`)}static createIndirect(t){return Ml.fromBban(`ETH${t.institution}${t.identifier}`)}static fromAddress(t){if(!Xf(t))throw new $ae(t);const r=BigInt(Jk(t)).toString(36),s=RE(r,15);return Ml.fromBban(s.toUpperCase())}static toIban(t){return Ml.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}}Ml._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("")};Ml._parseInt=(e,t)=>[...e].reduce((n,r)=>BigInt(parseInt(r,t))+BigInt(t)*n,BigInt(0));Ml._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};Ml.toAddress=e=>new Ml(e).toAddress();var vV=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())})},VFe;class WFe extends l${constructor(t){super(),this[VFe]="Promise",this._promise=new Promise(t)}then(t,n){return vV(this,void 0,void 0,function*(){return this._promise.then(t,n)})}catch(t){return vV(this,void 0,void 0,function*(){return this._promise.catch(t)})}finally(t){return vV(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}}VFe=Symbol.toStringTag;var wV={},jge;function M9t(){return jge||(jge=1,function(e,t){if(e.setImmediate)return;var n=1,r={},s=!1,a=e.document,o;function l(P){typeof P!="function"&&(P=new Function(""+P));for(var I=new Array(arguments.length-1),R=0;R<I.length;R++)I[R]=arguments[R+1];var O={callback:P,args:I};return r[n]=O,o(n),n++}function c(P){delete r[P]}function u(P){var I=P.callback,R=P.args;switch(R.length){case 0:I();break;case 1:I(R[0]);break;case 2:I(R[0],R[1]);break;case 3:I(R[0],R[1],R[2]);break;default:I.apply(t,R);break}}function d(P){if(s)setTimeout(d,0,P);else{var I=r[P];if(I){s=!0;try{u(I)}finally{c(P),s=!1}}}}function f(){o=function(P){process.nextTick(function(){d(P)})}}function x(){if(e.postMessage&&!e.importScripts){var P=!0,I=e.onmessage;return e.onmessage=function(){P=!1},e.postMessage("","*"),e.onmessage=I,P}}function g(){var P="setImmediate$"+Math.random()+"$",I=function(R){R.source===e&&typeof R.data=="string"&&R.data.indexOf(P)===0&&d(+R.data.slice(P.length))};e.addEventListener?e.addEventListener("message",I,!1):e.attachEvent("onmessage",I),o=function(R){e.postMessage(P+R,"*")}}function v(){var P=new MessageChannel;P.port1.onmessage=function(I){var R=I.data;d(R)},o=function(I){P.port2.postMessage(I)}}function w(){var P=a.documentElement;o=function(I){var R=a.createElement("script");R.onreadystatechange=function(){d(I),R.onreadystatechange=null,P.removeChild(R),R=null},P.appendChild(R)}}function C(){o=function(P){setTimeout(d,0,P)}}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 Iu>"u"?wV:Iu:self)),wV}M9t();var hi=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 R9t(e){return hi(this,void 0,void 0,function*(){return e.send({method:"eth_protocolVersion",params:[]})})}function qFe(e){return hi(this,void 0,void 0,function*(){return e.send({method:"eth_syncing",params:[]})})}function L9t(e){return hi(this,void 0,void 0,function*(){return e.send({method:"eth_coinbase",params:[]})})}function D9t(e){return hi(this,void 0,void 0,function*(){return e.send({method:"eth_mining",params:[]})})}function B9t(e){return hi(this,void 0,void 0,function*(){return e.send({method:"eth_hashrate",params:[]})})}function $9t(e){return hi(this,void 0,void 0,function*(){return e.send({method:"eth_gasPrice",params:[]})})}function U9t(e){return hi(this,void 0,void 0,function*(){return e.send({method:"eth_maxPriorityFeePerGas",params:[]})})}function z9t(e){return hi(this,void 0,void 0,function*(){return e.send({method:"eth_accounts",params:[]})})}function H9t(e){return hi(this,void 0,void 0,function*(){return e.send({method:"eth_blockNumber",params:[]})})}function V9t(e,t,n){return hi(this,void 0,void 0,function*(){return Gs.validate(["address","blockNumberOrTag"],[t,n]),e.send({method:"eth_getBalance",params:[t,n]})})}function W9t(e,t,n,r){return hi(this,void 0,void 0,function*(){return Gs.validate(["address","hex","blockNumberOrTag"],[t,n,r]),e.send({method:"eth_getStorageAt",params:[t,n,r]})})}function q9t(e,t,n){return hi(this,void 0,void 0,function*(){return Gs.validate(["address","blockNumberOrTag"],[t,n]),e.send({method:"eth_getTransactionCount",params:[t,n]})})}function G9t(e,t){return hi(this,void 0,void 0,function*(){return Gs.validate(["bytes32"],[t]),e.send({method:"eth_getBlockTransactionCountByHash",params:[t]})})}function K9t(e,t){return hi(this,void 0,void 0,function*(){return Gs.validate(["blockNumberOrTag"],[t]),e.send({method:"eth_getBlockTransactionCountByNumber",params:[t]})})}function Y9t(e,t){return hi(this,void 0,void 0,function*(){return Gs.validate(["bytes32"],[t]),e.send({method:"eth_getUncleCountByBlockHash",params:[t]})})}function X9t(e,t){return hi(this,void 0,void 0,function*(){return Gs.validate(["blockNumberOrTag"],[t]),e.send({method:"eth_getUncleCountByBlockNumber",params:[t]})})}function Q9t(e,t,n){return hi(this,void 0,void 0,function*(){return Gs.validate(["address","blockNumberOrTag"],[t,n]),e.send({method:"eth_getCode",params:[t,n]})})}function Z9t(e,t,n){return hi(this,void 0,void 0,function*(){return Gs.validate(["address","hex"],[t,n]),e.send({method:"eth_sign",params:[t,n]})})}function J9t(e,t){return hi(this,void 0,void 0,function*(){return e.send({method:"eth_signTransaction",params:[t]})})}function eEt(e,t){return hi(this,void 0,void 0,function*(){return e.send({method:"eth_sendTransaction",params:[t]})})}function GFe(e,t){return hi(this,void 0,void 0,function*(){return Gs.validate(["hex"],[t]),e.send({method:"eth_sendRawTransaction",params:[t]})})}function tEt(e,t,n){return hi(this,void 0,void 0,function*(){return Gs.validate(["blockNumberOrTag"],[n]),e.send({method:"eth_call",params:[t,n]})})}function nEt(e,t,n){return hi(this,void 0,void 0,function*(){return Gs.validate(["blockNumberOrTag"],[n]),e.send({method:"eth_estimateGas",params:[t,n]})})}function rEt(e,t,n){return hi(this,void 0,void 0,function*(){return Gs.validate(["bytes32","bool"],[t,n]),e.send({method:"eth_getBlockByHash",params:[t,n]})})}function KFe(e,t,n){return hi(this,void 0,void 0,function*(){return Gs.validate(["blockNumberOrTag","bool"],[t,n]),e.send({method:"eth_getBlockByNumber",params:[t,n]})})}function sEt(e,t){return hi(this,void 0,void 0,function*(){return Gs.validate(["bytes32"],[t]),e.send({method:"eth_getTransactionByHash",params:[t]})})}function iEt(e,t,n){return hi(this,void 0,void 0,function*(){return Gs.validate(["bytes32","hex"],[t,n]),e.send({method:"eth_getTransactionByBlockHashAndIndex",params:[t,n]})})}function aEt(e,t,n){return hi(this,void 0,void 0,function*(){return Gs.validate(["blockNumberOrTag","hex"],[t,n]),e.send({method:"eth_getTransactionByBlockNumberAndIndex",params:[t,n]})})}function oEt(e,t){return hi(this,void 0,void 0,function*(){return Gs.validate(["bytes32"],[t]),e.send({method:"eth_getTransactionReceipt",params:[t]})})}function lEt(e,t,n){return hi(this,void 0,void 0,function*(){return Gs.validate(["bytes32","hex"],[t,n]),e.send({method:"eth_getUncleByBlockHashAndIndex",params:[t,n]})})}function cEt(e,t,n){return hi(this,void 0,void 0,function*(){return Gs.validate(["blockNumberOrTag","hex"],[t,n]),e.send({method:"eth_getUncleByBlockNumberAndIndex",params:[t,n]})})}function uEt(e,t){return hi(this,void 0,void 0,function*(){return Gs.validate(["filter"],[t]),e.send({method:"eth_newFilter",params:[t]})})}function dEt(e){return hi(this,void 0,void 0,function*(){return e.send({method:"eth_newBlockFilter",params:[]})})}function fEt(e){return hi(this,void 0,void 0,function*(){return e.send({method:"eth_newPendingTransactionFilter",params:[]})})}function hEt(e,t){return hi(this,void 0,void 0,function*(){return Gs.validate(["hex"],[t]),e.send({method:"eth_uninstallFilter",params:[t]})})}function pEt(e,t){return hi(this,void 0,void 0,function*(){return Gs.validate(["hex"],[t]),e.send({method:"eth_getFilterChanges",params:[t]})})}function mEt(e,t){return hi(this,void 0,void 0,function*(){return Gs.validate(["hex"],[t]),e.send({method:"eth_getFilterLogs",params:[t]})})}function xEt(e,t){return hi(this,void 0,void 0,function*(){return Gs.validate(["filter"],[t]),e.send({method:"eth_getLogs",params:[t]})})}function gEt(e){return hi(this,void 0,void 0,function*(){return e.send({method:"eth_getWork",params:[]})})}function bEt(e,t,n,r){return hi(this,void 0,void 0,function*(){return Gs.validate(["bytes8","bytes32","bytes32"],[t,n,r]),e.send({method:"eth_submitWork",params:[t,n,r]})})}function yEt(e,t,n,r){return hi(this,void 0,void 0,function*(){Gs.validate(["hex","blockNumberOrTag"],[t,n]);for(const s of r)Gs.validate(["number"],[s]);return e.send({method:"eth_feeHistory",params:[t,n,r]})})}function vEt(e){return hi(this,void 0,void 0,function*(){return e.send({method:"eth_pendingTransactions",params:[]})})}function wEt(e){return hi(this,void 0,void 0,function*(){return e.send({method:"eth_requestAccounts",params:[]})})}function CEt(e){return hi(this,void 0,void 0,function*(){return e.send({method:"eth_chainId",params:[]})})}function SEt(e,t,n,r){return hi(this,void 0,void 0,function*(){return Gs.validate(["address","bytes32[]","blockNumberOrTag"],[t,n,r]),e.send({method:"eth_getProof",params:[t,n,r]})})}function NEt(e){return hi(this,void 0,void 0,function*(){return e.send({method:"web3_clientVersion",params:[]})})}function AEt(e,t,n){return hi(this,void 0,void 0,function*(){return Gs.validate(["blockNumberOrTag"],[n]),e.send({method:"eth_createAccessList",params:[t,n]})})}function jEt(e,t,n,r=!1){return hi(this,void 0,void 0,function*(){return Gs.validate(["address"],[t]),e.send({method:`eth_signTypedData${r?"":"_v4"}`,params:[t,n]})})}var voe=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 EEt(e){return voe(this,void 0,void 0,function*(){return e.send({method:"net_version",params:[]})})}function _Et(e){return voe(this,void 0,void 0,function*(){return e.send({method:"net_peerCount",params:[]})})}function kEt(e){return voe(this,void 0,void 0,function*(){return e.send({method:"net_listening",params:[]})})}var E1=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 TEt=e=>E1(void 0,void 0,void 0,function*(){return e.send({method:"personal_listAccounts",params:[]})}),IEt=(e,t)=>E1(void 0,void 0,void 0,function*(){return e.send({method:"personal_newAccount",params:[t]})}),PEt=(e,t,n,r)=>E1(void 0,void 0,void 0,function*(){return e.send({method:"personal_unlockAccount",params:[t,n,r]})}),FEt=(e,t)=>E1(void 0,void 0,void 0,function*(){return e.send({method:"personal_lockAccount",params:[t]})}),OEt=(e,t,n)=>E1(void 0,void 0,void 0,function*(){return e.send({method:"personal_importRawKey",params:[t,n]})}),MEt=(e,t,n)=>E1(void 0,void 0,void 0,function*(){return e.send({method:"personal_sendTransaction",params:[t,n]})}),REt=(e,t,n)=>E1(void 0,void 0,void 0,function*(){return e.send({method:"personal_signTransaction",params:[t,n]})}),LEt=(e,t,n,r)=>E1(void 0,void 0,void 0,function*(){return e.send({method:"personal_sign",params:[t,n,r]})}),DEt=(e,t,n)=>E1(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"}}},dP=(e,t,n)=>{try{Gs.validateJSONSchema(e,t)}catch(r){throw r instanceof nN?new RNt(r.errors,n):r}},BEt=e=>{var t,n;const r=e;if(!xr(r.type)){let a;switch(r.type){case"0x0":a=Ege;break;case"0x1":a=_ge;break;case"0x2":a=kge;break;default:return Wr({format:"uint"},r.type,mi)}return dP(a,r,r.type),Wr({format:"uint"},r.type,mi)}if(!xr(r.maxFeePerGas)||!xr(r.maxPriorityFeePerGas))return dP(kge,r,"0x2"),"0x2";if(!xr(r.accessList))return dP(_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(!xr(s)){const a=Object.keys(Xj).indexOf(s);if(a>=Object.keys(Xj).indexOf("london"))return xr(r.gasPrice)?"0x2":"0x0";if(a===Object.keys(Xj).indexOf("berlin"))return"0x0"}if(!xr(r.gasPrice))return dP(Ege,r,"0x0"),"0x0"},$Et=(e,t)=>{var n;return((n=t==null?void 0:t.transactionTypeParser)!==null&&n!==void 0?n:BEt)(e)},UEt=e=>e[0]>127?"0x0":p1(e[0]),zEt={type:"object",properties:{address:{format:"address"},storageKeys:{type:"array",items:{format:"bytes32"}}}},woe={type:"array",items:Object.assign({},zEt)},HEt={type:"object",properties:{accessList:Object.assign({},woe),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"]},VEt={type:"object",properties:{name:{format:"string"},networkId:{format:"uint"},chainId:{format:"uint"}}},YFe={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({},woe),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({},VEt),baseChain:Object.assign({},Tge),hardfork:Object.assign({},Ige)}},gasLimit:{format:"uint"},v:{format:"uint"},r:{format:"bytes32"},s:{format:"bytes32"}}},jee={type:"object",properties:Object.assign(Object.assign({},YFe.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({},woe),data:{format:"bytes"},input:{format:"bytes"},nonce:{format:"uint"},gasLimit:{format:"uint"},v:{format:"uint"},r:{format:"bytes32"},s:{format:"bytes32"}})},XFe={type:"object",properties:{index:{format:"uint"},validatorIndex:{format:"uint"},address:{format:"address"},amount:{format:"uint"}}},xR={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({},jee)},{type:"array",items:{format:"bytes32"}}]},transactionsRoot:{format:"bytes32"},uncles:{type:"array",items:{format:"bytes32"}},withdrawals:{type:"array",items:Object.assign({},XFe)},withdrawalsRoot:{format:"bytes32"}}},WEt={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({},XFe)},withdrawalsRoot:{format:"bytes32"}}},DA={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"}}}},qEt={type:"object",properties:{startingBlock:{format:"string"},currentBlock:{format:"string"},highestBlock:{format:"string"},knownStates:{format:"string"},pulledStates:{format:"string"}}},BA={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({},DA)},logsBloom:{format:"bytes"},root:{format:"bytes"},status:{format:"uint"},type:{format:"uint"}}},GEt={type:"object",properties:{messageHash:{format:"bytes"},r:{format:"bytes32"},s:{format:"bytes32"},v:{format:"bytes"},message:{format:"bytes"},signature:{format:"bytes"}}},KEt={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"}}}},YEt={type:"object",properties:{key:{format:"bytes32"},value:{format:"uint"},proof:{type:"array",items:{format:"bytes32"}}}},XEt={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({},YEt)}}};function df(e,t=hd,n={transactionSchema:jee,fillInputAndData:!1}){var r,s;let a=d2({},e);if(xr(e==null?void 0:e.common)||(a.common=Object.assign({},e.common),xr((r=e.common)===null||r===void 0?void 0:r.customChain)||(a.common.customChain=Object.assign({},e.common.customChain))),a=Wr((s=n.transactionSchema)!==null&&s!==void 0?s:jee,a,t),!xr(a.data)&&!xr(a.input)&&p1(a.data)!==p1(a.input))throw new xPe({data:qi(a.data),input:qi(a.input)});return n.fillInputAndData&&(xr(a.data)?xr(a.input)||(a.data=a.input):a.input=a.data),xr(a.gasLimit)||(a.gas=a.gasLimit,delete a.gasLimit),a}function QEt(e,t,n={fillInputAndData:!1}){return{raw:Wr({format:"bytes"},e,t),tx:df(Object.assign(Object.assign({},V3.fromSerializedData(lo(e)).toJSON()),{hash:qi(iN(lo(e))),type:UEt(lo(e))}),t,{fillInputAndData:n.fillInputAndData,transactionSchema:n.transactionSchema})}}var Coe=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 Soe(e,t){return Coe(this,void 0,void 0,function*(){const n=yield EEt(e.requestManager);return Wr({format:"uint"},n,t)})}function ZEt(e,t){return Coe(this,void 0,void 0,function*(){const n=yield _Et(e.requestManager);return Wr({format:"uint"},n,t)})}const JEt=e=>Coe(void 0,void 0,void 0,function*(){return kEt(e.requestManager)});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())})};class QFe extends Jd{getId(t=this.defaultReturnFormat){return CV(this,void 0,void 0,function*(){return Soe(this,t)})}getPeerCount(t=this.defaultReturnFormat){return CV(this,void 0,void 0,function*(){return ZEt(this,t)})}isListening(){return CV(this,void 0,void 0,function*(){return JEt(this)})}}const dN="ALLEVENTS",Eee={name:dN,signature:"",type:"event",inputs:[]},p$={bytes:d1.HEX,number:Qh.NUMBER};var ZFe=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 e_t(e,t,n){return ZFe(this,void 0,void 0,function*(){var r,s,a,o;const l=yield EOe(t,t.defaultBlock,!1,mi);if(xr(l.baseFeePerGas))throw new PNt;let c;if(xr(e.gasPrice)&&BigInt(l.baseFeePerGas)===BigInt(0)&&(c=yield Poe(t,n)),!xr(e.gasPrice)||!xr(c)){const u=Wr({format:"uint"},(r=e.gasPrice)!==null&&r!==void 0?r:c,n);return{maxPriorityFeePerGas:u,maxFeePerGas:u}}return{maxPriorityFeePerGas:Wr({format:"uint"},(s=e.maxPriorityFeePerGas)!==null&&s!==void 0?s:t.defaultMaxPriorityFeePerGas,n),maxFeePerGas:Wr({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 JFe(e,t,n){return ZFe(this,void 0,void 0,function*(){const r=eOe(e,t);if(!xr(r)){if(r.startsWith("-"))throw new Uxe(r);if(Number(r)<0||Number(r)>127)throw new Uxe(r);if(xr(e.gasPrice)&&(r==="0x0"||r==="0x1"))return{gasPrice:yield Poe(t,n),maxPriorityFeePerGas:void 0,maxFeePerGas:void 0};if(r==="0x2")return Object.assign({gasPrice:void 0},yield e_t(e,t,n))}})}var Noe=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 _ee=(e,t,n,r)=>{if(n!==void 0&&e in n&&n[e]!==void 0){if(typeof n[e]=="string"&&Xf(n[e]))return n[e];if(!Aa(n[e])&&YPe(n[e])){if(t.wallet){const s=t.wallet.get(Wr({format:"uint"},n[e],p$));if(!xr(s))return s.address;throw new zxe}throw new zxe}else throw e==="from"?new hNt(n.from):new pNt(n.to)}if(e==="from"){if(!xr(r))return h$(r);if(!xr(t.defaultAccount))return t.defaultAccount}},t_t=(e,t,...n)=>Noe(void 0,[e,t,...n],void 0,function*(r,s,a=r.defaultReturnFormat){if(xr(s))throw new INt;return kOe(r,s,r.defaultBlock,a)}),eOe=(e,t)=>{const n=$Et(e,t);if(!xr(n))return n;if(!xr(t.defaultTransactionType))return Wr({format:"uint"},t.defaultTransactionType,mi)};function n_t(e){return Noe(this,void 0,void 0,function*(){var t,n;let r=Wr(YFe,e.transaction,e.web3Context.defaultReturnFormat);if(xr(r.from)&&(r.from=_ee("from",e.web3Context,void 0,e.privateKey)),xr(r.nonce)&&(r.nonce=yield t_t(e.web3Context,r.from,mi)),xr(r.value)&&(r.value="0x0"),xr(r.data))xr(r.input)?r.input="0x":r.input.startsWith("0x")||(r.input=`0x${r.input}`);else{if(!xr(r.input)&&r.data!==r.input)throw new xPe({data:qi(r.data),input:qi(r.input)});r.data.startsWith("0x")||(r.data=`0x${r.data}`)}if(xr(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}})}xr(r.chain)&&(r.chain=e.web3Context.defaultChain),xr(r.hardfork)&&(r.hardfork=e.web3Context.defaultHardfork)}if(xr(r.chainId)&&xr((t=r.common)===null||t===void 0?void 0:t.customChain.chainId)&&(r.chainId=yield IOe(e.web3Context,mi)),xr(r.networkId)&&(r.networkId=(n=e.web3Context.defaultNetworkId)!==null&&n!==void 0?n:yield Soe(e.web3Context,mi)),xr(r.gasLimit)&&!xr(r.gas)&&(r.gasLimit=r.gas),r.type=eOe(r,e.web3Context),xr(r.accessList)&&(r.type==="0x1"||r.type==="0x2")&&(r.accessList=[]),e.fillGasPrice&&(r=Object.assign(Object.assign({},r),yield JFe(r,e.web3Context,mi))),xr(r.gas)&&xr(r.gasLimit)&&e.fillGasLimit){const s=yield Moe(e.web3Context,r,"latest",mi);r=Object.assign(Object.assign({},r),{gas:Wr({format:"uint"},s,mi)})}return r})}const r_t=e=>Noe(void 0,void 0,void 0,function*(){var t;return((t=e.web3Context.transactionBuilder)!==null&&t!==void 0?t:n_t)(Object.assign(Object.assign({},e),{transaction:e.transaction}))});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())})};function kee(e,t,n){const r=e.transactionPollingInterval,[s,a]=lFe(()=>Aoe(this,void 0,void 0,function*(){let l;try{l=yield Foe(e,p$)}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 yPe({starterBlockNumber:t,numberOfBlocks:c,transactionHash:n})}),r);return[a,{clean:()=>{clearInterval(s)}}]}function s_t(e,t,n){return Aoe(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]=kee(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 kee(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 yPe({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 tOe(e,t){return Aoe(this,void 0,void 0,function*(){var n,r;const{provider:s}=e.requestManager;let a;const o=yield Foe(e,p$);return!((r=(n=s).supportsSubscriptions)===null||r===void 0)&&r.call(n)&&e.enableExperimentalFeatures.useSubscriptionWhenCheckingBlockTimeout?a=yield s_t(e,o,t):a=kee(e,o,t),a})}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())})};function Tee(e,t,n){return i_t(this,void 0,void 0,function*(){const[r,s]=noe(e.transactionSendTimeout,new FNt({numberOfSeconds:e.transactionSendTimeout/1e3,transactionHash:n})),[a,o]=yield tOe(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 nOe(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]=toe(()=>Pge(this,void 0,void 0,function*(){try{return(r??_Oe)(e,t,n)}catch(x){console.warn("An error happen while trying to get the transaction receipt",x);return}}),a),[c,u]=noe(e.transactionPollingTimeout,new bPe({numberOfSeconds:e.transactionPollingTimeout/1e3,transactionHash:t})),[d,f]=yield tOe(e,t);try{return yield Promise.race([o,u,d])}finally{c&&clearTimeout(c),l&&clearInterval(l),f.clean()}})}var a_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 pO=({web3Context:e,transactionReceipt:t,transactionPromiEvent:n,customTransactionReceiptSchema:r,returnFormat:s})=>{var a;let o=1;const l=setInterval(()=>{a_t(void 0,void 0,void 0,function*(){if(o>=e.transactionConfirmationBlocks){clearInterval(l);return}const c=yield KFe(e.requestManager,nc(BigInt(t.blockNumber)+BigInt(o)),!1);c!=null&&c.hash&&(o+=1,n.emit("confirmation",{confirmations:Wr({format:"uint"},o,s),receipt:Wr(r??BA,t,s),latestBlockHash:Wr({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 o_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:Wr({format:"uint"},f,s),receipt:Wr(r??BA,t,s),latestBlockHash:Wr({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,pO({web3Context:e,transactionReceipt:t,transactionPromiEvent:n,customTransactionReceiptSchema:r,returnFormat:s})}))}).catch(()=>{a=!1,pO({web3Context:e,transactionReceipt:t,customTransactionReceiptSchema:r,transactionPromiEvent:n,returnFormat:s})})}),setTimeout(()=>{a&&pO({web3Context:e,transactionReceipt:t,transactionPromiEvent:n,returnFormat:s})},e.blockHeaderTimeout*1e3)};function l_t(e,t,n,r,s,a){if(xr(n)||xr(n.blockHash))throw new ONt({receipt:n,blockHash:Wr({format:"bytes32"},n==null?void 0:n.blockHash,s),transactionHash:Wr({format:"bytes32"},r,s)});if(!n.blockNumber)throw new MNt({receipt:n});t.emit("confirmation",{confirmations:Wr({format:"uint"},1,s),receipt:Wr(a??BA,n,s),latestBlockHash:Wr({format:"bytes32"},n.blockHash,s)});const o=e.requestManager.provider;o&&"supportsSubscriptions"in o&&o.supportsSubscriptions()?o_t({web3Context:e,transactionReceipt:n,transactionPromiEvent:t,customTransactionReceiptSchema:a,returnFormat:s}):pO({web3Context:e,transactionReceipt:n,transactionPromiEvent:t,customTransactionReceiptSchema:a,returnFormat:s})}const m$=e=>!ri(e)&&typeof e=="object"&&!ri(e.type)&&e.type==="error",joe=e=>!ri(e)&&typeof e=="object"&&!ri(e.type)&&e.type==="event",x$=e=>!ri(e)&&typeof e=="object"&&!ri(e.type)&&e.type==="function",c_t=e=>!ri(e)&&typeof e=="object"&&!ri(e.type)&&e.type==="constructor",u_t=e=>typeof e=="object"&&typeof e.components>"u"&&typeof e.name>"u",rOe=e=>e.includes("[]")?{type:"tuple[]",name:e.slice(0,-2)}:{type:"tuple",name:e},sOe=e=>{const t=[];for(const n of Object.keys(e)){const r=e[n];typeof r=="object"?t.push(Object.assign(Object.assign({},rOe(n)),{components:sOe(r)})):t.push({name:n,type:e[n]})}return t},Iee=(e,t)=>{const n=[];return t.forEach(r=>{if(typeof r.components=="object"){if(!r.type.startsWith("tuple"))throw new Yi(`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=Iee(e,r.components);n.push(`(${o.join(",")})${a}`)}else n.push(r.type)}),n},qg=e=>{var t,n,r,s;return m$(e)||joe(e)||x$(e)?!((t=e.name)===null||t===void 0)&&t.includes("(")?e.name:`${(n=e.name)!==null&&n!==void 0?n:""}(${Iee(!1,(r=e.inputs)!==null&&r!==void 0?r:[]).join(",")})`:`(${Iee(!1,(s=e.inputs)!==null&&s!==void 0?s:[]).join(",")})`},d_t=e=>{if(typeof e!="string"&&!m$(e))throw new Yi("Invalid parameter value in encodeErrorSignature");let t;return e&&(typeof e=="function"||typeof e=="object")?t=qg(e):t=e,Qf(t)},Eoe=e=>{if(typeof e!="string"&&!joe(e))throw new Yi("Invalid parameter value in encodeEventSignature");let t;return e&&(typeof e=="function"||typeof e=="object")?t=qg(e):t=e,Qf(t)};function _oe(e,t){const n=e.exec(t);return n==null?void 0:n.groups}var iOe=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,aOe=/^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)?$/,oOe=/^\(.+?\).*?$/,f_t=Object.defineProperty,h_t=(e,t,n)=>t in e?f_t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,k7=(e,t,n)=>(h_t(e,typeof t!="symbol"?t+"":t,n),n),p_t="abitype",m_t="0.7.1",Xd=class extends Error{constructor(e,t={}){var a;const n=t.cause instanceof Xd?t.cause.details:(a=t.cause)!=null&&a.message?t.cause.message:t.details,r=t.cause instanceof Xd&&t.cause.docsPath||t.docsPath,s=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...r?[`Docs: https://abitype.dev${r}`]:[],...n?[`Details: ${n}`]:[],`Version: ${p_t}@${m_t}`].join(`
`);super(s),k7(this,"details"),k7(this,"docsPath"),k7(this,"metaMessages"),k7(this,"shortMessage"),k7(this,"name","AbiTypeError"),t.cause&&(this.cause=t.cause),this.details=n,this.docsPath=r,this.metaMessages=t.metaMessages,this.shortMessage=e}},lOe=/^struct (?<name>[a-zA-Z0-9_]+) \{(?<properties>.*?)\}$/;function cOe(e){return lOe.test(e)}function x_t(e){return _oe(lOe,e)}var Oge=new Set(["memory","indexed","storage","calldata"]),g_t=new Set(["calldata","memory","storage"]);function b_t(e,t){return t?`${t}:${e}`:e}var SV=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}]]),y_t=/^(?<type>[a-zA-Z0-9_]+?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z0-9_]+))?$/,v_t=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z0-9_]+))?$/,w_t=/^u?int$/;function gR(e,t){var f,x;const n=b_t(e,t==null?void 0:t.type);if(SV.has(n))return SV.get(n);const r=oOe.test(e),s=_oe(r?v_t:y_t,e);if(!s)throw new Xd("Invalid ABI parameter.",{details:e});if(s.name&&S_t(s.name))throw new Xd("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=NC(s.type),v=[],w=g.length;for(let C=0;C<w;C++)v.push(gR(g[C],{structs:l}));u={components:v}}else if(s.type in l)c="tuple",u={components:l[s.type]};else if(w_t.test(s.type))c=`${s.type}256`;else if(c=s.type,(t==null?void 0:t.type)!=="struct"&&!uOe(c))throw new Xd("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 Xd("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${s.modifier}" not allowed${t!=null&&t.type?` in "${t.type}" type`:""}.`]});if(g_t.has(s.modifier)&&!N_t(c,!!s.array))throw new Xd("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 SV.set(n,d),d}function NC(e,t=[],n="",r=0){if(e===""){if(n==="")return t;if(r!==0)throw new Xd("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?NC(l,[...t,n.trim()]):NC(l,t,`${n}${o}`,r);case"(":return NC(l,t,`${n}${o}`,r+1);case")":return NC(l,t,`${n}${o}`,r-1);default:return NC(l,t,`${n}${o}`,r)}}return[]}function uOe(e){return e==="address"||e==="bool"||e==="function"||e==="string"||iOe.test(e)||aOe.test(e)}var C_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 S_t(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||iOe.test(e)||aOe.test(e)||C_t.test(e)}function N_t(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function A_t(e){const t={},n=e.length;for(let o=0;o<n;o++){const l=e[o];if(!cOe(l))continue;const c=x_t(l);if(!c)throw new Xd("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=gR(v,{type:"struct"});d.push(w)}if(!d.length)throw new Xd("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]=dOe(c,t)}return r}var j_t=/^(?<type>[a-zA-Z0-9_]+?)(?<array>(?:\[\d*?\])+?)?$/;function dOe(e,t,n=new Set){const r=[],s=e.length;for(let a=0;a<s;a++){const o=e[a];if(oOe.test(o.type))r.push(o);else{const c=_oe(j_t,o.type);if(!(c!=null&&c.type))throw new Xd("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 Xd("Circular reference detected.",{metaMessages:[`Struct "${d}" is a circular reference.`]});r.push({...o,type:`tuple${u??""}`,components:dOe(t[d]??[],t,new Set([...n,d]))})}else if(uOe(d))r.push(o);else throw new Xd("Unknown type.",{metaMessages:[`Type "${d}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]})}}return r}function E_t(e){let t;if(typeof e=="string")t=gR(e,{modifiers:Oge});else{const n=A_t(e),r=e.length;for(let s=0;s<r;s++){const a=e[s];if(!cOe(a)){t=gR(a,{modifiers:Oge,structs:n});break}}}if(!t)throw new Xd("Failed to parse ABI parameter.",{details:`parseAbiParameter(${JSON.stringify(e,null,2)})`,docsPath:"/api/human.html#parseabiparameter-1"});return t}const sl=32;function Pee(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 fOe(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=>fOe(r))})}function __t(e){return!ri(e)&&typeof e=="object"&&!ri(e.type)&&typeof e.type=="string"}function hOe(e){return e.map(t=>{var n;if(__t(t))return t;if(typeof t=="string")return fOe(E_t(t.replace(/tuple/,"")));if(u_t(t)){const r=Object.keys(t)[0],s=rOe(r);return s.name=(n=s.name)!==null&&n!==void 0?n:"",Object.assign(Object.assign({},s),{components:sOe(t[r])})}throw new Yi("Invalid abi")})}function koe(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 Yi("Invalid fixed array size",{size:r});return{param:{type:n,name:"",components:e.components},size:s}}function bR(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(bR))!==null&&n!==void 0?n:!1:e.type.endsWith("]")?bR(koe(e).param):!1}const pOe=20,mOe=sl-pOe;function k_t(e,t){if(typeof t!="string")throw new Yi("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}`),!Xf(n))throw new Yi("provided input is not valid address",{value:t,name:e.name,type:e.type});const r=p5(n),s=Pee(sl);return s.set(r,mOe),{dynamic:!1,encoded:s}}function T_t(e,t){const n=t.subarray(mOe,sl);if(n.length!==pOe)throw new Yi("Invalid decoding input, not enough bytes to decode address",{bytes:t});const r=A1(n);return{result:fx(r),encoded:t.subarray(sl),consumed:sl}}const Ky=new Map;let fP=BigInt(256);for(let e=8;e<=256;e+=8)Ky.set(`uint${e}`,{min:BigInt(0),max:fP-BigInt(1)}),Ky.set(`int${e}`,{min:-fP/BigInt(2),max:fP/BigInt(2)-BigInt(1)}),fP*=BigInt(256);Ky.set("int",Ky.get("int256"));Ky.set("uint",Ky.get("uint256"));const xOe=BigInt(1)<<BigInt(256);function I_t(e,t=sl){let n;return e<0?n=(xOe+e).toString(16):n=e.toString(16),n=sN(n,t*2),p5(n)}function P_t(e,t){const n=A1(e),r=BigInt(n);return r<=t?r:r-xOe}function sT(e,t){let n;try{n=Xv(t)}catch{throw new Yi("provided input is not number value",{type:e.type,value:t,name:e.name})}const r=Ky.get(e.type);if(!r)throw new Yi("provided abi contains invalid number datatype",{type:e.type});if(n<r.min)throw new Yi("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 Yi("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:I_t(n)}}function fN(e,t){if(t.length<sl)throw new Yi("Not enough bytes left to decode",{param:e,bytesLeft:t.length});const n=t.subarray(0,sl),r=Ky.get(e.type);if(!r)throw new Yi("provided abi contains invalid number datatype",{type:e.type});const s=P_t(n,r.max);if(s<r.min)throw new Yi("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 Yi("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(sl),consumed:sl}}function F_t(e,t){let n;try{n=eFe(t)}catch(r){if(r instanceof Uae)throw new Yi("provided input is not valid boolean value",{type:e.type,value:t,name:e.name})}return sT({type:"uint8",name:""},Number(n))}function O_t(e,t){const n=fN({type:"uint8",name:""},t);if(n.result>1||n.result<0)throw new Yi("Invalid boolean value encoded",{boolBytes:t.subarray(0,sl),numberResult:n});return{result:n.result===BigInt(1),encoded:n.encoded,consumed:sl}}const M_t=32;function gOe(e,t){if(typeof t=="string"&&t.length%2!==0&&(t+="0"),!c2(t))throw new Yi("provided input is not valid bytes value",{type:e.type,value:t,name:e.name});const n=sx(t),[,r]=e.type.split("bytes");if(r){if(Number(r)>M_t||Number(r)<1)throw new Yi("invalid bytes type. Static byte type can have between 1 and 32 bytes",{type:e.type});if(Number(r)<n.length)throw new Yi("provided input size is different than type size",{type:e.type,value:t,name:e.name});const o=Pee(sl);return o.set(n),{dynamic:!1,encoded:o}}const s=Math.ceil(n.length/sl),a=Pee(sl+s*sl);return a.set(sT({type:"uint32",name:""},n.length).encoded),a.set(n,sl),{dynamic:!0,encoded:a}}function bOe(e,t){const[,n]=e.type.split("bytes");let r=Number(n),s=t,a=1,o=0;if(!r){const l=fN({type:"uint32",name:""},s);r=Number(l.result),o+=l.consumed,s=l.encoded,a=Math.ceil(r/sl)}if(r>t.length)throw new Yi("there is not enough data to decode",{type:e.type,encoded:t,size:r});return{result:qi(s.subarray(0,r)),encoded:s.subarray(a*sl),consumed:o+a*sl}}function R_t(e,t){if(typeof t!="string")throw new Yi("invalid input, should be string",{input:t});const n=Zae(t);return gOe({type:"bytes",name:""},n)}function L_t(e,t){const n=bOe({type:"bytes",name:""},t);return{result:s$(n.result),encoded:n.encoded,consumed:n.consumed}}function yOe(e){let t=0,n=0;const r=[],s=[];for(const a of e)a.dynamic?t+=sl:t+=a.encoded.length;for(const a of e)a.dynamic?(r.push(sT({type:"uint256",name:""},t+n)),s.push(a),n+=a.encoded.length):r.push(a);return yd(...r.map(a=>a.encoded),...s.map(a=>a.encoded))}function D_t(e,t){if(!Array.isArray(t))throw new Yi("Expected value to be array",{abi:e,values:t});const{size:n,param:r}=koe(e),s=t.map(l=>Fee(r,l)),a=n===-1,o=s.length>0&&s[0].dynamic;if(!a&&t.length!==n)throw new Yi("Given arguments count doesn't match array length",{arrayLength:n,argumentsLength:t.length});if(a||o){const l=yOe(s);if(a){const c=sT({type:"uint256",name:""},s.length).encoded;return{dynamic:!0,encoded:s.length>0?yd(c,l):c}}return{dynamic:!0,encoded:l}}return{dynamic:!1,encoded:yd(...s.map(l=>l.encoded))}}function B_t(e,t){let{size:n,param:r}=koe(e);const s=n===-1;let a=0;const o=[];let l=t;if(s){const u=fN({type:"uint32",name:""},t);n=Number(u.result),a=u.consumed,l=u.encoded}if(bR(r)){for(let u=0;u<n;u+=1){const d=fN({type:"uint32",name:""},l.subarray(u*sl));a+=d.consumed;const f=yR(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=yR(r,t.subarray(a));a+=d.consumed,o.push(d.result)}return{result:o,encoded:t.subarray(a),consumed:a}}function Fee(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 Toe(e,t);if(e.type.endsWith("]"))return D_t(e,t);if(e.type.startsWith("bytes"))return gOe(e,t);if(e.type.startsWith("uint")||e.type.startsWith("int"))return sT(e,t);throw new Yi("Unsupported",{param:e,value:t})}function yR(e,t){if(e.type==="string")return L_t(e,t);if(e.type==="bool")return O_t(e,t);if(e.type==="address")return T_t(e,t);if(e.type==="tuple")return vOe(e,t);if(e.type.endsWith("]"))return B_t(e,t);if(e.type.startsWith("bytes"))return bOe(e,t);if(e.type.startsWith("uint")||e.type.startsWith("int"))return fN(e,t);throw new Yi("Unsupported",{param:e,bytes:t})}function Toe(e,t){var n,r,s;let a=!1;if(!Array.isArray(t)&&typeof t!="object")throw new Yi("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 Yi("input param length missmatch",{param:e,input:t});d=Fee(u,o[c])}else{const f=o[(s=u.name)!==null&&s!==void 0?s:""];if(f==null)throw new Yi("missing input defined in abi",{param:e,input:t,paramName:u.name});d=Fee(u,f)}d.dynamic&&(a=!0),l.push(d)}return a?{dynamic:!0,encoded:yOe(l)}:{dynamic:!1,encoded:yd(...l.map(c=>c.encoded))}}function vOe(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(bR(o)){const c=fN({type:"uint32",name:""},t.subarray(r));l=yR(o,t.subarray(Number(c.result))),r+=c.consumed,s+=l.consumed}else l=yR(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 $_t(e,t,n){const r=hOe(e),s=p5(t);return vOe({type:"tuple",name:"",components:r},s).result}function wOe(e){const t=[];return e.forEach(n=>{if(Array.isArray(n)){const r=wOe(n);t.push({type:"tuple",components:r,name:""})}else t.push({type:p1(n,!0)})}),t}function g$(e,t){if((e==null?void 0:e.length)!==t.length)throw new Yi("Invalid number of values received for given ABI",{expected:e==null?void 0:e.length,received:t.length});const n=hOe(e);return A1(Toe({type:"tuple",name:"",components:n},t).encoded)}function U_t(e){try{const t=wOe(e);return A1(Toe({type:"tuple",name:"",components:t},e).encoded)}catch{throw new Yi("Could not infer types from given params",{params:e})}}const Oee=(e,t)=>g$([e],[t]),COe=(e,t,n)=>{try{if(e.length>0&&(!t||t==="0x"||t==="0X"))throw new Yi("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 $_t(e,`0x${t.replace(/0x/i,"")}`,n)}catch(r){throw new Yi(`Parameter decoding error: ${r.message}`,{internalErr:r})}},n3=(e,t)=>COe(e,t,!1),SOe=(e,t)=>n3([e],t)[0],zE=e=>{if(typeof e!="string"&&!x$(e))throw new Yi("Invalid parameter value in encodeFunctionSignature");let t;return e&&(typeof e=="function"||typeof e=="object")?t=qg(e):t=e,Qf(t).slice(0,10)},z_t=(e,t)=>{var n;if(!x$(e))throw new Yi("Invalid parameter value in encodeFunctionCall");return`${zE(e)}${g$((n=e.inputs)!==null&&n!==void 0?n:[],t??[]).replace("0x","")}`},Mee=(e,t,n=!0)=>{const r=n&&t&&t.length>=10&&t.startsWith("0x")?t.slice(10):t;if(!e.inputs)throw new pd("No inputs found in the ABI");const s=n3([...e.inputs],r);return Object.assign(Object.assign({},s),{__method__:qg(e)})},H_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=n3([...e.outputs],n);return r.__length__===1?r[0]:r},V_t=["bool","string","int","uint","address","fixed","ufixed"],W_t=(e,t)=>e==="string"?t:SOe(e,t),NOe=(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?COe(Object.values(a),t,!0):{__length__:0},l=r.length-Object.keys(s).length,c=Object.values(s).map((x,g)=>V_t.some(v=>x.type.startsWith(v))?W_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},mO=(e,t)=>{if(t!=null&&t.data){let n,r,s;try{const a=t.data.slice(0,10),o=e.find(l=>d_t(l).startsWith(a));o!=null&&o.inputs?(n=o.name,r=qg(o),s=n3([...o.inputs],t.data.substring(10))):t.data.startsWith("0x08c379a0")?(n="Error",r="Error(string)",s=n3([{name:"message",type:"string"}],t.data.substring(10))):t.data.startsWith("0x4e487b71")?(n="Panic",r="Panic(uint256)",s=n3([{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 q_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 G_t=(e,t)=>{var n,r,s,a,o;if(e instanceof Zw&&e.cause instanceof YB){if(t!==void 0){const l=t.filter(c=>m$(c));return mO(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 XB&&!Array.isArray((o=e.cause)===null||o===void 0?void 0:o.errors)&&e.cause!==void 0)return e.cause.message;throw e};function AOe(e,t,n){return q_t(this,arguments,void 0,function*(r,s,a,o=r.defaultReturnFormat){try{yield Ooe(r,s,r.defaultBlock,o);return}catch(l){return G_t(l,a)}})}var K_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 NV(e,t,n,r,s,a){return K_t(this,void 0,void 0,function*(){let o=a;o===void 0&&e.handleRevert&&t!==void 0&&(o=yield AOe(e,t,s));let l;if(o===void 0)l=new pPe(n);else if(typeof o=="string")l=new KM(o,void 0,n);else if(o.customErrorName!==void 0&&o.customErrorDecodedSignature!==void 0&&o.customErrorArguments!==void 0){const c=o;l=new hPe(c.reason,c.customErrorName,c.customErrorDecodedSignature,c.customErrorArguments,c.signature,n,c.data)}else l=new KM(o.reason,o.signature,n,o.data);return l})}const Ioe=(e,t,n,r=hd)=>{var s,a,o,l,c,u;let d=Object.assign({},e);const f=Wr(DA,t,r);if([dN,"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:NOe([...(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 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())})};class jOe{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=Ioe(Eee,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 lv(this,void 0,void 0,function*(){if(this.options.checkRevertBeforeSending!==!1){let n=t;xr(t.data)&&xr(t.input)&&xr(t.gas)&&(n=Object.assign(Object.assign({},t),{gas:21e3}));const r=yield AOe(this.web3Context,n,this.options.contractAbi);if(r!==void 0)throw yield NV(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 lv(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)&&xr(n.gasPrice)&&(xr(r.maxPriorityFeePerGas)||xr(r.maxFeePerGas))&&(a=Object.assign(Object.assign({},n),yield JFe(n,this.web3Context,mi))),a})}signAndSend(t){return lv(this,arguments,void 0,function*({wallet:n,tx:r}){if(n){const s=yield n.signTransaction(r);return Tee(this.web3Context,()=>lv(this,void 0,void 0,function*(){return GFe(this.web3Context.requestManager,s.rawTransaction)}),s.transactionHash)}return Tee(this.web3Context,()=>lv(this,void 0,void 0,function*(){return eEt(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 lv(this,arguments,void 0,function*({error:n,tx:r}){var s;let a=n;return a instanceof Zw&&this.web3Context.handleRevert&&(a=yield NV(this.web3Context,r,void 0,void 0,(s=this.options)===null||s===void 0?void 0:s.contractAbi)),(a instanceof XB||a instanceof Zw||a instanceof hPe||a instanceof pPe||a instanceof KM||a instanceof bPe)&&this.promiEvent.listenerCount("error")>0&&this.promiEvent.emit("error",a),a})}emitConfirmation({receipt:t,transactionHash:n,customTransactionReceiptSchema:r}){this.promiEvent.listenerCount("confirmation")>0&&l_t(this.web3Context,this.promiEvent,t,n,this.returnFormat,r)}handleResolve(t){return lv(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 NV(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 Da=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())})},Y_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 X_t=e=>Da(void 0,void 0,void 0,function*(){return qFe(e.requestManager)});function Q_t(e,t){return Da(this,void 0,void 0,function*(){const n=yield B9t(e.requestManager);return Wr({format:"uint"},n,t??e.defaultReturnFormat)})}function Poe(e,t){return Da(this,void 0,void 0,function*(){const n=yield $9t(e.requestManager);return Wr({format:"uint"},n,t??e.defaultReturnFormat)})}function Z_t(e,t){return Da(this,void 0,void 0,function*(){const n=yield U9t(e.requestManager);return Wr({format:"uint"},n,t??e.defaultReturnFormat)})}function Foe(e,t){return Da(this,void 0,void 0,function*(){const n=yield H9t(e.requestManager);return Wr({format:"uint"},n,t??e.defaultReturnFormat)})}function J_t(e,t){return Da(this,arguments,void 0,function*(n,r,s=n.defaultBlock,a){const o=Rc(s)?s:Wr({format:"uint"},s,mi),l=yield V9t(n.requestManager,r,o);return Wr({format:"uint"},l,a??n.defaultReturnFormat)})}function ekt(e,t,n){return Da(this,arguments,void 0,function*(r,s,a,o=r.defaultBlock,l){const c=Wr({format:"uint"},a,mi),u=Rc(o)?o:Wr({format:"uint"},o,mi),d=yield W9t(r.requestManager,s,c,u);return Wr({format:"bytes"},d,l??r.defaultReturnFormat)})}function tkt(e,t){return Da(this,arguments,void 0,function*(n,r,s=n.defaultBlock,a){const o=Rc(s)?s:Wr({format:"uint"},s,mi),l=yield Q9t(n.requestManager,r,o);return Wr({format:"bytes"},l,a??n.defaultReturnFormat)})}function EOe(e){return Da(this,arguments,void 0,function*(t,n=t.defaultBlock,r=!1,s){var a;let o;if(c2(n)){const c=Wr({format:"bytes32"},n,mi);o=yield rEt(t.requestManager,c,r)}else{const c=Rc(n)?n:Wr({format:"uint"},n,mi);o=yield KFe(t.requestManager,c,r)}const l=Wr(xR,o,s??t.defaultReturnFormat);return xr(l)?l:Object.assign(Object.assign({},l),{transactions:(a=l.transactions)!==null&&a!==void 0?a:[]})})}function nkt(e){return Da(this,arguments,void 0,function*(t,n=t.defaultBlock,r){let s;if(c2(n)){const a=Wr({format:"bytes32"},n,mi);s=yield G9t(t.requestManager,a)}else{const a=Rc(n)?n:Wr({format:"uint"},n,mi);s=yield K9t(t.requestManager,a)}return Wr({format:"uint"},s,r??t.defaultReturnFormat)})}function rkt(e){return Da(this,arguments,void 0,function*(t,n=t.defaultBlock,r){let s;if(c2(n)){const a=Wr({format:"bytes32"},n,mi);s=yield Y9t(t.requestManager,a)}else{const a=Rc(n)?n:Wr({format:"uint"},n,mi);s=yield X9t(t.requestManager,a)}return Wr({format:"uint"},s,r??t.defaultReturnFormat)})}function skt(e){return Da(this,arguments,void 0,function*(t,n=t.defaultBlock,r,s){const a=Wr({format:"uint"},r,mi);let o;if(c2(n)){const l=Wr({format:"bytes32"},n,mi);o=yield lEt(t.requestManager,l,a)}else{const l=Rc(n)?n:Wr({format:"uint"},n,mi);o=yield cEt(t.requestManager,l,a)}return Wr(xR,o,s??t.defaultReturnFormat)})}function ikt(e,t){return Da(this,arguments,void 0,function*(n,r,s=n.defaultReturnFormat){const a=Wr({format:"bytes32"},r,hd),o=yield sEt(n.requestManager,a);return xr(o)?o:df(o,s,{transactionSchema:n.config.customTransactionSchema,fillInputAndData:!0})})}function akt(e,t){return Da(this,void 0,void 0,function*(){return(yield vEt(e.requestManager)).map(r=>df(r,t??e.defaultReturnFormat,{transactionSchema:e.config.customTransactionSchema,fillInputAndData:!0}))})}function okt(e){return Da(this,arguments,void 0,function*(t,n=t.defaultBlock,r,s){const a=Wr({format:"uint"},r,mi);let o;if(c2(n)){const l=Wr({format:"bytes32"},n,mi);o=yield iEt(t.requestManager,l,a)}else{const l=Rc(n)?n:Wr({format:"uint"},n,mi);o=yield aEt(t.requestManager,l,a)}return xr(o)?o:df(o,s??t.defaultReturnFormat,{transactionSchema:t.config.customTransactionSchema,fillInputAndData:!0})})}function _Oe(e,t,n){return Da(this,void 0,void 0,function*(){const r=Wr({format:"bytes32"},t,hd);let s;try{s=yield oEt(e.requestManager,r)}catch(a){if(typeof a=="object"&&!xr(a)&&"message"in a&&a.message==="transaction indexing is in progress")console.warn("Transaction indexing is in progress.");else throw a}return xr(s)?s:Wr(BA,s,n??e.defaultReturnFormat)})}function kOe(e,t){return Da(this,arguments,void 0,function*(n,r,s=n.defaultBlock,a){const o=Rc(s)?s:Wr({format:"uint"},s,mi),l=yield q9t(n.requestManager,r,o);return Wr({format:"uint"},l,a??n.defaultReturnFormat)})}function HE(e,t,n,r={checkRevertBeforeSending:!0},s){const a=new WFe((o,l)=>{setImmediate(()=>{Da(this,void 0,void 0,function*(){const c=new jOe({web3Context:e,promiEvent:a,options:r,returnFormat:n});let u=Object.assign({},t);xr(s)||(u=yield s.processTransaction(u));let d=df(Object.assign(Object.assign({},u),{from:_ee("from",e,u),to:_ee("to",e,u)}),mi,{transactionSchema:e.config.customTransactionSchema});try{d=yield c.populateGasPrice({transaction:u,transactionFormatted:d}),yield c.checkRevertBeforeSending(d),c.emitSending(d);let f;e.wallet&&!xr(d.from)&&(f=e.wallet.get(d.from));const x=yield c.signAndSend({wallet:f,tx:d}),g=Wr({format:"bytes32"},x,n??e.defaultReturnFormat);c.emitSent(d),c.emitTransactionHash(g);const v=yield nOe(e,x,n??e.defaultReturnFormat),w=c.getReceiptWithEvents(Wr(BA,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 lkt(e,t,n,r={checkRevertBeforeSending:!0}){const s=new WFe((a,o)=>{setImmediate(()=>{Da(this,void 0,void 0,function*(){const l=new jOe({web3Context:e,promiEvent:s,options:r,returnFormat:n}),c=Wr({format:"bytes"},t,mi),u=V3.fromSerializedData(sx(lo(c))),d=Object.assign(Object.assign({},u.toJSON()),{from:u.getSenderAddress().toString()});try{const{v:f,r:x,s:g}=d,v=Y_t(d,["v","r","s"]);yield l.checkRevertBeforeSending(v),l.emitSending(c);const w=yield Tee(e,()=>Da(this,void 0,void 0,function*(){return GFe(e.requestManager,c)}));l.emitSent(c);const C=Wr({format:"bytes32"},w,n??e.defaultReturnFormat);l.emitTransactionHash(C);const N=yield nOe(e,w,n??e.defaultReturnFormat),P=l.getReceiptWithEvents(Wr(BA,N,n??e.defaultReturnFormat));l.emitReceipt(P),a(yield l.handleResolve({receipt:P,tx:d})),l.emitConfirmation({receipt:P,transactionHash:w})}catch(f){o(yield l.handleError({error:f,tx:d}))}})})});return s}function ckt(e,t,n){return Da(this,arguments,void 0,function*(r,s,a,o=r.defaultReturnFormat){var l;const c=Wr({format:"bytes"},s,hd);if(!((l=r.wallet)===null||l===void 0)&&l.get(a)){const f=r.wallet.get(a).sign(c);return Wr(GEt,f,o)}if(typeof a=="number")throw new dNt(s,'RPC method "eth_sign" does not support index signatures');const u=yield Z9t(r.requestManager,a,c);return Wr({format:"bytes"},u,o)})}function ukt(e,t){return Da(this,arguments,void 0,function*(n,r,s=n.defaultReturnFormat){const a=yield J9t(n.requestManager,df(r,mi,{transactionSchema:n.config.customTransactionSchema}));return Gae(a)?QEt(a,s,{fillInputAndData:!0}):{raw:Wr({format:"bytes"},a.raw,s),tx:df(a.tx,s,{transactionSchema:n.config.customTransactionSchema,fillInputAndData:!0})}})}function Ooe(e,t){return Da(this,arguments,void 0,function*(n,r,s=n.defaultBlock,a=n.defaultReturnFormat){const o=Rc(s)?s:Wr({format:"uint"},s,mi),l=yield tEt(n.requestManager,df(r,mi,{transactionSchema:n.config.customTransactionSchema}),o);return Wr({format:"bytes"},l,a)})}function Moe(e,t){return Da(this,arguments,void 0,function*(n,r,s=n.defaultBlock,a){const o=df(r,mi,{transactionSchema:n.config.customTransactionSchema}),l=Rc(s)?s:Wr({format:"uint"},s,mi),c=yield nEt(n.requestManager,o,l);return Wr({format:"uint"},c,a??n.defaultReturnFormat)})}function TOe(e,t,n){return Da(this,void 0,void 0,function*(){let{toBlock:r,fromBlock:s}=t;xr(r)||(typeof r=="number"||typeof r=="bigint")&&(r=nc(r)),xr(s)||(typeof s=="number"||typeof s=="bigint")&&(s=nc(s));const a=Object.assign(Object.assign({},t),{fromBlock:s,toBlock:r});return(yield xEt(e.requestManager,a)).map(c=>typeof c=="string"?c:Wr(DA,c,n??e.defaultReturnFormat))})}function IOe(e,t){return Da(this,void 0,void 0,function*(){const n=yield CEt(e.requestManager);return Wr({format:"uint"},n,t??e.defaultReturnFormat)})}function dkt(e,t,n){return Da(this,arguments,void 0,function*(r,s,a,o=r.defaultBlock,l){const c=a.map(f=>Wr({format:"bytes"},f,mi)),u=Rc(o)?o:Wr({format:"uint"},o,mi),d=yield SEt(r.requestManager,s,c,u);return Wr(XEt,d,l??r.defaultReturnFormat)})}function fkt(e,t){return Da(this,arguments,void 0,function*(n,r,s=n.defaultBlock,a,o){const l=Wr({format:"uint"},r,mi),c=Rc(s)?s:Wr({format:"uint"},s,mi),u=Wr({type:"array",items:{format:"uint"}},a,p$),d=yield yEt(n.requestManager,l,c,u);return Wr(KEt,d,o??n.defaultReturnFormat)})}function POe(e,t){return Da(this,arguments,void 0,function*(n,r,s=n.defaultBlock,a){const o=Rc(s)?s:Wr({format:"uint"},s,mi),l=yield AEt(n.requestManager,df(r,mi,{transactionSchema:n.config.customTransactionSchema}),o);return Wr(HEt,l,a??n.defaultReturnFormat)})}function hkt(e,t,n,r,s){return Da(this,void 0,void 0,function*(){const a=yield jEt(e.requestManager,t,n,r);return Wr({format:"bytes"},a,s??e.defaultReturnFormat)})}var $A=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 pkt(e,t){return $A(this,void 0,void 0,function*(){const n=yield fEt(e.requestManager);return Wr({format:"uint"},n,t??e.defaultReturnFormat)})}function mkt(e,t,n){return $A(this,void 0,void 0,function*(){let{toBlock:r,fromBlock:s}=t;xr(r)||(typeof r=="number"||typeof r=="bigint")&&(r=nc(r)),xr(s)||(typeof s=="number"||typeof s=="bigint")&&(s=nc(s));const a=Object.assign(Object.assign({},t),{fromBlock:s,toBlock:r}),o=yield uEt(e.requestManager,a);return Wr({format:"uint"},o,n??e.defaultReturnFormat)})}function xkt(e,t){return $A(this,void 0,void 0,function*(){const n=yield dEt(e.requestManager);return Wr({format:"uint"},n,t??e.defaultReturnFormat)})}function gkt(e,t){return $A(this,void 0,void 0,function*(){return yield hEt(e.requestManager,nc(t))})}function bkt(e,t,n){return $A(this,void 0,void 0,function*(){return(yield pEt(e.requestManager,nc(t))).map(a=>typeof a=="string"?a:Wr(DA,a,n??e.defaultReturnFormat))})}function ykt(e,t,n){return $A(this,void 0,void 0,function*(){return(yield mEt(e.requestManager,nc(t))).map(a=>typeof a=="string"?a:Wr(DA,a,n??e.defaultReturnFormat))})}class FOe extends tT{_buildSubscriptionParams(){return["logs",this.args]}formatSubscriptionResult(t){return Wr(DA,t,super.returnFormat)}}class Mge extends tT{_buildSubscriptionParams(){return["newPendingTransactions"]}formatSubscriptionResult(t){return Wr({format:"string"},t,super.returnFormat)}}class vR extends tT{_buildSubscriptionParams(){return["newHeads"]}formatSubscriptionResult(t){return Wr(WEt,t,super.returnFormat)}}class OOe extends tT{_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",Wr(qEt,n,super.returnFormat))}}}var yi=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 Ree={logs:FOe,newPendingTransactions:Mge,newHeads:vR,syncing:OOe,pendingTransactions:Mge,newBlockHeaders:vR};class b$ extends Jd{constructor(t){if(typeof t=="string"||dR(t)){super({provider:t,registeredSubscriptions:Ree});return}if(t.registeredSubscriptions){super(t);return}super(Object.assign(Object.assign({},t),{registeredSubscriptions:Ree})),this.getFeeData=this.calculateFeeData}setTransactionMiddleware(t){this.transactionMiddleware=t}getTransactionMiddleware(){return this.transactionMiddleware}getProtocolVersion(){return yi(this,void 0,void 0,function*(){return R9t(this.requestManager)})}isSyncing(){return yi(this,void 0,void 0,function*(){return qFe(this.requestManager)})}getCoinbase(){return yi(this,void 0,void 0,function*(){return L9t(this.requestManager)})}isMining(){return yi(this,void 0,void 0,function*(){return D9t(this.requestManager)})}getHashrate(t){return yi(this,void 0,void 0,function*(){var n;return t===void 0&&(t=(n=this.defaultReturnFormat)!==null&&n!==void 0?n:hd),this.getHashRate(t)})}getHashRate(){return yi(this,arguments,void 0,function*(t=this.defaultReturnFormat){return Q_t(this,t)})}getGasPrice(){return yi(this,arguments,void 0,function*(t=this.defaultReturnFormat){return Poe(this,t)})}getMaxPriorityFeePerGas(){return yi(this,arguments,void 0,function*(t=this.defaultReturnFormat){return Z_t(this,t)})}calculateFeeData(){return yi(this,arguments,void 0,function*(t=BigInt(2),n=r$.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 yi(this,void 0,void 0,function*(){var t;return((t=yield z9t(this.requestManager))!==null&&t!==void 0?t:[]).map(r=>fx(r))})}getBlockNumber(){return yi(this,arguments,void 0,function*(t=this.defaultReturnFormat){return Foe(this,t)})}getBalance(t){return yi(this,arguments,void 0,function*(n,r=this.defaultBlock,s=this.defaultReturnFormat){return J_t(this,n,r,s)})}getStorageAt(t,n){return yi(this,arguments,void 0,function*(r,s,a=this.defaultBlock,o=this.defaultReturnFormat){return ekt(this,r,s,a,o)})}getCode(t){return yi(this,arguments,void 0,function*(n,r=this.defaultBlock,s=this.defaultReturnFormat){return tkt(this,n,r,s)})}getBlock(){return yi(this,arguments,void 0,function*(t=this.defaultBlock,n=!1,r=this.defaultReturnFormat){return EOe(this,t,n,r)})}getBlockTransactionCount(){return yi(this,arguments,void 0,function*(t=this.defaultBlock,n=this.defaultReturnFormat){return nkt(this,t,n)})}getBlockUncleCount(){return yi(this,arguments,void 0,function*(t=this.defaultBlock,n=this.defaultReturnFormat){return rkt(this,t,n)})}getUncle(){return yi(this,arguments,void 0,function*(t=this.defaultBlock,n,r=this.defaultReturnFormat){return skt(this,t,n,r)})}getTransaction(t){return yi(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){const s=yield ikt(this,n,r);if(!s)throw new $xe;return s})}getPendingTransactions(){return yi(this,arguments,void 0,function*(t=this.defaultReturnFormat){return akt(this,t)})}getTransactionFromBlock(){return yi(this,arguments,void 0,function*(t=this.defaultBlock,n,r=this.defaultReturnFormat){return okt(this,t,n,r)})}getTransactionReceipt(t){return yi(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){const s=yield _Oe(this,n,r);if(!s)throw new $xe;return s})}getTransactionCount(t){return yi(this,arguments,void 0,function*(n,r=this.defaultBlock,s=this.defaultReturnFormat){return kOe(this,n,r,s)})}sendTransaction(t,n=this.defaultReturnFormat,r){return HE(this,t,n,r,this.transactionMiddleware)}sendSignedTransaction(t,n=this.defaultReturnFormat,r){return lkt(this,t,n,r)}sign(t,n){return yi(this,arguments,void 0,function*(r,s,a=this.defaultReturnFormat){return ckt(this,r,s,a)})}signTransaction(t){return yi(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){return ukt(this,n,r)})}call(t){return yi(this,arguments,void 0,function*(n,r=this.defaultBlock,s=this.defaultReturnFormat){return Ooe(this,n,r,s)})}estimateGas(t){return yi(this,arguments,void 0,function*(n,r=this.defaultBlock,s=this.defaultReturnFormat){return Moe(this,n,r,s)})}getPastLogs(t){return yi(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){return TOe(this,n,r)})}getWork(){return yi(this,void 0,void 0,function*(){return gEt(this.requestManager)})}submitWork(t,n,r){return yi(this,void 0,void 0,function*(){return bEt(this.requestManager,t,n,r)})}requestAccounts(){return yi(this,void 0,void 0,function*(){return wEt(this.requestManager)})}getChainId(){return yi(this,arguments,void 0,function*(t=this.defaultReturnFormat){return IOe(this,t)})}getNodeInfo(){return yi(this,void 0,void 0,function*(){return NEt(this.requestManager)})}getProof(t,n){return yi(this,arguments,void 0,function*(r,s,a=this.defaultBlock,o=this.defaultReturnFormat){return dkt(this,r,s,a,o)})}getFeeHistory(t){return yi(this,arguments,void 0,function*(n,r=this.defaultBlock,s,a=this.defaultReturnFormat){return fkt(this,n,r,s,a)})}createAccessList(t){return yi(this,arguments,void 0,function*(n,r=this.defaultBlock,s=this.defaultReturnFormat){return POe(this,n,r,s)})}signTypedData(t,n,r,s){return yi(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:hd),hkt(this,t,n,r,s)})}subscribe(t,n,r){return yi(this,void 0,void 0,function*(){var s,a;r===void 0&&(r=(s=this.defaultReturnFormat)!==null&&s!==void 0?s:hd);const o=yield(a=this.subscriptionManager)===null||a===void 0?void 0:a.subscribe(t,n,r);return o instanceof FOe&&t==="logs"&&typeof n=="object"&&!ri(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 OOe)}clearSubscriptions(t=!1){var n;return(n=this.subscriptionManager)===null||n===void 0?void 0:n.unsubscribe(t?b$.shouldClearSubscription:void 0)}createNewPendingTransactionFilter(){return yi(this,arguments,void 0,function*(t=this.defaultReturnFormat){return pkt(this,t)})}createNewFilter(t){return yi(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){return mkt(this,n,r)})}createNewBlockFilter(){return yi(this,arguments,void 0,function*(t=this.defaultReturnFormat){return xkt(this,t)})}uninstallFilter(t){return yi(this,void 0,void 0,function*(){return gkt(this,t)})}getFilterChanges(t){return yi(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){return bkt(this,n,r)})}getFilterLogs(t){return yi(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){return ykt(this,n,r)})}}const vkt=e=>{if(!xr(e.common)){if(xr(e.common.customChain))throw new mNt;if(xr(e.common.customChain.chainId))throw new xNt;if(!xr(e.chainId)&&e.chainId!==e.common.customChain.chainId)throw new gNt({txChainId:e.chainId,customChainId:e.common.customChain.chainId})}},wkt=e=>{if(!xr(e.common)&&!xr(e.chain)&&!xr(e.hardfork))throw new vNt;if(!xr(e.chain)&&xr(e.hardfork)||!xr(e.hardfork)&&xr(e.chain))throw new wNt({chain:e.chain,hardfork:e.hardfork})},Ckt=e=>{if(!xr(e.common)&&!xr(e.common.baseChain)&&!xr(e.chain)&&e.chain!==e.common.baseChain)throw new bNt({txChain:e.chain,baseChain:e.common.baseChain})},Skt=e=>{if(!xr(e.common)&&!xr(e.common.hardfork)&&!xr(e.hardfork)&&e.hardfork!==e.common.hardfork)throw new yNt({txHardfork:e.hardfork,commonHardfork:e.common.hardfork})},Rge=e=>{if(xr(e.gas)||!h1(e.gas)||xr(e.gasPrice)||!h1(e.gasPrice))throw new jNt({gas:e.gas,gasPrice:e.gasPrice});if(!xr(e.maxFeePerGas)||!xr(e.maxPriorityFeePerGas))throw new mPe({maxFeePerGas:e.maxFeePerGas,maxPriorityFeePerGas:e.maxPriorityFeePerGas})},Lge=e=>{if(!xr(e.gasPrice)&&e.type==="0x2")throw new _Nt(e.gasPrice);if(e.type==="0x0"||e.type==="0x1")throw new mPe({maxFeePerGas:e.maxFeePerGas,maxPriorityFeePerGas:e.maxPriorityFeePerGas});if(xr(e.maxFeePerGas)||!h1(e.maxFeePerGas)||xr(e.maxPriorityFeePerGas)||!h1(e.maxPriorityFeePerGas))throw new ENt({maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas})},Nkt=e=>{const t=!xr(e.gas)||!xr(e.gasLimit),n=t&&!xr(e.gasPrice),r=t&&!xr(e.maxPriorityFeePerGas)&&!xr(e.maxFeePerGas);if(!n&&!r)throw new SNt({gas:e.gas,gasPrice:e.gasPrice,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas});if(n&&r)throw new ANt({gas:e.gas,gasPrice:e.gasPrice,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas});(n?Rge:Lge)(e),(!xr(e.type)&&e.type>"0x1"?Lge:Rge)(e)},Akt=(e,t,n={transactionSchema:void 0})=>{if(!xr(t)){t(e);return}if(typeof e!="object"||xr(e))throw new kNt(e);vkt(e),wkt(e),Ckt(e),Skt(e);const r=df(e,mi,{transactionSchema:n.transactionSchema});if(Nkt(r),xr(r.nonce)||xr(r.chainId)||r.nonce.startsWith("-")||r.chainId.startsWith("-"))throw new TNt({nonce:e.nonce,chainId:e.chainId})};var jkt=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 Ekt=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})},_kt=(e,t)=>{var n,r,s,a,o,l,c,u,d,f,x,g,v,w,C,N,P,I;const R=!xr(e.chain)&&!xr(e.hardfork)||!xr(e.common);let O;if(!R)t.defaultCommon?(O=Object.assign({},t.defaultCommon),xr(O.hardfork)&&(O.hardfork=(n=e.hardfork)!==null&&n!==void 0?n:t.defaultHardfork),xr(O.baseChain)&&(O.baseChain=t.defaultChain)):O=Zl.custom({name:"custom-network",chainId:Zd(e.chainId),networkId:xr(e.networkId)?void 0:Zd(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=Zd((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=Zd((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=(I=(P=(N=e.common)===null||N===void 0?void 0:N.baseChain)!==null&&P!==void 0?P:e.chain)!==null&&I!==void 0?I:t.defaultChain;L&&z&&U&&(O=Zl.custom({name:U,chainId:L,networkId:z,defaultHardfork:X},{baseChain:ne}))}return{common:O}},kkt=(e,t,n,...r)=>jkt(void 0,[e,t,n,...r],void 0,function*(s,a,o,l=!1,c=!0){const u=yield r_t({transaction:s,web3Context:a,privateKey:o,fillGasPrice:l,fillGasLimit:c}),d=df(u,mi,{transactionSchema:a.config.customTransactionSchema});return Akt(d,void 0,{transactionSchema:a.config.customTransactionSchema}),V3.fromTxData(Ekt(d),_kt(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(ri(n==null?void 0:n.fromBlock)||(l.fromBlock=Wr(xR.properties.number,n==null?void 0:n.fromBlock,{number:Qh.HEX,bytes:d1.HEX})),ri(n==null?void 0:n.toBlock)||(l.toBlock=Wr(xR.properties.number,n==null?void 0:n.toBlock,{number:Qh.HEX,bytes:d1.HEX})),a&&Array.isArray(a))l.topics=[...a];else if(l.topics=[],t&&!t.anonymous&&![dN,"allEvents"].includes(t.name)&&l.topics.push((s=t.signature)!==null&&s!==void 0?s:Eoe(qg(t))),![dN,"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=>Oee(c.type,d))):c.type==="string"?l.topics.push(iN(u)):l.topics.push(Oee(c.type,u))}return l.topics.length||delete l.topics,e&&(l.address=e.toLowerCase()),l},Jj=(e,t,n)=>{const r=Array.isArray(e.inputs)?e.inputs.length:0;if(e.inputs&&r!==t.length)throw new pd(`The number of arguments is not matching the methods required number. You need to pass ${r} arguments.`);let s;if(e.inputs?s=g$(Array.isArray(e.inputs)?e.inputs:[],t).replace("0x",""):s=U_t(t).replace("0x",""),c_t(e)){if(!n)throw new pd("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`${zE(e)}${s}`};class MOe extends tT{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 Ioe(this.abi,t,this.jsonInterface,super.returnFormat)}}Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));const y$=(e,t,n,r)=>{var s,a;const o={};return(!ri(e.data)||r==="both")&&(o.data=Jj(t,n,(s=e.data)!==null&&s!==void 0?s:e.input)),(!ri(e.input)||r==="both")&&(o.input=Jj(t,n,(a=e.input)!==null&&a!==void 0?a:e.data)),ri(o.input)&&ri(o.data)&&(o[r]=Jj(t,n)),{data:o.data,input:o.input}},Lee=({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 pd("Contract address not specified");if(!(n!=null&&n.from)&&!r.from)throw new pd('Contract "from" address not specified');let c=d2({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=y$(c,e,t,n==null?void 0:n.dataInputFill);return c=Object.assign(Object.assign({},c),{data:u.data,input:u.input}),c},Tkt=({abi:e,params:t,options:n,contractOptions:r})=>{if(!(n!=null&&n.to)&&!r.address)throw new pd("Contract address not specified");let s=d2({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=y$(s,e,t,n==null?void 0:n.dataInputFill);return s=Object.assign(Object.assign({},s),{data:a.data,input:a.input}),s},Ikt=({abi:e,params:t,options:n,contractOptions:r})=>{let s=d2({to:r.address,gas:r.gas,gasPrice:r.gasPrice,from:r.from,input:r.input,data:r.data},n);const a=y$(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"&&!ri(e)&&Object.keys(e).length!==0&&!py(e),Pkt=({abi:e,params:t,options:n,contractOptions:r})=>{if(!(n!=null&&n.to)&&!r.address)throw new pd("Contract address not specified");if(!(n!=null&&n.from)&&!r.from)throw new pd('Contract "from" address not specified');let s=d2({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=y$(s,e,t,n==null?void 0:n.dataInputFill);return s=Object.assign(Object.assign({},s),{data:a.data,input:a.input}),s};var Fkt=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 Okt{_contractMethodDeploySend(t){const n={transactionResolver:r=>{if(r.status===BigInt(0))throw new pd("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 xr(this.parent.getTransactionMiddleware())?HE(this.parent,t,this.parent.defaultReturnFormat,n):HE(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=Lee({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=Wr({format:"bytes"},(n=(t=this.deployOptions)===null||t===void 0?void 0:t.input)!==null&&n!==void 0?n:this.parent.options.input,hd),u=Wr({format:"bytes"},(s=(r=this.deployOptions)===null||r===void 0?void 0:r.data)!==null&&s!==void 0?s:this.parent.options.data,hd);if((!c||c.trim()==="0x")&&(!u||u.trim()==="0x"))throw new pd("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 Fkt(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 Jj(this.constructorAbi,this.args,Wr({format:"bytes"},this.deployData,this.parent.defaultReturnFormat))}decodeData(t){return Object.assign(Object.assign({},Mee(this.constructorAbi,t.replace(this.deployData,""),!1)),{__method__:this.constructorAbi.type})}}var Mkt=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 Rkt extends fR{constructor(t,n){super(t.requestManager,t.registeredSubscriptions),this.parentContract=n}subscribe(t,n){const r=Object.create(null,{subscribe:{get:()=>super.subscribe}});return Mkt(this,arguments,void 0,function*(s,a,o=hd){return r.subscribe.call(this,s,a??this.parentContract.options,o)})}}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 Lkt={logs:MOe,newHeads:vR,newBlockHeaders:vR};class r3 extends Jd{get subscriptionManager(){return this._subscriptionManager}constructor(t,n,r,s,a){var o,l,c;const u=py(n)?n:py(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=r3.givenProvider,super(Object.assign(Object.assign({},d),{provider:f,registeredSubscriptions:Lkt})),this.syncWithContext=!1,this._functions={},this._subscriptionManager=new Rkt(super.subscriptionManager,this),d!=null&&d.wallet&&(this._wallet=d.wallet),d!=null&&d.accountProvider&&(this._accountProvider=d.accountProvider),!xr(u)&&!xr(u.data)&&!xr(u.input)&&this.config.contractDataInputFill!=="both")throw new iNt({data:u.data,input:u.input});this._overloadedMethodAbis=new Map;const x=fg(s)?s:fg(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),xr(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 Jd&&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 Jd&&d.on(z3.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 r3([...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 r3([...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 Okt(this,t)}getPastEvents(t,n,r){return cv(this,void 0,void 0,function*(){var s;const a=typeof t=="string"?t:dN,o=typeof t!="string"&&!fg(t)?t:fg(n)?{}:n,l=fg(t)?t:fg(n)?n:r??this.defaultReturnFormat,c=a==="allEvents"||a===dN?Eee:this._jsonInterface.find(N=>"name"in N&&N.name===a);if(!c)throw new pd(`Event ${String(a)} not found.`);const{fromBlock:u,toBlock:d,topics:f,address:x}=Dge(this.options,c,o??{}),g=yield TOe(this,{fromBlock:u,toBlock:d,topics:f,address:x},l),v=g?g.map(N=>typeof N=="string"?N:Ioe(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(P=>{var I;if(Array.isArray(w[P]))return w[P].some(O=>String(N.returnValues[P]).toUpperCase()===String(O).toUpperCase());const R=(I=c.inputs)===null||I===void 0?void 0:I.filter(O=>O.name===P)[0];return R!=null&&R.indexed&&R.type==="string"&&iN(w[P])===String(N.returnValues[P])?!0:String(N.returnValues[P]).toUpperCase()===String(w[P]).toUpperCase()})):v})}_parseAndSetAddress(t,n=this.defaultReturnFormat){this._address=t&&fx(Wr({format:"address"},t,n))}decodeMethodData(t){const n=t.slice(0,10),s=this._jsonInterface.filter(a=>a.type!=="error").find(a=>n===zE(qg(a)));if(!s)throw new pd(`The ABI for the provided method signature ${n} was not found.`);return Mee(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=>m$(c));for(const c of o){const u=Object.assign(Object.assign({},c),{signature:""});if(x$(u)){const d=qg(u),f=zE(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(joe(u)){const d=qg(u),f=Eoe(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(Eee,n),this._jsonInterface=[...a],this._errorsInterface=l}_getAbiParams(t,n){var r;try{return Zj((r=t.inputs)!==null&&r!==void 0?r:[],n)}catch(s){throw new pd(`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),Gs.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),Gs.validate(N.inputs,u),C.push(N)}catch(P){w.push(P)}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 nN(w)}const v={arguments:u,call:(w,C)=>cv(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,P;let I=C??this.options;I=Object.assign(Object.assign({},I),{input:void 0,from:(P=(N=I==null?void 0:I.from)!==null&&N!==void 0?N:this.defaultAccount)!==null&&P!==void 0?P:void 0});const R=Lee({abi:s,params:a,options:Object.assign(Object.assign({},w),{dataInputFill:this.config.contractDataInputFill}),contractOptions:I});return R.dataInputFill&&delete R.dataInputFill,R},estimateGas:(w,...C)=>cv(this,[w,...C],void 0,function*(N,P=this.defaultReturnFormat){return this.contractMethodEstimateGas({abi:f,params:u,returnFormat:P,options:N})}),encodeABI:()=>Jj(f,u),decodeData:w=>Mee(f,w),createAccessList:(w,C)=>cv(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 cv(this,void 0,void 0,function*(){var o;const l=Tkt({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 Ooe(this,l,a,this.defaultReturnFormat);return H_t(t,c)}catch(c){throw c instanceof Zw&&mO(r,c.cause),c}})}_contractMethodCreateAccessList(t,n,r,s,a){return cv(this,void 0,void 0,function*(){var o;const l=Pkt({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 POe(this,l,a,this.defaultReturnFormat)}catch(c){throw c instanceof Zw&&mO(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=Lee({abi:t,params:n,options:Object.assign(Object.assign({},s),{dataInputFill:this.config.contractDataInputFill}),contractOptions:c}),d=xr(this.transactionMiddleware)?HE(this,u,this.defaultReturnFormat,{checkRevertBeforeSending:!1,contractAbi:this._jsonInterface}):HE(this,u,this.defaultReturnFormat,{checkRevertBeforeSending:!1,contractAbi:this._jsonInterface},this.transactionMiddleware);return d.on("error",f=>{f instanceof Zw&&mO(r,f.cause)}),d}contractMethodEstimateGas(t){return cv(this,arguments,void 0,function*({abi:n,params:r,returnFormat:s,options:a,contractOptions:o}){const l=Ikt({abi:n,params:r,options:Object.assign(Object.assign({},a),{dataInputFill:this.config.contractDataInputFill}),contractOptions:o??this.options});return Moe(this,l,kg.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 MOe({address:this.options.address,topics:a,abi:t,jsonInterface:this._jsonInterface},{subscriptionManager:this.subscriptionManager,returnFormat:n});return xr(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 og("Failed to get past events.",c))}),(s=this.subscriptionManager)===null||s===void 0||s.addSubscription(l).catch(c=>{l.emit("error",new og("Failed to subscribe.",c))}),l}}subscribeToContextEvents(t){const n=this;this.context=t,n.syncWithContext&&t.on(z3.CONFIG_CHANGE,r=>{n.setConfig({[r.name]:r.newValue})})}}const $ge={addr:"0x3b3b57de",name:"0x691f3431",abi:"0x2203ab56",pubkey:"0xc8690233",text:"0x59d1d43c",contenthash:"0xbc1c58d1"},q6={setAddr:"addr",addr:"addr",setPubkey:"pubkey",pubkey:"pubkey",setContenthash:"contenthash",contenthash:"contenthash",text:"text",name:"name"},wR={main:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",goerli:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},Dkt={"0x1":"main","0x5":"goerli"},Bkt=[{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"}],$kt=[{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 Ukt="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 zkt(e){let t=0;function n(){return e[t++]<<8|e[t++]}let r=n(),s=1,a=[0,1];for(let O=1;O<r;O++)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 O=0;O<f;O++)C=C<<1|d();let N=[],P=0,I=x;for(;;){let O=Math.floor(((C-P+1)*s-1)/I),U=0,L=r;for(;L-U>1;){let ne=U+L>>>1;O<a[ne]?L=ne:U=ne}if(U==0)break;N.push(U);let z=P+Math.floor(I*a[U]/s),X=P+Math.floor(I*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;P=z,I=1+X-z}let R=r-4;return N.map(O=>{switch(O-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 O-1}})}function Hkt(e){let t=0;return()=>e[t++]}function ROe(e){return Hkt(zkt(Vkt(e)))}function Vkt(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 Wkt(e){return e&1?~e>>1:e>>1}function qkt(e,t){let n=Array(e);for(let r=0,s=0;r<e;r++)n[r]=s+=Wkt(t());return n}function VE(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 LOe(e){return WE(()=>{let t=VE(e);if(t.length)return t})}function DOe(e){let t=[];for(;;){let n=e();if(n==0)break;t.push(Gkt(n,e))}for(;;){let n=e()-1;if(n<0)break;t.push(Kkt(n,e))}return t.flat()}function WE(e){let t=[];for(;;){let n=e(t.length);if(!n)break;t.push(n)}return t}function BOe(e,t,n){let r=Array(e).fill().map(()=>[]);for(let s=0;s<t;s++)qkt(e,n).forEach((a,o)=>r[o].push(a));return r}function Gkt(e,t){let n=1+t(),r=t(),s=WE(t);return BOe(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 Kkt(e,t){let n=1+t();return BOe(n,1+e,t).map(s=>[s[0],s.slice(1)])}function Ykt(e){let t=[],n=VE(e);return s(r([]),[]),t;function r(a){let o=e(),l=WE(()=>{let c=VE(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 Xkt(e){return e.toString(16).toUpperCase().padStart(2,"0")}function $Oe(e){return`{${Xkt(e)}}`}function Qkt(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 Zkt(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 Jkt="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 qE=44032,CR=4352,SR=4449,NR=4519,UOe=19,zOe=21,pN=28,AR=zOe*pN,eTt=UOe*AR,tTt=qE+eTt,nTt=CR+UOe,rTt=SR+zOe,sTt=NR+pN;function Sj(e){return e>>24&255}function HOe(e){return e&16777215}let Dee,Hge,Bee,xO;function iTt(){let e=ROe(Jkt);Dee=new Map(LOe(e).flatMap((t,n)=>t.map(r=>[r,n+1<<24]))),Hge=new Set(VE(e)),Bee=new Map,xO=new Map;for(let[t,n]of DOe(e)){if(!Hge.has(t)&&n.length==2){let[r,s]=n,a=xO.get(r);a||(a=new Map,xO.set(r,a)),a.set(s,t)}Bee.set(t,n.reverse())}}function VOe(e){return e>=qE&&e<tTt}function aTt(e,t){if(e>=CR&&e<nTt&&t>=SR&&t<rTt)return qE+(e-CR)*AR+(t-SR)*pN;if(VOe(e)&&t>NR&&t<sTt&&(e-qE)%pN==0)return e+(t-NR);{let n=xO.get(e);return n&&(n=n.get(t),n)?n:-1}}function WOe(e){Dee||iTt();let t=[],n=[],r=!1;function s(a){let o=Dee.get(a);o&&(r=!0,a|=o),t.push(a)}for(let a of e)for(;;){if(a<128)t.push(a);else if(VOe(a)){let o=a-qE,l=o/AR|0,c=o%AR/pN|0,u=o%pN;s(CR+l),s(SR+c),u>0&&s(NR+u)}else{let o=Bee.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 oTt(e){let t=[],n=[],r=-1,s=0;for(let a of e){let o=Sj(a),l=HOe(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=aTt(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 qOe(e){return WOe(e).map(HOe)}function lTt(e){return oTt(WOe(e))}const Vge=45,GOe=".",KOe=65039,YOe=1,jR=e=>Array.from(e);function GE(e,t){return e.P.has(t)||e.Q.has(t)}let cTt=class extends Array{get is_emoji(){return!0}},$ee,XOe,ew,Uee,QOe,u4,AV,AC,Ev,Wge,zee;function Roe(){if($ee)return;let e=ROe(Ukt);const t=()=>VE(e),n=()=>new Set(t()),r=(d,f)=>f.forEach(x=>d.add(x));$ee=new Map(DOe(e)),XOe=n(),ew=t(),Uee=new Set(t().map(d=>ew[d])),ew=new Set(ew),QOe=n(),n();let s=LOe(e),a=e();const o=()=>{let d=new Set;return t().forEach(f=>r(d,s[f])),r(d,t()),d};u4=WE(d=>{let f=WE(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}}}),AV=n(),AC=new Map;let l=t().concat(jR(AV)).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),AV.has(d)||AC.set(d,g)});for(let{V:d,M:f}of new Set(AC.values())){let x=[];for(let v of d){let w=u4.filter(N=>GE(N,v)),C=x.find(({G:N})=>w.some(P=>N.has(P)));C||(C={G:new Set,V:[]},x.push(C)),C.V.push(v),r(C.G,w)}let g=x.flatMap(v=>jR(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)}}Ev=new Set;let c=new Set;const u=d=>Ev.has(d)?c.add(d):Ev.add(d);for(let d of u4){for(let f of d.P)u(f);for(let f of d.Q)u(f)}for(let d of Ev)!AC.has(d)&&!c.has(d)&&AC.set(d,YOe);r(Ev,qOe(Ev)),Wge=Ykt(e).map(d=>cTt.from(d)).sort(Zkt),zee=new Map;for(let d of Wge){let f=[zee];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===KOe?f.push(...g):f=g}for(let x of f)x.V=d}}function Loe(e){return(ZOe(e)?"":`${Doe(v$([e]))} `)+$Oe(e)}function Doe(e){return`"${e}"‎`}function uTt(e){if(e.length>=4&&e[2]==Vge&&e[3]==Vge)throw new Error(`invalid label extension: "${hN(e.slice(0,4))}"`)}function dTt(e){for(let n=e.lastIndexOf(95);n>0;)if(e[--n]!==95)throw new Error("underscore allowed only at start")}function fTt(e){let t=e[0],n=Uge.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=Uge.get(t);if(o){if(s==a)throw e9(`${n} + ${o}`);s=a+1,n=o}}if(s==r)throw e9(`trailing ${n}`)}function v$(e,t=1/0,n=$Oe){let r=[];hTt(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];ZOe(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 hTt(e,t){return Roe(),ew.has(e)}function ZOe(e){return Roe(),QOe.has(e)}function pTt(e){return bTt(mTt(e,lTt,wTt))}function mTt(e,t,n){if(!e)return[];Roe();let r=0;return e.split(GOe).map(s=>{let a=Qkt(s),o={input:a,offset:r};r+=a.length+1;try{let l=o.tokens=vTt(a,t,n),c=l.length,u;if(!c)throw new Error("empty label");let d=o.output=l.flat();if(dTt(d),!(o.emoji=c>1||l[0].is_emoji)&&d.every(x=>x<128))uTt(d),u="ASCII";else{let x=l.flatMap(g=>g.is_emoji?[]:g);if(!x.length)u="Emoji";else{if(ew.has(d[0]))throw e9("leading combining mark");for(let w=1;w<c;w++){let C=l[w];if(!C.is_emoji&&ew.has(C[0]))throw e9(`emoji + combining mark: "${hN(l[w-1])} + ${v$([C[0]])}"`)}fTt(d);let g=jR(new Set(x)),[v]=gTt(g);yTt(v,x),xTt(v,g),u=v.N}}o.type=u}catch(l){o.error=l}return o})}function xTt(e,t){let n,r=[];for(let s of t){let a=AC.get(s);if(a===YOe)return;if(a){let o=a.M.get(s);if(n=n?n.filter(l=>o.has(l)):jR(o),!n.length)return}else r.push(s)}if(n){for(let s of n)if(r.every(a=>GE(s,a)))throw new Error(`whole-script confusable: ${e.N}/${s.N}`)}}function gTt(e){let t=u4;for(let n of e){let r=t.filter(s=>GE(s,n));if(!r.length)throw u4.some(s=>GE(s,n))?eMe(t[0],n):JOe(n);if(t=r,r.length==1)break}return t}function bTt(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 ${Doe(v$(t,63))}: ${s}`)}return hN(r)}).join(GOe)}function JOe(e){return new Error(`disallowed character: ${Loe(e)}`)}function eMe(e,t){let n=Loe(t),r=u4.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 yTt(e,t){for(let n of t)if(!GE(e,n))throw eMe(e,n);if(e.M){let n=qOe(t);for(let r=1,s=n.length;r<s;r++)if(Uee.has(n[r])){let a=r+1;for(let o;a<s&&Uee.has(o=n[a]);a++)for(let l=r;l<a;l++)if(n[l]==o)throw new Error(`duplicate non-spacing marks: ${Loe(o)}`);if(a-r>zge)throw new Error(`excessive non-spacing marks: ${Doe(v$(n.slice(r-1,a)))} (${a-r}/${zge})`);r=a}}}function vTt(e,t,n){let r=[],s=[];for(e=e.slice().reverse();e.length;){let a=CTt(e);if(a)s.length&&(r.push(t(s)),s=[]),r.push(n(a));else{let o=e.pop();if(Ev.has(o))s.push(o);else{let l=$ee.get(o);if(l)s.push(...l);else if(!XOe.has(o))throw JOe(o)}}}return s.length&&r.push(t(s)),r}function wTt(e){return e.filter(t=>t!=KOe)}function CTt(e,t){let n=zee,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 STt=e=>pTt(e),v0=e=>{let t="";for(let n=0;n<32;n+=1)t+="00";if(e){const r=STt(e).split(".");for(let s=r.length-1;s>=0;s-=1){const a=Qf(r[s]).slice(2);t=Qf(`0x${t}${a}`).slice(2)}}return`0x${t}`};var hP=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,n){this.contract=new r3(Bkt,n??wR.main,t),this.context=t}getOwner(t){return hP(this,void 0,void 0,function*(){try{return this.contract.methods.owner(v0(t)).call()}catch{throw new Error}})}getTTL(t){return hP(this,void 0,void 0,function*(){try{return this.contract.methods.ttl(v0(t)).call()}catch{throw new Error}})}recordExists(t){return hP(this,void 0,void 0,function*(){try{return this.contract.methods.recordExists(v0(t)).call()}catch{throw new Error}})}getResolver(t){return hP(this,void 0,void 0,function*(){try{return this.contract.methods.resolver(v0(t)).call().then(n=>{if(typeof n=="string")return new r3($kt,n,this.context);throw new Error})}catch{throw new Error}})}get events(){return this.contract.events}}var Hx=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 ATt{constructor(t){this.registry=t}getResolverContractAdapter(t){return Hx(this,void 0,void 0,function*(){return this.registry.getResolver(t)})}checkInterfaceSupport(t,n){var r,s;return Hx(this,void 0,void 0,function*(){if(ri($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 Hx(this,void 0,void 0,function*(){const s=yield this.getResolverContractAdapter(t);let a=n;if(!Aa(a)){if(a=(r=eT(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 Hx(this,void 0,void 0,function*(){const r=yield this.getResolverContractAdapter(t);return yield this.checkInterfaceSupport(r,q6.addr),r.methods.addr(v0(t),n).call()})}getPubkey(t){return Hx(this,void 0,void 0,function*(){const n=yield this.getResolverContractAdapter(t);return yield this.checkInterfaceSupport(n,q6.pubkey),n.methods.pubkey(v0(t)).call()})}getContenthash(t){return Hx(this,void 0,void 0,function*(){const n=yield this.getResolverContractAdapter(t);return yield this.checkInterfaceSupport(n,q6.contenthash),n.methods.contenthash(v0(t)).call()})}setAddress(t,n,r){return Hx(this,void 0,void 0,function*(){const s=yield this.getResolverContractAdapter(t);return yield this.checkInterfaceSupport(s,q6.setAddr),s.methods.setAddr(v0(t),n).send(r)})}getText(t,n){return Hx(this,void 0,void 0,function*(){const r=yield this.getResolverContractAdapter(t);return yield this.checkInterfaceSupport(r,q6.text),r.methods.text(v0(t),n).call()})}getName(t,n=!0){return Hx(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,q6.name)),s.methods.name(v0(r)).call()})}}var wh=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 tMe extends Jd{constructor(t,n){super(n??""),this.registryAddress=t??wR.main,this._registry=new NTt(this.getContextObject(),t),this._resolver=new ATt(this._registry)}getResolver(t){return wh(this,void 0,void 0,function*(){return this._registry.getResolver(t)})}recordExists(t){return wh(this,void 0,void 0,function*(){return this._registry.recordExists(t)})}getTTL(t){return wh(this,void 0,void 0,function*(){return this._registry.getTTL(t)})}getOwner(t){return wh(this,void 0,void 0,function*(){return this._registry.getOwner(t)})}getAddress(t,n=60){return wh(this,void 0,void 0,function*(){return this._resolver.getAddress(t,n)})}getText(t,n){return wh(this,void 0,void 0,function*(){return Xf(t)?this._resolver.getText(yield this._resolver.getName(t,!1),n):this._resolver.getText(t,n)})}getName(t,n=!0){return wh(this,void 0,void 0,function*(){return this._resolver.getName(t,n)})}getPubkey(t){return wh(this,void 0,void 0,function*(){return this._resolver.getPubkey(t)})}getContenthash(t){return wh(this,void 0,void 0,function*(){return this._resolver.getContenthash(t)})}checkNetwork(){return wh(this,void 0,void 0,function*(){const t=Date.now()/1e3;if(!this._lastSyncCheck||t-this._lastSyncCheck>3600){const s=yield X_t(this);if(!(typeof s=="boolean"&&!s))throw new oNt;this._lastSyncCheck=t}if(this._detectedAddress)return this._detectedAddress;const n=yield Soe(this,Object.assign(Object.assign({},this.defaultReturnFormat),{number:Qh.HEX})),r=wR[Dkt[n]];if(typeof r>"u")throw new aNt(n);return this._detectedAddress=r,this._detectedAddress})}supportsInterface(t,n){return wh(this,void 0,void 0,function*(){return this._resolver.supportsInterface(t,n)})}get events(){return this._registry.events}setAddress(t,n,r){return wh(this,void 0,void 0,function*(){return this._resolver.setAddress(t,n,r)})}}var _1=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 jTt=e=>_1(void 0,void 0,void 0,function*(){return(yield TEt(e)).map(fx)}),ETt=(e,t)=>_1(void 0,void 0,void 0,function*(){Gs.validate(["string"],[t]);const n=yield IEt(e,t);return fx(n)}),_Tt=(e,t,n,r)=>_1(void 0,void 0,void 0,function*(){return Gs.validate(["address","string","uint"],[t,n,r]),PEt(e,t,n,r)}),kTt=(e,t)=>_1(void 0,void 0,void 0,function*(){return Gs.validate(["address"],[t]),FEt(e,t)}),TTt=(e,t,n)=>_1(void 0,void 0,void 0,function*(){return Gs.validate(["string","string"],[t,n]),OEt(e,t,n)}),ITt=(e,t,n,r)=>_1(void 0,void 0,void 0,function*(){const s=df(t,mi,{transactionSchema:r==null?void 0:r.customTransactionSchema});return MEt(e,s,n)}),PTt=(e,t,n,r)=>_1(void 0,void 0,void 0,function*(){const s=df(t,mi,{transactionSchema:r==null?void 0:r.customTransactionSchema});return REt(e,s,n)}),FTt=(e,t,n,r)=>_1(void 0,void 0,void 0,function*(){Gs.validate(["string","address","string"],[t,n,r]);const s=Aa(t)?t:wm(t);return LEt(e,s,n,r)}),OTt=(e,t,n)=>_1(void 0,void 0,void 0,function*(){Gs.validate(["string","string"],[t,n]);const r=Aa(t)?t:wm(t);return DEt(e,r,n)});var Vx=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 nMe extends Jd{getAccounts(){return Vx(this,void 0,void 0,function*(){return jTt(this.requestManager)})}newAccount(t){return Vx(this,void 0,void 0,function*(){return ETt(this.requestManager,t)})}unlockAccount(t,n,r){return Vx(this,void 0,void 0,function*(){return _Tt(this.requestManager,t,n,r)})}lockAccount(t){return Vx(this,void 0,void 0,function*(){return kTt(this.requestManager,t)})}importRawKey(t,n){return Vx(this,void 0,void 0,function*(){return TTt(this.requestManager,t,n)})}sendTransaction(t,n){return Vx(this,void 0,void 0,function*(){return ITt(this.requestManager,t,n,this.config)})}signTransaction(t,n){return Vx(this,void 0,void 0,function*(){return PTt(this.requestManager,t,n,this.config)})}sign(t,n,r){return Vx(this,void 0,void 0,function*(){return FTt(this.requestManager,t,n,r)})}ecRecover(t,n){return Vx(this,void 0,void 0,function*(){return OTt(this.requestManager,t,n)})}}var j0;(function(e){e.HTTPS="https",e.WebSocket="wss"})(j0||(j0={}));var vs;(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"})(vs||(vs={}));const MTt=1300;class RTt extends fi{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=MTt}}const LTt=1301;class qge extends fi{constructor(t){super(`Invalid provider config options given for ${t}`),this.code=LTt}}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())})};class rMe extends ooe{constructor(t,n,r,s,a){if(super(),a!==void 0&&n===j0.HTTPS&&!("providerOptions"in a))throw new qge("HTTP Provider");if(a!==void 0&&n===j0.WebSocket&&!("socketOptions"in a||"reconnectOptions"in a))throw new qge("Websocket Provider");this.transport=n,n===j0.HTTPS?this.provider=new c$(this.getRPCURL(t,n,r,s),a):n===j0.WebSocket&&(this.provider=new mFe(this.getRPCURL(t,n,r,s),a==null?void 0:a.socketOptions,a==null?void 0:a.reconnectOptions))}request(t,n){return DTt(this,void 0,void 0,function*(){return this.transport===j0.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 BTt=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 wc=e=>e!==void 0&&e.trim().length>0;class $Tt extends rMe{constructor(t=vs.ETH_MAINNET,n=j0.HTTPS,r="",s="",a){super(t,n,r,s,a)}request(t,n){const r=Object.create(null,{request:{get:()=>super.request}});return BTt(this,void 0,void 0,function*(){try{return yield r.request.call(this,t,n)}catch(s){throw s instanceof N0&&s.statusCode===429?new RTt(s):s}})}getRPCURL(t,n,r,s){let a="",o="";switch(t){case vs.ETH_MAINNET:a=wc(s)?s:"powerful-holy-bush.quiknode.pro",o=wc(r)?r:"3240624a343867035925ff7561eb60dfdba2a668";break;case vs.ETH_SEPOLIA:a=wc(s)?s:"dimensional-fabled-glitter.ethereum-sepolia.quiknode.pro",o=wc(r)?r:"382a3b5a4b938f2d6e8686c19af4b22921fde2cd";break;case vs.ETH_HOLESKY:a=wc(s)?s:"yolo-morning-card.ethereum-holesky.quiknode.pro",o=wc(r)?r:"481ebe70638c4dcf176af617a16d02ab866b9af9";break;case vs.ARBITRUM_MAINNET:a=wc(s)?s:"autumn-divine-dinghy.arbitrum-mainnet.quiknode.pro",o=wc(r)?r:"a5d7bfbf60b5ae9ce3628e53d69ef50d529e9a8c";break;case vs.ARBITRUM_SEPOLIA:a=wc(s)?s:"few-patient-pond.arbitrum-sepolia.quiknode.pro",o=wc(r)?r:"3be985450970628c860b959c65cd2642dcafe53c";break;case vs.BNB_MAINNET:a=wc(s)?s:"purple-empty-reel.bsc.quiknode.pro",o=wc(r)?r:"ebf6c532961e21f092ff2facce1ec4c89c540158";break;case vs.BNB_TESTNET:a=wc(s)?s:"floral-rough-scion.bsc-testnet.quiknode.pro",o=wc(r)?r:"5b297e5acff5f81f4c37ebf6f235f7299b6f9d28";break;case vs.POLYGON_MAINNET:a=wc(s)?s:"small-chaotic-moon.matic.quiknode.pro",o=wc(r)?r:"847569f8a017e84d985e10d0f44365d965a951f1";break;case vs.POLYGON_AMOY:a=wc(s)?s:"prettiest-side-shape.matic-amoy.quiknode.pro",o=wc(r)?r:"79a9476eea661d4f82de614db1d8a895b14b881c";break;default:throw new Error("Network info not avalible.")}return`${n}://${a}/${o}`}}const UTt=e=>e!==void 0&&e.trim().length>0,zTt=[vs.DYMENSION_MAINNET,vs.DYMENSION_TESTNET,vs.KAVA_MAINNET,vs.CRONOS_MAINNET,vs.POLYGON_MAINNET];class ER extends rMe{constructor(t=vs.ETH_MAINNET,n=j0.HTTPS,r="",s){super(t,n,"",r,s)}getRPCURL(t,n,r,s){if(!ER.networkHostMap[t])throw new Error("Network info not avalible.");const a=`${ER.networkHostMap[t]}.publicnode.com`,o=UTt(s)?s:a;return zTt.includes(t)&&n===j0.WebSocket?`${n}://${o}/websocket`:`${n}://${o}`}}ER.networkHostMap={[vs.POLYGON_AMOY]:"polygon-amoy-bor-rpc",[vs.DYMENSION_MAINNET]:"dymension-evm-rpc",[vs.DYMENSION_TESTNET]:"dymension-testnet-evm-rpc",[vs.BLAST_MAINNET]:"blast-rpc",[vs.GNOSIS_MAINNET]:"gnosis-rpc",[vs.PULSECHAIN_MAINNET]:"pulsechain-rpc",[vs.PULSECHAIN_TESTNET]:"pulsechain-testnet-rpc",[vs.KAVA_MAINNET]:"kava-evm-rpc",[vs.CRONOS_MAINNET]:"cronos-evm-rpc",[vs.MANTLE_MAINNET]:"mantle-rpc",[vs.TAIKO_MAINNET]:"taiko-rpc",[vs.TAIKO_HEKLA]:"taiko-hekla-rpc",[vs.LINEA_MAINNET]:"linea-rpc",[vs.LINEA_SEPOLIA]:"linea-sepolia-rpc",[vs.SCROLL_MAINNET]:"scroll-rpc",[vs.SCROLL_SEPOLIA]:"scroll-sepolia-rpc",[vs.SYSCOIN_MAINNET]:"syscoin-evm-rpc",[vs.SYSCOIN_TANENBAUM]:"syscoin-tanenbaum-evm-rpc",[vs.HAQQ_MAINNET]:"haqq-evm-rpc",[vs.EVMOS_MAINNET]:"evmos-evm-rpc",[vs.EVMOS_TESTNET]:"evmos-testnet-evm-rpc",[vs.BERACHAIN_TESTNET]:"berachain-testnet-evm-rpc",[vs.ETH_MAINNET]:"ethereum-rpc",[vs.ETH_SEPOLIA]:"ethereum-sepolia-rpc",[vs.ETH_HOLESKY]:"ethereum-holesky-rpc",[vs.BSC_MAINNET]:"bsc-rpc",[vs.BSC_TESTNET]:"bsc-testnet-rpc",[vs.POLYGON_MAINNET]:"polygon-bor-rpc",[vs.BASE_MAINNET]:"base-rpc",[vs.BASE_SEPOLIA]:"base-sepolia-rpc",[vs.ARBITRUM_ONE]:"arbitrum-one-rpc",[vs.ARBITRUM_NOVA]:"arbitrum-nova-rpc",[vs.ARBITRUM_SEPOLIA]:"arbitrum-sepolia-rpc",[vs.AVALANCHE_C_MAINNET]:"avalanche-c-chain-rpc",[vs.AVALANCHE_P_MAINNET]:"avalanche-p-chain-rpc",[vs.AVALANCHE_X_MAINNET]:"avalanche-x-chain-rpc",[vs.AVALANCHE_FUJI_C]:"avalanche-fuji-c-chain-rpc",[vs.AVALANCHE_FUJI_P]:"avalanche-fuji-p-chain-rpc",[vs.AVALANCHE_FUJI_X]:"avalanche-fuji-x-chain-rpc",[vs.OPTIMISM_MAINNET]:"optimism-rpc",[vs.OPTIMISM_SEPOLIA]:"optimism-sepolia-rpc",[vs.FANTOM_MAINNET]:"fantom-rpc",[vs.FANTOM_TESTNET]:"fantom-testnet-rpc",[vs.OPBNB_MAINNET]:"opbnb-rpc",[vs.OPBNB_TESTNET]:"opbnb-testnet-rpc",[vs.GNOSIS_CHIADO]:"gnosis-chiado-rpc",[vs.CHILIZ_MAINNET]:"chiliz-rpc",[vs.CHILIZ_SPICY]:"chiliz-spicy-rpc",[vs.MOONBEAM_MAINNET]:"moonbeam-rpc",[vs.BAHAMUT_MAINNET]:"bahamut-rpc",[vs.TRON_MAINNET]:"tron-evm-rpc",[vs.MOONRIVER_MAINNET]:"moonriver-rpc"};const HTt=new $Tt,VTt={encodeEventSignature:Eoe,encodeFunctionCall:z_t,encodeFunctionSignature:zE,encodeParameter:Oee,encodeParameters:g$,decodeParameter:SOe,decodeParameters:n3,decodeLog:NOe};var T7=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 WTt=e=>{const t=(o,l)=>T7(void 0,void 0,void 0,function*(){const c=yield kkt(o,e),u=Wr({format:"bytes"},l,mi);return E9t(c,u)}),n=o=>{const l=yoe(o);return Object.assign(Object.assign({},l),{signTransaction:c=>T7(void 0,void 0,void 0,function*(){return t(c,l.privateKey)})})},r=(o,l,c)=>T7(void 0,void 0,void 0,function*(){var u;const d=yield I9t(o,l,(u=c==null?void 0:c.nonStrict)!==null&&u!==void 0?u:!0);return Object.assign(Object.assign({},d),{signTransaction:f=>T7(void 0,void 0,void 0,function*(){return t(f,d.privateKey)})})}),s=()=>{const o=T9t();return Object.assign(Object.assign({},o),{signTransaction:l=>T7(void 0,void 0,void 0,function*(){return t(l,o.privateKey)})})},a=new hR({create:s,privateKeyToAccount:n,decrypt:r});return{signTransaction:t,create:s,privateKeyToAccount:n,decrypt:r,recoverTransaction:_9t,hashMessage:boe,sign:zFe,recover:Aee,encrypt:HFe,wallet:a,privateKeyToAddress:h$,parseAndValidatePrivateKey:LA,privateKeyToPublicKey:k9t}},qTt={version:"4.16.0"};var GTt=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())})},_R;(function(e){e.eip6963announceProvider="eip6963:announceProvider",e.eip6963requestProvider="eip6963:requestProvider"})(_R||(_R={}));const jV=new Map,sMe="web3:providersMapUpdated",KTt=()=>GTt(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(_R.eip6963announceProvider,n=>{jV.set(n.detail.info.uuid,n.detail);const r=new CustomEvent(sMe,{detail:jV});window.dispatchEvent(r),e(jV)}),window.dispatchEvent(new Event(_R.eip6963requestProvider))})}),YTt=e=>{if(typeof window>"u")throw new Error("window object not available, EIP-6963 is intended to be used within a browser");window.addEventListener(sMe,e)};class Al extends Jd{constructor(t=HTt){var n;(ri(t)||typeof t=="string"&&t.trim()===""||typeof t!="string"&&!dR(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"||dR(t)?r.provider=t:t?r=t:r={},r.registeredSubscriptions=Object.assign(Object.assign({},Ree),(n=r.registeredSubscriptions)!==null&&n!==void 0?n:{}),super(r);const s=WTt(this);this._wallet=s.wallet,this._accountProvider=s,this.utils=pFe;const a=this;class o extends r3{constructor(u,d,f,x,g){if(py(d)&&py(f))throw new Bxe("Should not provide options at both 2nd and 3rd parameters");let v,w={},C,N;if(!ri(d)&&typeof d!="object"&&typeof d!="string")throw new Bxe;if(typeof d=="string"&&(v=d),py(d)?w=d:py(f)?w=f:w={},d instanceof Jd?C=d:f instanceof Jd?C=f:x instanceof Jd?C=x:C=a.getContextObject(),g?N=g:fg(f)?N=f:fg(x)&&(N=x),super(u,v,w,C,N),super.subscribeToContextEvents(a),!ri(l)){const P=l.getTransactionMiddleware();ri(P)||super.setTransactionMiddleware(P)}}}const l=a.use(b$);this.eth=Object.assign(l,{ens:a.use(tMe,wR.main),Iban:Ml,net:a.use(QFe),personal:a.use(nMe),Contract:o,abi:VTt,accounts:s})}}Al.version=qTt.version;Al.utils=pFe;Al.requestEIP6963Providers=KTt;Al.onNewProviderDiscovered=YTt;Al.modules={Web3Eth:b$,Iban:Ml,Net:QFe,ENS:tMe,Personal:nMe};const vd=({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),tn.success("TX Hash copied to clipboard!")}catch(f){console.error("Failed to copy: ",f),tn.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(Ea,{open:e,onClose:()=>{r||t(!1)},className:"relative z-[9001] font-inter",children:[i.jsx(ja,{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(ga,{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(Ba,{})}),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:ec,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:ske,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:ec,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(IM,{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(bet,{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(Ba,{})}),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."})})]})]})})})})]})},Boe=({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"})]})]})]}),iMe=[{id:"aster",label:"Aster",hash:"#aster-farming"},{id:"basedapp",label:"BasedApp",hash:"#basedapp-farming"},{id:"lighter",label:"Lighter",hash:"#lighter-farming"},{id:"apex",label:"Apex",hash:"#apex-farming"},{id:"extended",label:"Extended",hash:"#extended-farming"},{id:"variational",label:"Variational",hash:"#variational-farming"},{id:"paradex",label:"Paradex",hash:"#paradex-farming"},{id:"pacifica",label:"Pacifica",hash:"#pacifica-farming"}],XTt=iMe.reduce((e,t)=>(e[t.hash]=t.id,e),{}),f2=({current:e="",onCloseCurrent:t})=>{const n=oc(),r=Wo(),s=e||XTt[n.hash]||"",a=o=>{!o||o.id===s||(t&&t(),r(`${n.pathname}${n.search}${o.hash}`,{replace:!0}))};return i.jsxs("div",{className:"hidden lg:flex flex-col gap-4 w-[220px] p-4 rounded-2xl border border-[#242424] bg-[rgba(16,16,16,0.9)] shadow-lg shadow-black/30",children:[i.jsxs("div",{className:"flex items-center gap-2 px-2",children:[i.jsx("div",{className:"h-1 w-6 bg-gradient-to-r from-[#5ce0a5] to-[#4aba85] rounded-full"}),i.jsx("h3",{className:"text-[11px] text-[#b0b0b0] font-bold uppercase tracking-[0.15em]",children:"Farming Modules"})]}),i.jsx("div",{className:"flex flex-col gap-1.5",children:iMe.map(o=>{const l=o.id===s;return i.jsxs("button",{onClick:()=>a(o),className:`group relative h-12 w-full rounded-lg text-left px-3 text-[13px] font-medium transition-all duration-200 overflow-hidden ${l?"bg-[#293e33] text-white":"bg-transparent text-[#a8a8a8] hover:bg-[#1a1a1a] hover:text-white"}`,disabled:l,children:[i.jsx("div",{className:`absolute left-0 top-1/2 -translate-y-1/2 h-6 w-[3px] rounded-r-full transition-all duration-200 ${l?"bg-gradient-to-b from-[#5ce0a5] to-[#4aba85] opacity-100":"bg-[#3a3a3a] opacity-0 group-hover:opacity-100"}`}),i.jsxs("div",{className:"flex items-center gap-3 pl-2",children:[i.jsx("div",{className:`flex-shrink-0 w-5 h-5 rounded-md flex items-center justify-center transition-all duration-200 ${l?"bg-[#5ce0a5]/10 ring-1 ring-[#5ce0a5]/30":"bg-[#1f1f1f] group-hover:bg-[#252525]"}`,children:o.id==="aster"?i.jsx(Boe,{className:`w-3.5 h-3.5 ${l?"text-[#5ce0a5]":""}`}):o.id==="basedapp"?i.jsx("img",{src:Dyt,alt:"BasedApp",className:"w-3.5 h-3.5"}):o.id==="lighter"?i.jsx(Og,{className:`w-3.5 h-3.5 ${l?"text-[#5ce0a5]":"text-white"}`}):o.id==="apex"?i.jsx("img",{src:uke,alt:"Apex",className:"w-3.5 h-3.5"}):o.id==="extended"?i.jsx("img",{src:"https://app.extended.exchange/assets/logo/extended.svg",alt:"Extended",className:"w-3.5 h-3.5"}):o.id==="variational"?i.jsx("img",{src:cke,alt:"Variational",className:"w-3.5 h-3.5"}):o.id==="paradex"?i.jsx("img",{src:dke,alt:"Paradex",className:"w-3.5 h-3.5"}):o.id==="pacifica"?i.jsx("img",{src:"https://app.pacifica.fi/imgs/icon.svg",alt:"Pacifica",className:"w-3.5 h-3.5"}):null}),i.jsxs("span",{className:`transition-colors duration-200 ${l?"text-[#e8e8e8]":""}`,children:[o.label," Farming"]})]}),l&&i.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-[1px] bg-gradient-to-r from-transparent via-[#5ce0a5]/50 to-transparent"})]},o.id)})})]})};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(""),[P,I]=m.useState(2),[R,O]=m.useState(!1),[U,L]=m.useState(!1),[z,X]=m.useState(!1),[ne,J]=m.useState(!1),[K,re]=m.useState(!1),[he,Q]=m.useState(""),[ie,oe]=m.useState(""),[G,V]=m.useState(!1),[te,ae]=m.useState(!1),[fe,Ne]=m.useState(null),[me,we]=m.useState(""),[xe,ye]=m.useState(!1),[je,Pe]=m.useState(!1),[Re,Xe]=m.useState(null),[Ke,ut]=m.useState(!1),[et,tt]=m.useState([]),[Le,$e]=m.useState(!1),[ht,pt]=m.useState(!1),[Kt,wt]=m.useState(""),[nn,cn]=m.useState(!0),{setSignModalOpen:zn,setTelegramChatId:Xt,setSubscriberRole:on,setSubsExpireDay:Zt,setMushboomerETH:Ye,setMushboomerSOL:Ze,setIsReferralCode:Ft,setIsReferralCodeName:dn,setIsWhitelist:Yt,setHyperToken:Bt,setHyperAddress:ot}=m.useContext(Qr),De="https://dextrabothypev2.nftinit.io",_t="https://api.hyperliquid.xyz/info",ze="0x1924b8561eef20e70ede628a296175d358be80e5",nt=["HYPE","ETH","BTC","SOL","USDT0","PUP"],mt="0.01",$t=Ee=>{switch(Ee){case"BTC":return"UBTC";case"ETH":return"UETH";case"SOL":return"USOL";case"USDT0":return"USDT0";case"HYPE":default:return Ee}},Pt=Ee=>{if(Ee==null||Ee==="")return"0.00";const h=Number(Ee);return Number.isNaN(h)?"0.00":h.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})},un=Ee=>/^\d*\.?\d{0,6}$/.test(Ee),an=Ee=>/^\d*$/.test(Ee),xn=Ee=>{["e","E","+","-"].includes(Ee.key)&&Ee.preventDefault()},An=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]),yn=m.useMemo(()=>{if(v==="")return!1;const Ee=Number(v);return!Number.isNaN(Ee)&&Ee>=0&&Ee<=100},[v]),Vn=m.useMemo(()=>{if(C==="")return!1;const Ee=Number(C);return Number.isInteger(Ee)&&Ee>0&&Ee<=180},[C]),Gn=m.useMemo(()=>n.map(Ee=>{const h=(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),p=(Ee==null?void 0:Ee.version)===3?`${h} - (API-AGENT) Wallet`:h;return{value:(Ee==null?void 0:Ee.wallet_id)??(Ee==null?void 0:Ee.id)??(Ee==null?void 0:Ee.value)??"",label:p,raw:Ee}}),[n]),Rn=m.useMemo(()=>{var Ee;return(Ee=Gn.find(h=>String(h.value)===String(s)))==null?void 0:Ee.raw},[Gn,s]),Yn=m.useMemo(()=>{const Ee=Rn||{};return Ee.address||Ee.evm_address||Ee.wallet_address||Ee.public_address||Ee.eth_address||Ee.addr||null},[Rn]),Cn=(Rn==null?void 0:Rn.version)===3,rn=!Cn||Re>0,Oe=m.useMemo(()=>{if(!o)return{coin:$t(o),total:"0",entryNtl:"0"};const Ee=$t(o);return(et||[]).find(p=>(p==null?void 0:p.coin)===Ee)??{coin:Ee,total:"0",entryNtl:"0"}},[o,et]),Jt=s!==""&&o!==""&&(P===1?Vn&&yn:An&&kn)&&xe&&rn&&nn;m.useEffect(()=>{if(!e)return;const Ee=localStorage.getItem("hyperToken"),h=localStorage.getItem("hyperAddress");ye(!!(Ee&&h));const p=setInterval(()=>{const S=localStorage.getItem("hyperToken"),_=localStorage.getItem("hyperAddress");ye(!!(S&&_))},800);return()=>clearInterval(p)},[e]),m.useEffect(()=>{e&&(Q(""),xe&&Dt())},[e,xe]),m.useEffect(()=>{e&&(Yn?Xn(Yn):(Ne(null),we(""),tt([])))},[e,Yn]),m.useEffect(()=>{!e||!xe||(Et(),nr())},[e,xe]),m.useEffect(()=>{e&&P===1&&!v&&w(mt)},[e,P]),m.useEffect(()=>{if(!e||!xe)return;const Ee=Rn||{},h=Ee.address||Ee.evm_address||Ee.wallet_address||Ee.public_address||Ee.eth_address||Ee.addr||null;(Ee==null?void 0:Ee.version)===3&&h&&sn(h)},[e,xe,s,Rn]);async function sn(Ee){try{Pe(!0),Xe(null);const p=await(await fetch(_t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"maxBuilderFee",user:Ee,builder:ze})})).json();Xe(Number(p))}catch{Xe(null)}finally{Pe(!1)}}async function Et(){var Ee,h,p;try{L(!0);const S=window.localStorage.getItem("hyperToken"),_=window.localStorage.getItem("hyperAddress");if(!S||!_){V(!1);return}const T=await(await fetch(`${De}/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),((h=T==null?void 0:T.data)==null?void 0:h.wallet_id)!==void 0&&((p=T==null?void 0:T.data)==null?void 0:p.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 W=Number(B.methodType);W===1?(I(2),B.spread!==void 0&&B.spread!==null&&g(String(B.spread))):W===2?(I(1),B.spread!==void 0&&B.spread!==null?w(String(B.spread)):w(mt),B.orderPerHour!==void 0&&B.orderPerHour!==null&&N(String(B.orderPerHour))):I(2)}else V(!1)}catch{V(!1)}finally{L(!1)}}async function Xn(Ee){try{we(""),ae(!0),Ne(null);const p=await(await fetch(_t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"spotClearinghouseState",user:Ee})})).json(),S=Array.isArray(p==null?void 0:p.balances)?p.balances:[];tt(S);const _=S.find(k=>(k==null?void 0:k.coin)==="USDC");Ne(_?_.total:"0")}catch(h){we(h.message||"Failed to load USDC balance.")}finally{ae(!1)}}function gn(){const Ee=Yn||window.localStorage.getItem("hyperAddress");Ee&&Xn(Ee)}async function Dt(){try{O(!0);const Ee=window.localStorage.getItem("hyperToken"),h=window.localStorage.getItem("hyperAddress");if(!Ee||!h){ye(!1),zn(!0);return}const S=await(await fetch(`${De}/api/wallet/confirmed-list`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:h.toLowerCase(),token:Ee})})).json();S!=null&&S.success?r((S==null?void 0:S.data)||[]):Q((S==null?void 0:S.error_message)||"Failed to load wallets.")}catch(Ee){Q(Ee.message||"Wallet list error.")}finally{O(!1)}}async function en(){if(!xe){zn(!0);return}if(Jt)try{J(!0),Q("");const Ee=window.localStorage.getItem("hyperToken"),h=window.localStorage.getItem("hyperAddress");if(!Ee||!h){ye(!1),zn(!0);return}const S=P===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:h.toLowerCase(),token:Ee,wallet_id:Number(s),farming_params:S},T=await(await fetch(`${De}/api/hyper/farming/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(_)})).json();T!=null&&T.success?V(!0):Q((T==null?void 0:T.message)||"Start failed.")}catch(Ee){Q(Ee.message||"An error occurred while saving.")}finally{J(!1)}}async function In(){if(!xe)return zn(!0);if(s)try{re(!0),Q("");const Ee=window.localStorage.getItem("hyperToken"),h=window.localStorage.getItem("hyperAddress");if(!Ee||!h){ye(!1),zn(!0);return}const S=await(await fetch(`${De}/api/hyper/farming/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:h.toLowerCase(),token:Ee,wallet_id:Number(s)})})).json();S!=null&&S.success?V(!1):Q((S==null?void 0:S.error_message)||"Stop failed.")}catch(Ee){Q(Ee.message||"An error occurred while stopping.")}finally{re(!1)}}const Qn=32,ar={control:(Ee,h)=>({...Ee,backgroundColor:"#242424",borderColor:h.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,h)=>({...Ee,backgroundColor:h.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"})},hr=Ee=>{var h;return i.jsx(Ca.Option,{...Ee,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[((h=Ee.data)==null?void 0:h.icon)&&i.jsx("img",{src:Ee.data.icon,alt:Ee.data.label,className:"w-4 h-4",onError:p=>{p.currentTarget.style.display="none"}}),i.jsx("span",{className:"text-white text-[13px]",children:Ee.data.label})]})})},Gt=Ee=>{var h;return i.jsx(Ca.SingleValue,{...Ee,children:i.jsxs("div",{className:"flex items-center gap-2",children:[((h=Ee.data)==null?void 0:h.icon)&&i.jsx("img",{src:Ee.data.icon,alt:Ee.data.label,className:"w-4 h-4",onError:p=>{p.currentTarget.style.display="none"}}),i.jsx("span",{className:"text-white text-[13px]",children:Ee.data.label})]})})},$n=m.useMemo(()=>nt.map(Ee=>{let p=`https://app.hyperliquid.xyz/coins/${Ee==="USDT0"?"USDT":Ee}.svg`;return Ee==="PUP"&&(p="https://www.basedapp.io/_next/image?url=%2Ftokens%2Fpng%2FPUP_USDC.png&w=32&q=75"),{value:Ee,label:Ee,icon:p}}),[]),nr=async()=>{var p,S;const Ee=window.localStorage.getItem("hyperToken"),h=window.localStorage.getItem("hyperAddress");if(!(!Ee||!h))try{X(!0);const _=await _i(h.toLowerCase(),Ee);_!=null&&_.success?(Xt(_==null?void 0:_.telegram_chat_id),on(_==null?void 0:_.subscriber_role),Zt(_==null?void 0:_.subs_expire_day),Ye((p=_==null?void 0:_.mushboomer_counts)==null?void 0:p.eth),Ze((S=_==null?void 0:_.mushboomer_counts)==null?void 0:S.sol),Ft(_==null?void 0:_.referral_code),dn(_==null?void 0:_.refcode),Yt(_==null?void 0:_.whitelist),Bt(Ee),ot(h),cn(!0),X(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),Bt(""),ot(""),X(!1))}catch(_){console.error("Token verification error:",_),console.error(_.message||"An unknown error occurred."),X(!1)}},Rt=R||U||ne||K||z,En=G&&!K;return e?i.jsxs(i.Fragment,{children:[Ke&&Na.createPortal(i.jsx("div",{className:"fixed inset-0 z-[999999999]",children:i.jsx(f5,{open:Ke,setOpen:ut,handleListRequest:Dt,handlePageChange:()=>{}})}),document.body),i.jsx(vd,{open:ht,setOpen:pt,transactionHash:Kt,transactionLoading:Le,paymentPresaleRole:nn,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:()=>!Rt&&t(!1)}),i.jsxs("div",{className:"relative flex items-start gap-4 px-3 w-full max-w-[1000px]",children:[i.jsx(f2,{current:"basedapp",onCloseCurrent:()=>!Rt&&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:lke,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")?ut(!0):zn(!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(qk,{})}),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"})]})}),P===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."})}),xe&&Cn&&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..."}):rn?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 ${P===2?"bg-[#242424] text-white shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)]":"text-[#B3B3B3]"} ${En?"opacity-60 cursor-not-allowed":""}`,onClick:()=>!En&&I(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 ${P===1?"bg-[#242424] text-white shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)]":"text-[#B3B3B3]"} ${En?"opacity-60 cursor-not-allowed":""}`,onClick:()=>!En&&I(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(Nl,{styles:ar,isDisabled:Rt||R||En,isLoading:R,options:Gn,value:Gn.find(Ee=>String(Ee.value)===String(s))||null,onChange:Ee=>{if(En)return;a((Ee==null?void 0:Ee.value)??""),Xe(null);const h=(Ee==null?void 0:Ee.raw)||{},p=h.address||h.evm_address||h.wallet_address||h.public_address||h.eth_address||h.addr||null;xe&&(h==null?void 0:h.version)===3&&p&&sn(p)},placeholder:xe?R?"Loading...":"Select":"Connect to select",isSearchable:!0,onMenuOpen:()=>{xe||zn(!0)},menuIsOpen:xe?void 0:!1}),!xe&&i.jsx("button",{type:"button",onClick:()=>zn(!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(Nl,{styles:ar,components:{Option:hr,SingleValue:Gt},isDisabled:Rt||En,options:$n,value:$n.find(Ee=>Ee.value===o)||null,onChange:Ee=>{En||l((Ee==null?void 0:Ee.value)??"")},placeholder:"Select",isSearchable:!0})]})]}),P===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 h=Ee.target.value.trim();if(h==="")return N("");an(h)&&N(h)},onKeyDown:xn,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]":Vn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Rt||En}),C!==""&&!Vn&&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 h=Ee.target.value.trim();if(h==="")return w("");un(h)&&w(h)},onKeyDown:xn,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]":yn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Rt||En})]}),v!==""&&!yn&&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(xi,{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 h=Ee.target.value.trim();if(h==="")return u("");un(h)&&u(h)},onKeyDown:xn,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]":An?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Rt||En}),c!==""&&!An&&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 h=Ee.target.value.trim();if(h==="")return g("");un(h)&&g(h)},onKeyDown:xn,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:Rt||En})]}),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:[xe&&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:te?"Loading...":me?"—":Pt(fe??"0")}),i.jsx("div",{onClick:gn,className:"flex justify-center items-center cursor-pointer",title:"Refresh balance",children:i.jsx(jS,{className:`w-4 h-4 ${te?"animate-spin":""}`})})]}),xe&&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:Pt(Oe==null?void 0:Oe.total)}),i.jsxs("span",{className:"text-[#9B9B9B]",children:["(~",Pt(Oe==null?void 0:Oe.entryNtl)," USDC)"]}),i.jsx("div",{onClick:gn,className:"flex justify-center items-center cursor-pointer",title:"Refresh balance",children:i.jsx(jS,{className:`w-4 h-4 ${te?"animate-spin":""}`})})]})]}),i.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[i.jsx("button",{onClick:()=>!Rt&&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:Rt,children:"Cancel"}),xe?G?i.jsx("button",{onClick:In,disabled:!s||Rt,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:K?"Stopping...":"Stop"}):i.jsx("button",{onClick:en,disabled:!Jt||Rt,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] font-inter border ${!Jt||Rt?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:ne?"Starting...":"Start"}):i.jsx("button",{onClick:()=>zn(!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 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(Qr);ts();const[v,w]=m.useState(!1),[C,N]=m.useState(!1),[P,I]=m.useState(""),[R,O]=m.useState(""),[U,L]=m.useState(""),[z,X]=m.useState(""),[ne,J]=m.useState(""),[K,re]=m.useState("OFF"),[he,Q]=m.useState(""),[ie,oe]=m.useState(""),[G,V]=m.useState("LONG"),[te,ae]=m.useState("MARKET"),[fe,Ne]=m.useState(""),[me,we]=m.useState(""),[xe,ye]=m.useState(""),[je,Pe]=m.useState(!1),[Re,Xe]=m.useState(!1),[Ke,ut]=m.useState(!1),[et,tt]=m.useState(!1),[Le,$e]=m.useState(""),[ht,pt]=m.useState(""),[Kt,wt]=m.useState(!0),[nn,cn]=m.useState(!1),[zn,Xt]=m.useState(!1),[on,Zt]=m.useState(!1),[Ye,Ze]=m.useState(!1),[Ft,dn]=m.useState(!1),[Yt,Bt]=m.useState(!1),[ot,De]=m.useState(""),[_t,ze]=m.useState(!0),[nt,mt]=m.useState(2),$t="https://dextrabothypev2.nftinit.io",Pt="",un={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]]},an={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"}},xn=k=>{if(k==null||isNaN(k))return"";const T=Math.abs(k),B=W=>W.toFixed(1).replace(/\.0$/,"");return T>=1e9?`${B(k/1e9)}B`:T>=1e6?`${B(k/1e6)}M`:T>=1e3?`${B(k/1e3)}K`:`${k}`},An=(k,T)=>{const B=un[k]||[];if(!B.length||!T)return null;let W=null;for(const[ee,ce,ue]of B)T<=ee&&(!W||ee<W.maxLev)&&(W={min:ce,max:ue,maxLev:ee});return W},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}],[]),yn=k=>{var T;return((T=kn.find(B=>B.value===k))==null?void 0:T.maxLeverage)??100},Vn=k=>{["e","E","+","-"].includes(k.key)&&k.preventDefault()},Gn=k=>/^\d*\.?\d{0,6}$/.test(k),Rn=k=>/^\d*$/.test(k),Yn=m.useMemo(()=>{if(he==="")return!1;const k=Number(he);return Number.isInteger(k)&&k>=1&&k<=180},[he]),Cn=m.useMemo(()=>{if(ie==="")return!1;const k=Number(ie),T=yn(ne);return Number.isInteger(k)&&k>=1&&k<=T},[ie,ne]),rn=m.useMemo(()=>{if(fe==="")return!1;const k=Number(fe);return!Number.isNaN(k)&&k>=0&&k<=100},[fe]),Oe=m.useMemo(()=>{if(me==="")return!1;const k=Number(me);return!Number.isNaN(k)&&k>=0&&k<=100},[me]),Jt=m.useMemo(()=>{if(xe==="")return!1;const k=Number(xe);return!Number.isNaN(k)&&k>=0&&k<=100},[xe]),sn=Number(ie||0),Et=Cn&&ne?An(ne,sn):null,Xn=v&&P.trim()!==""&&R.trim()!==""&&(K!=="ON"||U.trim()!==""&&z.trim()!=="")&&ne!==""&&Yn&&Cn&&(G==="LONG"||G==="SHORT")&&(te==="LIMIT"||te==="MARKET")&&_t,gn=()=>(localStorage.getItem("hyperAddress")||"dextra").toLowerCase(),Dt=()=>`asterCreds:${gn()}`,en=()=>{try{const k=localStorage.getItem(Dt());if(!k)return;const T=JSON.parse(k);T.apiKey&&I(T.apiKey),T.apiSecret&&O(T.apiSecret),T.apiKeyTwo&&L(T.apiKeyTwo),T.apiSecretTwo&&X(T.apiSecretTwo),typeof T.remember=="boolean"&&wt(T.remember)}catch{}},In=()=>{if(Kt)try{localStorage.setItem(Dt(),JSON.stringify({apiKey:P,apiSecret:R,apiKeyTwo:U,apiSecretTwo:z,remember:!0}))}catch{}},Qn=()=>{try{localStorage.removeItem(Dt())}catch{}};m.useEffect(()=>{if(!e)return;const k=localStorage.getItem("hyperToken"),T=localStorage.getItem("hyperAddress");w(!!(k&&T));const B=setInterval(()=>{const W=localStorage.getItem("hyperToken"),ee=localStorage.getItem("hyperAddress");w(!!(W&&ee))},800);return()=>clearInterval(B)},[e]),m.useEffect(()=>{!e||!v||(ar(),Ee())},[e,v]),m.useEffect(()=>{e&&(me===""&&we(Pt),fe===""&&Ne(Pt),xe===""&&ye(Pt))},[e]),m.useEffect(()=>{if(!ne)return;const k=yn(ne),T=Number(ie);!Number.isNaN(T)&&T>k&&oe(String(k)),!Number.isNaN(T)&&T<1&&ie!==""&&oe("1")},[ne]),m.useEffect(()=>{e&&(Kt&&In(),Kt||Qn())},[P,R,U,z,Kt,e]);async function ar(){var k,T,B,W,ee;try{Xe(!0),$e("");const ce=window.localStorage.getItem("hyperToken"),ue=window.localStorage.getItem("hyperAddress");if(!ce||!ue){N(!1),en();return}const Se=await(await fetch(`${$t}/api/hyper/ast_farming/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:ue.toLowerCase(),token:ce})})).json(),ke=(k=Se==null?void 0:Se.data)==null?void 0:k.farming_params;if(Se!=null&&Se.success&&ke){N(!0);const Me=((T=Se==null?void 0:Se.data)==null?void 0:T.aster_apikey)??"",qe=((B=Se==null?void 0:Se.data)==null?void 0:B.aster_apisecret)??"",Fe=(ke==null?void 0:ke.api_key_2)??"",at=(ke==null?void 0:ke.api_secret_2)??"";Me&&I(String(Me)),qe&&O(String(qe)),Fe&&L(String(Fe)),at&&X(String(at)),((W=Se==null?void 0:Se.data)==null?void 0:W.delta_neutral)!==void 0&&re((ee=Se==null?void 0:Se.data)!=null&&ee.delta_neutral?"ON":"OFF"),ke!=null&&ke.coin&&J(String(ke.coin)),(ke==null?void 0:ke.orderPerHour)!=null&&Q(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&&Ne(String(ke.upspread)),(ke==null?void 0:ke.downspread)!=null&&we(String(ke.downspread)),(ke==null?void 0:ke.upspread)!=null&&ye(String(ke.upspread))}else N(!1),re("OFF");(!P&&!R||K==="ON"&&!U&&!z)&&en()}catch{N(!1),en(),re("OFF")}finally{Xe(!1)}}async function hr(){if(!v){r(!0);return}if(Xn)try{ut(!0),$e("");const k=window.localStorage.getItem("hyperToken"),T=window.localStorage.getItem("hyperAddress");if(!k||!T){r(!0);return}const B={methodType:K==="ON"?2:1,coin:ne,orderPerHour:Number(he),leverage:Number(ie),...K==="ON"?{api_key_2:U,api_secret_2:z}:te==="LIMIT"?{upspread:Number(xe),direction:G,order_type:te==="LIMIT"?"limit":"market"}:{upspread:Number(fe),downspread:Number(me),direction:G,order_type:te==="LIMIT"?"limit":"market"}},W={address:T.toLowerCase(),token:k,apikey:P,apisecret:R,farming_params:B,delta_neutral:K==="ON"},ce=await(await fetch(`${$t}/api/hyper/ast_farming/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(W)})).json();ce!=null&&ce.success?(N(!0),Kt&&In()):$e((ce==null?void 0:ce.error_message)||"Start failed.")}catch(k){$e(k.message||"An error occurred while saving.")}finally{ut(!1)}}async function Gt(){if(!v){r(!0);return}try{tt(!0),$e("");const k=window.localStorage.getItem("hyperToken"),T=window.localStorage.getItem("hyperAddress");if(!k||!T){r(!0);return}const W=await(await fetch(`${$t}/api/hyper/ast_farming/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:T.toLowerCase(),token:k})})).json();W!=null&&W.success?N(!1):$e((W==null?void 0:W.error_message)||"Stop failed.")}catch(k){$e(k.message||"An error occurred while stopping.")}finally{tt(!1)}}const $n={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"})},nr=({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"]}),Rt=k=>{var T;return i.jsx(Ca.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(nr,{max:k.data.maxLeverage})]})})},En=k=>{var T;return i.jsx(Ca.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(nr,{max:k.data.maxLeverage})]})})},Ee=async()=>{var B,W;const k=window.localStorage.getItem("hyperToken"),T=window.localStorage.getItem("hyperAddress");if(!(!k||!T))try{Pe(!0);const ee=await _i(T.toLowerCase(),k);ee!=null&&ee.success?(s(ee==null?void 0:ee.telegram_chat_id),a(ee==null?void 0:ee.subscriber_role),o(ee==null?void 0:ee.subs_expire_day),l((B=ee==null?void 0:ee.mushboomer_counts)==null?void 0:B.eth),c((W=ee==null?void 0:ee.mushboomer_counts)==null?void 0:W.sol),u(ee==null?void 0:ee.referral_code),d(ee==null?void 0:ee.refcode),f(ee==null?void 0:ee.whitelist),x(k),g(T),ze(!0),Pe(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),x(""),g(""),Pe(!1))}catch(ee){console.error("Token verification error:",ee),console.error(ee.message||"An unknown error occurred."),Pe(!1)}},h=kn;if(!e)return null;const p=Re||Ke||et||je,S=C&&!et,_=yn(ne);return i.jsxs(i.Fragment,{children:[i.jsx(vd,{open:Yt,setOpen:Bt,transactionHash:ot,transactionLoading:Ft,paymentPresaleRole:_t,errorFunds:ht,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:()=>!p&&t(!1)}),i.jsxs("div",{className:"relative flex items-start gap-4 px-3 w-full max-w-[1000px]",children:[i.jsx(f2,{current:"aster",onCloseCurrent:()=>!p&&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:`${K==="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(qk,{})}),i.jsx("div",{className:"text-white text-[13px] font-medium leading-[8px]",children:"YouTube"})]})})]}),C&&nt===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:`${K==="ON"?"space-y-3 pt-3.5 pb-3":"space-y-2 pt-2 pb-2"} px-5`,children:[Le&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:Le}),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(Boe,{className:"w-4 h-4"}),"Stage 3"]})})})})})}),v&&!C&&nt===2&&_t&&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"})]})]}),nt===2&&i.jsxs("div",{className:`${K==="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:[K==="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:P,onChange:k=>I(k.target.value),autoComplete:"off",placeholder:"ASTER_API_KEY",type:nn?"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:p||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:p||S,children:nn?i.jsx(ca,{size:14}):i.jsx(ua,{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=>O(k.target.value),autoComplete:"off",placeholder:"ASTER_API_SECRET",type:zn?"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:p||S}),i.jsx("button",{type:"button",onClick:()=>Xt(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:p||S,children:zn?i.jsx(ca,{size:14}):i.jsx(ua,{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:P,onChange:k=>I(k.target.value),autoComplete:"off",placeholder:"ASTER_API_KEY",type:nn?"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:p||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:p||S,children:nn?i.jsx(ca,{size:14}):i.jsx(ua,{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=>O(k.target.value),autoComplete:"off",placeholder:"ASTER_API_SECRET",type:zn?"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:p||S}),i.jsx("button",{type:"button",onClick:()=>Xt(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:p||S,children:zn?i.jsx(ca,{size:14}):i.jsx(ua,{size:14})})]})]})]}),K==="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:on?"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:p||S}),i.jsx("button",{type:"button",onClick:()=>Zt(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:p||S,children:on?i.jsx(ca,{size:14}):i.jsx(ua,{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:Ye?"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:p||S}),i.jsx("button",{type:"button",onClick:()=>Ze(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:p||S,children:Ye?i.jsx(ca,{size:14}):i.jsx(ua,{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(Nl,{styles:$n,components:{Option:Rt,SingleValue:En},isDisabled:p||S,options:h,value:h.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 Q("");Rn(T)&&Q(T)},onKeyDown:Vn,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]":Yn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:p||S}),he!==""&&!Yn&&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:K==="ON"?"On":"Off"}),i.jsx(_o,{checked:K==="ON",onChange:k=>re(k?"ON":"OFF"),disabled:p||S,className:`${K==="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 ${p||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  ${K==="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("");Rn(T)&&oe(T)},onKeyDown:Vn,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]":Cn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:p||S}),ie!==""&&!Cn&&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:[sn,"x"]}),":"," ",i.jsxs("b",{children:[xn(Et.min)," – ",xn(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"})]}),an[ne]&&i.jsxs("div",{children:["Trading Limit is"," ",i.jsxs("b",{children:[xn(an[ne].market)," ",an[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:`${K==="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":te==="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",p||S?"opacity-60 cursor-not-allowed":"cursor-pointer",te==="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 ",te==="MARKET"?" ✓":""]})}),i.jsx("button",{"aria-pressed":te==="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",p||S?"opacity-60 cursor-not-allowed":"cursor-pointer",te==="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 ",te==="LIMIT"?" ✓":""]})})]})]}),i.jsxs("div",{className:`${K==="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",p||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",p||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:`${K==="ON"||te==="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 Ne("");Gn(T)&&Ne(T)},onKeyDown:Vn,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]":rn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:p||S})]}),fe!==""&&!rn&&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:me,onChange:k=>{const T=k.target.value.trim();if(T==="")return we("");Gn(T)&&we(T)},onKeyDown:Vn,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] ${me===""?"border-[#353535]":Oe?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:p||S})]}),me!==""&&!Oe&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter a percentage between 0 and 100."})]})]}),i.jsx("div",{className:`${K==="OFF"&&te==="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:xe,onChange:k=>{const T=k.target.value.trim();if(T==="")return ye("");Gn(T)&&ye(T)},onKeyDown:Vn,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] ${xe===""?"border-[#353535]":Jt?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:p||S})]}),xe!==""&&!Jt&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter a percentage between 0 and 100."})]})})]}),nt===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:()=>!p&&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:p,children:"Cancel"}),v?C?i.jsx("button",{onClick:Gt,disabled:p,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:et?"Stopping...":"Stop"}):i.jsx("button",{onClick:hr,disabled:!Xn||p,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!Xn||p?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:Ke?"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&&nt===2&&i.jsx("div",{className:"absolute inset-0 rounded-3xl bg-black/40 flex items-center justify-center text-sm",children:"Loading..."})]})]})]})]})]})},QTt=({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})]})}),up=({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"})]}),so=({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"})})]}),Ai=({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"})]}),m5=({open:e=!1,setOpen:t=()=>{},oldSlotCount:n,checkAccountLighter:r,tradeMarket:s,product:a})=>{const{address:o}=ts(),{setSignModalOpen:l,setTelegramChatId:c,setSubscriberRole:u,setSubsExpireDay:d,setMushboomerETH:f,setMushboomerSOL:x,setIsReferralCode:g,setIsReferralCodeName:v,setIsWhitelist:w,setHyperToken:C,setHyperAddress:N}=m.useContext(Qr),[P,I]=m.useState(1),[R,O]=m.useState(!1),[U,L]=m.useState(!1),[z,X]=m.useState(""),[ne,J]=m.useState(""),[K,re]=m.useState(""),he=fe=>/^\d*$/.test(fe),Q=fe=>{["e","E","+","-"].includes(fe.key)&&fe.preventDefault()};m.useEffect(()=>{e||I(1)},[e]);const ie=m.useRef(K);m.useEffect(()=>{ie.current=K},[K]);const oe=m.useMemo(()=>{if(P==="")return!1;const fe=Number(P);return Number.isInteger(fe)&&fe>=1},[P]),G=async()=>{var me,we,xe,ye;const fe=window.localStorage.getItem("hyperToken"),Ne=window.localStorage.getItem("hyperAddress");if(!(!fe||!Ne))try{const je=await _i(Ne.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((me=je==null?void 0:je.mushboomer_counts)==null?void 0:me.eth),x((we=je==null?void 0:je.mushboomer_counts)==null?void 0:we.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(Ne),re((ye=(xe=je==null?void 0:je.slots_info)==null?void 0:xe[s])==null?void 0:ye.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 Al(window.ethereum).eth.getAccounts(Ne=>Ne),te=async(fe="slot",Ne=24,me=5e3)=>{Ne<=0||(await new Promise(we=>setTimeout(we,me)),await G(),fe==="slot"&&ie.current<=n?te(fe,Ne-1,me):r())},ae=async fe=>{J("");const Ne=window.localStorage.getItem("hyperToken"),me=window.localStorage.getItem("hyperAddress");if(!Ne||!o){l(!0);return}L(!0),O(!0);try{await window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0x1"}]})}catch(ye){console.error("Failed to switch network",ye),O(!1);return}const we=new Al(window.ethereum);var xe=await V();if(xe.length>0?xe=xe[0]:xe=void 0,xe){const je=fe*.012,Pe=we.utils.toWei(je.toString(),"ether"),Re={from:xe,to:"0xdEAe8586eD227A5096EBae47342fFc1ED99f13F9",value:Pe};await we.eth.sendTransaction(Re).then(Xe=>{console.log("txHash :>> ",Xe),O(!1),X(Xe.transactionHash);const Ke=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():me,token:Ne,payment_tx:Xe.transactionHash,slot_role:Ke,slot_qty:Number(P)})}),G(),te("slot")}).catch(Xe=>{console.log(Xe),Xe.code===-32003||Xe.message.includes("insufficient funds")?J("Insufficient funds."):Xe.message==="MetaMask Tx Signature: User denied transaction signature."&&L(!1)})}else await we.eth.requestAccounts()};return e?i.jsxs(i.Fragment,{children:[i.jsx(vd,{open:U,setOpen:L,transactionHash:z,transactionLoading:R,paymentPresaleRole:!(K<=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:()=>I(fe=>{const Ne=Number(fe||0);return Ne>1?String(Ne-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:P,onChange:fe=>{const Ne=fe.target.value.trim();if(Ne==="")return I("");he(Ne)&&I(Ne)},onKeyDown:Q,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(fe=>{const Ne=Number(fe||0);return String(Ne+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:"+"})]}),P!==""&&!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:[(P*.012).toFixed(3)," ETH"]})]}),i.jsx("div",{onClick:fe=>{fe.preventDefault(),oe&&ae(P)},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 Jr,Ks,Es,gr;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(Qr);ts();const[g,v]=m.useState(1),[w,C]=m.useState(0),[N,P]=m.useState(0),[I,R]=m.useState(0),[O,U]=m.useState(0),[L,z]=m.useState({}),[X,ne]=m.useState(null),[J,K]=m.useState(!1),[re,he]=m.useState(!1),[Q,ie]=m.useState(!1),[oe,G]=m.useState("OFF"),[V,te]=m.useState(""),[ae,fe]=m.useState(""),[Ne,me]=m.useState(""),[we,xe]=m.useState(""),[ye,je]=m.useState(""),[Pe,Re]=m.useState(""),[Xe,Ke]=m.useState(""),[ut,et]=m.useState(""),[tt,Le]=m.useState([]),[$e,ht]=m.useState(""),[pt,Kt]=m.useState(""),[wt,nn]=m.useState(""),[cn,zn]=m.useState("LONG"),[Xt,on]=m.useState("STANDARD"),[Zt,Ye]=m.useState("STANDARD"),[Ze,Ft]=m.useState("MARKET"),[dn,Yt]=m.useState(""),[Bt,ot]=m.useState(""),[De,_t]=m.useState(""),[ze,nt]=m.useState(!1),[mt,$t]=m.useState(!1),[Pt,un]=m.useState(!1),[an,xn]=m.useState(!1),[An,kn]=m.useState(""),[yn,Vn]=m.useState(""),[Gn,Rn]=m.useState(!0),[Yn,Cn]=m.useState(!1),[rn,Oe]=m.useState(!1),[Jt,sn]=m.useState(!1),[Et,Xn]=m.useState(!1),[gn,Dt]=m.useState(""),[en,In]=m.useState(!0),[Qn,ar]=m.useState(!1),[hr,Gt]=m.useState("Hour"),[$n,nr]=m.useState(1),[Rt,En]=m.useState("lighter"),[Ee,h]=m.useState(!1),p=m.useRef(null),[S,_]=m.useState(""),[k,T]=m.useState(null),[B,W]=m.useState(""),[ee,ce]=m.useState(!1),ue=k?(k==null?void 0:k.getTime())<=Date.now():!1,ge="https://dextrabothypev2.nftinit.io",Se="",ke={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI"},Me=["BTC","ETH","SOL"];m.useEffect(()=>{async function Vt(){if(e)try{const st=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_lighter_coins/")).json();if(st!=null&&st.coins){let Ct=st.coins.map(vt=>{const ln=(vt==null?void 0:vt.label)||"",pn=ke[ln]||ln,dr=pn==="XMR"?"https://app.lighter.xyz/assets/xmr-CV8khZ54.png":pn==="NMR"?"https://app.lighter.xyz/assets/nmr-2YIHMk6g.png":pn==="USELESS"?"https://app.lighter.xyz/assets/useless-BTmgr78l.png":pn==="DOLO"?"https://app.lighter.xyz/assets/dolo-DuOVl-Vo.png":pn==="CRO"?"https://app.lighter.xyz/assets/cro-C7lstwu3.png":pn==="FF"?"https://app.lighter.xyz/assets/ff-CvnDhHny.png":pn==="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=":pn==="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=":pn==="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==":pn==="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=":pn==="CC"?"https://app.lighter.xyz/assets/cc-D4WHZ-w6.png":`https://app.hyperliquid.xyz/coins/${pn}.svg`;return{...vt,icon:dr}});Rt==="variational"&&oe==="ON"&&(Ct=Ct.filter(vt=>Me.includes(vt.label))),Le(Ct)}}catch(de){console.error("Failed to fetch coin list:",de)}}Vt()},[e,Rt,oe]);const qe=Vt=>{var de;return((de=tt==null?void 0:tt.find(st=>st.value===Vt))==null?void 0:de.maxLeverage)??100},Fe=Vt=>{["e","E","+","-"].includes(Vt.key)&&Vt.preventDefault()},at=Vt=>/^\d*\.?\d{0,6}$/.test(Vt),se=Vt=>/^\d*$/.test(Vt),Ce=m.useMemo(()=>{if(pt==="")return!1;const Vt=Number(pt);return Number.isInteger(Vt)&&Vt>=1&&Vt<=180},[pt]),Ue=m.useMemo(()=>{if(wt==="")return!1;const Vt=Number(wt),de=qe(ut);return Number.isInteger(Vt)&&Vt>=1&&Vt<=de},[wt,ut,tt]),Be=m.useMemo(()=>{if(dn==="")return!1;const Vt=Number(dn);return Number.isNaN(Vt)?!1:Vt===0?!0:Vt>=1&&Vt<=1e7},[dn]),_e=m.useMemo(()=>{if(Bt==="")return!1;const Vt=Number(Bt);if(Number.isNaN(Vt))return!1;const de=wt===""?null:Number(wt),st=de?de*100-1:4999;return Vt===0?!0:Vt>0&&Vt<1?!1:Vt>=1&&Vt<=st},[Bt,wt]);m.useMemo(()=>{if(De==="")return!1;const Vt=Number(De);return!Number.isNaN(Vt)&&Vt>0&&Vt<=100},[De]);const rt=re&&ye.trim()!==""&&V.trim()!==""&&Ne.trim()!==""&&ut!==""&&Ce&&Ue&&$e&&(!dn||Be)&&(!Bt||_e)&&(cn==="LONG"||cn==="SHORT"||cn==="RANDOM")&&(Ze==="LIMIT"||Ze==="MARKET"||Ze==="RANDOM")&&en,ct=re&&V.trim()!==""&&Ne.trim()!==""&&ye.trim()!==""&&(Rt!=="lighter"||ae.trim()!=="")&&(Rt!=="lighter"||we.trim()!=="")&&(Rt!=="lighter"||Pe.trim()!=="")&&(Rt!=="lighter"||V.trim()!==ae.trim())&&(Rt!=="lighter"||Ne.trim()!==we.trim())&&(Rt!=="lighter"||ye.trim().toLowerCase()!==Pe.trim().toLowerCase())&&ut!==""&&Ce&&Ue&&$e&&(Rt!=="variational"||S.trim()!=="")&&(Rt!=="variational"||!B)&&(Rt!=="variational"||!ue)&&en;m.useEffect(()=>{if(oe==="ON"&&Rt==="lighter"){if(Ne&&we&&Ne.trim()===we.trim()){kn("Make sure the wallet API indexes are unique for each Slot.");return}if(ye&&Pe&&ye.trim().toLowerCase()===Pe.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,Ne,we,V,ae,ye,Pe]);const yt=()=>(localStorage.getItem("hyperAddress")||"dextra").toLowerCase(),Lt=()=>`lighterCreds:${yt()}`,ft=()=>{try{const Vt=localStorage.getItem(Lt());if(!Vt)return;const de=JSON.parse(Vt);de.apiKey&&te(de.apiKey),de.apiKeyTwo&&fe(de.apiKeyTwo),de.apiKeyIndex&&me(de.apiKeyIndex),de.apiKeyIndexTwo&&xe(de.apiKeyIndexTwo),de.lighterLoginAddress&&je(de.lighterLoginAddress),de.lighterLoginAddressTwo&&Re(de.lighterLoginAddressTwo),typeof de.remember=="boolean"&&Rn(de.remember)}catch{}},Tt=()=>{if(Gn)try{localStorage.setItem(Lt(),JSON.stringify({apiKey:V,apiKeyIndex:Ne,lighterLoginAddress:ye,remember:!0}))}catch{}},Ge=()=>{try{localStorage.removeItem(Lt())}catch{}};m.useEffect(()=>{if(!e)return;const Vt=localStorage.getItem("hyperToken"),de=localStorage.getItem("hyperAddress");he(!!(Vt&&de));const st=setInterval(()=>{const Ct=localStorage.getItem("hyperToken"),vt=localStorage.getItem("hyperAddress");he(!!(Ct&&vt))},800);return()=>clearInterval(st)},[e]),m.useEffect(()=>{!e||!re||(At(),kr())},[e,re]),m.useEffect(()=>{e&&(Bt===""&&ot(Se),dn===""&&Yt(Se),De===""&&_t(Se))},[e]),m.useEffect(()=>{if(!ut)return;const Vt=qe(ut),de=Number(wt);!Number.isNaN(de)&&de>Vt&&nn(String(Vt)),!Number.isNaN(de)&&de<1&&wt!==""&&nn("1")},[ut]),m.useEffect(()=>{e&&(Gn&&Tt(),Gn||Ge())},[V,Ne,ye,Xe,Gn,e]);async function At(){var Vt,de,st,Ct,vt,ln,pn,dr,jr,pr,fr,Kr,rs,Ir,br,Zn;try{$t(!0),kn("");const xs=window.localStorage.getItem("hyperToken"),Qs=window.localStorage.getItem("hyperAddress");if(!xs||!Qs){ie(!1),ft();return}const Pr=await(await fetch(`${ge}/api/hyper/new_farming_app/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:Qs.toLowerCase(),token:xs})})).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 vn=$e?$e.toLowerCase().replace("-","_"):null,Fn=L==null?void 0:L[vn];if(vn&&Fn){const lt={...L,[vn]:{...Fn,isStop:!0}};z(lt);const tr=Object.keys(lt).filter(Wn=>Wn.startsWith("lighter"));if(tr.length>0&&!$e){const Tr=tr.sort((es,Rs)=>{var Hn,Hr;const kt=parseInt(((Hn=es.match(/\d+/))==null?void 0:Hn[0])||0,10),or=parseInt(((Hr=Rs.match(/\d+/))==null?void 0:Hr[0])||0,10);return kt-or})[0].match(/\d+/);Tr&&ht(`Lighter-${Tr[0]}`)}}else ht("Lighter-1")}Pr!=null&&Pr.slots_info&&(P((de=(Vt=Pr==null?void 0:Pr.slots_info)==null?void 0:Vt.lighter)==null?void 0:de.total_qty),C((Ct=(st=Pr==null?void 0:Pr.slots_info)==null?void 0:st.lighter)==null?void 0:Ct.active_qty),U((ln=(vt=Pr==null?void 0:Pr.slots_info)==null?void 0:vt.variational)==null?void 0:ln.total_qty),R((dr=(pn=Pr==null?void 0:Pr.slots_info)==null?void 0:pn.variational)==null?void 0:dr.active_qty));return}if(Pr!=null&&Pr.success&&(Pr!=null&&Pr.data)){const vn=$e?$e.toLowerCase().replace("-","_"):null,Fn=L==null?void 0:L[vn],lt=Pr.data||{};vn&&!lt[vn]&&Fn&&(lt[vn]={...Fn,isStop:!0}),z(lt);const tr=Object.keys(lt).filter(Wn=>Wn.startsWith("lighter"));if(tr.length>0&&!$e){const Tr=tr.sort((es,Rs)=>{var Hn,Hr;const kt=parseInt(((Hn=es.match(/\d+/))==null?void 0:Hn[0])||0,10),or=parseInt(((Hr=Rs.match(/\d+/))==null?void 0:Hr[0])||0,10);return kt-or})[0].match(/\d+/);Tr&&ht(`Lighter-${Tr[0]}`)}Pr!=null&&Pr.slots_info&&(P((pr=(jr=Pr==null?void 0:Pr.slots_info)==null?void 0:jr.lighter)==null?void 0:pr.total_qty),C((Kr=(fr=Pr==null?void 0:Pr.slots_info)==null?void 0:fr.lighter)==null?void 0:Kr.active_qty),U((Ir=(rs=Pr==null?void 0:Pr.slots_info)==null?void 0:rs.variational)==null?void 0:Ir.total_qty),R((Zn=(br=Pr==null?void 0:Pr.slots_info)==null?void 0:br.variational)==null?void 0:Zn.active_qty))}}catch{ie(!1),ft(),G("OFF"),K(!1)}finally{$t(!1)}}const Ot=m.useMemo(()=>$e?$e.toLowerCase().replace("-","_"):"",[$e]),it=!!((Jr=L==null?void 0:L[Ot])!=null&&Jr.delta)&&!!((Ks=L==null?void 0:L[Ot])!=null&&Ks.from_slot),jt=it?`lighter_${(Es=L==null?void 0:L[Ot])==null?void 0:Es.from_slot}`:Ot;m.useEffect(()=>{var st,Ct,vt,ln,pn,dr,jr,pr,fr,Kr,rs,Ir,br,Zn,xs,Qs,ai,Pr,vn,Fn;if(!$e||!L)return;const Vt=jt,de=L==null?void 0:L[Vt];if(!de){te(""),fe(""),me(""),xe(""),je(""),Re(""),et(""),Kt(""),nn(""),zn("LONG"),Ft("MARKET"),ie(!1),G("OFF"),K(!1),Gt("Hour"),Yt(""),ot(""),_(""),En("lighter"),T(null);return}if(de!=null&&de.farming_params){de!=null&&de.isStop?ie(!1):ie(!0),G("OFF"),K(!1);const lt=de.farming_params,Ut=(de==null?void 0:de.lighter_api_pkey)??"",tr=(de==null?void 0:de.lighter_login_address)??"",Wn=(de==null?void 0:de.lighter_api_index)??"",Fr=(de==null?void 0:de.slot_number)??"";Ut&&te(String(Ut)),tr&&je(String(tr)),Wn&&me(String(Wn)),Fr&&!it&&ht(`Lighter-${Fr}`),lt!=null&&lt.cycleSeconds&&Gt((lt==null?void 0:lt.cycleSeconds)===86400?"Day":"Hour"),lt!=null&&lt.coin&&et(String(lt.coin)),(lt==null?void 0:lt.orderPerHour)!=null&&Kt(String(lt.orderPerHour)),(lt==null?void 0:lt.leverage)!=null&&nn(String(lt.leverage)),lt!=null&&lt.direction&&zn(String(lt.direction).toUpperCase()==="SHORT"?"SHORT":String(lt.direction).toUpperCase()==="RANDOM"?"RANDOM":"LONG"),lt!=null&&lt.orderType&&Ft(String(lt.orderType).toUpperCase()==="MARKET"?"MARKET":String(lt.orderType).toUpperCase()==="LIMIT"?"LIMIT":"RANDOM"),lt!=null&&lt.accountType&&nr(lt.accountType==="standart"?1:2),lt!=null&&lt.accountType&&on(lt.accountType==="standart"?"STANDARD":"PREMIUM"),(lt==null?void 0:lt.tp)!=null&&Yt(String(lt.tp)),(lt==null?void 0:lt.sl)!=null&&ot(String(lt.sl)),(lt==null?void 0:lt.spread)!=null&&_t(String(lt.spread))}else if(de!=null&&de.source_params){de!=null&&de.isStop?ie(!1):ie(!0),G("ON"),K(!1);const lt=((st=de==null?void 0:de.source_params)==null?void 0:st.api_pkey)??"",Ut=((Ct=de==null?void 0:de.source_params)==null?void 0:Ct.login_wallet)??"",tr=((vt=de==null?void 0:de.source_params)==null?void 0:vt.api_index)??"",Wn=((ln=de==null?void 0:de.target_params)==null?void 0:ln.api_pkey)??"",Fr=((pn=de==null?void 0:de.target_params)==null?void 0:pn.login_wallet)??"",Tr=((dr=de==null?void 0:de.target_params)==null?void 0:dr.api_index)??"",es=(de==null?void 0:de.slot_number)??"";es&&!it&&ht(`Lighter-${es}`),lt&&te(String(lt)),Wn&&fe(String(Wn)),Ut&&je(String(Ut)),Fr&&Re(String(Fr)),tr&&me(String(tr)),Tr&&xe(String(Tr)),(jr=de==null?void 0:de.source_params)!=null&&jr.coin&&et(String((pr=de==null?void 0:de.source_params)==null?void 0:pr.coin)),((fr=de==null?void 0:de.source_params)==null?void 0:fr.orderPerHour)!=null&&Kt(String((Kr=de==null?void 0:de.source_params)==null?void 0:Kr.orderPerHour)),((rs=de==null?void 0:de.source_params)==null?void 0:rs.leverage)!=null&&nn(String((Ir=de==null?void 0:de.source_params)==null?void 0:Ir.leverage)),(br=de==null?void 0:de.source_params)!=null&&br.accountType&&nr(((Zn=de==null?void 0:de.source_params)==null?void 0:Zn.accountType)==="standart"?1:2),(xs=de==null?void 0:de.source_params)!=null&&xs.accountType&&on(((Qs=de==null?void 0:de.source_params)==null?void 0:Qs.accountType)==="standart"?"STANDARD":"PREMIUM"),(ai=de==null?void 0:de.target_params)!=null&&ai.accountType&&Ye(((Pr=de==null?void 0:de.target_params)==null?void 0:Pr.accountType)==="standart"?"STANDARD":"PREMIUM"),de!=null&&de.target_app&&En((de==null?void 0:de.target_app)==="lighter"?"lighter":"variational"),(vn=de==null?void 0:de.target_params)!=null&&vn.vr_token&&_((Fn=de==null?void 0:de.target_params)==null?void 0:Fn.vr_token)}else ie(!1),G("OFF"),K(!1)},[$e,L,it,jt]);const Nn=Vt=>{var de;return Number(((de=String(Vt||"").match(/\d+/))==null?void 0:de[0])||0)},mn=Vt=>(Vt||"").toLowerCase().replace("-","_"),ir=m.useMemo(()=>{const Vt=L==null?void 0:L[mn($e)];if(Vt!=null&&Vt.delta&&(Vt!=null&&Vt.from_slot))return Number(Vt.from_slot);const de=Number(Vt==null?void 0:Vt.slot_number);return Number.isFinite(de)?de:Nn($e)},[$e,L]),Sn=m.useMemo(()=>{const Vt=Number(g)||0,de=Array.from({length:Vt},()=>({used:!1,kind:null})),st=L||{};for(const[Ct,vt]of Object.entries(st)){if(!Ct.startsWith("lighter_"))continue;const ln=Nn(Ct)-1;ln<0||ln>=Vt||((vt==null?void 0:vt.isStop)===!0?de[ln]={used:!1,kind:null}:vt!=null&&vt.source_params?de[ln]={used:!0,kind:"delta-src"}:vt!=null&&vt.target_params||vt!=null&&vt.delta?de[ln]={used:!0,kind:"delta-shadow"}:vt!=null&&vt.farming_params?de[ln]={used:!0,kind:"single"}:de[ln]={used:!0,kind:"unknown"})}return de},[L,g]),Bn=m.useMemo(()=>Sn.map((Vt,de)=>Vt.used&&Vt.kind!=="delta-src-inferred"?`Lighter-${de+1}`:null).filter(Boolean),[Sn]);m.useMemo(()=>Sn.filter(Vt=>!Vt.used).length,[Sn]);async function rr(){if(!re){n(!0);return}if(rt)try{un(!0),kn("");const Vt=window.localStorage.getItem("hyperToken"),de=window.localStorage.getItem("hyperAddress");if(!Vt||!de){n(!0);return}const st={coin:ut,orderPerHour:Number(pt),leverage:Number(wt),direction:cn,orderType:Ze,tp:Number(dn),sl:Number(Bt),cycleSeconds:hr==="Hour"?3600:86400},Ct={address:de.toLowerCase(),token:Vt,api_pkey:V,api_index:Number(Ne),login_wallet:ye,slot_number:Number($e==null?void 0:$e.replace("Lighter-","")),farming_params:st},ln=await(await fetch(`${ge}/api/hyper/lighter_farming/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ct)})).json();ln!=null&&ln.success?(ie(!0),At(),Gn&&Tt()):kn((ln==null?void 0:ln.error_message)||"Start failed.")}catch(Vt){kn(Vt.message||"An error occurred while saving.")}finally{un(!1)}}async function ur(){var de;const Vt=Nn($e)-1;if(Vt<0){kn("Please select a slot."),un(!1);return}if((de=Sn[Vt])!=null&&de.used){kn("Selected slot is already in use."),un(!1);return}if(!re){n(!0);return}if(ct)try{un(!0),kn("");const st=window.localStorage.getItem("hyperToken"),Ct=window.localStorage.getItem("hyperAddress");if(!st||!Ct){n(!0);return}const vt={api_pkey:V,api_index:Ne,login_wallet:ye,coin:ut,orderPerHour:Number(pt),leverage:Number(wt)},ln={...Rt==="lighter"&&{api_pkey:ae,api_index:we,login_wallet:Pe},coin:ut==null?void 0:ut.replace("USDT",""),orderPerHour:Number(pt),leverage:Number(wt),...Rt==="variational"&&{vr_token:S}},pn={address:Ct.toLowerCase(),token:st,slot_number:Number($e==null?void 0:$e.replace("Lighter-","")),source_app:"lighter",source_params:vt,target_app:Rt==="lighter"?"lighter":"variational_delta",target_params:ln},jr=await(await fetch(`${ge}/api/hyper/farming_app/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(pn)})).json();jr!=null&&jr.success?(ie(!0),At(),Gn&&Tt()):kn((jr==null?void 0:jr.error_message)||fallback)}catch(st){kn(st.message||"An error occurred while saving.")}finally{un(!1)}}async function _r(){if(!re){n(!0);return}try{xn(!0),kn("");const Vt=window.localStorage.getItem("hyperToken"),de=window.localStorage.getItem("hyperAddress");if(!Vt||!de){n(!0);return}const Ct=await(await fetch(`${ge}/api/hyper/lighter_farming/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:de.toLowerCase(),token:Vt,slot_number:ir})})).json();Ct!=null&&Ct.success?(ie(!1),At()):kn((Ct==null?void 0:Ct.error_message)||"Stop failed.")}catch(Vt){kn(Vt.message||"An error occurred while stopping.")}finally{xn(!1)}}async function Un(){if(!re){n(!0);return}try{xn(!0),kn("");const Vt=window.localStorage.getItem("hyperToken"),de=window.localStorage.getItem("hyperAddress");if(!Vt||!de){n(!0);return}const Ct=await(await fetch(`${ge}/api/hyper/farming_app/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:de.toLowerCase(),token:Vt,source_app:"lighter",target_app:Rt==="lighter"?"lighter":"variational_delta",slot_number:ir})})).json();Ct!=null&&Ct.success?(ie(!1),At()):kn((Ct==null?void 0:Ct.error_message)||"Stop failed.")}catch(Vt){kn(Vt.message||"An error occurred while stopping.")}finally{xn(!1)}}const Ln=Vt=>{En(Vt??"lighter"),h(!1)},Kn=[{value:"lighter",label:"Lighter"},{value:"variational",label:"Variational"}];function Yr(Vt){try{const de=Vt.split(".");if(de.length!==3)throw new Error("Invalid JWT format");const Ct=de[1].replace(/-/g,"+").replace(/_/g,"/"),vt=decodeURIComponent(atob(Ct).split("").map(ln=>"%"+("00"+ln.charCodeAt(0).toString(16)).slice(-2)).join(""));return JSON.parse(vt)}catch{return null}}const os={control:(Vt,de)=>({...Vt,backgroundColor:"#242424",borderColor:de.isFocused?"#67FFBD":"#353535",minHeight:32,height:32,boxShadow:"none",cursor:"pointer",alignItems:"center",minWidth:"max-content"}),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,de)=>({...Vt,backgroundColor:de.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"})},ds=({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"]}),Je=Vt=>{var de,st,Ct;return i.jsx(Ca.Option,{...Vt,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[(de=Vt.data)!=null&&de.icon?i.jsx("img",{src:Vt.data.icon,alt:Vt.data.label,className:`${((st=Vt.data)==null?void 0:st.label)==="XRP"||((Ct=Vt.data)==null?void 0:Ct.label)==="MEGA"?"bg-[#4F4F4F] rounded-full":""} w-4 h-4 rounded-[4px]`,onError:vt=>vt.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(ds,{max:Vt.data.maxLeverage})]})})},bt=Vt=>{var de,st,Ct;return i.jsx(Ca.SingleValue,{...Vt,children:i.jsxs("div",{className:"flex items-center gap-2",children:[(de=Vt.data)!=null&&de.icon?i.jsx("img",{src:Vt.data.icon,alt:Vt.data.label,className:`${((st=Vt.data)==null?void 0:st.label)==="XRP"||((Ct=Vt.data)==null?void 0:Ct.label)==="MEGA"?"bg-[#4F4F4F] rounded-full":""} w-4 h-4 rounded-[4px]`,onError:vt=>vt.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(ds,{max:Vt.data.maxLeverage})]})})},Tn=Vt=>{const de=Bn.includes(Vt.data.value);return i.jsx(Ca.Option,{...Vt,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[i.jsx("span",{className:"text-white text-[13px]",children:Vt.data.label}),de&&i.jsx("span",{className:"ml-auto w-2 h-2 rounded-full bg-[#67FFBD]",title:"Active"})]})})},er=Vt=>i.jsx(Ca.SingleValue,{...Vt,children:i.jsx("div",{className:"flex items-center gap-2 px-3",children:i.jsx("span",{className:"text-white text-[13px]",children:Vt.data.label})})}),kr=async()=>{var st,Ct,vt,ln,pn,dr,jr,pr;const Vt=window.localStorage.getItem("hyperToken"),de=window.localStorage.getItem("hyperAddress");if(!(!Vt||!de))try{nt(!0);const fr=await _i(de.toLowerCase(),Vt);fr!=null&&fr.success?(r(fr==null?void 0:fr.telegram_chat_id),s(fr==null?void 0:fr.subscriber_role),a(fr==null?void 0:fr.subs_expire_day),o((st=fr==null?void 0:fr.mushboomer_counts)==null?void 0:st.eth),l((Ct=fr==null?void 0:fr.mushboomer_counts)==null?void 0:Ct.sol),c(fr==null?void 0:fr.referral_code),u(fr==null?void 0:fr.refcode),d(fr==null?void 0:fr.whitelist),f(Vt),x(de),In(!0),v((ln=(vt=fr==null?void 0:fr.slots_info)==null?void 0:vt.lighter)==null?void 0:ln.total_qty),P((dr=(pn=fr==null?void 0:fr.slots_info)==null?void 0:pn.lighter)==null?void 0:dr.total_qty),C((pr=(jr=fr==null?void 0:fr.slots_info)==null?void 0:jr.lighter)==null?void 0:pr.active_qty),nt(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),f(""),x(""),nt(!1))}catch(fr){console.error("Token verification error:",fr),console.error(fr.message||"An unknown error occurred."),nt(!1)}},Dr=tt,Ur=m.useMemo(()=>Array.from({length:g},(Vt,de)=>({value:`Lighter-${de+1}`,label:`Lighter-${de+1}`})),[g]);if(!e)return null;const cr=mt||Pt||an||ze,Cr=Q&&!an,ls=qe(ut),yr=I===O;return i.jsxs(i.Fragment,{children:[i.jsx(vd,{open:Et,setOpen:Xn,transactionHash:gn,transactionLoading:Jt,paymentPresaleRole:en,errorFunds:yn,activeMethod:2}),i.jsx(m5,{open:Qn,setOpen:ar,paymentLighterRole:en,oldSlotCount:X,checkAccountLighter:kr,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:()=>!cr&&t(!1)}),i.jsxs("div",{className:"relative flex items-start gap-4 px-3 w-full max-w-[1000px]",children:[i.jsx(f2,{current:"lighter",onCloseCurrent:()=>!cr&&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(up,{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:l5,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(qk,{})}),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:[An&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:An==="Get more slots to run Delta Neutral with Variational"?i.jsxs(i.Fragment,{children:[i.jsx("span",{children:An}),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:An})}),re&&en&&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 ${(Ur==null?void 0:Ur.length)||N} in use.`}),re&&yr&&Rt==="variational"&&!Q&&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&&en&&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(s5,{className:"w-3 h-3 text-[#67FFBD] fill-[#67FFBD]"}),i.jsxs("span",{className:"text-[#67FFBD] font-medium",children:[w||0,"/",Ur.length]})]})]}),i.jsx(Nl,{styles:os,components:{Option:Tn,SingleValue:er},options:Ur,value:Ur.find(Vt=>Vt.value===$e)||null,onChange:Vt=>ht((Vt==null?void 0:Vt.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:ye,onChange:Vt=>je(Vt.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] ${ye===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:cr||Cr})})]}),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:Vt=>te(Vt.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY",type:Yn?"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:cr||Cr}),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:cr||Cr,children:Yn?i.jsx(ca,{size:14}):i.jsx(ua,{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:Ne,onChange:Vt=>{const de=Vt.target.value.trim();if(de==="")return me("");se(de)&&me(de)},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] ${Ne===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:cr||Cr})})]})]}):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:ye,onChange:Vt=>je(Vt.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] ${ye===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:cr||Cr})})]}),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:Vt=>te(Vt.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY",type:Yn?"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:cr||Cr}),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:cr||Cr,children:Yn?i.jsx(ca,{size:14}):i.jsx(ua,{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:p,className:"relative w-[120px]",children:[i.jsxs("div",{className:`${cr||Cr?"cursor-not-allowed":"cursor-pointer"} rounded-md bg-[#353535] text-white px-2 h-6 flex items-center justify-between`,onClick:Vt=>{Vt.preventDefault(),cr||Cr||h(!Ee)},children:[i.jsx("span",{className:"text-white font-inter text-[14px] font-medium leading-[8px] tracking-[-0.28px]",children:(gr=Kn==null?void 0:Kn.find(Vt=>(Vt==null?void 0:Vt.value)===Rt))==null?void 0:gr.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:Kn==null?void 0:Kn.map((Vt,de)=>i.jsxs("div",{onClick:st=>{st.preventDefault(),cr||Cr||Ln(Vt==null?void 0:Vt.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 ${(Vt==null?void 0:Vt.value)===Rt?"bg-[#2c2c2c]":"hover:bg-[#2c2c2c]"} text-white ${cr||Cr?"cursor-not-allowed":"cursor-pointer"}`,children:[i.jsx("span",{className:"text-white",children:Vt==null?void 0:Vt.label}),(Vt==null?void 0:Vt.value)===Rt&&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"})})]},de))})})]})})]}),Rt==="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:Pe,onChange:Vt=>Re(Vt.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] ${Pe===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:cr||Cr})})]}),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:Vt=>fe(Vt.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY_2",type:rn?"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:cr||Cr}),i.jsx("button",{type:"button",onClick:()=>Oe(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:cr||Cr,children:rn?i.jsx(ca,{size:14}):i.jsx(ua,{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:we,onChange:Vt=>{const de=Vt.target.value.trim();if(de==="")return xe("");se(de)&&xe(de)},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] ${we===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:cr||Cr})})]})]}),Rt==="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:Vt=>{const de=Vt.target.value;if(_(de),!de.trim()){T(null),W("");return}const st=Yr(de);if(st&&(st!=null&&st.exp)){const Ct=new Date((st==null?void 0:st.exp)*1e3);T(Ct),W("")}else st?(T(null),W("The token's expiration date could not be found.")):(T(null),W("Invalid token format."))},type:ee?"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:cr||Cr}),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 "+(ue?"text-[#FF797C]":"text-[#F8D4AB]"),children:k==null?void 0:k.toLocaleString("en-US",{dateStyle:"medium",timeStyle:"short"})}),ue&&i.jsx("span",{children:i.jsx("img",{src:ec,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:()=>ce(Vt=>!Vt),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:cr||Cr,children:ee?i.jsx(ca,{size:14}):i.jsx(ua,{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:Ne,onChange:Vt=>{const de=Vt.target.value.trim();if(de==="")return me("");se(de)&&me(de)},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] ${Ne===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:cr||Cr})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Select Pair"}),i.jsx(Nl,{styles:os,components:{Option:Je,SingleValue:bt},isDisabled:cr||Cr,options:Dr,value:Dr.find(Vt=>Vt.value===ut)||null,onChange:Vt=>et((Vt==null?void 0:Vt.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:pt,onChange:Vt=>{const de=Vt.target.value.trim();if(de==="")return Kt("");se(de)&&Kt(de)},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] ${pt===""?"border-[#353535]":Ce?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:cr||Cr}),pt!==""&&!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:hr,onChange:Vt=>Gt(Vt.target.value),className:`${cr||Cr?"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:cr||Cr,children:[i.jsx("option",{value:"Hour",children:"Hour"}),i.jsx("option",{value:"Day",children:"Day"})]})]}),i.jsx("input",{value:pt,onChange:Vt=>{const de=Vt.target.value.trim();if(de==="")return Kt("");se(de)&&Kt(de)},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] ${pt===""?"border-[#353535]":Ce?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:cr||Cr}),pt!==""&&!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(_o,{checked:oe==="ON",onChange:Vt=>G(Vt?"ON":"OFF"),disabled:cr||Cr,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 ${cr||Cr?"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:wt,onChange:Vt=>{const de=Vt.target.value.trim();if(de==="")return nn("");se(de)&&nn(de)},onKeyDown:Fe,inputMode:"numeric",autoComplete:"off",placeholder:ut?`1–${ls}x`:"e.g. 3",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${wt===""?"border-[#353535]":Ue?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:cr||Cr})]})]}),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:()=>!Cr&&zn("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",cr||Cr?"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",wt?` - ${wt}x`:""]})}),i.jsx("div",{"aria-pressed":cn==="SHORT",onClick:()=>!Cr&&zn("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",cr||Cr?"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",wt?` - ${wt}x`:""]})}),i.jsx("div",{"aria-pressed":cn==="RANDOM",onClick:()=>!Cr&&zn("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",cr||Cr?"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",wt?` - ${wt}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":Ze==="MARKET",onClick:()=>!Cr&&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",cr||Cr?"cursor-not-allowed":"cursor-pointer",Ze==="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 ",Ze==="MARKET"?" ✓":""]})}),i.jsx("button",{"aria-pressed":Ze==="LIMIT",onClick:()=>!Cr&&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",cr||Cr?"cursor-not-allowed":"cursor-pointer",Ze==="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 ",Ze==="LIMIT"?" ✓":""]})}),i.jsx("button",{"aria-pressed":Ze==="RANDOM",onClick:()=>!Cr&&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",cr||Cr?"cursor-not-allowed":"cursor-pointer",Ze==="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 ",Ze==="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:dn,onChange:Vt=>{const de=Vt.target.value.trim();if(de==="")return Yt("");at(de)&&Yt(de)},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] ${dn===""?"border-[#353535]":Be?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:cr||Cr})]}),dn!==""&&!Be&&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:Bt,onChange:Vt=>{const de=Vt.target.value.trim();if(de==="")return ot("");at(de)&&ot(de)},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] ${Bt===""?"border-[#353535]":_e?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:cr||Cr})]}),Bt!==""&&!_e&&i.jsxs("div",{className:"text-[#FF797C] text-[11px]",children:["Value must be 0, or between 1 and"," ",wt?Math.max(wt*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(_o,{checked:oe==="ON",onChange:Vt=>G(Vt?"ON":"OFF"),disabled:cr||Cr,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 ${cr||Cr?"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:()=>!cr&&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:cr,children:"Cancel"}),re?oe==="ON"?Q?i.jsx("button",{onClick:Un,disabled:cr,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:an?"Stopping...":"Stop"}):i.jsx("button",{onClick:ur,disabled:!ct||cr||Rt==="variational"&&yr&&oe==="ON",className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!ct||cr||Rt==="variational"&&yr&&oe==="ON"?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"} ${J?"hidden":""}`,children:Pt?"Starting...":"Start"}):Q?i.jsx("button",{onClick:_r,disabled:cr,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:an?"Stopping...":"Stop"}):i.jsx("button",{onClick:rr,disabled:!rt||cr,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!rt||cr?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"} ${J?"hidden":""}`,children:Pt?"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"})]})}),mt&&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(Qr);ts();const[g,v]=m.useState(!1),[w,C]=m.useState(!1),[N,P]=m.useState(""),[I,R]=m.useState(""),[O,U]=m.useState(""),[L,z]=m.useState(""),[X,ne]=m.useState(""),[J,K]=m.useState(""),[re,he]=m.useState(""),[Q,ie]=m.useState("LONG"),[oe,G]=m.useState(!1),[V,te]=m.useState(!1),[ae,fe]=m.useState(!1),[Ne,me]=m.useState(!1),[we,xe]=m.useState(""),[ye,je]=m.useState(""),[Pe,Re]=m.useState(!0),[Xe,Ke]=m.useState(!1),[ut,et]=m.useState(!1),[tt,Le]=m.useState(!1),[$e,ht]=m.useState(!1),[pt,Kt]=m.useState(!1),[wt,nn]=m.useState(!1),[cn,zn]=m.useState(""),[Xt,on]=m.useState(!0);m.useState(1);const Zt="https://dextrabothypev2.nftinit.io",Ye=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}],[]),Ze=Cn=>{var rn;return((rn=Ye.find(Oe=>Oe.value===Cn))==null?void 0:rn.maxLeverage)??100},Ft=Cn=>{["e","E","+","-"].includes(Cn.key)&&Cn.preventDefault()},dn=Cn=>/^\d*$/.test(Cn),Yt=m.useMemo(()=>{if(J==="")return!1;const Cn=Number(J);return Number.isInteger(Cn)&&Cn>=1&&Cn<=100},[J]),Bt=m.useMemo(()=>{if(re==="")return!1;const Cn=Number(re),rn=Ze(X);return Number.isInteger(Cn)&&Cn>=1&&Cn<=rn},[re,X]),ot=g&&N.trim()!==""&&O.trim()!==""&&I.trim()!==""&&L.trim()!==""&&X!==""&&Yt&&Bt&&(Q==="LONG"||Q==="SHORT"||Q==="RANDOM"),De=()=>(localStorage.getItem("hyperAddress")||"dextra").toLowerCase(),_t=()=>`apexCreds:${De()}`,ze=()=>{try{const Cn=localStorage.getItem(_t());if(!Cn)return;const rn=JSON.parse(Cn);rn.apiKey&&P(rn.apiKey),rn.apiKeySecret&&R(rn.apiKeySecret),rn.omniKeySeed&&z(rn.omniKeySeed),rn.apiKeyPass&&U(rn.apiKeyPass),typeof rn.remember=="boolean"&&Re(rn.remember)}catch{}},nt=()=>{if(Pe)try{localStorage.setItem(_t(),JSON.stringify({apiKey:N,apiKeyPass:O,apiKeySecret:I,omniKeySeed:L,remember:!0}))}catch{}},mt=()=>{try{localStorage.removeItem(_t())}catch{}};m.useEffect(()=>{if(!e)return;const Cn=localStorage.getItem("hyperToken"),rn=localStorage.getItem("hyperAddress");v(!!(Cn&&rn));const Oe=setInterval(()=>{const Jt=localStorage.getItem("hyperToken"),sn=localStorage.getItem("hyperAddress");v(!!(Jt&&sn))},800);return()=>clearInterval(Oe)},[e]),m.useEffect(()=>{!e||!g||($t(),yn())},[e,g]),m.useEffect(()=>{if(!X)return;const Cn=Ze(X),rn=Number(re);!Number.isNaN(rn)&&rn>Cn&&he(String(Cn)),!Number.isNaN(rn)&&rn<1&&re!==""&&he("1")},[X]),m.useEffect(()=>{e&&(Pe&&nt(),Pe||mt())},[N,O,I,L,Pe,e]);async function $t(){var Cn,rn,Oe,Jt,sn;try{te(!0),xe("");const Et=window.localStorage.getItem("hyperToken"),Xn=window.localStorage.getItem("hyperAddress");if(!Et||!Xn){C(!1),ze();return}const Dt=await(await fetch(`${Zt}/api/hyper/apex_farming/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:Xn.toLowerCase(),token:Et})})).json(),en=(Cn=Dt==null?void 0:Dt.data)==null?void 0:Cn.farming_params;if(Dt!=null&&Dt.success&&en){C(!0);const In=((rn=Dt==null?void 0:Dt.data)==null?void 0:rn.apex_api_pkey)??"",Qn=((Oe=Dt==null?void 0:Dt.data)==null?void 0:Oe.apex_api_pass)??"",ar=((Jt=Dt==null?void 0:Dt.data)==null?void 0:Jt.apex_api_secret)??"",hr=((sn=Dt==null?void 0:Dt.data)==null?void 0:sn.apex_key_seed)??"";In&&P(String(In)),Qn&&U(String(Qn)),ar&&R(String(ar)),hr&&z(String(hr)),en!=null&&en.symbol&&ne(String(en.symbol)),(en==null?void 0:en.orderPerHour)!=null&&K(String(en.orderPerHour)),(en==null?void 0:en.leverage)!=null&&he(String(en.leverage)),en!=null&&en.direction&&ie(String(en.direction).toUpperCase()==="SHORT"?"SHORT":String(en.direction).toUpperCase()==="RANDOM"?"RANDOM":"LONG")}else C(!1);!N&&!O&&!I&&!L&&ze()}catch{C(!1),ze()}finally{te(!1)}}async function Pt(){if(!g){n(!0);return}if(ot)try{fe(!0),xe("");const Cn=window.localStorage.getItem("hyperToken"),rn=window.localStorage.getItem("hyperAddress");if(!Cn||!rn){n(!0);return}const Oe={symbol:X,orderPerHour:Number(J),leverage:Number(re),direction:Q},Jt={address:rn.toLowerCase(),token:Cn,apex_api_pkey:N,apex_api_secret:I,apex_api_pass:O,apex_key_seed:L,farming_params:Oe},Et=await(await fetch(`${Zt}/api/hyper/apex_farming/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Jt)})).json();Et!=null&&Et.success?(C(!0),Pe&&nt()):xe((Et==null?void 0:Et.error_message)||"Start failed.")}catch(Cn){xe(Cn.message||"An error occurred while saving.")}finally{fe(!1)}}async function un(){if(!g){n(!0);return}try{me(!0),xe("");const Cn=window.localStorage.getItem("hyperToken"),rn=window.localStorage.getItem("hyperAddress");if(!Cn||!rn){n(!0);return}const Jt=await(await fetch(`${Zt}/api/hyper/apex_farming/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:rn.toLowerCase(),token:Cn})})).json();Jt!=null&&Jt.success?C(!1):xe((Jt==null?void 0:Jt.error_message)||"Stop failed.")}catch(Cn){xe(Cn.message||"An error occurred while stopping.")}finally{me(!1)}}const an={control:(Cn,rn)=>({...Cn,backgroundColor:"#242424",borderColor:rn.isFocused?"#67FFBD":"#353535",minHeight:32,height:32,boxShadow:"none",cursor:"pointer",alignItems:"center"}),valueContainer:Cn=>({...Cn,height:32,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:Cn=>({...Cn,height:32}),input:Cn=>({...Cn,color:"#FFFFFF",margin:0,padding:0}),singleValue:Cn=>({...Cn,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:Cn=>({...Cn,color:"#7F7F7F",fontSize:"12px"}),menu:Cn=>({...Cn,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:Cn=>({...Cn,paddingTop:0,paddingBottom:0}),option:(Cn,rn)=>({...Cn,backgroundColor:rn.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:32,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:Cn=>({...Cn,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:Cn=>({...Cn,backgroundColor:"#353535"})},xn=({max:Cn})=>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:[Cn,"x"]}),An=Cn=>{var rn;return i.jsx(Ca.Option,{...Cn,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[((rn=Cn.data)==null?void 0:rn.icon)&&i.jsx("img",{src:Cn.data.icon,alt:Cn.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:Cn.data.label}),i.jsx(xn,{max:Cn.data.maxLeverage})]})})},kn=Cn=>{var rn;return i.jsx(Ca.SingleValue,{...Cn,children:i.jsxs("div",{className:"flex items-center gap-2",children:[((rn=Cn.data)==null?void 0:rn.icon)&&i.jsx("img",{src:Cn.data.icon,alt:Cn.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:Cn.data.label}),i.jsx(xn,{max:Cn.data.maxLeverage})]})})},yn=async()=>{var Oe,Jt;const Cn=window.localStorage.getItem("hyperToken"),rn=window.localStorage.getItem("hyperAddress");if(!(!Cn||!rn))try{G(!0);const sn=await _i(rn.toLowerCase(),Cn);sn!=null&&sn.success?(r(sn==null?void 0:sn.telegram_chat_id),s(sn==null?void 0:sn.subscriber_role),a(sn==null?void 0:sn.subs_expire_day),o((Oe=sn==null?void 0:sn.mushboomer_counts)==null?void 0:Oe.eth),l((Jt=sn==null?void 0:sn.mushboomer_counts)==null?void 0:Jt.sol),c(sn==null?void 0:sn.referral_code),u(sn==null?void 0:sn.refcode),d(sn==null?void 0:sn.whitelist),f(Cn),x(rn),on(!0),G(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),f(""),x(""),G(!1))}catch(sn){console.error("Token verification error:",sn),console.error(sn.message||"An unknown error occurred."),G(!1)}},Vn=Ye;if(!e)return null;const Gn=V||ae||Ne||oe,Rn=w&&!Ne,Yn=Ze(X);return i.jsxs(i.Fragment,{children:[i.jsx(vd,{open:wt,setOpen:nn,transactionHash:cn,transactionLoading:pt,paymentPresaleRole:Xt,errorFunds:ye,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:()=>!Gn&&t(!1)}),i.jsxs("div",{className:"relative flex items-start gap-4 px-3 w-full max-w-[1000px]",children:[i.jsx(f2,{current:"apex",onCloseCurrent:()=>!Gn&&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(qk,{})}),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:[we&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:we}),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:Cn=>P(Cn.target.value),autoComplete:"off",placeholder:"API_KEY",type:Xe?"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:Gn||Rn}),i.jsx("button",{type:"button",onClick:()=>Ke(Cn=>!Cn),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:Gn||Rn,children:Xe?i.jsx(ca,{size:14}):i.jsx(ua,{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:O,onChange:Cn=>U(Cn.target.value),autoComplete:"off",placeholder:"API_KEY_PAASSPHRASE",type:tt?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${O===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Gn||Rn}),i.jsx("button",{type:"button",onClick:()=>Le(Cn=>!Cn),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:Gn||Rn,children:tt?i.jsx(ca,{size:14}):i.jsx(ua,{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:I,onChange:Cn=>R(Cn.target.value),autoComplete:"off",placeholder:"API_KEY_SECRET",type:ut?"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:Gn||Rn}),i.jsx("button",{type:"button",onClick:()=>et(Cn=>!Cn),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:Gn||Rn,children:ut?i.jsx(ca,{size:14}):i.jsx(ua,{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:Cn=>z(Cn.target.value),autoComplete:"off",placeholder:"OMNI_KEY_SEED",type:$e?"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:Gn||Rn}),i.jsx("button",{type:"button",onClick:()=>ht(Cn=>!Cn),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:Gn||Rn,children:$e?i.jsx(ca,{size:14}):i.jsx(ua,{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(Nl,{styles:an,components:{Option:An,SingleValue:kn},isDisabled:Gn||Rn,options:Vn,value:Vn.find(Cn=>Cn.value===X)||null,onChange:Cn=>ne((Cn==null?void 0:Cn.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:Cn=>{const rn=Cn.target.value.trim();if(rn==="")return K("");dn(rn)&&K(rn)},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]":Yt?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Gn||Rn}),J!==""&&!Yt&&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:Cn=>{const rn=Cn.target.value.trim();if(rn==="")return he("");dn(rn)&&he(rn)},onKeyDown:Ft,inputMode:"numeric",autoComplete:"off",placeholder:X?`1–${Yn}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]":Bt?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Gn||Rn})]}),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":Q==="LONG",onClick:()=>!Rn&&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",Gn||Rn?"opacity-60 cursor-not-allowed":"cursor-pointer",Q==="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":Q==="SHORT",onClick:()=>!Rn&&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",Gn||Rn?"opacity-60 cursor-not-allowed":"cursor-pointer",Q==="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":Q==="RANDOM",onClick:()=>!Rn&&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",Gn||Rn?"opacity-60 cursor-not-allowed":"cursor-pointer",Q==="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:()=>!Gn&&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:Gn,children:"Cancel"}),g?w?i.jsx("button",{onClick:un,disabled:Gn,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:Ne?"Stopping...":"Stop"}):i.jsx("button",{onClick:Pt,disabled:!ot||Gn,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!ot||Gn?"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 os,ds;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(Qr);ts();const[g,v]=m.useState(!1),[w,C]=m.useState(!1),[N,P]=m.useState(1),[I,R]=m.useState(0),[O,U]=m.useState(0),[L,z]=m.useState({}),[X,ne]=m.useState(null),[J,K]=m.useState(!1),[re,he]=m.useState("variational");m.useState(!1),m.useRef(null);const[Q,ie]=m.useState(!1),[oe,G]=m.useState(!1),[V,te]=m.useState(0),[ae,fe]=m.useState("OFF"),[Ne,me]=m.useState(""),[we,xe]=m.useState(""),[ye,je]=m.useState(""),[Pe,Re]=m.useState(""),[Xe,Ke]=m.useState(null),[ut,et]=m.useState(""),[tt,Le]=m.useState(""),[$e,ht]=m.useState(""),[pt,Kt]=m.useState("");m.useState("");const[wt,nn]=m.useState("");m.useState([]);const[cn,zn]=m.useState(""),[Xt,on]=m.useState(""),[Zt,Ye]=m.useState(""),[Ze,Ft]=m.useState("LONG"),[dn,Yt]=m.useState("STANDARD"),[Bt,ot]=m.useState("STANDARD"),[De,_t]=m.useState("MARKET"),[ze,nt]=m.useState(""),[mt,$t]=m.useState(""),[Pt,un]=m.useState(""),[an,xn]=m.useState("Hour"),[An,kn]=m.useState(!1),[yn,Vn]=m.useState(!1),[Gn,Rn]=m.useState(!1),[Yn,Cn]=m.useState(!1),[rn,Oe]=m.useState(""),[Jt,sn]=m.useState(""),[Et,Xn]=m.useState(!0),[gn,Dt]=m.useState(!1),[en,In]=m.useState(!1),[Qn,ar]=m.useState(!1),[hr,Gt]=m.useState(!1),[$n,nr]=m.useState(!1),[Rt,En]=m.useState(""),[Ee,h]=m.useState(!0),[p,S]=m.useState(""),_=Xe?(Xe==null?void 0:Xe.getTime())<=Date.now():!1;m.useState(1);const k="https://dextrabothypev2.nftinit.io",T="",B=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}],[]),W=Je=>{var bt;return((bt=B.find(Tn=>Tn.value===Je))==null?void 0:bt.maxLeverage)??100},ee=Je=>{["e","E","+","-"].includes(Je.key)&&Je.preventDefault()},ce=Je=>/^\d*\.?\d{0,6}$/.test(Je),ue=Je=>/^\d*$/.test(Je),ge=m.useMemo(()=>{if(Xt==="")return!1;const Je=Number(Xt);return Number.isInteger(Je)&&Je>=1&&Je<=120},[Xt]),Se=m.useMemo(()=>{if(Zt==="")return!1;const Je=Number(Zt),bt=W(wt);return Number.isInteger(Je)&&Je>=1&&Je<=bt},[Zt,wt]),ke=m.useMemo(()=>{if(ze==="")return!1;const Je=Number(ze);return Number.isNaN(Je)?!1:Je===0?!0:Je>=1&&Je<=1e7},[ze]),Me=m.useMemo(()=>{if(mt==="")return!1;const Je=Number(mt);if(Number.isNaN(Je))return!1;const bt=Zt===""?null:Number(Zt),Tn=bt?bt*100-1:4999;return Je===0?!0:Je>0&&Je<1?!1:Je>=1&&Je<=Tn},[mt,Zt]);m.useMemo(()=>{if(Pt==="")return!1;const Je=Number(Pt);return!Number.isNaN(Je)&&Je>0&&Je<=100},[Pt]);const qe=g&&Pe.trim()!==""&&wt!==""&&ge&&Se&&(!ze||ke)&&(!mt||Me)&&!_&&!ut&&cn&&(Ze==="LONG"||Ze==="SHORT"||Ze==="RANDOM")&&(De==="LIMIT"||De==="MARKET"||De==="RANDOM")&&Ee,Fe=g&&Pe.trim()!==""&&wt!==""&&ge&&cn&&Se&&cn&&Ee,at=()=>(localStorage.getItem("hyperAddress")||"dextra").toLowerCase(),se=()=>`variationalCreds:${at()}`,Ce=()=>{try{const Je=localStorage.getItem(se());if(!Je)return;const bt=JSON.parse(Je);bt.variationalToken&&Re(bt.variationalToken),typeof bt.remember=="boolean"&&Xn(bt.remember)}catch{}},Ue=()=>{if(Et)try{localStorage.setItem(se(),JSON.stringify({variationalToken:Pe,remember:!0}))}catch{}},Be=()=>{try{localStorage.removeItem(se())}catch{}};m.useEffect(()=>{if(!e)return;const Je=localStorage.getItem("hyperToken"),bt=localStorage.getItem("hyperAddress");v(!!(Je&&bt));const Tn=setInterval(()=>{const er=localStorage.getItem("hyperToken"),kr=localStorage.getItem("hyperAddress");v(!!(er&&kr))},800);return()=>clearInterval(Tn)},[e]),m.useEffect(()=>{!e||!g||(_e(),rr())},[e,g]),m.useEffect(()=>{e&&(mt===""&&$t(T),ze===""&&nt(T),Pt===""&&un(T))},[e]),m.useEffect(()=>{if(!wt)return;const Je=W(wt),bt=Number(Zt);!Number.isNaN(bt)&&bt>Je&&Ye(String(Je)),!Number.isNaN(bt)&&bt<1&&Zt!==""&&Ye("1")},[wt]),m.useEffect(()=>{e&&(Et&&Ue(),Et||Be())},[Pe,Et,e]);async function _e(){var Je,bt,Tn,er,kr,Dr,Ur,cr;try{Vn(!0),Oe("");const Cr=window.localStorage.getItem("hyperToken"),ls=window.localStorage.getItem("hyperAddress");if(!Cr||!ls){C(!1),Ce();return}const Jr=await(await fetch(`${k}/api/hyper/new_farming_app/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:ls.toLowerCase(),token:Cr})})).json();if(!(Jr!=null&&Jr.success)){if(console.warn("INFO API RESPONSE:",Jr==null?void 0:Jr.error_message),(Jr==null?void 0:Jr.error_message)==="You have not a running process"){const Ks=cn?cn.toLowerCase().replace("-","_farming_"):null,Es=L==null?void 0:L[Ks];if(Ks&&Es){const gr={...L,[Ks]:{...Es,isStop:!0}};z(gr);const de=Object.keys(gr).filter(st=>st.startsWith("variational"));if(de.length>0&&!cn){const vt=de.sort((ln,pn)=>{var pr,fr;const dr=parseInt(((pr=ln.match(/\d+/))==null?void 0:pr[0])||0,10),jr=parseInt(((fr=pn.match(/\d+/))==null?void 0:fr[0])||0,10);return dr-jr})[0].match(/\d+/);vt&&zn(`Variational-${vt[0]}`)}}else zn("Variational-1")}Jr!=null&&Jr.slots_info&&(U((bt=(Je=Jr==null?void 0:Jr.slots_info)==null?void 0:Je.variational)==null?void 0:bt.total_qty),R((er=(Tn=Jr==null?void 0:Jr.slots_info)==null?void 0:Tn.variational)==null?void 0:er.active_qty));return}if(Jr!=null&&Jr.success&&(Jr!=null&&Jr.data)){const Ks=cn?cn.toLowerCase().replace("-","_farming_"):null,Es=L==null?void 0:L[Ks],gr=Jr.data||{};Ks&&!gr[Ks]&&Es&&(gr[Ks]={...Es,isStop:!0}),z(gr);const de=Object.keys(gr).filter(st=>st.startsWith("variational"));if(de.length>0&&!cn){const vt=de.sort((ln,pn)=>{var pr,fr;const dr=parseInt(((pr=ln.match(/\d+/))==null?void 0:pr[0])||0,10),jr=parseInt(((fr=pn.match(/\d+/))==null?void 0:fr[0])||0,10);return dr-jr})[0].match(/\d+/);vt&&zn(`Variational-${vt[0]}`)}Jr!=null&&Jr.slots_info&&(U((Dr=(kr=Jr==null?void 0:Jr.slots_info)==null?void 0:kr.variational)==null?void 0:Dr.total_qty),R((cr=(Ur=Jr==null?void 0:Jr.slots_info)==null?void 0:Ur.variational)==null?void 0:cr.active_qty))}}catch{C(!1),Ce(),fe("OFF"),K(!1)}finally{Vn(!1)}}const rt=m.useMemo(()=>cn?cn.toLowerCase().replace("-","_farming_"):"",[cn]),ct=!!((os=L==null?void 0:L[rt])!=null&&os.delta)&&!!((ds=L==null?void 0:L[rt])!=null&&ds.from_slot),yt=rt;m.useEffect(()=>{var Tn,er,kr,Dr,Ur,cr,Cr,ls,yr,Jr,Ks,Es,gr,Vt,de,st;if(!cn||!L)return;const Je=yt,bt=L==null?void 0:L[Je];if(!bt){me(""),xe(""),je(""),Le(""),ht(""),Kt(""),nn(""),on(""),S(""),Ye(""),Ft("LONG"),_t("MARKET"),C(!1),fe("OFF"),K(!1),xn("Hour"),nt(""),$t(""),Re(""),Ke(null),he("variational"),G(!1),te(0);return}if((bt==null?void 0:bt.target_params)==null&&bt.source_params){bt!=null&&bt.isStop?C(!1):C(!0),fe("OFF"),K(!1),G(!1);const Ct=bt.source_params,vt=(bt==null?void 0:bt.slot_number)??"";vt&&!ct&&zn(`Variational-${vt}`),Ct!=null&&Ct.cycleSeconds&&xn((Ct==null?void 0:Ct.cycleSeconds)===86400?"Day":"Hour"),Ct!=null&&Ct.vr_token&&Re(String(Ct.vr_token)),Ct!=null&&Ct.coin&&nn(String(Ct.coin)),(Ct==null?void 0:Ct.orderPerHour)!=null&&on(String(Ct.orderPerHour)),(Ct==null?void 0:Ct.leverage)!=null&&Ye(String(Ct.leverage)),Ct!=null&&Ct.direction&&Ft(String(Ct.direction).toUpperCase()==="SHORT"?"SHORT":String(Ct.direction).toUpperCase()==="RANDOM"?"RANDOM":"LONG"),Ct!=null&&Ct.orderType&&_t(String(Ct.orderType).toUpperCase()==="MARKET"?"MARKET":String(Ct.orderType).toUpperCase()==="LIMIT"?"LIMIT":"RANDOM"),(Ct==null?void 0:Ct.tp)!=null&&nt(String(Ct.tp)),(Ct==null?void 0:Ct.sl)!=null&&$t(String(Ct.sl))}else if((bt==null?void 0:bt.target_params)!==null){bt!=null&&bt.isStop?(C(!1),G(!1)):(C(!0),G(!0)),fe("OFF"),K(!1);const Ct=(bt==null?void 0:bt.slot_number)??"";te(Ct),Ct&&!ct&&zn(`Variational-${Ct}`),(Tn=bt==null?void 0:bt.source_params)!=null&&Tn.vr_token&&Re(String((er=bt==null?void 0:bt.source_params)==null?void 0:er.vr_token)),(kr=bt==null?void 0:bt.target_params)!=null&&kr.coin&&nn(String((Dr=bt==null?void 0:bt.target_params)==null?void 0:Dr.coin)),((Ur=bt==null?void 0:bt.source_params)==null?void 0:Ur.orderPerHour)!=null&&on(String((cr=bt==null?void 0:bt.source_params)==null?void 0:cr.orderPerHour)),bt!=null&&bt.source_app&&S(bt==null?void 0:bt.source_app),((Cr=bt==null?void 0:bt.source_params)==null?void 0:Cr.leverage)!=null&&Ye(String((ls=bt==null?void 0:bt.source_params)==null?void 0:ls.leverage)),(yr=bt==null?void 0:bt.source_params)!=null&&yr.accountType&&Yt(((Jr=bt==null?void 0:bt.source_params)==null?void 0:Jr.accountType)==="standart"?"STANDARD":"PREMIUM"),(Ks=bt==null?void 0:bt.target_params)!=null&&Ks.accountType&&ot(((Es=bt==null?void 0:bt.target_params)==null?void 0:Es.accountType)==="standart"?"STANDARD":"PREMIUM"),bt!=null&&bt.target_app&&he(((bt==null?void 0:bt.target_app)==="variational","variational")),(gr=bt==null?void 0:bt.target_params)!=null&&gr.vr_token&&Re((Vt=bt==null?void 0:bt.target_params)==null?void 0:Vt.vr_token),(de=bt==null?void 0:bt.target_params)!=null&&de.cycleSeconds&&xn(((st=bt==null?void 0:bt.target_params)==null?void 0:st.cycleSeconds)===86400?"Day":"Hour")}else C(!1),fe("OFF"),K(!1)},[cn,L,ct,yt]);const Lt=Je=>{var bt;return Number(((bt=String(Je||"").match(/\d+/))==null?void 0:bt[0])||0)},ft=Je=>(Je||"").toLowerCase().replace("-","_"),Tt=m.useMemo(()=>{const Je=L==null?void 0:L[ft(cn)];if(Je!=null&&Je.delta&&(Je!=null&&Je.from_slot))return Number(Je.from_slot);const bt=Number(Je==null?void 0:Je.slot_number);return Number.isFinite(bt)?bt:Lt(cn)},[cn,L]),Ge=m.useMemo(()=>{const Je=Number(N)||0,bt=Array.from({length:Je},()=>({used:!1,kind:null})),Tn=L||{};for(const[er,kr]of Object.entries(Tn)){if(!er.startsWith("variational_farming"))continue;const Dr=Lt(er)-1;Dr<0||Dr>=Je||((kr==null?void 0:kr.isStop)===!0?bt[Dr]={used:!1,kind:null}:kr!=null&&kr.source_params?bt[Dr]={used:!0,kind:"delta-src"}:kr!=null&&kr.target_params||kr!=null&&kr.delta?bt[Dr]={used:!0,kind:"delta-shadow"}:kr!=null&&kr.farming_params?bt[Dr]={used:!0,kind:"single"}:bt[Dr]={used:!0,kind:"unknown"})}return bt},[L,N]),At=m.useMemo(()=>Ge.map((Je,bt)=>Je.used&&Je.kind!=="delta-src-inferred"?`Variational-${bt+1}`:null).filter(Boolean),[Ge]);m.useMemo(()=>Ge.filter(Je=>!Je.used).length,[Ge]);async function Ot(){if(!g){n(!0);return}if(qe)try{Rn(!0),Oe("");const Je=window.localStorage.getItem("hyperToken"),bt=window.localStorage.getItem("hyperAddress");if(!Je||!bt){n(!0);return}const Tn={vr_token:Pe,coin:wt,orderPerHour:Number(Xt),leverage:Number(Zt),direction:Ze,orderType:"MARKET",tp:Number(ze),sl:Number(mt),cycleSeconds:an==="Hour"?3600:86400},er={api_pkey:we,api_index:tt,login_wallet:pt,coin:wt==null?void 0:wt.replace("USDT",""),orderPerHour:Number(Xt),leverage:Number(Zt)},kr={address:bt.toLowerCase(),token:Je,source_app:"variational_farming",source_params:Tn,slot_number:Number(cn==null?void 0:cn.replace("Variational-",""))},Ur=await(await fetch(`${k}/api/hyper/farming_app/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(kr)})).json();Ur!=null&&Ur.success?(C(!0),_e(),Et&&Ue()):Oe((Ur==null?void 0:Ur.error_message)||"Start failed.")}catch(Je){Oe(Je.message||"An error occurred while saving.")}finally{Rn(!1)}}async function it(){if(!g){n(!0);return}try{Cn(!0),Oe("");const Je=window.localStorage.getItem("hyperToken"),bt=window.localStorage.getItem("hyperAddress");if(!Je||!bt){n(!0);return}const er=await(await fetch(`${k}/api/hyper/farming_app/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:bt.toLowerCase(),token:Je,...oe?{slot_number:V,target_app:"variational_delta",source_app:p}:{source_app:"variational_farming",slot_number:Tt}})})).json();er!=null&&er.success?(C(!1),_e()):Oe((er==null?void 0:er.error_message)||"Stop failed.")}catch(Je){Oe(Je.message||"An error occurred while stopping.")}finally{Cn(!1)}}const jt={control:(Je,bt)=>({...Je,backgroundColor:"#242424",borderColor:bt.isFocused?"#67FFBD":"#353535",minHeight:32,height:32,boxShadow:"none",cursor:"pointer",alignItems:"center"}),valueContainer:Je=>({...Je,height:32,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:Je=>({...Je,height:32}),input:Je=>({...Je,color:"#FFFFFF",margin:0,padding:0}),singleValue:Je=>({...Je,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:Je=>({...Je,color:"#7F7F7F",fontSize:"12px"}),menu:Je=>({...Je,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:Je=>({...Je,paddingTop:0,paddingBottom:0,maxHeight:200}),option:(Je,bt)=>({...Je,backgroundColor:bt.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:32,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:Je=>({...Je,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:Je=>({...Je,backgroundColor:"#353535"})};m.useEffect(()=>{if(!Pe){Ke(null),et("");return}const Je=ur(Pe);if(Je&&(Je!=null&&Je.exp)){const bt=new Date(Je.exp*1e3);Ke(bt),et("")}else Je?(Ke(null),et("The token's expiration date could not be found.")):(Ke(null),et("Invalid token format."))},[Pe]);const Nn=({max:Je})=>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:[Je,"x"]}),mn=Je=>{var bt,Tn;return i.jsx(Ca.Option,{...Je,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[(bt=Je.data)!=null&&bt.icon?i.jsx("img",{src:Je.data.icon,alt:Je.data.label,className:`w-4 h-4 ${((Tn=Je==null?void 0:Je.data)==null?void 0:Tn.label)==="XRP"?"bg-gray-600 rounded-full":"rounded-[4px]"}`,onError:er=>er.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:Je.data.label}),i.jsx(Nn,{max:Je.data.maxLeverage})]})})},ir=Je=>{var bt,Tn;return i.jsx(Ca.SingleValue,{...Je,children:i.jsxs("div",{className:"flex items-center gap-2",children:[(bt=Je.data)!=null&&bt.icon?i.jsx("img",{src:Je.data.icon,alt:Je.data.label,className:`w-4 h-4 ${((Tn=Je==null?void 0:Je.data)==null?void 0:Tn.label)==="XRP"?"bg-gray-600 rounded-full":"rounded-[4px]"}`,onError:er=>er.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:Je.data.label}),i.jsx(Nn,{max:Je.data.maxLeverage})]})})},Sn=Je=>{const bt=At.includes(Je.data.value);return i.jsx(Ca.Option,{...Je,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[i.jsx("span",{className:"text-white text-[13px]",children:Je.data.label}),bt&&i.jsx("span",{className:"ml-auto w-2 h-2 rounded-full bg-[#67FFBD]",title:"Active"})]})})},Bn=Je=>i.jsx(Ca.SingleValue,{...Je,children:i.jsx("div",{className:"flex items-center gap-2 px-3",children:i.jsx("span",{className:"text-white text-[13px]",children:Je.data.label})})}),rr=async()=>{var Tn,er,kr,Dr,Ur,cr,Cr,ls;const Je=window.localStorage.getItem("hyperToken"),bt=window.localStorage.getItem("hyperAddress");if(!(!Je||!bt))try{kn(!0);const yr=await _i(bt.toLowerCase(),Je);yr!=null&&yr.success?(r(yr==null?void 0:yr.telegram_chat_id),s(yr==null?void 0:yr.subscriber_role),a(yr==null?void 0:yr.subs_expire_day),o((Tn=yr==null?void 0:yr.mushboomer_counts)==null?void 0:Tn.eth),l((er=yr==null?void 0:yr.mushboomer_counts)==null?void 0:er.sol),c(yr==null?void 0:yr.referral_code),u(yr==null?void 0:yr.refcode),d(yr==null?void 0:yr.whitelist),f(Je),x(bt),h(!0),P((Dr=(kr=yr==null?void 0:yr.slots_info)==null?void 0:kr.variational)==null?void 0:Dr.total_qty),U((cr=(Ur=yr==null?void 0:yr.slots_info)==null?void 0:Ur.variational)==null?void 0:cr.total_qty),R((ls=(Cr=yr==null?void 0:yr.slots_info)==null?void 0:Cr.variational)==null?void 0:ls.active_qty),kn(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),f(""),x(""),kn(!1))}catch(yr){console.error("Token verification error:",yr),console.error(yr.message||"An unknown error occurred."),kn(!1)}};function ur(Je){try{const bt=Je.split(".");if(bt.length!==3)throw new Error("Invalid JWT format");const er=bt[1].replace(/-/g,"+").replace(/_/g,"/"),kr=decodeURIComponent(atob(er).split("").map(Dr=>"%"+("00"+Dr.charCodeAt(0).toString(16)).slice(-2)).join(""));return JSON.parse(kr)}catch{return null}}const _r=B,Un=m.useMemo(()=>Array.from({length:N},(Je,bt)=>({value:`Variational-${bt+1}`,label:`Variational-${bt+1}`})),[N]);if(!e)return null;const Ln=yn||Gn||Yn||An,Kn=w&&!Yn,Yr=W(wt);return i.jsxs(i.Fragment,{children:[i.jsx(vd,{open:$n,setOpen:nr,transactionHash:Rt,transactionLoading:hr,paymentPresaleRole:Ee,errorFunds:Jt,activeMethod:2}),i.jsx(m5,{open:Q,setOpen:ie,paymentLighterRole:Ee,oldSlotCount:X,checkAccountLighter:rr,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:()=>!Ln&&t(!1)}),i.jsxs("div",{className:"relative flex items-start gap-4 px-3 w-full max-w-[1000px]",children:[i.jsx(f2,{current:"variational",onCloseCurrent:()=>!Ln&&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:l5,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:[rn&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:rn}),g&&Ee&&O===I&&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 ${p.charAt(0).toUpperCase()+p.slice(1)} 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(s5,{className:"w-3 h-3 text-[#67FFBD] fill-[#67FFBD]"}),i.jsxs("span",{className:"text-[#67FFBD] font-medium",children:[I||0,"/",Un.length]})]})]}),i.jsx(Nl,{styles:jt,components:{Option:Sn,SingleValue:Bn},options:Un,value:Un.find(Je=>Je.value===cn)||null,onChange:Je=>zn((Je==null?void 0:Je.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:$e,onChange:Je=>ht(Je.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] ${$e===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Ln||Kn})})]}),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:Ne,onChange:Je=>me(Je.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY",type:gn?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ne===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Ln||Kn}),i.jsx("button",{type:"button",onClick:()=>Dt(Je=>!Je),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:Ln||Kn,children:gn?i.jsx(ca,{size:14}):i.jsx(ua,{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:ye,onChange:Je=>{const bt=Je.target.value.trim();if(bt==="")return je("");ue(bt)&&je(bt)},onKeyDown:ee,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] ${ye===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Ln||Kn})})]})]}):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:pt,onChange:Je=>Kt(Je.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] ${pt===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Ln||Kn})})]}),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:we,onChange:Je=>xe(Je.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] ${we===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Ln||Kn}),i.jsx("button",{type:"button",onClick:()=>ar(Je=>!Je),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:Ln||Kn,children:Qn?i.jsx(ca,{size:14}):i.jsx(ua,{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:tt,onChange:Je=>{const bt=Je.target.value.trim();if(bt==="")return Le("");ue(bt)&&Le(bt)},onKeyDown:ee,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] ${tt===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Ln||Kn})})]})]})]}),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:Pe,onChange:Je=>{const bt=Je.target.value;if(Re(bt),!bt.trim()){Ke(null),et("");return}const Tn=ur(bt);if(Tn&&(Tn!=null&&Tn.exp)){const er=new Date((Tn==null?void 0:Tn.exp)*1e3);Ke(er),et("")}else Tn?(Ke(null),et("The token's expiration date could not be found.")):(Ke(null),et("Invalid token format."))},type:en?"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] ${Pe===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Ln||Kn}),Xe&&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 "+(_?"text-[#FF797C]":"text-[#F8D4AB]"),children:Xe==null?void 0:Xe.toLocaleString("en-US",{dateStyle:"medium",timeStyle:"short"})}),_&&i.jsx("span",{children:i.jsx("img",{src:ec,alt:"",className:"w-3.5 h-3.5"})})]}),ut&&i.jsx("div",{className:"text-[10px] text-[#FF797C] mt-[2px] pl-[3px]",children:ut}),i.jsx("button",{type:"button",onClick:()=>In(Je=>!Je),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:Ln||Kn,children:en?i.jsx(ca,{size:14}):i.jsx(ua,{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(Nl,{styles:jt,components:{Option:mn,SingleValue:ir},isDisabled:Ln||Kn,options:_r,value:_r.find(Je=>Je.value===wt)||null,onChange:Je=>nn((Je==null?void 0:Je.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:Xt,onChange:Je=>{const bt=Je.target.value.trim();if(bt==="")return on("");ue(bt)&&on(bt)},onKeyDown:ee,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] ${Xt===""?"border-[#353535]":ge?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Ln||Kn}),Xt!==""&&!ge&&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:an,onChange:Je=>xn(Je.target.value),className:`${Ln||Kn?"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:Ln||Kn,children:[i.jsx("option",{value:"Hour",children:"Hour"}),i.jsx("option",{value:"Day",children:"Day"})]})]}),i.jsx("input",{value:Xt,onChange:Je=>{const bt=Je.target.value.trim();if(bt==="")return on("");ue(bt)&&on(bt)},onKeyDown:ee,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] ${Xt===""?"border-[#353535]":ge?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Ln||Kn}),Xt!==""&&!ge&&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(_o,{checked:ae==="ON",onChange:Je=>fe(Je?"ON":"OFF"),disabled:Ln||Kn,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 ${Ln||Kn?"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:Zt,onChange:Je=>{const bt=Je.target.value.trim();if(bt==="")return Ye("");ue(bt)&&Ye(bt)},onKeyDown:ee,inputMode:"numeric",autoComplete:"off",placeholder:wt?`1–${Yr}x`:"e.g. 3",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Zt===""?"border-[#353535]":Se?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Ln||Kn})]})]}),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":Ze==="LONG",onClick:()=>!Kn&&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",Ln||Kn?"cursor-not-allowed":"cursor-pointer",Ze==="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",Zt?` - ${Zt}x`:""]})}),i.jsx("div",{"aria-pressed":Ze==="SHORT",onClick:()=>!Kn&&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",Ln||Kn?"cursor-not-allowed":"cursor-pointer",Ze==="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",Zt?` - ${Zt}x`:""]})}),i.jsx("div",{"aria-pressed":Ze==="RANDOM",onClick:()=>!Kn&&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",Ln||Kn?"cursor-not-allowed":"cursor-pointer",Ze==="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",Zt?` - ${Zt}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":De==="MARKET",onClick:()=>!Kn&&_t("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",Ln||Kn?"cursor-not-allowed":"cursor-pointer",De==="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 ",De==="MARKET"?" ✓":""]})}),i.jsxs("button",{"aria-pressed":De==="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",De==="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 ",De==="LIMIT"?" ✓":""]}),i.jsx("span",{className:"min-w-max text-[6px] -mt-[1px] text-[#FF9A3C]",children:"Coming Soon"})]}),i.jsxs("button",{"aria-pressed":De==="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",De==="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 ",De==="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:ze,onChange:Je=>{const bt=Je.target.value.trim();if(bt==="")return nt("");ce(bt)&&nt(bt)},onKeyDown:ee,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] ${ze===""?"border-[#353535]":ke?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Ln||Kn})]}),ze!==""&&!ke&&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:mt,onChange:Je=>{const bt=Je.target.value.trim();if(bt==="")return $t("");ce(bt)&&$t(bt)},onKeyDown:ee,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] ${mt===""?"border-[#353535]":Me?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Ln||Kn})]}),mt!==""&&!Me&&i.jsxs("div",{className:"text-[#FF797C] text-[11px]",children:["Value must be 0, or between 1 and"," ",Zt?Math.max(Zt*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:()=>!Ln&&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:Ln,children:"Cancel"}),g?ae==="ON"?w?i.jsx("button",{onClick:stopLighterFarming,disabled:Ln,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:Yn?"Stopping...":"Stop"}):i.jsx("button",{onClick:saveLighterFarming,disabled:!Fe||Ln,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!Fe||Ln?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:Gn?"Starting...":"Start"}):w?i.jsx("button",{onClick:it,disabled:Ln,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:Yn?"Stopping...":"Stop"}):i.jsx("button",{onClick:Ot,disabled:!qe||Ln,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!qe||Ln?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:Gn?"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"})]})}),yn&&i.jsx("div",{className:"absolute inset-0 rounded-3xl bg-black/40 flex items-center justify-center text-sm",children:"Loading..."})]})]})]})]})]})},w$=({open:e=!1,setOpen:t=()=>{}})=>{var ai,Pr,vn,Fn;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(Qr),{address:g}=ts(),[v,w]=m.useState(!1),[C,N]=m.useState(!1),[P,I]=m.useState(1),[R,O]=m.useState(0),[U,L]=m.useState(0),[z,X]=m.useState(0),[ne,J]=m.useState(0),[K,re]=m.useState({}),[he,Q]=m.useState(null),[ie,oe]=m.useState("variational"),[G,V]=m.useState(!1),te=m.useRef(null),[ae,fe]=m.useState(!1),[Ne,me]=m.useState("Extended-1"),[we,xe]=m.useState("ON"),[ye,je]=m.useState(""),[Pe,Re]=m.useState(""),[Xe,Ke]=m.useState(""),[ut,et]=m.useState(""),[tt,Le]=m.useState(""),[$e,ht]=m.useState(""),[pt,Kt]=m.useState(""),[wt,nn]=m.useState(""),[cn,zn]=m.useState([]),[Xt,on]=m.useState(""),[Zt,Ye]=m.useState(""),[Ze,Ft]=m.useState("LONG"),[dn,Yt]=m.useState("STANDARD"),[Bt,ot]=m.useState("STANDARD"),[De,_t]=m.useState("LIMIT"),[ze,nt]=m.useState("LIMIT"),[mt,$t]=m.useState("MARKET"),[Pt,un]=m.useState(""),[an,xn]=m.useState(""),[An,kn]=m.useState(""),[yn,Vn]=m.useState(!1),[Gn,Rn]=m.useState(!1),[Yn,Cn]=m.useState(!1),[rn,Oe]=m.useState(!1),[Jt,sn]=m.useState(""),[Et,Xn]=m.useState(""),[gn,Dt]=m.useState(!0),[en,In]=m.useState(!1),[Qn,ar]=m.useState(!1),[hr,Gt]=m.useState(!1),[$n,nr]=m.useState(!1),[Rt,En]=m.useState(!1),[Ee,h]=m.useState(!1),[p,S]=m.useState(!1),[_,k]=m.useState(""),[T,B]=m.useState(!0),[W,ee]=m.useState(""),[ce,ue]=m.useState(null),[ge,Se]=m.useState(""),[ke,Me]=m.useState(!1),qe=ce?(ce==null?void 0:ce.getTime())<=Date.now():!1,[Fe,at]=m.useState("Hour"),[se,Ce]=m.useState([]),[Ue,Be]=m.useState(""),[_e,rt]=m.useState(!1),[ct,yt]=m.useState(!1);m.useState(1);const Lt="https://dextrabothypev2.nftinit.io",ft="",Tt=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}],[]),Ge=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:"XMR",label:"XMR",icon:"https://cdn.extended.exchange/crypto/XMR.svg",maxLeverage:25},{value:"XRP",label:"XRP",icon:"https://app.hyperliquid.xyz/coins/XRP.svg",maxLeverage:50},{value:"PUMP",label:"PUMP",icon:"https://app.hyperliquid.xyz/coins/PUMP.svg",maxLeverage:50},{value:"BNB",label:"BNB",icon:"https://app.hyperliquid.xyz/coins/BNB.svg",maxLeverage:25},{value:"ZEC",label:"ZEC",icon:"https://app.hyperliquid.xyz/coins/ZEC.svg",maxLeverage:10},{value:"LTC",label:"LTC",icon:"https://app.hyperliquid.xyz/coins/LTC.svg",maxLeverage:25},{value:"IP",label:"IP",icon:"https://app.hyperliquid.xyz/coins/IP.svg",maxLeverage:10},{value:"SUI",label:"SUI",icon:"https://app.hyperliquid.xyz/coins/SUI.svg",maxLeverage:50},{value:"AAVE",label:"AAVE",icon:"https://app.hyperliquid.xyz/coins/AAVE.svg",maxLeverage:50},{value:"FARTCOIN",label:"FARTCOIN",icon:"https://app.hyperliquid.xyz/coins/FARTCOIN.svg",maxLeverage:25},{value:"BERA",label:"BERA",icon:"https://app.hyperliquid.xyz/coins/BERA.svg",maxLeverage:10},{value:"ASTER",label:"ASTER",icon:"https://app.hyperliquid.xyz/coins/ASTER.svg",maxLeverage:25},{value:"ENA",label:"ENA",icon:"https://app.hyperliquid.xyz/coins/ENA.svg",maxLeverage:50},{value:"ADA",label:"ADA",icon:"https://app.hyperliquid.xyz/coins/ADA.svg",maxLeverage:50},{value:"TIA",label:"TIA",icon:"https://app.hyperliquid.xyz/coins/TIA.svg",maxLeverage:25},{value:"LINK",label:"LINK",icon:"https://app.hyperliquid.xyz/coins/LINK.svg",maxLeverage:25}],[]),At={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI"};m.useEffect(()=>{async function lt(){if(e)try{const tr=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_farming_coins/?app=extended")).json();if(tr!=null&&tr.coins){let Wn=tr.coins.map(Fr=>{const Tr=(Fr==null?void 0:Fr.label)||"",es=At[Tr]||Tr,Rs=es==="XMR"?"https://app.lighter.xyz/assets/xmr-CV8khZ54.png":es==="NMR"?"https://app.lighter.xyz/assets/nmr-2YIHMk6g.png":es==="USELESS"?"https://app.lighter.xyz/assets/useless-BTmgr78l.png":es==="DOLO"?"https://app.lighter.xyz/assets/dolo-DuOVl-Vo.png":es==="CRO"?"https://app.lighter.xyz/assets/cro-C7lstwu3.png":es==="FF"?"https://app.lighter.xyz/assets/ff-CvnDhHny.png":es==="4"||es=="EUR"||es=="EDEN"||es=="XAU"?"":`https://app.hyperliquid.xyz/coins/${es}.svg`;return{...Fr,icon:Rs}});zn(Wn)}}catch(Ut){console.error("Failed to fetch coin list:",Ut)}}lt()},[e]);async function Ot(){try{rt(!0);const lt=window.localStorage.getItem("hyperToken"),Ut=window.localStorage.getItem("hyperAddress");if(!lt||!Ut){n(!0);return}const tr=`${Lt}/api/wallet/list-extended`,Fr=await(await fetch(`${tr}`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:Ut.toLowerCase(),token:lt})})).json();Fr!=null&&Fr.success?Ce((Fr==null?void 0:Fr.data)||[]):sn((Fr==null?void 0:Fr.error_message)||"Failed to load wallets.")}catch(lt){sn(lt.message||"Wallet list error.")}finally{rt(!1)}}const it=lt=>{var Ut;return((Ut=(we==="ON"?Ge:Tt).find(tr=>tr.value===lt))==null?void 0:Ut.maxLeverage)??100},jt=lt=>{["e","E","+","-"].includes(lt.key)&&lt.preventDefault()},Nn=lt=>/^\d*\.?\d{0,6}$/.test(lt),mn=lt=>/^\d*$/.test(lt),ir=m.useMemo(()=>{if(Xt==="")return!1;const lt=Number(Xt);return Number.isInteger(lt)&&lt>=1&&lt<=120},[Xt]),Sn=m.useMemo(()=>{if(Zt==="")return!1;const lt=Number(Zt),Ut=it(wt);return Number.isInteger(lt)&&lt>=1&&lt<=Ut},[Zt,wt]),Bn=m.useMemo(()=>{if(Pt==="")return!1;const lt=Number(Pt);return Number.isNaN(lt)?!1:lt===0?!0:lt>=1&&lt<=1e7},[Pt]),rr=m.useMemo(()=>{if(an==="")return!1;const lt=Number(an);if(Number.isNaN(lt))return!1;const Ut=Zt===""?null:Number(Zt),tr=Ut?Ut*100-1:4999;return lt===0?!0:lt>0&&lt<1?!1:lt>=1&&lt<=tr},[an,Zt]);m.useMemo(()=>{if(An==="")return!1;const lt=Number(An);return!Number.isNaN(lt)&&lt>0&&lt<=100},[An]);const ur=we=="ON"?Ge:Tt,_r=m.useMemo(()=>wt?ur.some(lt=>lt.value===wt):!1,[wt,ur]),Un=v&&ye.trim()!==""&&$e.trim()!==""&&Xe.trim()!==""&&ut.trim()!==""&&wt!==""&&ir&&Sn&&Ne&&(!Pt||Bn)&&(!an||rr)&&(Ze==="LONG"||Ze==="SHORT"||Ze==="RANDOM")&&(De==="LIMIT"||De==="MARKET"||De==="RANDOM")&&T,Ln=v&&Ue&&Ne&&wt!==""&&_r&&ir&&Sn&&(ie!=="variational"||W.trim()!=="")&&(ie!=="variational"||!ge)&&(ie!=="variational"||!qe)&&T,Kn=()=>(localStorage.getItem("hyperAddress")||"dextra").toLowerCase(),Yr=()=>`extendedCreds:${Kn()}`,os=()=>{try{const lt=localStorage.getItem(Yr());if(!lt)return;const Ut=JSON.parse(lt);Ut.apiKey&&je(Ut.apiKey),Ut.apiPrivateKey&&Ke(Ut.apiPrivateKey),Ut.vaultNumber&&et(Ut.vaultNumber),Ut.apiPublicKey&&ht(Ut.apiPublicKey),typeof Ut.remember=="boolean"&&Dt(Ut.remember)}catch{}},ds=()=>{if(gn)try{localStorage.setItem(Yr(),JSON.stringify({apiKey:ye,apiPrivateKey:Xe,apiPublicKey:$e,vaultNumber:ut,remember:!0}))}catch{}},Je=()=>{try{localStorage.removeItem(Yr())}catch{}};m.useEffect(()=>{if(!e)return;const lt=localStorage.getItem("hyperToken"),Ut=localStorage.getItem("hyperAddress");w(!!(lt&&Ut));const tr=setInterval(()=>{const Wn=localStorage.getItem("hyperToken"),Fr=localStorage.getItem("hyperAddress");w(!!(Wn&&Fr))},800);return()=>clearInterval(tr)},[e]),m.useEffect(()=>{!e||!v||(bt(),Ot(),pr())},[e,v]),m.useEffect(()=>{e&&(an===""&&xn(ft),Pt===""&&un(ft),An===""&&kn(ft))},[e]),m.useEffect(()=>{if(!wt)return;const lt=it(wt),Ut=Number(Zt);!Number.isNaN(Ut)&&Ut>lt&&Ye(String(lt)),!Number.isNaN(Ut)&&Ut<1&&Zt!==""&&Ye("1")},[wt]),m.useEffect(()=>{e&&(gn&&ds(),gn||Je())},[ye,Xe,ut,$e,gn,e]);async function bt(){var lt,Ut,tr,Wn,Fr,Tr,es,Rs,kt,or,Hn,Hr,as,ss,ms,gs;try{Rn(!0),sn("");const Ui=window.localStorage.getItem("hyperToken"),$s=window.localStorage.getItem("hyperAddress");if(!Ui||!$s){N(!1),os();return}const Cs=await(await fetch(`${Lt}/api/test_app/new_farming_app/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:$s.toLowerCase(),token:Ui})})).json();if(!(Cs!=null&&Cs.success)){if(console.warn("INFO API RESPONSE:",Cs==null?void 0:Cs.error_message),(Cs==null?void 0:Cs.error_message)==="You have not a running process"){const dc=Ne?Ne.toLowerCase().replace("-","_"):null,_s=K==null?void 0:K[dc];if(dc&&_s){const _a={...K,[dc]:{..._s,isStop:!0}};re(_a);const ba=Object.keys(_a).filter(qo=>qo.startsWith("extended"));if(ba.length>0&&!Ne){const Wl=ba.sort((bi,wd)=>{var E,F;const dt=parseInt(((E=bi.match(/\d+/))==null?void 0:E[0])||0,10),y=parseInt(((F=wd.match(/\d+/))==null?void 0:F[0])||0,10);return dt-y})[0].match(/\d+/);Wl&&me(`Extended-${Wl[0]}`)}}else me("Extended-1")}Cs!=null&&Cs.slots_info&&(L((Ut=(lt=Cs==null?void 0:Cs.slots_info)==null?void 0:lt.extended)==null?void 0:Ut.total_qty),O((Wn=(tr=Cs==null?void 0:Cs.slots_info)==null?void 0:tr.extended)==null?void 0:Wn.active_qty),J((Tr=(Fr=Cs==null?void 0:Cs.slots_info)==null?void 0:Fr.variational)==null?void 0:Tr.total_qty),X((Rs=(es=Cs==null?void 0:Cs.slots_info)==null?void 0:es.variational)==null?void 0:Rs.active_qty));return}if(Cs!=null&&Cs.success&&(Cs!=null&&Cs.data)){const dc=Ne?Ne.toLowerCase().replace("-","_"):null,_s=K==null?void 0:K[dc],_a=Cs.data||{};dc&&!_a[dc]&&_s&&(_a[dc]={..._s,isStop:!0}),re(_a);const ba=Object.keys(_a).filter(qo=>qo.startsWith("extended"));if(ba.length>0&&!Ne){const Wl=ba.sort((bi,wd)=>{var E,F;const dt=parseInt(((E=bi.match(/\d+/))==null?void 0:E[0])||0,10),y=parseInt(((F=wd.match(/\d+/))==null?void 0:F[0])||0,10);return dt-y})[0].match(/\d+/);Wl&&me(`Extended-${Wl[0]}`)}Cs!=null&&Cs.slots_info&&(L((or=(kt=Cs==null?void 0:Cs.slots_info)==null?void 0:kt.extended)==null?void 0:or.total_qty),O((Hr=(Hn=Cs==null?void 0:Cs.slots_info)==null?void 0:Hn.extended)==null?void 0:Hr.active_qty),J((ss=(as=Cs==null?void 0:Cs.slots_info)==null?void 0:as.variational)==null?void 0:ss.total_qty),X((gs=(ms=Cs==null?void 0:Cs.slots_info)==null?void 0:ms.variational)==null?void 0:gs.active_qty))}}catch{N(!1),os(),xe("ON")}finally{Rn(!1)}}const Tn=m.useMemo(()=>Ne?Ne.toLowerCase().replace("-","_"):"",[Ne]),er=!!((ai=K==null?void 0:K[Tn])!=null&&ai.delta)&&!!((Pr=K==null?void 0:K[Tn])!=null&&Pr.from_slot),kr=er?`extended_${(vn=K==null?void 0:K[Tn])==null?void 0:vn.from_slot}`:Tn;m.useEffect(()=>{var tr,Wn,Fr,Tr,es,Rs,kt,or,Hn,Hr,as,ss,ms,gs,Ui,$s,bs,Cs,dc;if(!Ne||!K)return;const lt=kr,Ut=K==null?void 0:K[lt];if(!Ut){je(""),Ke(""),ht(""),Le(""),et(""),nn(""),on(""),Ye(""),Ft("LONG"),_t("LIMIT"),N(!1),xe("ON"),at("Hour"),un(""),xn(""),ee(""),nt("LIMIT"),$t("MARKET"),oe("variational"),ue(null);return}if((Ut==null?void 0:Ut.target_params)==null&&Ut.source_params){Ut!=null&&Ut.isStop?N(!1):N(!0),xe("OFF");const _s=Ut.source_params,_a=(Ut==null?void 0:Ut.slot_number)??"";_a&&!er&&me(`Extended-${_a}`),_s!=null&&_s.cycleSeconds&&at((_s==null?void 0:_s.cycleSeconds)===86400?"Day":"Hour");const $u=(_s==null?void 0:_s.extendedapikey)??"",ba=(_s==null?void 0:_s.x10privatekey)??"",qo=(_s==null?void 0:_s.x10publickey)??"",Uu=(_s==null?void 0:_s.x10vault)??"";if($u&&je(String($u)),ba&&Ke(String(ba)),qo&&ht(String(qo)),Uu&&et(String(Uu)),_s!=null&&_s.coin){const Wl=String(_s.coin).replace(/-USD$/,"");nn(Wl)}(_s==null?void 0:_s.orderPerHour)!=null&&on(String(_s.orderPerHour)),(_s==null?void 0:_s.leverage)!=null&&Ye(String(_s.leverage)),_s!=null&&_s.direction&&Ft(String(_s.direction).toUpperCase()==="SHORT"?"SHORT":String(_s.direction).toUpperCase()==="RANDOM"?"RANDOM":"LONG"),_s!=null&&_s.orderType&&_t(String(_s.orderType).toUpperCase()==="MARKET"?"MARKET":String(_s.orderType).toUpperCase()==="LIMIT"?"LIMIT":"RANDOM"),(_s==null?void 0:_s.tp)!=null&&un(String(_s.tp)),(_s==null?void 0:_s.sl)!=null&&xn(String(_s.sl))}else if((Ut==null?void 0:Ut.target_params)!==null){Ut!=null&&Ut.isStop?N(!1):N(!0),xe("ON");const _s=(Ut==null?void 0:Ut.slot_number)??"";_s&&!er&&me(`Extended-${_s}`);const _a=Ut.source_params,$u=(_a==null?void 0:_a.extendedapikey)??"",ba=(_a==null?void 0:_a.x10privatekey)??"",qo=(_a==null?void 0:_a.x10publickey)??"",Uu=(_a==null?void 0:_a.x10vault)??"";if($u&&je(String($u)),ba&&Ke(String(ba)),qo&&ht(String(qo)),Uu&&et(String(Uu)),(tr=Ut==null?void 0:Ut.source_params)!=null&&tr.wallet_id&&Be(String((Wn=Ut==null?void 0:Ut.source_params)==null?void 0:Wn.wallet_id)),(Fr=Ut==null?void 0:Ut.source_params)!=null&&Fr.coin){const Wl=String((Tr=Ut==null?void 0:Ut.source_params)==null?void 0:Tr.coin).replace(/-USD$/,"");nn(Wl)}((es=Ut==null?void 0:Ut.source_params)==null?void 0:es.orderPerHour)!=null&&on(String((Rs=Ut==null?void 0:Ut.source_params)==null?void 0:Rs.orderPerHour)),((kt=Ut==null?void 0:Ut.source_params)==null?void 0:kt.leverage)!=null&&Ye(String((or=Ut==null?void 0:Ut.source_params)==null?void 0:or.leverage)),(Hn=Ut==null?void 0:Ut.source_params)!=null&&Hn.accountType&&Yt(((Hr=Ut==null?void 0:Ut.source_params)==null?void 0:Hr.accountType)==="standart"?"STANDARD":"PREMIUM"),(as=Ut==null?void 0:Ut.target_params)!=null&&as.accountType&&ot(((ss=Ut==null?void 0:Ut.target_params)==null?void 0:ss.accountType)==="standart"?"STANDARD":"PREMIUM"),Ut!=null&&Ut.target_app&&oe(((Ut==null?void 0:Ut.target_app)==="variational","variational")),(ms=Ut==null?void 0:Ut.target_params)!=null&&ms.vr_token&&ee((gs=Ut==null?void 0:Ut.target_params)==null?void 0:gs.vr_token),(Ui=Ut==null?void 0:Ut.source_params)!=null&&Ui.source_orderType&&nt(String(($s=Ut==null?void 0:Ut.source_params)==null?void 0:$s.source_orderType).toUpperCase()==="MARKET"?"MARKET":String((bs=Ut==null?void 0:Ut.source_params)==null?void 0:bs.source_orderType).toUpperCase()==="LIMIT"?"LIMIT":"HYBRID"),(Cs=Ut==null?void 0:Ut.source_params)!=null&&Cs.cycleSeconds&&at(((dc=Ut==null?void 0:Ut.source_params)==null?void 0:dc.cycleSeconds)===86400?"Day":"Hour")}else N(!1),xe("OFF")},[Ne,K,er,kr]);const Dr=lt=>{var Ut;return Number(((Ut=String(lt||"").match(/\d+/))==null?void 0:Ut[0])||0)},Ur=lt=>(lt||"").toLowerCase().replace("-","_"),cr=m.useMemo(()=>{const lt=K==null?void 0:K[Ur(Ne)];if(lt!=null&&lt.delta&&(lt!=null&&lt.from_slot))return Number(lt.from_slot);const Ut=Number(lt==null?void 0:lt.slot_number);return Number.isFinite(Ut)?Ut:Dr(Ne)},[Ne,K]),Cr=m.useMemo(()=>{const lt=Number(P)||0,Ut=Array.from({length:lt},()=>({used:!1,kind:null})),tr=K||{};for(const[Wn,Fr]of Object.entries(tr)){if(!Wn.startsWith("extended"))continue;const Tr=Dr(Wn)-1;Tr<0||Tr>=lt||((Fr==null?void 0:Fr.isStop)===!0?Ut[Tr]={used:!1,kind:null}:Fr!=null&&Fr.source_params?Ut[Tr]={used:!0,kind:"delta-src"}:Fr!=null&&Fr.target_params||Fr!=null&&Fr.delta?Ut[Tr]={used:!0,kind:"delta-shadow"}:Fr!=null&&Fr.farming_params?Ut[Tr]={used:!0,kind:"single"}:Ut[Tr]={used:!0,kind:"unknown"})}return Ut},[K,P]),ls=m.useMemo(()=>Cr.map((lt,Ut)=>lt.used&&lt.kind!=="delta-src-inferred"?`Extended-${Ut+1}`:null).filter(Boolean),[Cr]);m.useMemo(()=>Cr.filter(lt=>!lt.used).length,[Cr]);async function yr(){var Ut;const lt=Dr(Ne)-1;if(lt<0){sn("Please select a slot."),Cn(!1);return}if((Ut=Cr[lt])!=null&&Ut.used){sn("Selected slot is already in use."),Cn(!1);return}if(!v){n(!0);return}if(we==="OFF"){if(!Un)return}else if(!Ln)return;try{Cn(!0),sn("");const tr=window.localStorage.getItem("hyperToken"),Wn=window.localStorage.getItem("hyperAddress");if(!tr||!Wn){n(!0);return}const Fr={coin:`${wt}-USD`,leverage:Number(Zt),orderPerHour:Number(Xt),cycleSeconds:Fe==="Hour"?3600:86400,...we==="ON"?{source_orderType:ze,wallet_id:Ue}:{extendedapikey:ye,x10publickey:$e,x10privatekey:Xe,x10vault:ut,orderType:De,tp:Number(Pt),sl:Number(an),direction:Ze}},Tr={...ie==="variational"&&{vr_token:W},coin:`${wt}`,orderPerHour:Number(Xt),leverage:Number(Zt),target_orderType:mt,cycleSeconds:Fe==="Hour"?3600:86400},es={address:Wn.toLowerCase(),token:tr,slot_number:Number(Ne==null?void 0:Ne.replace("Extended-","")),source_app:"extended",source_params:Fr,...we==="ON"?{target_app:ie==="extended"?"extended":"variational_delta",target_params:Tr}:{}},kt=await(await fetch(`${Lt}/api/hyper/farming_app/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(es)})).json();kt!=null&&kt.success?(N(!0),bt(),gn&&ds()):sn((kt==null?void 0:kt.error_message)||"Start failed.")}catch(tr){sn(tr.message||"An error occurred while saving.")}finally{Cn(!1)}}async function Jr(){if(!v){n(!0);return}try{Oe(!0),sn("");const lt=window.localStorage.getItem("hyperToken"),Ut=window.localStorage.getItem("hyperAddress");if(!lt||!Ut){n(!0);return}const Wn=await(await fetch(`${Lt}/api/hyper/farming_app/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:Ut.toLowerCase(),token:lt,source_app:"extended",slot_number:cr,...we==="ON"?{target_app:ie==="extended"?"extended":"variational_delta"}:{}})})).json();Wn!=null&&Wn.success?(N(!1),bt()):sn((Wn==null?void 0:Wn.error_message)||"Stop failed.")}catch(lt){sn(lt.message||"An error occurred while stopping.")}finally{Oe(!1)}}const Ks=lt=>{oe(lt??"variational"),V(!1)},Es=[{value:"variational",label:"Variational"}];function gr(lt){try{const Ut=lt.split(".");if(Ut.length!==3)throw new Error("Invalid JWT format");const Wn=Ut[1].replace(/-/g,"+").replace(/_/g,"/"),Fr=decodeURIComponent(atob(Wn).split("").map(Tr=>"%"+("00"+Tr.charCodeAt(0).toString(16)).slice(-2)).join(""));return JSON.parse(Fr)}catch{return null}}const Vt={control:(lt,Ut)=>({...lt,backgroundColor:"#242424",borderColor:Ut.isFocused?"#67FFBD":"#353535",minHeight:32,height:32,boxShadow:"none",cursor:"pointer",alignItems:"center"}),valueContainer:lt=>({...lt,height:32,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:lt=>({...lt,height:32}),input:lt=>({...lt,color:"#FFFFFF",margin:0,padding:0}),singleValue:lt=>({...lt,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:lt=>({...lt,color:"#7F7F7F",fontSize:"12px"}),menu:lt=>({...lt,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:lt=>({...lt,paddingTop:0,paddingBottom:0,maxHeight:200}),option:(lt,Ut)=>({...lt,backgroundColor:Ut.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:32,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:lt=>({...lt,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:lt=>({...lt,backgroundColor:"#353535"})},de=({max:lt})=>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:[lt,"x"]}),st=lt=>{var Ut;return i.jsx(Ca.Option,{...lt,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[(Ut=lt.data)!=null&&Ut.icon?i.jsx("img",{src:lt.data.icon,alt:lt.data.label,className:"w-4 h-4 rounded-[4px]",onError:tr=>tr.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:lt.data.label}),i.jsx(de,{max:lt.data.maxLeverage})]})})},Ct=lt=>{var Ut;return i.jsx(Ca.SingleValue,{...lt,children:i.jsxs("div",{className:"flex items-center gap-2",children:[(Ut=lt.data)!=null&&Ut.icon?i.jsx("img",{src:lt.data.icon,alt:lt.data.label,className:"w-4 h-4 rounded-[4px]",onError:tr=>tr.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:lt.data.label}),i.jsx(de,{max:lt.data.maxLeverage})]})})},vt=lt=>{const Ut=ls.includes(lt.data.value);return i.jsx(Ca.Option,{...lt,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[i.jsx("span",{className:"text-white text-[13px]",children:lt.data.label}),Ut&&i.jsx("span",{className:"ml-auto w-2 h-2 rounded-full bg-[#67FFBD]",title:"Active"})]})})},ln=lt=>i.jsx(Ca.SingleValue,{...lt,children:i.jsx("div",{className:"flex items-center gap-2 px-3",children:i.jsx("span",{className:"text-white text-[13px]",children:lt.data.label})})}),pn=m.useMemo(()=>se.map(lt=>{const Ut=(lt==null?void 0:lt.wallet_name)??(lt==null?void 0:lt.name)??(lt==null?void 0:lt.label)??String(lt==null?void 0:lt.wallet_id),tr=(lt==null?void 0:lt.version)===3?`${Ut} - (API-AGENT) Wallet`:Ut;return{value:(lt==null?void 0:lt.wallet_id)??(lt==null?void 0:lt.id)??(lt==null?void 0:lt.value)??"",label:tr,raw:lt}}),[se]),dr=m.useMemo(()=>{var lt;return(lt=pn.find(Ut=>String(Ut.value)===String(Ue)))==null?void 0:lt.raw},[pn,Ue]);m.useMemo(()=>{const lt=dr||{};return lt.address||lt.evm_address||lt.wallet_address||lt.public_address||lt.eth_address||lt.addr||null},[dr]);const jr=lt=>i.jsxs(Ca.MenuList,{...lt,children:[i.jsxs("div",{onClick:()=>{lt.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"}),lt.children]}),pr=async()=>{var tr,Wn,Fr,Tr,es,Rs,kt,or;const lt=window.localStorage.getItem("hyperToken"),Ut=window.localStorage.getItem("hyperAddress");if(!(!lt||!Ut))try{Vn(!0);const Hn=await _i(Ut.toLowerCase(),lt);Hn!=null&&Hn.success?(r(Hn==null?void 0:Hn.telegram_chat_id),s(Hn==null?void 0:Hn.subscriber_role),a(Hn==null?void 0:Hn.subs_expire_day),o((tr=Hn==null?void 0:Hn.mushboomer_counts)==null?void 0:tr.eth),l((Wn=Hn==null?void 0:Hn.mushboomer_counts)==null?void 0:Wn.sol),c(Hn==null?void 0:Hn.referral_code),u(Hn==null?void 0:Hn.refcode),d(Hn==null?void 0:Hn.whitelist),f(lt),x(Ut),B(!0),I((Tr=(Fr=Hn==null?void 0:Hn.slots_info)==null?void 0:Fr.extended)==null?void 0:Tr.total_qty),L((Rs=(es=Hn==null?void 0:Hn.slots_info)==null?void 0:es.extended)==null?void 0:Rs.total_qty),O((or=(kt=Hn==null?void 0:Hn.slots_info)==null?void 0:kt.extended)==null?void 0:or.active_qty),Vn(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),f(""),x(""),Vn(!1))}catch(Hn){console.error("Token verification error:",Hn),console.error(Hn.message||"An unknown error occurred."),Vn(!1)}},fr=async()=>new Al(window.ethereum).eth.getAccounts(Ut=>Ut),Kr=async(lt="extended",Ut=24,tr=5e3)=>{Ut<=0||(await new Promise(Wn=>setTimeout(Wn,tr)),await pr(),lt==="extended"&&!T&&Kr(lt,Ut-1,tr))},rs=async()=>{Xn("");const lt=window.localStorage.getItem("hyperToken"),Ut=window.localStorage.getItem("hyperAddress");if(!lt||!g){n(!0);return}S(!0),h(!0);try{await window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0x1"}]})}catch(Fr){console.error("Failed to switch network",Fr),h(!1);return}const tr=new Al(window.ethereum);var Wn=await fr();if(Wn.length>0?Wn=Wn[0]:Wn=void 0,Wn){const Tr={from:Wn,to:"0xdEAe8586eD227A5096EBae47342fFc1ED99f13F9",value:"120000000000000000"};await tr.eth.sendTransaction(Tr).then(es=>{console.log("txHash :>> ",es),h(!1),k(es.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():Ut,token:lt,payment_tx:es.transactionHash,payment_role:"farming_tools"})}),pr(),Kr("extended")}).catch(es=>{console.log(es),es.code===-32003||es.message.includes("insufficient funds")?Xn("Insufficient funds."):es.message==="MetaMask Tx Signature: User denied transaction signature."&&S(!1)})}else await tr.eth.requestAccounts()},Ir=m.useMemo(()=>Array.from({length:P},(lt,Ut)=>({value:`Extended-${Ut+1}`,label:`Extended-${Ut+1}`})),[P]);if(!e)return null;const br=Gn||Yn||rn||yn,Zn=C&&!rn,xs=it(wt),Qs=z===ne;return i.jsxs(i.Fragment,{children:[i.jsx(vd,{open:p,setOpen:S,transactionHash:_,transactionLoading:Ee,paymentPresaleRole:T,errorFunds:Et,activeMethod:2}),i.jsx(m5,{open:ae,setOpen:fe,paymentLighterRole:T,oldSlotCount:he,checkAccountLighter:pr,tradeMarket:"extended"}),ct&&Na.createPortal(i.jsx("div",{className:"fixed inset-0 z-[999999999]",children:i.jsx(f5,{open:ct,setOpen:yt,handleListRequest:Ot,handlePageChange:()=>{},source:"EXTENDED"})}),document.body),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:()=>!br&&t(!1)}),i.jsxs("div",{className:"relative flex items-start gap-4 px-3 w-full max-w-[1000px]",children:[i.jsx(f2,{current:"extended",onCloseCurrent:()=>!br&&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:l5,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:[Jt&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:Jt==="Get more slots to run Delta Neutral with Variational"?i.jsxs(i.Fragment,{children:[i.jsx("span",{children:Jt}),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:Jt})}),v&&T&&U===R&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:`No free Extended slots. All ${(Ir==null?void 0:Ir.length)||U} in use.`}),v&&Qs&&ie==="variational"&&!C&&we==="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"})]})}),v&&!T&&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:ec,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:()=>{rs()},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"})]})}),v&&T&&i.jsxs("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(s5,{className:"w-3 h-3 text-[#67FFBD] fill-[#67FFBD]"}),i.jsxs("span",{className:"text-[#67FFBD] font-medium",children:[R||0,"/",Ir.length]})]})]}),i.jsx(Nl,{styles:Vt,components:{Option:vt,SingleValue:ln},options:Ir,value:Ir.find(lt=>lt.value===Ne)||null,onChange:lt=>me((lt==null?void 0:lt.value)??""),placeholder:"Select",isSearchable:!0})]}),i.jsx("div",{className:"flex justify-end items-end w-full ",children:i.jsxs("div",{onClick:lt=>{lt.preventDefault(),v?yt(!0):n(!0)},className:"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] inline-flex justify-center items-center gap-1.5 cursor-pointer w-max",children:[i.jsx("span",{className:"text-[18px] leading-none",children:"+"}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px] min-w-max",children:"Add Account"})]})})]}),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:[we==="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:"Extended"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Select Wallet"}),i.jsxs("div",{className:"relative",children:[i.jsx(Nl,{styles:Vt,isDisabled:br||_e||Zn,isLoading:_e,options:pn,components:{MenuList:jr},setIsGenWalletModal:yt,value:pn.find(lt=>String(lt.value)===String(Ue))||null,onChange:lt=>{Zn||Be((lt==null?void 0:lt.value)??"")},placeholder:v?_e?"Loading...":"Select":"Connect to select",isSearchable:!0,onMenuOpen:()=>{v||n(!0)},menuIsOpen:v?void 0:!1}),!v&&i.jsx("button",{type:"button",onClick:()=>n(!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-semibold",children:"Order Type"}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("button",{"aria-pressed":ze==="LIMIT",onClick:()=>!Zn&&nt("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",br||Zn?"cursor-not-allowed":"cursor-pointer",ze==="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 ",ze==="LIMIT"?" ✓":""]})}),i.jsx("button",{"aria-pressed":ze==="HYBRID",onClick:()=>!Zn&&nt("HYBRID"),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",br||Zn?"cursor-not-allowed":"cursor-pointer",ze==="HYBRID"?"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:["HYBRID ",ze==="HYBRID"?" ✓":""]})}),i.jsx("button",{"aria-pressed":ze==="MARKET",onClick:()=>!Zn&&nt("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",br||Zn?"cursor-not-allowed":"cursor-pointer",ze==="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 ",ze==="MARKET"?" ✓":""]})})]})]})]}):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:ye,onChange:lt=>je(lt.target.value),autoComplete:"off",placeholder:"API_KEY",type:en?"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:br||Zn}),i.jsx("button",{type:"button",onClick:()=>In(lt=>!lt),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:br||Zn,children:en?i.jsx(ca,{size:14}):i.jsx(ua,{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:$e,onChange:lt=>ht(lt.target.value),autoComplete:"off",placeholder:"STARK_KEY_PUBLIC",type:Qn?"text":"password",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${$e===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:br||Zn}),i.jsx("button",{type:"button",onClick:()=>ar(lt=>!lt),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:br||Zn,children:Qn?i.jsx(ca,{size:14}):i.jsx(ua,{size:14})})]})]})]}),we==="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:te,className:"relative w-[120px]",children:[i.jsxs("div",{className:`${br||Zn?"cursor-not-allowed":"cursor-pointer"} rounded-md bg-[#353535] text-white px-2 h-6 flex items-center justify-between`,onClick:lt=>{lt.preventDefault(),br||Zn||V(!G)},children:[i.jsx("span",{className:"text-white font-inter text-[14px] font-medium leading-[8px] tracking-[-0.28px]",children:(Fn=Es==null?void 0:Es.find(lt=>(lt==null?void 0:lt.value)===ie))==null?void 0:Fn.label}),i.jsx("svg",{className:`w-4 h-4 ml-2 transform transition ${G?"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"})})]}),G&&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:Es==null?void 0:Es.map((lt,Ut)=>i.jsxs("div",{onClick:tr=>{tr.preventDefault(),br||Zn||Ks(lt==null?void 0:lt.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 ${(lt==null?void 0:lt.value)===ie?"bg-[#2c2c2c]":"hover:bg-[#2c2c2c]"} text-white ${br||Zn?"cursor-not-allowed":"cursor-pointer"}`,children:[i.jsx("span",{className:"text-white",children:lt==null?void 0:lt.label}),(lt==null?void 0:lt.value)===ie&&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"})})]},Ut))})})]})})]}),ie==="extended"&&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 Stark key Public"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:pt,onChange:lt=>Kt(lt.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] ${pt===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:br||Zn})})]}),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:Pe,onChange:lt=>Re(lt.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY_2",type:Rt?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Pe===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:br||Zn}),i.jsx("button",{type:"button",onClick:()=>En(lt=>!lt),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:br||Zn,children:Rt?i.jsx(ca,{size:14}):i.jsx(ua,{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:tt,onChange:lt=>{const Ut=lt.target.value.trim();if(Ut==="")return Le("");mn(Ut)&&Le(Ut)},onKeyDown:jt,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] ${tt===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:br||Zn})})]})]}),ie==="variational"&&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:"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:W,onChange:lt=>{const Ut=lt.target.value;if(ee(Ut),!Ut.trim()){ue(null),Se("");return}const tr=gr(Ut);if(tr&&(tr!=null&&tr.exp)){const Wn=new Date((tr==null?void 0:tr.exp)*1e3);ue(Wn),Se("")}else tr?(ue(null),Se("The token's expiration date could not be found.")):(ue(null),Se("Invalid token format."))},type:ke?"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] ${W===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:br||Zn}),ce&&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 "+(qe?"text-[#FF797C]":"text-[#F8D4AB]"),children:ce==null?void 0:ce.toLocaleString("en-US",{dateStyle:"medium",timeStyle:"short"})}),qe&&i.jsx("span",{children:i.jsx("img",{src:ec,alt:"",className:"w-3.5 h-3.5"})})]}),ge&&i.jsx("div",{className:"text-[10px] text-[#FF797C] mt-[2px] pl-[3px]",children:ge}),i.jsx("button",{type:"button",onClick:()=>Me(lt=>!lt),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:br||Zn,children:ke?i.jsx(ca,{size:14}):i.jsx(ua,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Order Type"}),i.jsx("div",{className:"flex items-center gap-3",children:i.jsx("button",{"aria-pressed":mt==="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",mt==="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 ",mt==="MARKET"?" ✓":""]})})})]})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${we==="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:Xe,onChange:lt=>Ke(lt.target.value),autoComplete:"off",placeholder:"STARK_KEY_PRIVATE",type:hr?"text":"password",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Xe===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:br||Zn}),i.jsx("button",{type:"button",onClick:()=>Gt(lt=>!lt),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:br||Zn,children:hr?i.jsx(ca,{size:14}):i.jsx(ua,{size:14})})]})]}),i.jsxs("div",{className:`${we==="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:ut,onChange:lt=>{const Ut=lt.target.value.trim();if(Ut==="")return et("");mn(Ut)&&et(Ut)},onKeyDown:jt,inputMode:"numeric",autoComplete:"off",placeholder:"VAULT_NUMBER",type:$n?"text":"password",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ut===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:br||Zn}),i.jsx("button",{type:"button",onClick:()=>nr(lt=>!lt),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:br||Zn,children:$n?i.jsx(ca,{size:14}):i.jsx(ua,{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(Nl,{styles:Vt,components:{Option:st,SingleValue:Ct},isDisabled:br||Zn,options:ur,value:ur.find(lt=>lt.value===wt)||null,onChange:lt=>nn((lt==null?void 0:lt.value)??""),placeholder:"Select",isSearchable:!0})]}),i.jsxs("div",{className:" 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:Fe,onChange:lt=>at(lt.target.value),className:`${br||Zn?"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:br||Zn,children:[i.jsx("option",{value:"Hour",children:"Hour"}),i.jsx("option",{value:"Day",children:"Day"})]})]}),i.jsx("input",{value:Xt,onChange:lt=>{const Ut=lt.target.value.trim();if(Ut==="")return on("");mn(Ut)&&on(Ut)},onKeyDown:jt,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] ${Xt===""?"border-[#353535]":ir?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:br||Zn}),Xt!==""&&!ir&&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:`${we==="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:we==="ON"?"On":"Off"}),i.jsx(_o,{checked:we==="ON",onChange:lt=>xe(lt?"ON":"OFF"),disabled:br||Zn,className:`${we==="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 ${br||Zn?"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  ${we==="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:Zt,onChange:lt=>{const Ut=lt.target.value.trim();if(Ut==="")return Ye("");mn(Ut)&&Ye(Ut)},onKeyDown:jt,inputMode:"numeric",autoComplete:"off",placeholder:wt?`1–${xs}x`:"e.g. 3",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Zt===""?"border-[#353535]":Sn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:br||Zn})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${we==="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":Ze==="LONG",onClick:()=>!Zn&&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",br||Zn?"cursor-not-allowed":"cursor-pointer",Ze==="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",Zt?` - ${Zt}x`:""]})}),i.jsx("div",{"aria-pressed":Ze==="SHORT",onClick:()=>!Zn&&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",br||Zn?"cursor-not-allowed":"cursor-pointer",Ze==="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",Zt?` - ${Zt}x`:""]})}),i.jsx("div",{"aria-pressed":Ze==="RANDOM",onClick:()=>!Zn&&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",br||Zn?"cursor-not-allowed":"cursor-pointer",Ze==="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",Zt?` - ${Zt}x`:""]})})]})]}),i.jsxs("div",{className:`${we==="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":De==="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",De==="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 ",De==="MARKET"?" ✓":""]}),i.jsx("span",{className:"min-w-max text-[6px] -mt-[1px] text-[#FF9A3C]",children:"Coming Soon"})]}),i.jsx("button",{"aria-pressed":De==="LIMIT",onClick:()=>!Zn&&_t("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",br||Zn?"cursor-not-allowed":"cursor-pointer",De==="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 ",De==="LIMIT"?" ✓":""]})}),i.jsxs("button",{"aria-pressed":De==="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",De==="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 ",De==="RANDOM"?" ✓":""]}),i.jsx("span",{className:"min-w-max text-[6px] -mt-[1px] text-[#FF9A3C]",children:"Coming Soon"})]})]})]})]}),i.jsxs("div",{className:`${we==="ON"?"hidden":""} grid grid-cols-1 md:grid-cols-2 gap-4`,children:[i.jsxs("div",{className:`${we==="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:Pt,onChange:lt=>{const Ut=lt.target.value.trim();if(Ut==="")return un("");Nn(Ut)&&un(Ut)},onKeyDown:jt,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] ${Pt===""?"border-[#353535]":Bn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:br||Zn})]}),Pt!==""&&!Bn&&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:`${we==="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:an,onChange:lt=>{const Ut=lt.target.value.trim();if(Ut==="")return xn("");Nn(Ut)&&xn(Ut)},onKeyDown:jt,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] ${an===""?"border-[#353535]":rr?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:br||Zn})]}),an!==""&&!rr&&i.jsxs("div",{className:"text-[#FF797C] text-[11px]",children:["Value must be 0, or between 1 and"," ",Zt?Math.max(Zt*100-1,0):4999,". Numbers between 0 and 1 are not allowed."]})]})]}),i.jsx("div",{className:`${we==="ON"?"hidden":""} grid grid-cols-1 md:grid-cols-2 gap-4`,children:i.jsxs("div",{className:`${we==="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:we==="ON"?"On":"Off"}),i.jsx(_o,{checked:we==="ON",onChange:lt=>xe(lt?"ON":"OFF"),disabled:br||Zn,className:`${we==="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 ${br||Zn?"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  ${we==="ON"?"translate-x-3":"translate-x-0"}`})})]})]})})]}),i.jsx("div",{className:`${we==="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:()=>!br&&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:br,children:"Cancel"}),v?we==="ON"?C?i.jsx("button",{onClick:Jr,disabled:br,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:rn?"Stopping...":"Stop"}):i.jsx("button",{onClick:yr,disabled:!Ln||br||ie==="variational"&&Qs&&we==="ON",className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!Ln||br||ie==="variational"&&Qs&&we==="ON"?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:Yn?"Starting...":"Start"}):C?i.jsx("button",{onClick:Jr,disabled:br,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:rn?"Stopping...":"Stop"}):i.jsx("button",{onClick:yr,disabled:!Un||br,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!Un||br?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:Yn?"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"})]})}),Gn&&i.jsx("div",{className:"absolute inset-0 rounded-3xl bg-black/40 flex items-center justify-center text-sm",children:"Loading..."})]})]})]})]})]})},aMe=({className:e})=>i.jsx("svg",{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",strokeWidth:"1",fill:"none",fillRule:"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",fillRule:"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",fillRule:"nonzero"}),i.jsx("polygon",{id:"Vector3",fillRule:"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",fillRule:"nonzero"}),i.jsx("polygon",{id:"Vector5",fillRule:"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 ct,yt,Lt;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(Qr);ts();const[g,v]=m.useState(!1),[w,C]=m.useState(!1),[N,P]=m.useState(1),[I,R]=m.useState(0),[O,U]=m.useState(0),[L,z]=m.useState({}),[X,ne]=m.useState(null),[J,K]=m.useState("paradex");m.useState(!1),m.useRef(null);const[re,he]=m.useState(!1),[Q,ie]=m.useState(""),[oe,G]=m.useState("OFF"),[V,te]=m.useState(""),[ae,fe]=m.useState(""),[Ne,me]=m.useState("");m.useState("");const[we,xe]=m.useState(""),[ye,je]=m.useState(""),[Pe,Re]=m.useState(""),[Xe,Ke]=m.useState(""),[ut,et]=m.useState([]),[tt,Le]=m.useState(""),[$e,ht]=m.useState(""),[pt,Kt]=m.useState("LONG"),[wt,nn]=m.useState("MARKET"),[cn,zn]=m.useState(""),[Xt,on]=m.useState(""),[Zt,Ye]=m.useState(""),[Ze,Ft]=m.useState(!1),[dn,Yt]=m.useState(!1),[Bt,ot]=m.useState(!1),[De,_t]=m.useState(!1),[ze,nt]=m.useState(""),[mt,$t]=m.useState(""),[Pt,un]=m.useState(!0),[an,xn]=m.useState(!1),[An,kn]=m.useState(!1),[yn,Vn]=m.useState(!1),[Gn,Rn]=m.useState(!1),[Yn,Cn]=m.useState(""),[rn,Oe]=m.useState(!0),[Jt,sn]=m.useState("Hour"),Et="https://dextrabothypev2.nftinit.io",Xn="";m.useEffect(()=>{async function ft(){if(e)try{const Ge=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_farming_coins/?app=paradex")).json();if(Ge!=null&&Ge.coins){const At=[...Ge.coins].sort((it,jt)=>(jt.maxLeverage||0)-(it.maxLeverage||0)),Ot=At==null?void 0:At.map(it=>{const mn=`https://app.paradex.trade/static/market/${(it==null?void 0:it.label)||""}.svg`;return{...it,icon:mn}});et(Ot)}}catch(Tt){console.error("Failed to fetch coin list:",Tt)}}ft()},[e]);const gn=ft=>{var Tt;return((Tt=ut.find(Ge=>Ge.value===ft))==null?void 0:Tt.maxLeverage)??100},Dt=ft=>{["e","E","+","-"].includes(ft.key)&&ft.preventDefault()},en=ft=>/^\d*\.?\d{0,6}$/.test(ft),In=ft=>/^\d*$/.test(ft),Qn=m.useMemo(()=>{if(tt==="")return!1;const ft=Number(tt);return Number.isInteger(ft)&&ft>=1&&ft<=180},[tt]),ar=m.useMemo(()=>{if($e==="")return!1;const ft=Number($e),Tt=gn(Xe);return Number.isInteger(ft)&&ft>=1&&ft<=Tt},[$e,Xe,ut]),hr=m.useMemo(()=>{if(cn==="")return!1;const ft=Number(cn);return Number.isNaN(ft)?!1:ft===0?!0:ft>=1&&ft<=1e7},[cn]),Gt=m.useMemo(()=>{if(Xt==="")return!1;const ft=Number(Xt);if(Number.isNaN(ft))return!1;const Tt=$e===""?null:Number($e),Ge=Tt?Tt*100-1:4999;return ft===0?!0:ft>0&&ft<1?!1:ft>=1&&ft<=Ge},[Xt,$e]);m.useMemo(()=>{if(Zt==="")return!1;const ft=Number(Zt);return!Number.isNaN(ft)&&ft>0&&ft<=100},[Zt]);const $n=g&&V.trim()!==""&&ye.trim()!==""&&Xe!==""&&Qn&&ar&&(!cn||hr)&&(!Xt||Gt)&&(pt==="LONG"||pt==="SHORT"||pt==="RANDOM")&&(wt==="LIMIT"||wt==="MARKET"||wt==="RANDOM")&&rn,nr=()=>(localStorage.getItem("hyperAddress")||"dextra").toLowerCase(),Rt=()=>`paradexCreds:${nr()}`,En=()=>{try{const ft=localStorage.getItem(Rt());if(!ft)return;const Tt=JSON.parse(ft);Tt.privateKey&&te(Tt.privateKey),Tt.paradexAddress&&je(Tt.paradexAddress),typeof Tt.remember=="boolean"&&un(Tt.remember)}catch{}},Ee=()=>{if(Pt)try{localStorage.setItem(Rt(),JSON.stringify({privateKey:V,paradexAddress:ye,remember:!0}))}catch{}},h=()=>{try{localStorage.removeItem(Rt())}catch{}};m.useEffect(()=>{if(!e)return;const ft=localStorage.getItem("hyperToken"),Tt=localStorage.getItem("hyperAddress");v(!!(ft&&Tt));const Ge=setInterval(()=>{const At=localStorage.getItem("hyperToken"),Ot=localStorage.getItem("hyperAddress");v(!!(At&&Ot))},800);return()=>clearInterval(Ge)},[e]),m.useEffect(()=>{!e||!g||(p(),se())},[e,g]),m.useEffect(()=>{e&&(Xt===""&&on(Xn),cn===""&&zn(Xn),Zt===""&&Ye(Xn))},[e]),m.useEffect(()=>{if(!Xe)return;const ft=gn(Xe),Tt=Number($e);!Number.isNaN(Tt)&&Tt>ft&&ht(String(ft)),!Number.isNaN(Tt)&&Tt<1&&$e!==""&&ht("1")},[Xe]),m.useEffect(()=>{e&&(Pt&&Ee(),Pt||h())},[V,ye,Pt,e]);async function p(){var ft,Tt,Ge,At,Ot,it,jt,Nn;try{Yt(!0),nt("");const mn=window.localStorage.getItem("hyperToken"),ir=window.localStorage.getItem("hyperAddress");if(!mn||!ir){C(!1),En();return}const Bn=await(await fetch(`${Et}/api/hyper/new_farming_app/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:ir.toLowerCase(),token:mn})})).json();if(!(Bn!=null&&Bn.success)){if(console.warn("INFO API RESPONSE:",Bn==null?void 0:Bn.error_message),(Bn==null?void 0:Bn.error_message)==="You have not a running process"){const rr=Q?Q.toLowerCase().replace("-","_"):null,ur=L==null?void 0:L[rr];if(rr&&ur){const _r={...L,[rr]:{...ur,isStop:!0}};z(_r);const Ln=Object.keys(_r).filter(Kn=>Kn.startsWith("paradex"));if(Ln.length>0&&!Q){const os=Ln.sort((ds,Je)=>{var er,kr;const bt=parseInt(((er=ds.match(/\d+/))==null?void 0:er[0])||0,10),Tn=parseInt(((kr=Je.match(/\d+/))==null?void 0:kr[0])||0,10);return bt-Tn})[0].match(/\d+/);os&&ie(`Paradex-${os[0]}`)}}else ie("Paradex-1")}Bn!=null&&Bn.slots_info&&(U((Tt=(ft=Bn==null?void 0:Bn.slots_info)==null?void 0:ft.paradex)==null?void 0:Tt.total_qty),R((At=(Ge=Bn==null?void 0:Bn.slots_info)==null?void 0:Ge.paradex)==null?void 0:At.active_qty));return}if(Bn!=null&&Bn.success&&(Bn!=null&&Bn.data)){const rr=Q?Q.toLowerCase().replace("-","_"):null,ur=L==null?void 0:L[rr],_r=Bn.data||{};rr&&!_r[rr]&&ur&&(_r[rr]={...ur,isStop:!0}),z(_r);const Ln=Object.keys(_r).filter(Kn=>Kn.startsWith("paradex"));if(Ln.length>0&&!Q){const os=Ln.sort((ds,Je)=>{var er,kr;const bt=parseInt(((er=ds.match(/\d+/))==null?void 0:er[0])||0,10),Tn=parseInt(((kr=Je.match(/\d+/))==null?void 0:kr[0])||0,10);return bt-Tn})[0].match(/\d+/);os&&ie(`Paradex-${os[0]}`)}Bn!=null&&Bn.slots_info&&(U((it=(Ot=Bn==null?void 0:Bn.slots_info)==null?void 0:Ot.paradex)==null?void 0:it.total_qty),R((Nn=(jt=Bn==null?void 0:Bn.slots_info)==null?void 0:jt.paradex)==null?void 0:Nn.active_qty))}}catch{C(!1),En(),G("OFF")}finally{Yt(!1)}}const S=m.useMemo(()=>Q?Q.toLowerCase().replace("-","_"):"",[Q]),_=!!((ct=L==null?void 0:L[S])!=null&&ct.delta)&&!!((yt=L==null?void 0:L[S])!=null&&yt.from_slot),k=_?`paradex_${(Lt=L==null?void 0:L[S])==null?void 0:Lt.from_slot}`:S;m.useEffect(()=>{var Ge,At,Ot,it,jt,Nn,mn,ir,Sn,Bn;if(!Q||!L)return;const ft=k,Tt=L==null?void 0:L[ft];if(!Tt){te(""),je(""),Ke(""),Le(""),ht(""),Kt("LONG"),nn("LIMIT"),C(!1),G("OFF"),sn("Hour"),zn(""),on(""),K("paradex");return}if((Tt==null?void 0:Tt.target_params)==null&&Tt.source_params){Tt!=null&&Tt.isStop?C(!1):C(!0),G("OFF");const rr=Tt.source_params,ur=(Tt==null?void 0:Tt.slot_number)??"";ur&&!_&&ie(`Paradex-${ur}`),rr!=null&&rr.cycleSeconds&&sn((rr==null?void 0:rr.cycleSeconds)===86400?"Day":"Hour");const _r=(rr==null?void 0:rr.paradex_pkey)??"",Un=(rr==null?void 0:rr.paradex_address)??"";if(_r&&te(String(_r)),Un&&je(String(Un)),rr!=null&&rr.coin){const Ln=String(rr.coin).replace(/-USD$/,"");Ke(Ln)}(rr==null?void 0:rr.orderPerHour)!=null&&Le(String(rr.orderPerHour)),(rr==null?void 0:rr.leverage)!=null&&ht(String(rr.leverage)),rr!=null&&rr.direction&&Kt(String(rr.direction).toUpperCase()==="SHORT"?"SHORT":String(rr.direction).toUpperCase()==="RANDOM"?"RANDOM":"LONG"),rr!=null&&rr.orderType&&nn(String(rr.orderType).toUpperCase()==="MARKET"?"MARKET":String(rr.orderType).toUpperCase()==="LIMIT"?"LIMIT":"RANDOM"),(rr==null?void 0:rr.tp)!=null&&zn(String(rr.tp)),(rr==null?void 0:rr.sl)!=null&&on(String(rr.sl))}else if((Tt==null?void 0:Tt.target_params)!==null){Tt!=null&&Tt.isStop?C(!1):C(!0),G("OFF");const rr=(Tt==null?void 0:Tt.slot_number)??"";rr&&!_&&ie(`Paradex-${rr}`),(Ge=Tt==null?void 0:Tt.source_params)!=null&&Ge.coin&&Ke(String((At=Tt==null?void 0:Tt.source_params)==null?void 0:At.coin)),((Ot=Tt==null?void 0:Tt.source_params)==null?void 0:Ot.orderPerHour)!=null&&Le(String((it=Tt==null?void 0:Tt.source_params)==null?void 0:it.orderPerHour)),((jt=Tt==null?void 0:Tt.source_params)==null?void 0:jt.leverage)!=null&&ht(String((Nn=Tt==null?void 0:Tt.source_params)==null?void 0:Nn.leverage)),(mn=Tt==null?void 0:Tt.source_params)!=null&&mn.accountType&&setStatusType(((ir=Tt==null?void 0:Tt.source_params)==null?void 0:ir.accountType)==="standart"?"STANDARD":"PREMIUM"),(Sn=Tt==null?void 0:Tt.target_params)!=null&&Sn.accountType&&setStatusTypeTwo(((Bn=Tt==null?void 0:Tt.target_params)==null?void 0:Bn.accountType)==="standart"?"STANDARD":"PREMIUM"),Tt!=null&&Tt.target_app&&K(((Tt==null?void 0:Tt.target_app)==="paradex","paradex"))}else C(!1),G("OFF")},[Q,L,_,k]);const T=ft=>{var Tt;return Number(((Tt=String(ft||"").match(/\d+/))==null?void 0:Tt[0])||0)},B=ft=>(ft||"").toLowerCase().replace("-","_"),W=m.useMemo(()=>{const ft=L==null?void 0:L[B(Q)];if(ft!=null&&ft.delta&&(ft!=null&&ft.from_slot))return Number(ft.from_slot);const Tt=Number(ft==null?void 0:ft.slot_number);return Number.isFinite(Tt)?Tt:T(Q)},[Q,L]),ee=m.useMemo(()=>{const ft=Number(N)||0,Tt=Array.from({length:ft},()=>({used:!1,kind:null})),Ge=L||{};for(const[At,Ot]of Object.entries(Ge)){if(!At.startsWith("paradex"))continue;const it=T(At)-1;it<0||it>=ft||((Ot==null?void 0:Ot.isStop)===!0?Tt[it]={used:!1,kind:null}:Ot!=null&&Ot.source_params?Tt[it]={used:!0,kind:"delta-src"}:Ot!=null&&Ot.target_params||Ot!=null&&Ot.delta?Tt[it]={used:!0,kind:"delta-shadow"}:Ot!=null&&Ot.farming_params?Tt[it]={used:!0,kind:"single"}:Tt[it]={used:!0,kind:"unknown"})}return Tt},[L,N]),ce=m.useMemo(()=>ee.map((ft,Tt)=>ft.used&&ft.kind!=="delta-src-inferred"?`Paradex-${Tt+1}`:null).filter(Boolean),[ee]);m.useMemo(()=>ee.filter(ft=>!ft.used).length,[ee]);async function ue(){if(!g){n(!0);return}if($n)try{ot(!0),nt("");const ft=window.localStorage.getItem("hyperToken"),Tt=window.localStorage.getItem("hyperAddress");if(!ft||!Tt){n(!0);return}const Ge={paradex_address:ye,paradex_pkey:V,cycleSeconds:Jt==="Hour"?3600:86400,tp:Number(cn),sl:Number(Xt),coin:`${Xe}`,orderPerHour:Number(tt),leverage:Number($e),direction:pt,orderType:wt},At={api_pkey:ae,login_wallet:Pe,coin:Xe==null?void 0:Xe.replace("USDT",""),orderPerHour:Number(tt),leverage:Number($e)},Ot={address:Tt.toLowerCase(),token:ft,slot_number:Number(Q==null?void 0:Q.replace("Paradex-","")),source_app:"paradex",source_params:Ge},jt=await(await fetch(`${Et}/api/hyper/farming_app/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ot)})).json();jt!=null&&jt.success?(C(!0),p(),Pt&&Ee()):nt((jt==null?void 0:jt.error_message)||"Start failed.")}catch(ft){nt(ft.message||"An error occurred while saving.")}finally{ot(!1)}}async function ge(){if(!g){n(!0);return}try{_t(!0),nt("");const ft=window.localStorage.getItem("hyperToken"),Tt=window.localStorage.getItem("hyperAddress");if(!ft||!Tt){n(!0);return}const At=await(await fetch(`${Et}/api/hyper/farming_app/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:Tt.toLowerCase(),token:ft,source_app:"paradex",slot_number:W})})).json();At!=null&&At.success?(C(!1),p()):nt((At==null?void 0:At.error_message)||"Stop failed.")}catch(ft){nt(ft.message||"An error occurred while stopping.")}finally{_t(!1)}}const Se={control:(ft,Tt)=>({...ft,backgroundColor:"#242424",borderColor:Tt.isFocused?"#67FFBD":"#353535",minHeight:32,height:32,boxShadow:"none",cursor:"pointer",alignItems:"center"}),valueContainer:ft=>({...ft,height:32,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:ft=>({...ft,height:32}),input:ft=>({...ft,color:"#FFFFFF",margin:0,padding:0}),singleValue:ft=>({...ft,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:ft=>({...ft,color:"#7F7F7F",fontSize:"12px"}),menu:ft=>({...ft,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:ft=>({...ft,paddingTop:0,paddingBottom:0,maxHeight:200}),option:(ft,Tt)=>({...ft,backgroundColor:Tt.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:32,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:ft=>({...ft,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:ft=>({...ft,backgroundColor:"#353535"})},ke=({max:ft})=>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:[ft,"x"]}),Me=ft=>{var Tt;return i.jsx(Ca.Option,{...ft,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[(Tt=ft.data)!=null&&Tt.icon?i.jsx("img",{src:ft.data.icon,alt:ft.data.label,className:"w-4 h-4 rounded-[4px]",onError:Ge=>Ge.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:ft.data.label}),i.jsx(ke,{max:ft.data.maxLeverage})]})})},qe=ft=>{var Tt;return i.jsx(Ca.SingleValue,{...ft,children:i.jsxs("div",{className:"flex items-center gap-2",children:[(Tt=ft.data)!=null&&Tt.icon?i.jsx("img",{src:ft.data.icon,alt:ft.data.label,className:"w-4 h-4 rounded-[4px]",onError:Ge=>Ge.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:ft.data.label}),i.jsx(ke,{max:ft.data.maxLeverage})]})})},Fe=ft=>{const Tt=ce.includes(ft.data.value);return i.jsx(Ca.Option,{...ft,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[i.jsx("span",{className:"text-white text-[13px]",children:ft.data.label}),Tt&&i.jsx("span",{className:"ml-auto w-2 h-2 rounded-full bg-[#67FFBD]",title:"Active"})]})})},at=ft=>i.jsx(Ca.SingleValue,{...ft,children:i.jsx("div",{className:"flex items-center gap-2 px-3",children:i.jsx("span",{className:"text-white text-[13px]",children:ft.data.label})})}),se=async()=>{var Ge,At,Ot,it,jt,Nn,mn,ir;const ft=window.localStorage.getItem("hyperToken"),Tt=window.localStorage.getItem("hyperAddress");if(!(!ft||!Tt))try{Ft(!0);const Sn=await _i(Tt.toLowerCase(),ft);Sn!=null&&Sn.success?(r(Sn==null?void 0:Sn.telegram_chat_id),s(Sn==null?void 0:Sn.subscriber_role),a(Sn==null?void 0:Sn.subs_expire_day),o((Ge=Sn==null?void 0:Sn.mushboomer_counts)==null?void 0:Ge.eth),l((At=Sn==null?void 0:Sn.mushboomer_counts)==null?void 0:At.sol),c(Sn==null?void 0:Sn.referral_code),u(Sn==null?void 0:Sn.refcode),d(Sn==null?void 0:Sn.whitelist),f(ft),x(Tt),Oe(!0),P((it=(Ot=Sn==null?void 0:Sn.slots_info)==null?void 0:Ot.paradex)==null?void 0:it.total_qty),U((Nn=(jt=Sn==null?void 0:Sn.slots_info)==null?void 0:jt.paradex)==null?void 0:Nn.total_qty),R((ir=(mn=Sn==null?void 0:Sn.slots_info)==null?void 0:mn.paradex)==null?void 0:ir.active_qty),Ft(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),f(""),x(""),Ft(!1))}catch(Sn){console.error("Token verification error:",Sn),console.error(Sn.message||"An unknown error occurred."),Ft(!1)}},Ce=ut,Ue=m.useMemo(()=>Array.from({length:N},(ft,Tt)=>({value:`Paradex-${Tt+1}`,label:`Paradex-${Tt+1}`})),[N]);if(!e)return null;const Be=dn||Bt||De||Ze,_e=w&&!De,rt=gn(Xe);return i.jsxs(i.Fragment,{children:[i.jsx(vd,{open:Gn,setOpen:Rn,transactionHash:Yn,transactionLoading:yn,paymentPresaleRole:rn,errorFunds:mt,activeMethod:2}),i.jsx(m5,{open:re,setOpen:he,paymentLighterRole:rn,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:()=>!Be&&t(!1)}),i.jsxs("div",{className:"relative flex items-start gap-4 px-3 w-full max-w-[1000px]",children:[i.jsx(f2,{current:"paradex",onCloseCurrent:()=>!Be&&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(aMe,{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:l5,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:[ze&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:ze}),g&&rn&&O===I&&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&&rn&&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(s5,{className:"w-3 h-3 text-[#67FFBD] fill-[#67FFBD]"}),i.jsxs("span",{className:"text-[#67FFBD] font-medium",children:[I||0,"/",Ue.length]})]})]}),i.jsx(Nl,{styles:Se,components:{Option:Fe,SingleValue:at},options:Ue,value:Ue.find(ft=>ft.value===Q)||null,onChange:ft=>ie((ft==null?void 0:ft.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:ye,onChange:ft=>je(ft.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] ${ye===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Be||_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:ft=>te(ft.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY",type:an?"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:Be||_e}),i.jsx("button",{type:"button",onClick:()=>xn(ft=>!ft),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:Be||_e,children:an?i.jsx(ca,{size:14}):i.jsx(ua,{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:Ne,onChange:ft=>{const Tt=ft.target.value.trim();if(Tt==="")return me("");In(Tt)&&me(Tt)},onKeyDown:Dt,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] ${Ne===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Be||_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:ye,onChange:ft=>je(ft.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] ${ye===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Be||_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:ft=>te(ft.target.value),autoComplete:"off",placeholder:"PARADEX_PRIVATE_KEY",type:an?"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:Be||_e}),i.jsx("button",{type:"button",onClick:()=>xn(ft=>!ft),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:Be||_e,children:an?i.jsx(ca,{size:14}):i.jsx(ua,{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:Pe,onChange:ft=>Re(ft.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] ${Pe===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Be||_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:ft=>fe(ft.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY_2",type:An?"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:Be||_e}),i.jsx("button",{type:"button",onClick:()=>kn(ft=>!ft),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:Be||_e,children:An?i.jsx(ca,{size:14}):i.jsx(ua,{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:we,onChange:ft=>{const Tt=ft.target.value.trim();if(Tt==="")return xe("");In(Tt)&&xe(Tt)},onKeyDown:Dt,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] ${we===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Be||_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:tt,onChange:ft=>{const Tt=ft.target.value.trim();if(Tt==="")return Le("");In(Tt)&&Le(Tt)},onKeyDown:Dt,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] ${tt===""?"border-[#353535]":Qn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Be||_e}),tt!==""&&!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(Nl,{styles:Se,components:{Option:Me,SingleValue:qe},isDisabled:Be||_e,options:Ce,value:Ce.find(ft=>ft.value===Xe)||null,onChange:ft=>Ke((ft==null?void 0:ft.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:Jt,onChange:ft=>sn(ft.target.value),className:`${Be||_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:Be||_e,children:[i.jsx("option",{value:"Hour",children:"Hour"}),i.jsx("option",{value:"Day",children:"Day"})]})]}),i.jsx("input",{value:tt,onChange:ft=>{const Tt=ft.target.value.trim();if(Tt==="")return Le("");In(Tt)&&Le(Tt)},onKeyDown:Dt,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] ${tt===""?"border-[#353535]":Qn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Be||_e}),tt!==""&&!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(_o,{checked:oe==="ON",onChange:ft=>G(ft?"ON":"OFF"),disabled:Be||_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 ${Be||_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:$e,onChange:ft=>{const Tt=ft.target.value.trim();if(Tt==="")return ht("");In(Tt)&&ht(Tt)},onKeyDown:Dt,inputMode:"numeric",autoComplete:"off",placeholder:Xe?`1–${rt}x`:"e.g. 3",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${$e===""?"border-[#353535]":ar?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Be||_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":pt==="LONG",onClick:()=>!_e&&Kt("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",Be||_e?"cursor-not-allowed":"cursor-pointer",pt==="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",$e?` - ${$e}x`:""]})}),i.jsx("div",{"aria-pressed":pt==="SHORT",onClick:()=>!_e&&Kt("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",Be||_e?"cursor-not-allowed":"cursor-pointer",pt==="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",$e?` - ${$e}x`:""]})}),i.jsx("div",{"aria-pressed":pt==="RANDOM",onClick:()=>!_e&&Kt("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",Be||_e?"cursor-not-allowed":"cursor-pointer",pt==="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",$e?` - ${$e}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":wt==="MARKET",onClick:()=>!_e&&nn("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",Be||_e?"cursor-not-allowed":"cursor-pointer",wt==="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 ",wt==="MARKET"?" ✓":""]})}),i.jsx("button",{"aria-pressed":wt==="LIMIT",onClick:()=>!_e&&nn("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",Be||_e?"cursor-not-allowed":"cursor-pointer",wt==="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 ",wt==="LIMIT"?" ✓":""]})}),i.jsx("button",{"aria-pressed":wt==="RANDOM",onClick:()=>!_e&&nn("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",Be||_e?"cursor-not-allowed":"cursor-pointer",wt==="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 ",wt==="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:ft=>{const Tt=ft.target.value.trim();if(Tt==="")return zn("");en(Tt)&&zn(Tt)},onKeyDown:Dt,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]":hr?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Be||_e})]}),cn!==""&&!hr&&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:Xt,onChange:ft=>{const Tt=ft.target.value.trim();if(Tt==="")return on("");en(Tt)&&on(Tt)},onKeyDown:Dt,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]":Gt?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Be||_e})]}),Xt!==""&&!Gt&&i.jsxs("div",{className:"text-[#FF797C] text-[11px]",children:["Value must be 0, or between 1 and"," ",$e?Math.max($e*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:()=>!Be&&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:Be,children:"Cancel"}),g?oe==="ON"?w?i.jsx("button",{onClick:ge,disabled:Be,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:De?"Stopping...":"Stop"}):i.jsx("button",{onClick:ue,disabled:!$n||Be,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!$n||Be?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:Bt?"Starting...":"Start"}):w?i.jsx("button",{onClick:ge,disabled:Be,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:De?"Stopping...":"Stop"}):i.jsx("button",{onClick:ue,disabled:!$n||Be,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!$n||Be?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:Bt?"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"})]})}),dn&&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 Ge,At,Ot;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(Qr);ts();const[g,v]=m.useState(!1),[w,C]=m.useState(!1),[N,P]=m.useState(1),[I,R]=m.useState(0),[O,U]=m.useState(0),[L,z]=m.useState({}),[X,ne]=m.useState(null),[J,K]=m.useState("pacifica");m.useState(!1),m.useRef(null);const[re,he]=m.useState(!1),[Q,ie]=m.useState(""),[oe,G]=m.useState("OFF"),[V,te]=m.useState(""),[ae,fe]=m.useState(""),[Ne,me]=m.useState("");m.useState("");const[we,xe]=m.useState(""),[ye,je]=m.useState(""),[Pe,Re]=m.useState(""),[Xe,Ke]=m.useState(""),[ut,et]=m.useState([]),[tt,Le]=m.useState(""),[$e,ht]=m.useState(""),[pt,Kt]=m.useState("LONG"),[wt,nn]=m.useState("LIMIT"),[cn,zn]=m.useState(""),[Xt,on]=m.useState(""),[Zt,Ye]=m.useState(""),[Ze,Ft]=m.useState(!1),[dn,Yt]=m.useState(!1),[Bt,ot]=m.useState(!1),[De,_t]=m.useState(!1),[ze,nt]=m.useState(""),[mt,$t]=m.useState(""),[Pt,un]=m.useState(!0),[an,xn]=m.useState(!1),[An,kn]=m.useState(!1),[yn,Vn]=m.useState(!1),[Gn,Rn]=m.useState(!1),[Yn,Cn]=m.useState(""),[rn,Oe]=m.useState(!0),[Jt,sn]=m.useState("Hour"),[Et,Xn]=m.useState("Limit"),[gn,Dt]=m.useState("Limit"),en="https://dextrabothypev2.nftinit.io",In="";m.useEffect(()=>{async function it(){if(e)try{const Nn=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_farming_coins/?app=pacifica")).json();if(Nn!=null&&Nn.coins){let mn=Nn.coins.map(ir=>{const rr=`https://app.pacifica.fi/imgs/tokens/${(ir==null?void 0:ir.label)||""}.svg`;return{...ir,icon:rr}});et(mn)}}catch(jt){console.error("Failed to fetch coin list:",jt)}}it()},[e]);const Qn=it=>{var jt;return((jt=ut.find(Nn=>Nn.value===it))==null?void 0:jt.maxLeverage)??100},ar=it=>{["e","E","+","-"].includes(it.key)&&it.preventDefault()},hr=it=>/^\d*\.?\d{0,6}$/.test(it),Gt=it=>/^\d*$/.test(it),$n=m.useMemo(()=>{if(tt==="")return!1;const it=Number(tt);return Number.isInteger(it)&&it>=1&&it<=180},[tt]),nr=m.useMemo(()=>{if($e==="")return!1;const it=Number($e),jt=Qn(Xe);return Number.isInteger(it)&&it>=1&&it<=jt},[$e,Xe,ut]),Rt=m.useMemo(()=>{const it=V.trim();return it?it.length>86:!1},[V]),En=m.useMemo(()=>{if(cn==="")return!1;const it=Number(cn);return Number.isNaN(it)?!1:it===0?!0:it>=1&&it<=1e7},[cn]),Ee=m.useMemo(()=>{if(Xt==="")return!1;const it=Number(Xt);if(Number.isNaN(it))return!1;const jt=$e===""?null:Number($e),Nn=jt?jt*100-1:4999;return it===0?!0:it>0&&it<1?!1:it>=1&&it<=Nn},[Xt,$e]);m.useMemo(()=>{if(Zt==="")return!1;const it=Number(Zt);return!Number.isNaN(it)&&it>0&&it<=100},[Zt]);const h=g&&V.trim()!==""&&ye.trim()!==""&&Xe!==""&&$n&&nr&&Q&&(!cn||En)&&(!Xt||Ee)&&(pt==="LONG"||pt==="SHORT"||pt==="RANDOM")&&(wt==="LIMIT"||wt==="MARKET"||wt==="HYBRID")&&Rt&&rn,p=()=>(localStorage.getItem("hyperAddress")||"dextra").toLowerCase(),S=()=>`pacificaCreds:${p()}`,_=()=>{try{const it=localStorage.getItem(S());if(!it)return;const jt=JSON.parse(it);jt.privateKey&&te(jt.privateKey),jt.loginAddress&&je(jt.loginAddress),typeof jt.remember=="boolean"&&un(jt.remember)}catch{}},k=()=>{if(Pt)try{localStorage.setItem(S(),JSON.stringify({privateKey:V,loginAddress:ye,remember:!0}))}catch{}},T=()=>{try{localStorage.removeItem(S())}catch{}};m.useEffect(()=>{if(!e)return;const it=localStorage.getItem("hyperToken"),jt=localStorage.getItem("hyperAddress");v(!!(it&&jt));const Nn=setInterval(()=>{const mn=localStorage.getItem("hyperToken"),ir=localStorage.getItem("hyperAddress");v(!!(mn&&ir))},800);return()=>clearInterval(Nn)},[e]),m.useEffect(()=>{!e||!g||(B(),rt())},[e,g]),m.useEffect(()=>{e&&(Xt===""&&on(In),cn===""&&zn(In),Zt===""&&Ye(In))},[e]),m.useEffect(()=>{if(!Xe)return;const it=Qn(Xe),jt=Number($e);!Number.isNaN(jt)&&jt>it&&ht(String(it)),!Number.isNaN(jt)&&jt<1&&$e!==""&&ht("1")},[Xe]),m.useEffect(()=>{e&&(Pt&&k(),Pt||T())},[V,ye,Pt,e]);async function B(){var it,jt,Nn,mn,ir,Sn,Bn,rr;try{Yt(!0),nt("");const ur=window.localStorage.getItem("hyperToken"),_r=window.localStorage.getItem("hyperAddress");if(!ur||!_r){C(!1),_();return}const Ln=await(await fetch(`${en}/api/hyper/new_farming_app/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:_r.toLowerCase(),token:ur})})).json();if(!(Ln!=null&&Ln.success)){if(console.warn("INFO API RESPONSE:",Ln==null?void 0:Ln.error_message),(Ln==null?void 0:Ln.error_message)==="You have not a running process"){const Kn=Q?Q.toLowerCase().replace("-","_"):null,Yr=L==null?void 0:L[Kn];if(Kn&&Yr){const os={...L,[Kn]:{...Yr,isStop:!0}};z(os);const Je=Object.keys(os).filter(bt=>bt.startsWith("pacifica"));if(Je.length>0&&!Q){const er=Je.sort((kr,Dr)=>{var Cr,ls;const Ur=parseInt(((Cr=kr.match(/\d+/))==null?void 0:Cr[0])||0,10),cr=parseInt(((ls=Dr.match(/\d+/))==null?void 0:ls[0])||0,10);return Ur-cr})[0].match(/\d+/);er&&ie(`Pacifica-${er[0]}`)}}else ie("Pacifica-1")}Ln!=null&&Ln.slots_info&&(U((jt=(it=Ln==null?void 0:Ln.slots_info)==null?void 0:it.pacifica)==null?void 0:jt.total_qty),R((mn=(Nn=Ln==null?void 0:Ln.slots_info)==null?void 0:Nn.pacifica)==null?void 0:mn.active_qty));return}if(Ln!=null&&Ln.success&&(Ln!=null&&Ln.data)){const Kn=Q?Q.toLowerCase().replace("-","_"):null,Yr=L==null?void 0:L[Kn],os=Ln.data||{};Kn&&!os[Kn]&&Yr&&(os[Kn]={...Yr,isStop:!0}),z(os);const Je=Object.keys(os).filter(bt=>bt.startsWith("pacifica"));if(Je.length>0&&!Q){const er=Je.sort((kr,Dr)=>{var Cr,ls;const Ur=parseInt(((Cr=kr.match(/\d+/))==null?void 0:Cr[0])||0,10),cr=parseInt(((ls=Dr.match(/\d+/))==null?void 0:ls[0])||0,10);return Ur-cr})[0].match(/\d+/);er&&ie(`Pacifica-${er[0]}`)}Ln!=null&&Ln.slots_info&&(U((Sn=(ir=Ln==null?void 0:Ln.slots_info)==null?void 0:ir.pacifica)==null?void 0:Sn.total_qty),R((rr=(Bn=Ln==null?void 0:Ln.slots_info)==null?void 0:Bn.pacifica)==null?void 0:rr.active_qty))}}catch{C(!1),_(),G("OFF")}finally{Yt(!1)}}const W=m.useMemo(()=>Q?Q.toLowerCase().replace("-","_"):"",[Q]),ee=!!((Ge=L==null?void 0:L[W])!=null&&Ge.delta)&&!!((At=L==null?void 0:L[W])!=null&&At.from_slot),ce=ee?`pacifica_${(Ot=L==null?void 0:L[W])==null?void 0:Ot.from_slot}`:W;m.useEffect(()=>{var Nn,mn,ir,Sn,Bn,rr,ur,_r,Un,Ln;if(!Q||!L)return;const it=ce,jt=L==null?void 0:L[it];if(!jt){te(""),je(""),Ke(""),Le(""),ht(""),Kt("LONG"),nn("LIMIT"),C(!1),G("OFF"),sn("Hour"),Xn("Limit"),Dt("Limit"),zn(""),on(""),K("pacifica");return}if((jt==null?void 0:jt.target_params)==null&&jt.source_params){jt!=null&&jt.isStop?C(!1):C(!0),G("OFF");const Kn=jt.source_params,Yr=(jt==null?void 0:jt.slot_number)??"";Yr&&!ee&&ie(`Pacifica-${Yr}`),Kn!=null&&Kn.cycleSeconds&&sn((Kn==null?void 0:Kn.cycleSeconds)===86400?"Day":"Hour"),Kn!=null&&Kn.tp_type&&Xn(String(Kn==null?void 0:Kn.tp_type).toUpperCase()==="MARKET"?"Market":"Limit"),Kn!=null&&Kn.sl_type&&Dt(String(Kn==null?void 0:Kn.sl_type).toUpperCase()==="MARKET"?"Market":"Limit");const os=(Kn==null?void 0:Kn.agent_pkey)??"",ds=(Kn==null?void 0:Kn.login_address)??"";if(os&&te(String(os)),ds&&je(String(ds)),Kn!=null&&Kn.coin){const Je=String(Kn.coin);Ke(Je)}(Kn==null?void 0:Kn.orderPerHour)!=null&&Le(String(Kn.orderPerHour)),(Kn==null?void 0:Kn.leverage)!=null&&ht(String(Kn.leverage)),Kn!=null&&Kn.direction&&Kt(String(Kn.direction).toUpperCase()==="SHORT"?"SHORT":String(Kn.direction).toUpperCase()==="RANDOM"?"RANDOM":"LONG"),Kn!=null&&Kn.orderType&&nn(String(Kn.orderType).toUpperCase()==="MARKET"?"MARKET":String(Kn.orderType).toUpperCase()==="LIMIT"?"LIMIT":"HYBRID"),(Kn==null?void 0:Kn.tp)!=null&&zn(String(Kn.tp)),(Kn==null?void 0:Kn.sl)!=null&&on(String(Kn.sl))}else if((jt==null?void 0:jt.target_params)!==null){jt!=null&&jt.isStop?C(!1):C(!0),G("OFF");const Kn=(jt==null?void 0:jt.slot_number)??"";Kn&&!ee&&ie(`Pacifica-${Kn}`),(Nn=jt==null?void 0:jt.source_params)!=null&&Nn.coin&&Ke(String((mn=jt==null?void 0:jt.source_params)==null?void 0:mn.coin)),((ir=jt==null?void 0:jt.source_params)==null?void 0:ir.orderPerHour)!=null&&Le(String((Sn=jt==null?void 0:jt.source_params)==null?void 0:Sn.orderPerHour)),((Bn=jt==null?void 0:jt.source_params)==null?void 0:Bn.leverage)!=null&&ht(String((rr=jt==null?void 0:jt.source_params)==null?void 0:rr.leverage)),(ur=jt==null?void 0:jt.source_params)!=null&&ur.accountType&&setStatusType(((_r=jt==null?void 0:jt.source_params)==null?void 0:_r.accountType)==="standart"?"STANDARD":"PREMIUM"),(Un=jt==null?void 0:jt.target_params)!=null&&Un.accountType&&setStatusTypeTwo(((Ln=jt==null?void 0:jt.target_params)==null?void 0:Ln.accountType)==="standart"?"STANDARD":"PREMIUM"),jt!=null&&jt.target_app&&K(((jt==null?void 0:jt.target_app)==="pacifica","pacifica"))}else C(!1),G("OFF")},[Q,L,ee,ce]);const ue=it=>{var jt;return Number(((jt=String(it||"").match(/\d+/))==null?void 0:jt[0])||0)},ge=it=>(it||"").toLowerCase().replace("-","_"),Se=m.useMemo(()=>{const it=L==null?void 0:L[ge(Q)];if(it!=null&&it.delta&&(it!=null&&it.from_slot))return Number(it.from_slot);const jt=Number(it==null?void 0:it.slot_number);return Number.isFinite(jt)?jt:ue(Q)},[Q,L]),ke=m.useMemo(()=>{const it=Number(N)||0,jt=Array.from({length:it},()=>({used:!1,kind:null})),Nn=L||{};for(const[mn,ir]of Object.entries(Nn)){if(!mn.startsWith("pacifica"))continue;const Sn=ue(mn)-1;Sn<0||Sn>=it||((ir==null?void 0:ir.isStop)===!0?jt[Sn]={used:!1,kind:null}:ir!=null&&ir.source_params?jt[Sn]={used:!0,kind:"delta-src"}:ir!=null&&ir.target_params||ir!=null&&ir.delta?jt[Sn]={used:!0,kind:"delta-shadow"}:ir!=null&&ir.farming_params?jt[Sn]={used:!0,kind:"single"}:jt[Sn]={used:!0,kind:"unknown"})}return jt},[L,N]),Me=m.useMemo(()=>ke.map((it,jt)=>it.used&&it.kind!=="delta-src-inferred"?`Pacifica-${jt+1}`:null).filter(Boolean),[ke]);m.useMemo(()=>ke.filter(it=>!it.used).length,[ke]);async function qe(){if(!g){n(!0);return}if(h)try{ot(!0),nt("");const it=window.localStorage.getItem("hyperToken"),jt=window.localStorage.getItem("hyperAddress");if(!it||!jt){n(!0);return}const Nn={login_address:ye,agent_pkey:V,cycleSeconds:Jt==="Hour"?3600:86400,tp_type:Et.toUpperCase(),sl_type:gn.toUpperCase(),tp:Number(cn),sl:Number(Xt),coin:`${Xe}`,orderPerHour:Number(tt),leverage:Number($e),direction:pt,orderType:wt},mn={api_pkey:ae,login_wallet:Pe,coin:Xe==null?void 0:Xe.replace("USDT",""),orderPerHour:Number(tt),leverage:Number($e)},ir={address:jt.toLowerCase(),token:it,slot_number:Number(Q==null?void 0:Q.replace("Pacifica-","")),source_app:"pacifica",source_params:Nn},Bn=await(await fetch(`${en}/api/hyper/farming_app/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ir)})).json();Bn!=null&&Bn.success?(C(!0),B(),Pt&&k()):nt((Bn==null?void 0:Bn.error_message)||"Start failed.")}catch(it){nt(it.message||"An error occurred while saving.")}finally{ot(!1)}}async function Fe(){if(!g){n(!0);return}try{_t(!0),nt("");const it=window.localStorage.getItem("hyperToken"),jt=window.localStorage.getItem("hyperAddress");if(!it||!jt){n(!0);return}const mn=await(await fetch(`${en}/api/hyper/farming_app/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:jt.toLowerCase(),token:it,source_app:"pacifica",slot_number:Se})})).json();mn!=null&&mn.success?(C(!1),B()):nt((mn==null?void 0:mn.error_message)||"Stop failed.")}catch(it){nt(it.message||"An error occurred while stopping.")}finally{_t(!1)}}const at={control:(it,jt)=>({...it,backgroundColor:"#242424",borderColor:jt.isFocused?"#67FFBD":"#353535",minHeight:32,height:32,boxShadow:"none",cursor:"pointer",alignItems:"center"}),valueContainer:it=>({...it,height:32,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:it=>({...it,height:32}),input:it=>({...it,color:"#FFFFFF",margin:0,padding:0}),singleValue:it=>({...it,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:it=>({...it,color:"#7F7F7F",fontSize:"12px"}),menu:it=>({...it,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:it=>({...it,paddingTop:0,paddingBottom:0,maxHeight:200}),option:(it,jt)=>({...it,backgroundColor:jt.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:32,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:it=>({...it,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:it=>({...it,backgroundColor:"#353535"})},se=({max:it})=>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:[it,"x"]}),Ce=it=>{var jt;return i.jsx(Ca.Option,{...it,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[(jt=it.data)!=null&&jt.icon?i.jsx("img",{src:it.data.icon,alt:it.data.label,className:"w-4 h-4 rounded-[4px]",onError:Nn=>Nn.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:it.data.label}),i.jsx(se,{max:it.data.maxLeverage})]})})},Ue=it=>{var jt;return i.jsx(Ca.SingleValue,{...it,children:i.jsxs("div",{className:"flex items-center gap-2",children:[(jt=it.data)!=null&&jt.icon?i.jsx("img",{src:it.data.icon,alt:it.data.label,className:"w-4 h-4 rounded-[4px]",onError:Nn=>Nn.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:it.data.label}),i.jsx(se,{max:it.data.maxLeverage})]})})},Be=it=>{const jt=Me.includes(it.data.value);return i.jsx(Ca.Option,{...it,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[i.jsx("span",{className:"text-white text-[13px]",children:it.data.label}),jt&&i.jsx("span",{className:"ml-auto w-2 h-2 rounded-full bg-[#67FFBD]",title:"Active"})]})})},_e=it=>i.jsx(Ca.SingleValue,{...it,children:i.jsx("div",{className:"flex items-center gap-2 px-3",children:i.jsx("span",{className:"text-white text-[13px]",children:it.data.label})})}),rt=async()=>{var Nn,mn,ir,Sn,Bn,rr,ur,_r;const it=window.localStorage.getItem("hyperToken"),jt=window.localStorage.getItem("hyperAddress");if(!(!it||!jt))try{Ft(!0);const Un=await _i(jt.toLowerCase(),it);Un!=null&&Un.success?(r(Un==null?void 0:Un.telegram_chat_id),s(Un==null?void 0:Un.subscriber_role),a(Un==null?void 0:Un.subs_expire_day),o((Nn=Un==null?void 0:Un.mushboomer_counts)==null?void 0:Nn.eth),l((mn=Un==null?void 0:Un.mushboomer_counts)==null?void 0:mn.sol),c(Un==null?void 0:Un.referral_code),u(Un==null?void 0:Un.refcode),d(Un==null?void 0:Un.whitelist),f(it),x(jt),Oe(!0),P((Sn=(ir=Un==null?void 0:Un.slots_info)==null?void 0:ir.pacifica)==null?void 0:Sn.total_qty),U((rr=(Bn=Un==null?void 0:Un.slots_info)==null?void 0:Bn.pacifica)==null?void 0:rr.total_qty),R((_r=(ur=Un==null?void 0:Un.slots_info)==null?void 0:ur.pacifica)==null?void 0:_r.active_qty),Ft(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),f(""),x(""),Ft(!1))}catch(Un){console.error("Token verification error:",Un),console.error(Un.message||"An unknown error occurred."),Ft(!1)}},ct=ut,yt=m.useMemo(()=>Array.from({length:N},(it,jt)=>({value:`Pacifica-${jt+1}`,label:`Pacifica-${jt+1}`})),[N]);if(!e)return null;const Lt=dn||Bt||De||Ze,ft=w&&!De,Tt=Qn(Xe);return i.jsxs(i.Fragment,{children:[i.jsx(vd,{open:Gn,setOpen:Rn,transactionHash:Yn,transactionLoading:yn,paymentPresaleRole:rn,errorFunds:mt,activeMethod:2}),i.jsx(m5,{open:re,setOpen:he,paymentLighterRole:rn,oldSlotCount:X,checkAccountLighter:rt,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:()=>!Lt&&t(!1)}),i.jsxs("div",{className:"relative flex items-start gap-4 px-3 w-full max-w-[1000px]",children:[i.jsx(f2,{current:"pacifica",onCloseCurrent:()=>!Lt&&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:l5,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:[ze&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:ze}),g&&rn&&O===I&&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&&rn&&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(s5,{className:"w-3 h-3 text-[#67FFBD] fill-[#67FFBD]"}),i.jsxs("span",{className:"text-[#67FFBD] font-medium",children:[I||0,"/",yt.length]})]})]}),i.jsx(Nl,{styles:at,components:{Option:Be,SingleValue:_e},options:yt,value:yt.find(it=>it.value===Q)||null,onChange:it=>ie((it==null?void 0:it.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:ye,onChange:it=>je(it.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] ${ye===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Lt||ft})})]}),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:it=>te(it.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY",type:an?"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:Lt||ft}),i.jsx("button",{type:"button",onClick:()=>xn(it=>!it),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:Lt||ft,children:an?i.jsx(ca,{size:14}):i.jsx(ua,{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:Ne,onChange:it=>{const jt=it.target.value.trim();if(jt==="")return me("");Gt(jt)&&me(jt)},onKeyDown:ar,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] ${Ne===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Lt||ft})})]})]}):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:ye,onChange:it=>je(it.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] ${ye===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Lt||ft})})]}),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:it=>te(it.target.value),autoComplete:"off",placeholder:"PACIFICA_PRIVATE_KEY",type:an?"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]":Rt?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Lt||ft}),i.jsx("button",{type:"button",onClick:()=>xn(it=>!it),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:Lt||ft,children:an?i.jsx(ca,{size:14}):i.jsx(ua,{size:14})})]}),V!==""&&!Rt&&i.jsx("div",{className:"text-[#FF797C] text-[11px]",children:"Please enter a valid private key."})]})]}),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:Pe,onChange:it=>Re(it.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] ${Pe===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Lt||ft})})]}),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:it=>fe(it.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY_2",type:An?"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:Lt||ft}),i.jsx("button",{type:"button",onClick:()=>kn(it=>!it),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:Lt||ft,children:An?i.jsx(ca,{size:14}):i.jsx(ua,{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:we,onChange:it=>{const jt=it.target.value.trim();if(jt==="")return xe("");Gt(jt)&&xe(jt)},onKeyDown:ar,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] ${we===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Lt||ft})})]})]})]}),V!==""&&!Rt&&i.jsx("div",{children:i.jsx("img",{src:Byt,alt:"",className:"mt-4 rounded-md w-full"})}),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:tt,onChange:it=>{const jt=it.target.value.trim();if(jt==="")return Le("");Gt(jt)&&Le(jt)},onKeyDown:ar,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] ${tt===""?"border-[#353535]":$n?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Lt||ft}),tt!==""&&!$n&&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(Nl,{styles:at,components:{Option:Ce,SingleValue:Ue},isDisabled:Lt||ft,options:ct,value:ct.find(it=>it.value===Xe)||null,onChange:it=>Ke((it==null?void 0:it.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:Jt,onChange:it=>sn(it.target.value),className:`${Lt||ft?"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:Lt||ft,children:[i.jsx("option",{value:"Hour",children:"Hour"}),i.jsx("option",{value:"Day",children:"Day"})]})]}),i.jsx("input",{value:tt,onChange:it=>{const jt=it.target.value.trim();if(jt==="")return Le("");Gt(jt)&&Le(jt)},onKeyDown:ar,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] ${tt===""?"border-[#353535]":$n?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Lt||ft}),tt!==""&&!$n&&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(_o,{checked:oe==="ON",onChange:it=>G(it?"ON":"OFF"),disabled:Lt||ft,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 ${Lt||ft?"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:$e,onChange:it=>{const jt=it.target.value.trim();if(jt==="")return ht("");Gt(jt)&&ht(jt)},onKeyDown:ar,inputMode:"numeric",autoComplete:"off",placeholder:Xe?`1–${Tt}x`:"e.g. 3",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${$e===""?"border-[#353535]":nr?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Lt||ft})]})]}),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":pt==="LONG",onClick:()=>!ft&&Kt("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",Lt||ft?"cursor-not-allowed":"cursor-pointer",pt==="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",$e?` - ${$e}x`:""]})}),i.jsx("div",{"aria-pressed":pt==="SHORT",onClick:()=>!ft&&Kt("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",Lt||ft?"cursor-not-allowed":"cursor-pointer",pt==="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",$e?` - ${$e}x`:""]})}),i.jsx("div",{"aria-pressed":pt==="RANDOM",onClick:()=>!ft&&Kt("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",Lt||ft?"cursor-not-allowed":"cursor-pointer",pt==="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",$e?` - ${$e}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":wt==="LIMIT",onClick:()=>!ft&&nn("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",Lt||ft?"cursor-not-allowed":"cursor-pointer",wt==="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 ",wt==="LIMIT"?" ✓":""]})}),i.jsx("button",{"aria-pressed":wt==="HYBRID",onClick:()=>!ft&&nn("HYBRID"),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",Lt||ft?"cursor-not-allowed":"cursor-pointer",wt==="HYBRID"?"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:["HYBRID ",wt==="HYBRID"?" ✓":""]})}),i.jsx("button",{"aria-pressed":wt==="MARKET",onClick:()=>!ft&&nn("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",Lt||ft?"cursor-not-allowed":"cursor-pointer",wt==="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 ",wt==="MARKET"?" ✓":""]})})]})]})]}),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-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:"Take Profit %"}),i.jsxs("select",{value:Et,onChange:it=>Xn(it.target.value),className:`${Lt||ft?"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:Lt||ft,children:[i.jsx("option",{value:"Limit",children:"Limit"}),i.jsx("option",{value:"Market",children:"Market"})]})]}),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:it=>{const jt=it.target.value.trim();if(jt==="")return zn("");hr(jt)&&zn(jt)},onKeyDown:ar,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]":En?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Lt||ft})]}),cn!==""&&!En&&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-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:"Stop Loss %"}),i.jsxs("select",{value:gn,onChange:it=>Dt(it.target.value),className:`${Lt||ft?"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:Lt||ft,children:[i.jsx("option",{value:"Limit",children:"Limit"}),i.jsx("option",{value:"Market",children:"Market"})]})]}),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:it=>{const jt=it.target.value.trim();if(jt==="")return on("");hr(jt)&&on(jt)},onKeyDown:ar,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]":Ee?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Lt||ft})]}),Xt!==""&&!Ee&&i.jsxs("div",{className:"text-[#FF797C] text-[11px]",children:["Value must be 0, or between 1 and"," ",$e?Math.max($e*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:()=>!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] hover:border-white disabled:opacity-60",disabled:Lt,children:"Cancel"}),g?oe==="ON"?w?i.jsx("button",{onClick:Fe,disabled:Lt,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:De?"Stopping...":"Stop"}):i.jsx("button",{onClick:qe,disabled:!h||Lt,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!h||Lt?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:Bt?"Starting...":"Start"}):w?i.jsx("button",{onClick:Fe,disabled:Lt,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:De?"Stopping...":"Stop"}):i.jsx("button",{onClick:qe,disabled:!h||Lt,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!h||Lt?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:Bt?"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"})]})}),dn&&i.jsx("div",{className:"absolute inset-0 rounded-3xl bg-black/40 flex items-center justify-center text-sm",children:"Loading..."})]})]})]})]})]})},ZTt=()=>{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),P=(I=[])=>I==null?void 0:I.map(R=>R.submenu?{...R,submenu:P(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(ml,{to:"https://dextrabot.com/",className:"cursor-pointer",children:i.jsx("div",{className:"flex items-center gap-2 font-manrope",children:i.jsx("img",{src:_A,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:cit.map(I=>I.type==="link"?i.jsx(QTt,{linkTo:I.to,title:I.label},I.to):I.type==="dropdown"?i.jsx(lit,{label:I.label,items:P(I.items),activePaths:I.activePaths,badgeLabel:I.badgeLabel,badgeTone:I.badgeTone},I.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(w$,{open:x,setOpen:g}),i.jsx(Woe,{open:v,setOpen:w}),i.jsx(qoe,{open:C,setOpen:N})]})},_y=({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"})]}),hm=(e,t=null)=>{t&&e.target.src===t?e.target.src=IH:t&&e.target.src!==t?e.target.src=t:e.target.src!==IH&&(e.target.src=IH)},JTt=m.forwardRef(({setOpen:e},t)=>{const{searchTerminalCoin:n,isSearchTerminalError:r}=m.useContext(Qr),[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(P=>(P==null?void 0:P.toLowerCase())!==C)];N.length>12&&N.pop(),l(N),localStorage.setItem("recentWallets",JSON.stringify(N)),window.open(`/wallet-details/${s}`,"_blank"),e(!1)}else tn.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(P=>Array.isArray(P)&&P.some(I=>{var R;return(R=I==null?void 0:I.toLowerCase())==null?void 0:R.includes(C)})).map(P=>P[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(_y,{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:$a,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 P=JSON.parse(localStorage.getItem("recentCoins")||"[]");P!=null&&P.includes(C)||(P.unshift(C),P.length>14&&P.pop(),localStorage.setItem("recentCoins",JSON.stringify(P)))},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:P=>hm(P)}),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:P=>hm(P)}),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:Wbt,alt:"",className:"w-4 h-4"}),C&&C.slice(0,6)+"..."+C.slice(-4)]})})})},N))})]})]})}),eIt=({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(Ea,{open:e,onClose:t,className:"relative z-50",children:[i.jsx(ja,{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(ga,{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(JTt,{ref:n,setOpen:t})})})})})]})},oMe=()=>{const[e,t]=m.useState(!1);return i.jsxs(i.Fragment,{children:[i.jsx(eIt,{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(_y,{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"',tIt={rounded:`SFRounded, ui-rounded, "SF Pro Rounded", ${Gge}`,system:Gge},I7={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"}},nIt={large:{modalOverlay:"blur(20px)"},none:{modalOverlay:"blur(0px)"},small:{modalOverlay:"blur(4px)"}},lMe=({borderRadius:e="large",fontStack:t="rounded",overlayBlur:n="none"})=>({blurs:{modalOverlay:nIt[n].modalOverlay},fonts:{body:tIt[t]},radii:{actionButton:I7[e].actionButton,connectButton:I7[e].connectButton,menuButton:I7[e].connectButton,modal:I7[e].modal,modalMobile:I7[e].modalMobile}}),cMe={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=cMe.blue,uMe=({accentColor:e=Kge.accentColor,accentColorForeground:t=Kge.accentColorForeground,...n}={})=>({...lMe(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)"}});uMe.accentColors=cMe;var gO="#1A1B1F",dMe={blue:{accentColor:"#3898FF",accentColorForeground:"#FFF"},green:{accentColor:"#4BD166",accentColorForeground:gO},orange:{accentColor:"#FF983D",accentColorForeground:gO},pink:{accentColor:"#FF7AB8",accentColorForeground:gO},purple:{accentColor:"#7A70FF",accentColorForeground:"#FFF"},red:{accentColor:"#FF6257",accentColorForeground:"#FFF"}},Yge=dMe.blue,fMe=({accentColor:e=Yge.accentColor,accentColorForeground:t=Yge.accentColorForeground,...n}={})=>({...lMe(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:gO,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)"}});fMe.accentColors=dMe;var Hee=`{
  "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 rIt(e,t){return Object.defineProperty(e,"__recipe__",{value:t,writable:!1}),e}var hMe=rIt;function pMe(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 hMe(n,{importPath:"@vanilla-extract/sprinkles/createUtils",importName:"createNormalizeValueFn",args:[{conditions:e.conditions}]})}function sIt(e){var{conditions:t}=e;if(!t)throw new Error("Styles have no conditions");var n=pMe(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 hMe(r,{importPath:"@vanilla-extract/sprinkles/createUtils",importName:"createMapValueFn",args:[{conditions:e.conditions}]})}function iIt(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 aIt(e){var t=iIt(e,"string");return typeof t=="symbol"?t:String(t)}function oIt(e,t,n){return t=aIt(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 EV(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){oIt(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 lIt=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=EV({},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?EV(EV({},d),f):c,P=function(){var O=N[I],U=s[I];try{if(U.mappings)return 1;if(typeof O=="string"||typeof O=="number")u.push(U.values[O].defaultClass);else if(Array.isArray(O))for(var L=0;L<O.length;L++){var z=O[L];if(z!=null){var X=U.responsiveArray[L];u.push(U.values[z].conditions[X])}}else for(var ne in O){var J=O[ne];J!=null&&u.push(U.values[J].conditions[ne])}}catch(K){throw K}};for(var I in N)P();return e(u.join(" "))};return Object.assign(l,{properties:new Set(a)})},cIt=e=>e,uIt=function(){return lIt(cIt)(...arguments)};function mMe(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=mMe(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function xMe(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=mMe(e))&&(r&&(r+=" "),r+=t);return r}var dIt="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 fIt(e){let t=0;function n(){return e[t++]<<8|e[t++]}let r=n(),s=1,a=[0,1];for(let O=1;O<r;O++)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 O=0;O<f;O++)C=C<<1|d();let N=[],P=0,I=x;for(;;){let O=Math.floor(((C-P+1)*s-1)/I),U=0,L=r;for(;L-U>1;){let ne=U+L>>>1;O<a[ne]?L=ne:U=ne}if(U==0)break;N.push(U);let z=P+Math.floor(I*a[U]/s),X=P+Math.floor(I*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;P=z,I=1+X-z}let R=r-4;return N.map(O=>{switch(O-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 O-1}})}function hIt(e){let t=0;return()=>e[t++]}function gMe(e){return hIt(fIt(pIt(e)))}function pIt(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 mIt(e){return e&1?~e>>1:e>>1}function xIt(e,t){let n=Array(e);for(let r=0,s=0;r<e;r++)n[r]=s+=mIt(t());return n}function KE(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 bMe(e){return YE(()=>{let t=KE(e);if(t.length)return t})}function yMe(e){let t=[];for(;;){let n=e();if(n==0)break;t.push(gIt(n,e))}for(;;){let n=e()-1;if(n<0)break;t.push(bIt(n,e))}return t.flat()}function YE(e){let t=[];for(;;){let n=e(t.length);if(!n)break;t.push(n)}return t}function vMe(e,t,n){let r=Array(e).fill().map(()=>[]);for(let s=0;s<t;s++)xIt(e,n).forEach((a,o)=>r[o].push(a));return r}function gIt(e,t){let n=1+t(),r=t(),s=YE(t);return vMe(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 bIt(e,t){let n=1+t();return vMe(n,1+e,t).map(s=>[s[0],s.slice(1)])}function yIt(e){let t=[],n=KE(e);return s(r([]),[]),t;function r(a){let o=e(),l=YE(()=>{let c=KE(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 vIt(e){return e.toString(16).toUpperCase().padStart(2,"0")}function wMe(e){return`{${vIt(e)}}`}function wIt(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 mN(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 CIt(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 SIt="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 XE=44032,kR=4352,TR=4449,IR=4519,CMe=19,SMe=21,xN=28,PR=SMe*xN,NIt=CMe*PR,AIt=XE+NIt,jIt=kR+CMe,EIt=TR+SMe,_It=IR+xN;function Nj(e){return e>>24&255}function NMe(e){return e&16777215}let Vee,Jge,Wee,bO;function kIt(){let e=gMe(SIt);Vee=new Map(bMe(e).flatMap((t,n)=>t.map(r=>[r,n+1<<24]))),Jge=new Set(KE(e)),Wee=new Map,bO=new Map;for(let[t,n]of yMe(e)){if(!Jge.has(t)&&n.length==2){let[r,s]=n,a=bO.get(r);a||(a=new Map,bO.set(r,a)),a.set(s,t)}Wee.set(t,n.reverse())}}function AMe(e){return e>=XE&&e<AIt}function TIt(e,t){if(e>=kR&&e<jIt&&t>=TR&&t<EIt)return XE+(e-kR)*PR+(t-TR)*xN;if(AMe(e)&&t>IR&&t<_It&&(e-XE)%xN==0)return e+(t-IR);{let n=bO.get(e);return n&&(n=n.get(t),n)?n:-1}}function jMe(e){Vee||kIt();let t=[],n=[],r=!1;function s(a){let o=Vee.get(a);o&&(r=!0,a|=o),t.push(a)}for(let a of e)for(;;){if(a<128)t.push(a);else if(AMe(a)){let o=a-XE,l=o/PR|0,c=o%PR/xN|0,u=o%xN;s(kR+l),s(TR+c),u>0&&s(IR+u)}else{let o=Wee.get(a);o?n.push(...o):s(a)}if(!n.length)break;a=n.pop()}if(r&&t.length>1){let a=Nj(t[0]);for(let o=1;o<t.length;o++){let l=Nj(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=Nj(t[--c]),a<=l))break}a=Nj(t[o])}}return t}function IIt(e){let t=[],n=[],r=-1,s=0;for(let a of e){let o=Nj(a),l=NMe(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=TIt(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 EMe(e){return jMe(e).map(NMe)}function PIt(e){return IIt(jMe(e))}const e1e=45,_Me=".",kMe=65039,TMe=1,FR=e=>Array.from(e);function QE(e,t){return e.P.has(t)||e.Q.has(t)}class FIt extends Array{get is_emoji(){return!0}}let qee,IMe,tw,Gee,PMe,d4,_V,jC,_v,t1e,Kee;function Goe(){if(qee)return;let e=gMe(dIt);const t=()=>KE(e),n=()=>new Set(t()),r=(d,f)=>f.forEach(x=>d.add(x));qee=new Map(yMe(e)),IMe=n(),tw=t(),Gee=new Set(t().map(d=>tw[d])),tw=new Set(tw),PMe=n(),n();let s=bMe(e),a=e();const o=()=>{let d=new Set;return t().forEach(f=>r(d,s[f])),r(d,t()),d};d4=YE(d=>{let f=YE(e).map(x=>x+96);if(f.length){let x=d>=a;f[0]-=32,f=mN(f),x&&(f=`Restricted[${f}]`);let g=o(),v=o(),w=!e();return{N:f,P:g,Q:v,M:w,R:x}}}),_V=n(),jC=new Map;let l=t().concat(FR(_V)).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),_V.has(d)||jC.set(d,g)});for(let{V:d,M:f}of new Set(jC.values())){let x=[];for(let v of d){let w=d4.filter(N=>QE(N,v)),C=x.find(({G:N})=>w.some(P=>N.has(P)));C||(C={G:new Set,V:[]},x.push(C)),C.V.push(v),r(C.G,w)}let g=x.flatMap(v=>FR(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)}}_v=new Set;let c=new Set;const u=d=>_v.has(d)?c.add(d):_v.add(d);for(let d of d4){for(let f of d.P)u(f);for(let f of d.Q)u(f)}for(let d of _v)!jC.has(d)&&!c.has(d)&&jC.set(d,TMe);r(_v,EMe(_v)),t1e=yIt(e).map(d=>FIt.from(d)).sort(CIt),Kee=new Map;for(let d of t1e){let f=[Kee];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===kMe?f.push(...g):f=g}for(let x of f)x.V=d}}function Koe(e){return(FMe(e)?"":`${Yoe(C$([e]))} `)+wMe(e)}function Yoe(e){return`"${e}"‎`}function OIt(e){if(e.length>=4&&e[2]==e1e&&e[3]==e1e)throw new Error(`invalid label extension: "${mN(e.slice(0,4))}"`)}function MIt(e){for(let n=e.lastIndexOf(95);n>0;)if(e[--n]!==95)throw new Error("underscore allowed only at start")}function RIt(e){let t=e[0],n=Qge.get(t);if(n)throw t9(`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 t9(`${n} + ${o}`);s=a+1,n=o}}if(s==r)throw t9(`trailing ${n}`)}function C$(e,t=1/0,n=wMe){let r=[];LIt(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];FMe(l)&&(r.push(mN(e.slice(s,o))),r.push(n(l)),s=o+1)}return r.push(mN(e.slice(s,a))),r.join("")}function LIt(e,t){return Goe(),tw.has(e)}function FMe(e){return Goe(),PMe.has(e)}function DIt(e){return zIt(BIt(e,PIt,WIt))}function BIt(e,t,n){if(!e)return[];Goe();let r=0;return e.split(_Me).map(s=>{let a=wIt(s),o={input:a,offset:r};r+=a.length+1;try{let l=o.tokens=VIt(a,t,n),c=l.length,u;if(!c)throw new Error("empty label");let d=o.output=l.flat();if(MIt(d),!(o.emoji=c>1||l[0].is_emoji)&&d.every(x=>x<128))OIt(d),u="ASCII";else{let x=l.flatMap(g=>g.is_emoji?[]:g);if(!x.length)u="Emoji";else{if(tw.has(d[0]))throw t9("leading combining mark");for(let w=1;w<c;w++){let C=l[w];if(!C.is_emoji&&tw.has(C[0]))throw t9(`emoji + combining mark: "${mN(l[w-1])} + ${C$([C[0]])}"`)}RIt(d);let g=FR(new Set(x)),[v]=UIt(g);HIt(v,x),$It(v,g),u=v.N}}o.type=u}catch(l){o.error=l}return o})}function $It(e,t){let n,r=[];for(let s of t){let a=jC.get(s);if(a===TMe)return;if(a){let o=a.M.get(s);if(n=n?n.filter(l=>o.has(l)):FR(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 UIt(e){let t=d4;for(let n of e){let r=t.filter(s=>QE(s,n));if(!r.length)throw d4.some(s=>QE(s,n))?MMe(t[0],n):OMe(n);if(t=r,r.length==1)break}return t}function zIt(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(C$(t,63))}: ${s}`)}return mN(r)}).join(_Me)}function OMe(e){return new Error(`disallowed character: ${Koe(e)}`)}function MMe(e,t){let n=Koe(t),r=d4.find(s=>s.P.has(t));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${e.N} + ${n}`)}function t9(e){return new Error(`illegal placement: ${e}`)}function HIt(e,t){for(let n of t)if(!QE(e,n))throw MMe(e,n);if(e.M){let n=EMe(t);for(let r=1,s=n.length;r<s;r++)if(Gee.has(n[r])){let a=r+1;for(let o;a<s&&Gee.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(C$(n.slice(r-1,a)))} (${a-r}/${Zge})`);r=a}}}function VIt(e,t,n){let r=[],s=[];for(e=e.slice().reverse();e.length;){let a=qIt(e);if(a)s.length&&(r.push(t(s)),s=[]),r.push(n(a));else{let o=e.pop();if(_v.has(o))s.push(o);else{let l=qee.get(o);if(l)s.push(...l);else if(!IMe.has(o))throw OMe(o)}}}return s.length&&r.push(t(s)),r}function WIt(e){return e.filter(t=>t!=kMe)}function qIt(e,t){let n=Kee,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 GIt(e){return DIt(e)}function KIt(e){return GIt(e)}const YIt={gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},XIt={block:Lut({format(e){var n;return{transactions:(n=e.transactions)==null?void 0:n.map(r=>{if(typeof r=="string")return r;const s=iB(r);return s.typeHex==="0x7e"&&(s.isSystemTx=r.isSystemTx,s.mint=r.mint?sd(r.mint):void 0,s.sourceHash=r.sourceHash,s.type="deposit"),s}),stateRoot:e.stateRoot}}}),transaction:Mut({format(e){const t={};return e.type==="0x7e"&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?sd(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:aht({format(e){return{l1GasPrice:e.l1GasPrice?sd(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?sd(e.l1GasUsed):null,l1Fee:e.l1Fee?sd(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null}}})};function QIt(e,t){return ePt(e)?JIt(e):Gpt(e,t)}const ZIt={transaction:QIt};function JIt(e){tPt(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?ui(o):"0x",c?ui(c):"0x",s?ui(s):"0x",a?"0x1":"0x",n??"0x"];return Nm(["0x7e",By(u)])}function ePt(e){return e.type==="deposit"||typeof e.sourceHash<"u"}function tPt(e){const{from:t,to:n}=e;if(t&&!ic(t))throw new xd({address:t});if(n&&!ic(n))throw new xd({address:n})}const n1e={contracts:YIt,formatters:XIt,serializers:ZIt},r1e=hB({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}}}),ZE=hB({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}}}),P7=1,s1e=hB({...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:{[P7]:{address:"0xe5965Ab5962eDc7477C8520243A95517CD252fA9"}},l2OutputOracle:{[P7]:{address:"0xdfe97868233d1aa22e815a266982f2cf17685a27"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263},portal:{[P7]:{address:"0xbEb5Fc579115071764c7423A4f12eDde41f106Ed"}},l1StandardBridge:{[P7]:{address:"0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1"}}},sourceId:P7}),i1e=hB({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 Ob=function(){return Ob=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},Ob.apply(this,arguments)};function nPt(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 rPt(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 n9="right-scroll-bar-position",r9="width-before-scroll-bar",sPt="with-scroll-bars-hidden",iPt="--removed-body-scroll-bar-size";function kV(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function aPt(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 oPt=typeof window<"u"?m.useLayoutEffect:m.useEffect,a1e=new WeakMap;function RMe(e,t){var n=aPt(null,function(r){return e.forEach(function(s){return kV(s,r)})});return oPt(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)||kV(l,null)}),a.forEach(function(l){s.has(l)||kV(l,o)})}a1e.set(n,e)},[e]),n}var Yee=function(e,t){return Yee=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])},Yee(e,t)};function LMe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Yee(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var gN=function(){return gN=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},gN.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 DMe(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 BMe(e,t){return function(n,r){t(n,r,e)}}function $Me(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 UMe(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 zMe(e){return typeof e=="symbol"?e:"".concat(e)}function HMe(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 VMe(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function WMe(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 qMe(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 S$=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 GMe(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&S$(t,e,n)}function OR(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 KMe(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Qoe(arguments[t]));return e}function YMe(){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 XMe(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 bN(e){return this instanceof bN?(this.v=e,this):new bN(e)}function QMe(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 bN?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 ZMe(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:bN(e[s](o)),done:!1}:a?a(o):o}:a}}function JMe(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 OR=="function"?OR(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 eRe(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var lPt=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function tRe(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)&&S$(t,e,n);return lPt(t,e),t}function nRe(e){return e&&e.__esModule?e:{default:e}}function rRe(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 sRe(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 iRe(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 aRe(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 cPt=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 oRe(e){function t(a){e.error=e.hasError?new cPt(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 lRe(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 uPt={__extends:LMe,__assign:gN,__rest:Xoe,__decorate:DMe,__param:BMe,__esDecorate:$Me,__runInitializers:UMe,__propKey:zMe,__setFunctionName:HMe,__metadata:VMe,__awaiter:WMe,__generator:qMe,__createBinding:S$,__exportStar:GMe,__values:OR,__read:Qoe,__spread:KMe,__spreadArrays:YMe,__spreadArray:XMe,__await:bN,__asyncGenerator:QMe,__asyncDelegator:ZMe,__asyncValues:JMe,__makeTemplateObject:eRe,__importStar:tRe,__importDefault:nRe,__classPrivateFieldGet:rRe,__classPrivateFieldSet:sRe,__classPrivateFieldIn:iRe,__addDisposableResource:aRe,__disposeResources:oRe,__rewriteRelativeImportExtension:lRe},yvn=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:aRe,get __assign(){return gN},__asyncDelegator:ZMe,__asyncGenerator:QMe,__asyncValues:JMe,__await:bN,__awaiter:WMe,__classPrivateFieldGet:rRe,__classPrivateFieldIn:iRe,__classPrivateFieldSet:sRe,__createBinding:S$,__decorate:DMe,__disposeResources:oRe,__esDecorate:$Me,__exportStar:GMe,__extends:LMe,__generator:qMe,__importDefault:nRe,__importStar:tRe,__makeTemplateObject:eRe,__metadata:VMe,__param:BMe,__propKey:zMe,__read:Qoe,__rest:Xoe,__rewriteRelativeImportExtension:lRe,__runInitializers:UMe,__setFunctionName:HMe,__spread:KMe,__spreadArray:XMe,__spreadArrays:YMe,__values:OR,default:uPt},Symbol.toStringTag,{value:"Module"}));function dPt(e){return e}function fPt(e,t){t===void 0&&(t=dPt);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 cRe(e){e===void 0&&(e={});var t=fPt(null);return t.options=gN({async:!0,ssr:!1},e),t}var uRe=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,gN({},n))};uRe.isSideCarExport=!0;function dRe(e,t){return e.useMedium(t),uRe}var fRe=cRe(),TV=function(){},N$=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:TV,onWheelCapture:TV,onTouchMoveCapture:TV}),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,P=e.gapMode,I=nPt(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=x,O=RMe([n,t]),U=Ob(Ob({},I),s);return m.createElement(m.Fragment,null,d&&m.createElement(R,{sideCar:fRe,removeScrollBar:u,shards:f,noIsolation:g,inert:v,setCallbacks:a,allowPinchZoom:!!w,lockRef:n,gapMode:P}),o?m.cloneElement(m.Children.only(l),Ob(Ob({},U),{ref:O})):m.createElement(N,Ob({},U,{className:c,ref:O}),l))});N$.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};N$.classNames={fullWidth:r9,zeroRight:n9};var hPt=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function pPt(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=hPt();return t&&e.setAttribute("nonce",t),e}function mPt(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function xPt(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var gPt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=pPt())&&(mPt(t,n),xPt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},bPt=function(){var e=gPt();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Zoe=function(){var e=bPt(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},yPt={left:0,top:0,right:0,gap:0},IV=function(e){return parseInt(e||"",10)||0},vPt=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[IV(n),IV(r),IV(s)]},wPt=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return yPt;var t=vPt(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])}},CPt=Zoe(),f4="data-scroll-locked",SPt=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(sPt,` {
   overflow: hidden `).concat(r,`;
   padding-right: `).concat(l,"px ").concat(r,`;
  }
  body[`).concat(f4,`] {
    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(n9,` {
    right: `).concat(l,"px ").concat(r,`;
  }
  
  .`).concat(r9,` {
    margin-right: `).concat(l,"px ").concat(r,`;
  }
  
  .`).concat(n9," .").concat(n9,` {
    right: 0 `).concat(r,`;
  }
  
  .`).concat(r9," .").concat(r9,` {
    margin-right: 0 `).concat(r,`;
  }
  
  body[`).concat(f4,`] {
    `).concat(iPt,": ").concat(l,`px;
  }
`)},o1e=function(){var e=parseInt(document.body.getAttribute(f4)||"0",10);return isFinite(e)?e:0},NPt=function(){m.useEffect(function(){return document.body.setAttribute(f4,(o1e()+1).toString()),function(){var e=o1e()-1;e<=0?document.body.removeAttribute(f4):document.body.setAttribute(f4,e.toString())}},[])},hRe=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;NPt();var a=m.useMemo(function(){return wPt(s)},[s]);return m.createElement(CPt,{styles:SPt(a,!t,s,n?"":"!important")})},Xee=!1;if(typeof window<"u")try{var pP=Object.defineProperty({},"passive",{get:function(){return Xee=!0,!0}});window.addEventListener("test",pP,pP),window.removeEventListener("test",pP,pP)}catch{Xee=!1}var G6=Xee?{passive:!1}:!1,APt=function(e){return e.tagName==="TEXTAREA"},pRe=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!APt(e)&&n[t]==="visible")},jPt=function(e){return pRe(e,"overflowY")},EPt=function(e){return pRe(e,"overflowX")},l1e=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=mRe(e,r);if(s){var a=xRe(e,r),o=a[1],l=a[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},_Pt=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},kPt=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},mRe=function(e,t){return e==="v"?jPt(t):EPt(t)},xRe=function(e,t){return e==="v"?_Pt(t):kPt(t)},TPt=function(e,t){return e==="h"&&t==="rtl"?-1:1},IPt=function(e,t,n,r,s){var a=TPt(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=xRe(e,l),v=g[0],w=g[1],C=g[2],N=w-C-a*v;(v||N)&&mRe(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},mP=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},PPt=function(e,t){return e[0]===t[0]&&e[1]===t[1]},FPt=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},OPt=0,K6=[];function MPt(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),s=m.useState(OPt++)[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=rPt([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=mP(w),P=n.current,I="deltaX"in w?w.deltaX:P[0]-N[0],R="deltaY"in w?w.deltaY:P[1]-N[1],O,U=w.target,L=Math.abs(I)>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?O=L:(O=L==="v"?"h":"v",z=l1e(L,U)),!z)return!1;if(!r.current&&"changedTouches"in w&&(I||R)&&(r.current=O),!O)return!0;var X=r.current||O;return IPt(X,C,w,X==="h"?I:R)},[]),c=m.useCallback(function(w){var C=w;if(!(!K6.length||K6[K6.length-1]!==a)){var N="deltaY"in C?c1e(C):mP(C),P=t.current.filter(function(O){return O.name===C.type&&(O.target===C.target||C.target===O.shadowParent)&&PPt(O.delta,N)})[0];if(P&&P.should){C.cancelable&&C.preventDefault();return}if(!P){var I=(o.current.shards||[]).map(u1e).filter(Boolean).filter(function(O){return O.contains(C.target)}),R=I.length>0?l(C,I[0]):!o.current.noIsolation;R&&C.cancelable&&C.preventDefault()}}},[]),u=m.useCallback(function(w,C,N,P){var I={name:w,delta:C,target:N,should:P,shadowParent:RPt(N)};t.current.push(I),setTimeout(function(){t.current=t.current.filter(function(R){return R!==I})},1)},[]),d=m.useCallback(function(w){n.current=mP(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,mP(w),w.target,l(w,e.lockRef.current))},[]);m.useEffect(function(){return K6.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:x}),document.addEventListener("wheel",c,G6),document.addEventListener("touchmove",c,G6),document.addEventListener("touchstart",d,G6),function(){K6=K6.filter(function(w){return w!==a}),document.removeEventListener("wheel",c,G6),document.removeEventListener("touchmove",c,G6),document.removeEventListener("touchstart",d,G6)}},[]);var g=e.removeScrollBar,v=e.inert;return m.createElement(m.Fragment,null,v?m.createElement(a,{styles:FPt(s)}):null,g?m.createElement(hRe,{gapMode:e.gapMode}):null)}function RPt(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const LPt=dRe(fRe,MPt);var gRe=m.forwardRef(function(e,t){return m.createElement(N$,Ob({},e,{ref:t,sideCar:LPt}))});gRe.classNames=N$.classNames;function d1e(e){var t=e.match(/^var\((.*)\)$/);return t?t[1]:e}function DPt(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 bRe(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]=bRe(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;bRe(t,(l,c)=>{if(l!=null){var u=DPt(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 Aj={exports:{}},BPt=Aj.exports,h1e;function $Pt(){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",P="console",I="mobile",R="tablet",O="smarttv",U="wearable",L="embedded",z=500,X="Amazon",ne="Apple",J="ASUS",K="BlackBerry",re="Browser",he="Chrome",Q="Edge",ie="Firefox",oe="Google",G="Huawei",V="LG",te="Microsoft",ae="Motorola",fe="Opera",Ne="Samsung",me="Sharp",we="Sony",xe="Xiaomi",ye="Zebra",je="Facebook",Pe="Chromium OS",Re="Mac OS",Xe=" Browser",Ke=function(on,Zt){var Ye={};for(var Ze in on)Zt[Ze]&&Zt[Ze].length%2===0?Ye[Ze]=Zt[Ze].concat(on[Ze]):Ye[Ze]=on[Ze];return Ye},ut=function(on){for(var Zt={},Ye=0;Ye<on.length;Ye++)Zt[on[Ye].toUpperCase()]=on[Ye];return Zt},et=function(on,Zt){return typeof on===d?tt(Zt).indexOf(tt(on))!==-1:!1},tt=function(on){return on.toLowerCase()},Le=function(on){return typeof on===d?on.replace(/[^\d\.]/g,a).split(".")[0]:r},$e=function(on,Zt){if(typeof on===d)return on=on.replace(/^\s\s*/,a),typeof Zt===c?on:on.substring(0,z)},ht=function(on,Zt){for(var Ye=0,Ze,Ft,dn,Yt,Bt,ot;Ye<Zt.length&&!Bt;){var De=Zt[Ye],_t=Zt[Ye+1];for(Ze=Ft=0;Ze<De.length&&!Bt&&De[Ze];)if(Bt=De[Ze++].exec(on),Bt)for(dn=0;dn<_t.length;dn++)ot=Bt[++Ft],Yt=_t[dn],typeof Yt===u&&Yt.length>0?Yt.length===2?typeof Yt[1]==l?this[Yt[0]]=Yt[1].call(this,ot):this[Yt[0]]=Yt[1]:Yt.length===3?typeof Yt[1]===l&&!(Yt[1].exec&&Yt[1].test)?this[Yt[0]]=ot?Yt[1].call(this,ot,Yt[2]):r:this[Yt[0]]=ot?ot.replace(Yt[1],Yt[2]):r:Yt.length===4&&(this[Yt[0]]=ot?Yt[3].call(this,ot.replace(Yt[1],Yt[2])):r):this[Yt]=ot||r;Ye+=2}},pt=function(on,Zt){for(var Ye in Zt)if(typeof Zt[Ye]===u&&Zt[Ye].length>0){for(var Ze=0;Ze<Zt[Ye].length;Ze++)if(et(Zt[Ye][Ze],on))return Ye===o?r:Ye}else if(et(Zt[Ye],on))return Ye===o?r:Ye;return Zt.hasOwnProperty("*")?Zt["*"]:on},Kt={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},wt={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"},nn={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"+Xe]],[/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"+Xe],C],[/samsungbrowser\/([\w\.]+)/i],[C,[g,Ne+" 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,pt,Kt]],[/(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,tt]],[/((?: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,tt]],[/(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,tt]]],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,Ne],[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,Ne],[v,I]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[x,[w,ne],[v,I]],[/\((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,me],[v,I]],[/(?:honor)([-\w ]+)[;\)]/i],[x,[w,"Honor"],[v,I]],[/\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,I]],[/\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,xe],[v,I]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[x,/_/g," "],[w,xe],[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,I]],[/\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,I]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[x,[w,"Realme"],[v,I]],[/\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,I]],[/\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,I]],[/(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,I]],[/(pixel c)\b/i],[x,[w,oe],[v,R]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[x,[w,oe],[v,I]],[/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,we],[v,I]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[x,"Xperia Tablet"],[w,we],[v,R]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[x,[w,"OnePlus"],[v,I]],[/(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,I]],[/(playbook);[-\w\),; ]+(rim)/i],[x,w,[v,R]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[x,[w,K],[v,I]],[/(?:\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,I]],[/(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,I]],[/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,tt],x,[v,pt,{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,I]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[x,[w,"Ulefone"],[v,I]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[x,[w,"Energizer"],[v,I]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[x,[w,"Cat"],[v,I]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[x,[w,"Smartfren"],[v,I]],[/droid.+; (a(?:015|06[35]|142p?))/i],[x,[w,"Nothing"],[v,I]],[/(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,I]],[/(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,te],[v,R]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[x,[w,"Fairphone"],[v,I]],[/(u304aa)/i],[x,[w,"AT&T"],[v,I]],[/\bsie-(\w*)/i],[x,[w,"Siemens"],[v,I]],[/\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,I]],[/\b(gen\d{3}) b.+49h/i],[x,[w,"Swiss"],[v,I]],[/\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,I]],[/\b(lvtel\-)?(v1[12]) b/i],[[w,"LvTel"],x,[v,I]],[/\b(ph-1) /i],[x,[w,"Essential"],[v,I]],[/\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,I]],[/(kin\.[onetw]{3})/i],[[x,/\./g," "],[w,te],[v,I]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[x,[w,ye],[v,R]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[x,[w,ye],[v,I]],[/smart-tv.+(samsung)/i],[w,[v,O]],[/hbbtv.+maple;(\d+)/i],[[x,/^/,"SmartTV"],[w,Ne],[v,O]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[w,V],[v,O]],[/(apple) ?tv/i],[w,[x,ne+" TV"],[v,O]],[/crkey/i],[[x,he+"cast"],[w,oe],[v,O]],[/droid.+aft(\w+)( bui|\))/i],[x,[w,X],[v,O]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[x,[w,me],[v,O]],[/(bravia[\w ]+)( bui|\))/i],[x,[w,we],[v,O]],[/(mitv-\w{5}) bui/i],[x,[w,xe],[v,O]],[/Hbbtv.*(technisat) (.*);/i],[w,x,[v,O]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[w,$e],[x,$e],[v,O]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[v,O]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[w,x,[v,P]],[/droid.+; (shield) bui/i],[x,[w,"Nvidia"],[v,P]],[/(playstation [345portablevi]+)/i],[x,[w,we],[v,P]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[x,[w,te],[v,P]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[x,[w,Ne],[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,ye],[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,I]],[/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,I]],[/(android[-\w\. ]{0,9});.+buil/i],[x,[w,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[C,[g,Q+"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,pt,wt]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[C,pt,wt],[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,K]],[/(?: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,Pe],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(on,Zt){if(typeof on===u&&(Zt=on,on=r),!(this instanceof cn))return new cn(on,Zt).getResult();var Ye=typeof n!==c&&n.navigator?n.navigator:r,Ze=on||(Ye&&Ye.userAgent?Ye.userAgent:a),Ft=Ye&&Ye.userAgentData?Ye.userAgentData:r,dn=Zt?Ke(nn,Zt):nn,Yt=Ye&&Ye.userAgent==Ze;return this.getBrowser=function(){var Bt={};return Bt[g]=r,Bt[C]=r,ht.call(Bt,Ze,dn.browser),Bt[f]=Le(Bt[C]),Yt&&Ye&&Ye.brave&&typeof Ye.brave.isBrave==l&&(Bt[g]="Brave"),Bt},this.getCPU=function(){var Bt={};return Bt[N]=r,ht.call(Bt,Ze,dn.cpu),Bt},this.getDevice=function(){var Bt={};return Bt[w]=r,Bt[x]=r,Bt[v]=r,ht.call(Bt,Ze,dn.device),Yt&&!Bt[v]&&Ft&&Ft.mobile&&(Bt[v]=I),Yt&&Bt[x]=="Macintosh"&&Ye&&typeof Ye.standalone!==c&&Ye.maxTouchPoints&&Ye.maxTouchPoints>2&&(Bt[x]="iPad",Bt[v]=R),Bt},this.getEngine=function(){var Bt={};return Bt[g]=r,Bt[C]=r,ht.call(Bt,Ze,dn.engine),Bt},this.getOS=function(){var Bt={};return Bt[g]=r,Bt[C]=r,ht.call(Bt,Ze,dn.os),Yt&&!Bt[g]&&Ft&&Ft.platform&&Ft.platform!="Unknown"&&(Bt[g]=Ft.platform.replace(/chrome os/i,Pe).replace(/macos/i,Re)),Bt},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 Ze},this.setUA=function(Bt){return Ze=typeof Bt===d&&Bt.length>z?$e(Bt,z):Bt,this},this.setUA(Ze),this};cn.VERSION=s,cn.BROWSER=ut([g,C,f]),cn.CPU=ut([N]),cn.DEVICE=ut([x,w,v,P,I,O,R,U,L]),cn.ENGINE=cn.OS=ut([g,C]),e.exports&&(t=e.exports=cn),t.UAParser=cn;var zn=typeof n!==c&&(n.jQuery||n.Zepto);if(zn&&!zn.ua){var Xt=new cn;zn.ua=Xt.getResult(),zn.ua.get=function(){return Xt.getUA()},zn.ua.set=function(on){Xt.setUA(on);var Zt=Xt.getResult();for(var Ye in Zt)zn.ua[Ye]=Zt[Ye]}}})(typeof window=="object"?window:BPt)}(Aj,Aj.exports)),Aj.exports}var UPt=$Pt(),Y6={},PV,p1e;function zPt(){return p1e||(p1e=1,PV=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),PV}var FV={},pb={},m1e;function x5(){if(m1e)return pb;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 pb.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},pb.getSymbolTotalCodewords=function(r){return t[r]},pb.getBCHDigit=function(n){let r=0;for(;n!==0;)r++,n>>>=1;return r},pb.setToSJISFunction=function(r){if(typeof r!="function")throw new Error('"toSJISFunc" is not a valid function.');e=r},pb.isKanjiModeEnabled=function(){return typeof e<"u"},pb.toSJIS=function(r){return e(r)},pb}var OV={},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}}}(OV)),OV}var MV,g1e;function HPt(){if(g1e)return MV;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++}},MV=e,MV}var RV,b1e;function VPt(){if(b1e)return RV;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]},RV=e,RV}var LV={},y1e;function WPt(){return y1e||(y1e=1,function(e){const t=x5().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}}(LV)),LV}var DV={},v1e;function qPt(){if(v1e)return DV;v1e=1;const e=x5().getSymbolSize,t=7;return DV.getPositions=function(r){const s=e(r);return[[0,0],[s-t,0],[0,s-t]]},DV}var BV={},w1e;function GPt(){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}}(BV)),BV}var xP={},C1e;function yRe(){if(C1e)return xP;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 xP.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}},xP.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}},xP}var $V={},F7={},S1e;function KPt(){if(S1e)return F7;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]}(),F7.log=function(r){if(r<1)throw new Error("log("+r+")");return t[r]},F7.exp=function(r){return e[r]},F7.mul=function(r,s){return r===0||s===0?0:e[t[r]+t[s]]},F7}var N1e;function YPt(){return N1e||(N1e=1,function(e){const t=KPt();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}}($V)),$V}var UV,A1e;function XPt(){if(A1e)return UV;A1e=1;const e=YPt();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},UV=t,UV}var zV={},HV={},VV={},j1e;function vRe(){return j1e||(j1e=1,VV.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}),VV}var Jm={},E1e;function wRe(){if(E1e)return Jm;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
]))+`;Jm.KANJI=new RegExp(n,"g"),Jm.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Jm.BYTE=new RegExp(r,"g"),Jm.NUMERIC=new RegExp(e,"g"),Jm.ALPHANUMERIC=new RegExp(t,"g");const s=new RegExp("^"+n+"$"),a=new RegExp("^"+e+"$"),o=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return Jm.testKanji=function(c){return s.test(c)},Jm.testNumeric=function(c){return a.test(c)},Jm.testAlphanumeric=function(c){return o.test(c)},Jm}var _1e;function g5(){return _1e||(_1e=1,function(e){const t=vRe(),n=wRe();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}}}(HV)),HV}var k1e;function QPt(){return k1e||(k1e=1,function(e){const t=x5(),n=yRe(),r=Joe(),s=g5(),a=vRe(),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),P=(C-N)*8;if(w===s.MIXED)return P;const I=P-u(w,g);switch(w){case s.NUMERIC:return Math.floor(I/10*3);case s.ALPHANUMERIC:return Math.floor(I/11*2);case s.KANJI:return Math.floor(I/13);case s.BYTE:default:return Math.floor(I/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}}(zV)),zV}var WV={},T1e;function ZPt(){if(T1e)return WV;T1e=1;const e=x5(),t=1335,n=21522,r=e.getBCHDigit(t);return WV.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},WV}var qV={},GV,I1e;function JPt(){if(I1e)return GV;I1e=1;const e=g5();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))},GV=t,GV}var KV,P1e;function eFt(){if(P1e)return KV;P1e=1;const e=g5(),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)},KV=n,KV}var YV,F1e;function tFt(){if(F1e)return YV;F1e=1;const e=g5();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)},YV=t,YV}var XV,O1e;function nFt(){if(O1e)return XV;O1e=1;const e=g5(),t=x5();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)}},XV=n,XV}var QV={exports:{}},M1e;function rFt(){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}(QV)),QV.exports}var R1e;function sFt(){return R1e||(R1e=1,function(e){const t=g5(),n=JPt(),r=eFt(),s=tFt(),a=nFt(),o=wRe(),l=x5(),c=rFt();function u(N){return unescape(encodeURIComponent(N)).length}function d(N,P,I){const R=[];let O;for(;(O=N.exec(I))!==null;)R.push({data:O[0],index:O.index,mode:P,length:O[0].length});return R}function f(N){const P=d(o.NUMERIC,t.NUMERIC,N),I=d(o.ALPHANUMERIC,t.ALPHANUMERIC,N);let R,O;return l.isKanjiModeEnabled()?(R=d(o.BYTE,t.BYTE,N),O=d(o.KANJI,t.KANJI,N)):(R=d(o.BYTE_KANJI,t.BYTE,N),O=[]),P.concat(I,R,O).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,P){switch(P){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(P,I){const R=P.length-1>=0?P[P.length-1]:null;return R&&R.mode===I.mode?(P[P.length-1].data+=I.data,P):(P.push(I),P)},[])}function v(N){const P=[];for(let I=0;I<N.length;I++){const R=N[I];switch(R.mode){case t.NUMERIC:P.push([R,{data:R.data,mode:t.ALPHANUMERIC,length:R.length},{data:R.data,mode:t.BYTE,length:R.length}]);break;case t.ALPHANUMERIC:P.push([R,{data:R.data,mode:t.BYTE,length:R.length}]);break;case t.KANJI:P.push([R,{data:R.data,mode:t.BYTE,length:u(R.data)}]);break;case t.BYTE:P.push([{data:R.data,mode:t.BYTE,length:u(R.data)}])}}return P}function w(N,P){const I={},R={start:{}};let O=["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),I[J]={node:ne,lastCount:0},R[J]={};for(let K=0;K<O.length;K++){const re=O[K];I[re]&&I[re].node.mode===ne.mode?(R[re][J]=x(I[re].lastCount+ne.length,ne.mode)-x(I[re].lastCount,ne.mode),I[re].lastCount+=ne.length):(I[re]&&(I[re].lastCount=ne.length),R[re][J]=x(ne.length,ne.mode)+4+t.getCharCountIndicator(ne.mode,P))}}O=z}for(let U=0;U<O.length;U++)R[O[U]].end=0;return{map:R,table:I}}function C(N,P){let I;const R=t.getBestModeForData(N);if(I=t.from(P,R),I!==t.BYTE&&I.bit<R.bit)throw new Error('"'+N+'" cannot be encoded with mode '+t.toString(I)+`.
 Suggested mode is: `+t.toString(R));switch(I===t.KANJI&&!l.isKanjiModeEnabled()&&(I=t.BYTE),I){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(P){return P.reduce(function(I,R){return typeof R=="string"?I.push(C(R,null)):R.data&&I.push(C(R.data,R.mode)),I},[])},e.fromString=function(P,I){const R=f(P,l.isKanjiModeEnabled()),O=v(R),U=w(O,I),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(P){return e.fromArray(f(P,l.isKanjiModeEnabled()))}}(qV)),qV}var L1e;function iFt(){if(L1e)return FV;L1e=1;const e=x5(),t=Joe(),n=HPt(),r=VPt(),s=WPt(),a=qPt(),o=GPt(),l=yRe(),c=XPt(),u=QPt(),d=ZPt(),f=g5(),x=sFt();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],K=X[ne][1];for(let re=-1;re<=7;re++)if(!(J+re<=-1||z<=J+re))for(let he=-1;he<=7;he++)K+he<=-1||z<=K+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,K+he,!0,!0):U.set(J+re,K+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 K=-2;K<=2;K++)for(let re=-2;re<=2;re++)K===-2||K===2||re===-2||re===2||K===0&&re===0?U.set(ne+K,J+re,!0,!0):U.set(ne+K,J+re,!1,!0)}}function C(U,L){const z=U.size,X=u.getEncodedBits(L);let ne,J,K;for(let re=0;re<18;re++)ne=Math.floor(re/3),J=re%3+z-8-3,K=(X>>re&1)===1,U.set(ne,J,K,!0),U.set(J,ne,K,!0)}function N(U,L,z){const X=U.size,ne=d.getEncodedBits(L,z);let J,K;for(J=0;J<15;J++)K=(ne>>J&1)===1,J<6?U.set(J,8,K,!0):J<8?U.set(J+1,8,K,!0):U.set(X-15+J,8,K,!0),J<8?U.set(8,X-J-1,K,!0):J<9?U.set(8,15-J-1+1,K,!0):U.set(8,15-J-1,K,!0);U.set(X-8,8,1,!0)}function P(U,L){const z=U.size;let X=-1,ne=z-1,J=7,K=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 Q=!1;K<L.length&&(Q=(L[K]>>>J&1)===1),U.set(ne,re-he,Q),J--,J===-1&&(K++,J=7)}if(ne+=X,ne<0||z<=ne){ne-=X,X=-X;break}}}function I(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),K=(ne-J)*8;for(X.getLengthInBits()+4<=K&&X.put(0,4);X.getLengthInBits()%8!==0;)X.putBit(0);const re=(K-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,K=l.getBlocksCount(L,z),re=X%K,he=K-re,Q=Math.floor(X/K),ie=Math.floor(J/K),oe=ie+1,G=Q-ie,V=new c(G);let te=0;const ae=new Array(K),fe=new Array(K);let Ne=0;const me=new Uint8Array(U.buffer);for(let Pe=0;Pe<K;Pe++){const Re=Pe<he?ie:oe;ae[Pe]=me.slice(te,te+Re),fe[Pe]=V.encode(ae[Pe]),te+=Re,Ne=Math.max(Ne,Re)}const we=new Uint8Array(X);let xe=0,ye,je;for(ye=0;ye<Ne;ye++)for(je=0;je<K;je++)ye<ae[je].length&&(we[xe++]=ae[je][ye]);for(ye=0;ye<G;ye++)for(je=0;je<K;je++)we[xe++]=fe[je][ye];return we}function O(U,L,z,X){let ne;if(Array.isArray(U))ne=x.fromArray(U);else if(typeof U=="string"){let Q=L;if(!Q){const ie=x.rawSplit(U);Q=u.getBestVersionForData(ie,z)}ne=x.fromString(U,Q||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 K=I(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),P(he,K),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 FV.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)),O(L,ne,X,J)},FV}var ZV={},JV={},D1e;function CRe(){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}}}(JV)),JV}var B1e;function aFt(){return B1e||(B1e=1,function(e){const t=CRe();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)}}(ZV)),ZV}var eW={},$1e;function oFt(){if($1e)return eW;$1e=1;const e=CRe();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 eW.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},eW}var U1e;function lFt(){if(U1e)return Y6;U1e=1;const e=zPt(),t=iFt(),n=aFt(),r=oFt();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 Y6.create=t.create,Y6.toCanvas=s.bind(null,n.render),Y6.toDataURL=s.bind(null,n.renderToDataURL),Y6.toString=s.bind(null,function(a,o,l){return r.render(a,l)}),Y6}var cFt=lFt();const uFt=Ii(cFt);A$.type="coinbaseWallet";function A$(e={}){return e.version==="3"||e.headlessMode?fFt(e):dFt(e)}function dFt(e){let t,n,r,s;return a=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",rdns:"com.coinbase.wallet",type:A$.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=>Ec(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===yo.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 yo(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=>Ec(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 is(async()=>{const{createCoinbaseWalletSDK:u}=await import("./index-BhtVN9_m.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 ip(new S3);const u=await this.getProvider();try{return await u.request({method:"wallet_switchEthereumChain",params:[{chainId:Us(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:Us(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 yo(w)}throw new ip(v)}},onAccountsChanged(o){o.length===0?this.onDisconnect():a.emitter.emit("change",{accounts:o.map(l=>Ec(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 fFt(e){let n,r,s,a,o;return l=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",type:A$.type,async connect({chainId:c}={}){try{const u=await this.getProvider(),d=(await u.request({method:"eth_requestAccounts"})).map(x=>Ec(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===yo.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 yo(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=>Ec(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 is(async()=>{const{default:w}=await import("./index-Bftpp1YE.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 ip(new S3);const f=await this.getProvider();try{return await f.request({method:"wallet_switchEthereumChain",params:[{chainId:Us(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 P;(v=c==null?void 0:c.rpcUrls)!=null&&v.length?P=c.rpcUrls:P=[((w=d.rpcUrls.default)==null?void 0:w.http[0])??""];const I={blockExplorerUrls:N,chainId:Us(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:P};return await f.request({method:"wallet_addEthereumChain",params:[I]}),d}catch(N){throw new yo(N)}throw new ip(C)}},onAccountsChanged(c){c.length===0?this.onDisconnect():l.emitter.emit("change",{accounts:c.map(u=>Ec(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 qh;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 qh;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 qh;return(await a.request({method:"eth_accounts"})).map(Ec)},async getProvider(){if(typeof window<"u"&&(window==null?void 0:window.parent)!==window){if(!n){const{default:o}=await is(async()=>{const{default:d}=await import("./index-B8lqC164.js");return{default:d}},__vite__mapDeps([6,7,2])),l=new o(e),c=await kie(()=>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 is(()=>import("./index-Dwm2KIpY.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 qh;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 qh;c||(c=this.onDisplayUri,C.on("display_uri",c));let N=x;if(!N){const O=await((v=f.storage)==null?void 0:v.getItem("state"))??{};f.chains.some(L=>L.id===O.chainId)?N=O.chainId:N=(w=f.chains[0])==null?void 0:w.id}if(!N)throw new Error("No chains found on connector.");const P=await this.isChainsStale();if(C.session&&P&&await C.disconnect(),!C.session||P){const O=f.chains.filter(U=>U.id!==N).map(U=>U.id);await C.connect({optionalChains:[N,...O],..."pairingTopic"in g?{pairingTopic:g.pairingTopic}:{}}),this.setRequestedChainsIds(f.chains.map(U=>U.id))}const I=(await C.enable()).map(O=>Ec(O)),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:I,chainId:R}}catch(C){throw/(user rejected|connection request reset)/i.test(C==null?void 0:C.message)?new yo(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=>Ec(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 is(async()=>{const{EthereumProvider:N}=await import("./index.es-BDexHQlT.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[P]=Y0t({chain:N,transports:f.transports});return[N.id,P]})),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,P;const v=await this.getProvider();if(!v)throw new qh;const w=f.chains.find(I=>I.id===g);if(!w)throw new ip(new S3);try{await Promise.all([new Promise(R=>{const O=({chainId:U})=>{U===g&&(f.emitter.off("change",O),R())};f.emitter.on("change",O)}),v.request({method:"wallet_switchEthereumChain",params:[{chainId:Us(g)}]})]);const I=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...I,g]),w}catch(I){const R=I;if(/(user rejected)/i.test(R.message))throw new yo(R);try{let O;x!=null&&x.blockExplorerUrls?O=x.blockExplorerUrls:O=(C=w.blockExplorers)!=null&&C.default.url?[(N=w.blockExplorers)==null?void 0:N.default.url]:[];let U;(P=x==null?void 0:x.rpcUrls)!=null&&P.length?U=x.rpcUrls:U=[...w.rpcUrls.default.http];const L={blockExplorerUrls:O,chainId:Us(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(O){throw new yo(O)}}},onAccountsChanged(x){x.length===0?this.onDisconnect():f.emitter.emit("change",{accounts:x.map(g=>Ec(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 MR={},hFt=768;sIt({conditions:{defaultCondition:"smallScreen",conditionNames:["smallScreen","largeScreen"],responsiveArray:void 0}});var pFt=pMe({conditions:{defaultCondition:"smallScreen",conditionNames:["smallScreen","largeScreen"],responsiveArray:void 0}}),Qee=uIt({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)"}},mFt={shrink:"_12cbo8i6",shrinkSm:"_12cbo8i7"},xFt="_12cbo8i3 ju367v8r",gFt={grow:"_12cbo8i4",growLg:"_12cbo8i5"};function au({active:e,hover:t}){return[xFt,t&&gFt[t],mFt[e]]}var SRe=m.createContext(null);function bFt(){const{adapter:e}=m.useContext(SRe)??{};if(!e)throw new Error("No authentication adapter found");return e}function j$(){const e=m.useContext(SRe);return(e==null?void 0:e.status)??null}function NRe(){const e=j$(),{isConnected:t}=ts();return t?e&&(e==="loading"||e==="unauthenticated")?e:"connected":"disconnected"}function nle(){return typeof navigator<"u"&&/android/i.test(navigator.userAgent)}function yFt(){return typeof navigator<"u"&&/iPhone|iPod/.test(navigator.userAgent)}function vFt(){return typeof navigator<"u"&&(/iPad/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)}function b5(){return yFt()||vFt()}function lu(){return nle()||b5()}var wFt="iekbcc0",CFt={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"},SFt=({reset:e,...t})=>{if(!e)return Qee(t);const n=CFt[e],r=Qee(t);return xMe(wFt,n,r)},wn=Ae.forwardRef(({as:e="div",className:t,testId:n,...r},s)=>{const a={},o={};for(const c in r)Qee.properties.has(c)?a[c]=r[c]:o[c]=r[c];const l=SFt({reset:typeof e=="string"?e:"div",...a});return Ae.createElement(e,{className:xMe(l,t),...o,"data-testid":n?`rk-${n.replace(/^rk-/,"")}`:void 0,ref:s})});wn.displayName="Box";var ARe=new Map,tW=new Map;async function jRe(e){const t=tW.get(e);if(t)return t;const n=async()=>e().then(async s=>(ARe.set(e,s),s)),r=n().catch(s=>n().catch(a=>{tW.delete(e)}));return tW.set(e,r),r}async function ix(...e){return await Promise.all(e.map(t=>typeof t=="function"?jRe(t):t))}function NFt(){const[,e]=m.useReducer(t=>t+1,0);return e}function rle(e){const t=typeof e=="function"?ARe.get(e):void 0,n=NFt();return m.useEffect(()=>{typeof e=="function"&&!t&&jRe(e).then(n)},[e,t,n]),typeof e=="function"?t:e}function Fc({alt:e,background:t,borderColor:n,borderRadius:r,useAsImage:s,boxShadow:a,height:o,src:l,width:c,testId:u}){const d=b5(),f=rle(l),x=f&&/^http/.test(f),[g,v]=m.useReducer(()=>!0,!1);return Ae.createElement(wn,{"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},Ae.createElement(wn,{...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?Ae.createElement(wn,{...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 AFt="_1luule42",jFt="_1luule43",EFt=e=>m.useMemo(()=>`${e}_${Math.round(Math.random()*1e9)}`,[e]),JE=({height:e=21,width:t=21})=>{const n=EFt("spinner");return Ae.createElement("svg",{className:AFt,fill:"none",height:e,viewBox:"0 0 21 21",width:t,xmlns:"http://www.w3.org/2000/svg"},Ae.createElement("title",null,"Loading"),Ae.createElement("clipPath",{id:n},Ae.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"})),Ae.createElement("foreignObject",{clipPath:`url(#${n})`,height:"21",width:"21",x:"0",y:"0"},Ae.createElement("div",{className:jFt})))},Zi=["#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:Zi[0],emoji:"🌶"},{color:Zi[1],emoji:"🤑"},{color:Zi[2],emoji:"🐙"},{color:Zi[3],emoji:"🫐"},{color:Zi[4],emoji:"🐳"},{color:Zi[0],emoji:"🤶"},{color:Zi[5],emoji:"🌲"},{color:Zi[6],emoji:"🌞"},{color:Zi[7],emoji:"🐒"},{color:Zi[8],emoji:"🐵"},{color:Zi[9],emoji:"🦊"},{color:Zi[10],emoji:"🐼"},{color:Zi[11],emoji:"🦄"},{color:Zi[12],emoji:"🐷"},{color:Zi[13],emoji:"🐧"},{color:Zi[8],emoji:"🦩"},{color:Zi[14],emoji:"👽"},{color:Zi[0],emoji:"🎈"},{color:Zi[8],emoji:"🍉"},{color:Zi[1],emoji:"🎉"},{color:Zi[15],emoji:"🐲"},{color:Zi[16],emoji:"🌎"},{color:Zi[17],emoji:"🍊"},{color:Zi[18],emoji:"🐭"},{color:Zi[19],emoji:"🍣"},{color:Zi[1],emoji:"🐥"},{color:Zi[20],emoji:"👾"},{color:Zi[15],emoji:"🥦"},{color:Zi[0],emoji:"👹"},{color:Zi[17],emoji:"🙀"},{color:Zi[4],emoji:"⛱"},{color:Zi[21],emoji:"⛵️"},{color:Zi[17],emoji:"🥳"},{color:Zi[8],emoji:"🤯"},{color:Zi[22],emoji:"🤠"}];function _Ft(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 kFt(e){const n=Math.abs(_Ft((typeof e=="string"?e:"").toLowerCase())%H1e.length);return H1e[n??0]}var TFt=({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(()=>kFt(e),[e]);return t?r?Ae.createElement(wn,{backgroundSize:"cover",borderRadius:"full",position:"absolute",style:{backgroundImage:`url(${t})`,backgroundPosition:"center",height:n,width:n}}):Ae.createElement(wn,{alignItems:"center",backgroundSize:"cover",borderRadius:"full",color:"modalText",display:"flex",justifyContent:"center",position:"absolute",style:{height:n,width:n}},Ae.createElement(JE,null)):Ae.createElement(wn,{alignItems:"center",display:"flex",justifyContent:"center",overflow:"hidden",style:{...!t&&{backgroundColor:a},height:n,width:n}},o)},ERe=TFt,_Re=m.createContext(ERe);function IFt({address:e,imageUrl:t,loading:n,size:r}){const s=m.useContext(_Re);return Ae.createElement(wn,{"aria-hidden":!0,borderRadius:"full",overflow:"hidden",position:"relative",style:{height:`${r}px`,width:`${r}px`},userSelect:"none"},Ae.createElement(wn,{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"},Ae.createElement(s,{address:e,ensImage:t,size:r})),n&&Ae.createElement(wn,{color:"accentColor",display:"flex",height:"full",position:"absolute",width:"full"},Ae.createElement(JE,{height:"100%",width:"100%"})))}var V1e={defaultLocale:"en",locale:"en"},PFt=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)}}},Xh=new PFt({en:JSON.parse(Hee),"en-US":JSON.parse(Hee)});Xh.defaultLocale="en-US";Xh.locale="en-US";Xh.enableFallback=!0;var FFt=async e=>{switch(e){case"ar":case"ar-AR":return(await is(async()=>{const{default:t}=await import("./ar_AR-ZRPPM56D-d2WEfzQ_.js");return{default:t}},[])).default;case"de":case"de-DE":return(await is(async()=>{const{default:t}=await import("./de_DE-GYZFZXWH-CYZf24IR.js");return{default:t}},[])).default;case"en":case"en-US":return(await is(async()=>{const{default:t}=await Promise.resolve().then(()=>vNe);return{default:t}},void 0)).default;case"es":case"es-419":return(await is(async()=>{const{default:t}=await import("./es_419-OGVOQEFZ-D6BJPTeQ.js");return{default:t}},[])).default;case"fr":case"fr-FR":return(await is(async()=>{const{default:t}=await import("./fr_FR-Q5QBQBX2-lQoTmpTH.js");return{default:t}},[])).default;case"hi":case"hi-IN":return(await is(async()=>{const{default:t}=await import("./hi_IN-7I7LRHGW-CTQjmeYe.js");return{default:t}},[])).default;case"id":case"id-ID":return(await is(async()=>{const{default:t}=await import("./id_ID-ZMGZ2JFV-CgKQKAmU.js");return{default:t}},[])).default;case"ja":case"ja-JP":return(await is(async()=>{const{default:t}=await import("./ja_JP-NYBCHQTZ-CMaBl8Za.js");return{default:t}},[])).default;case"ko":case"ko-KR":return(await is(async()=>{const{default:t}=await import("./ko_KR-67WE736M-DHWhIjcm.js");return{default:t}},[])).default;case"ms":case"ms-MY":return(await is(async()=>{const{default:t}=await import("./ms_MY-65AJIBUS-BLlUrxe6.js");return{default:t}},[])).default;case"pt":case"pt-BR":return(await is(async()=>{const{default:t}=await import("./pt_BR-DMJANC65-DMs4DrlC.js");return{default:t}},[])).default;case"ru":case"ru-RU":return(await is(async()=>{const{default:t}=await import("./ru_RU-WER7RQ6A-DsJK55uv.js");return{default:t}},[])).default;case"th":case"th-TH":return(await is(async()=>{const{default:t}=await import("./th_TH-JOSHEZ6D-Cp87mIRZ.js");return{default:t}},[])).default;case"tr":case"tr-TR":return(await is(async()=>{const{default:t}=await import("./tr_TR-EAMG2YPO-C52_xfsf.js");return{default:t}},[])).default;case"ua":case"uk-UA":return(await is(async()=>{const{default:t}=await import("./uk_UA-GO2TRVWA-C1C1400t.js");return{default:t}},[])).default;case"vi":case"vi-VN":return(await is(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 is(async()=>{const{default:t}=await import("./zh_CN-THPIFVWJ-Cbp71xMR.js");return{default:t}},[])).default;case"zh-HK":return(await is(async()=>{const{default:t}=await import("./zh_HK-R7XP4TGF-CyJtfKGw.js");return{default:t}},[])).default;case"zh-Hant":case"zh-TW":return(await is(async()=>{const{default:t}=await import("./zh_TW-F5LD752V-AHFgsYw-.js");return{default:t}},[])).default;default:return(await is(async()=>{const{default:t}=await Promise.resolve().then(()=>vNe);return{default:t}},void 0)).default}};async function W1e(e){if(Xh.isLocaleCached(e)){Xh.updateLocale(e);return}const n=await FFt(e);Xh.setTranslations(e,JSON.parse(n))}var OFt=()=>{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}},cc=m.createContext({i18n:Xh}),MFt=({children:e,locale:t})=>{const[n,r]=m.useState(0),s=m.useMemo(()=>OFt(),[]);m.useEffect(()=>Xh.onChange(()=>{r(l=>l+1)}),[]),m.useEffect(()=>{t&&t!==Xh.locale?W1e(t):!t&&s&&s!==Xh.locale&&W1e(s)},[t,s]);const a=m.useMemo(()=>({t:(l,c)=>Xh.t(l,c),i18n:Xh}),[n]);return Ae.createElement(cc.Provider,{value:a},e)};function kRe(e){return e!=null}var q1e={iconBackground:"#7290CC",iconUrl:async()=>(await is(async()=>{const{default:e}=await import("./apechain-COEQ5RUI-0TDoXOYf.js");return{default:e}},[])).default},nW={iconBackground:"#96bedc",iconUrl:async()=>(await is(async()=>{const{default:e}=await import("./arbitrum-HW44W6XR-hPA5bMPt.js");return{default:e}},[])).default},G1e={iconBackground:"#e84141",iconUrl:async()=>(await is(async()=>{const{default:e}=await import("./avalanche-MXEFEDSW-DcC5FNt3.js");return{default:e}},[])).default},rW={iconBackground:"#0052ff",iconUrl:async()=>(await is(async()=>{const{default:e}=await import("./base-Z4LFBE5D-DHfqMzJC.js");return{default:e}},[])).default},sW={iconBackground:"#814625",iconUrl:async()=>(await is(async()=>{const{default:e}=await import("./berachain-ZN3U5LDZ-CAvW_8ws.js");return{default:e}},[])).default},K1e={iconBackground:"#000000",iconUrl:async()=>(await is(async()=>{const{default:e}=await import("./blast-46UQLYYY-BV_Xlsq4.js");return{default:e}},[])).default},Y1e={iconBackground:"#ebac0e",iconUrl:async()=>(await is(async()=>{const{default:e}=await import("./bsc-RVE67I5L-DVYEF0vl.js");return{default:e}},[])).default},X1e={iconBackground:"#FCFF52",iconUrl:async()=>(await is(async()=>{const{default:e}=await import("./celo-E6XU57FO-C5IguUgF.js");return{default:e}},[])).default},Q1e={iconBackground:"#002D74",iconUrl:async()=>(await is(async()=>{const{default:e}=await import("./cronos-ROYR77VZ-Prn3LRPZ.js");return{default:e}},[])).default},RFt={iconBackground:"#A36EFD",iconUrl:async()=>(await is(async()=>{const{default:e}=await import("./degen-7ROC3GCY-9HqAkHtZ.js");return{default:e}},[])).default},mb={iconBackground:"#484c50",iconUrl:async()=>(await is(async()=>{const{default:e}=await import("./ethereum-RFBAMUVK-WsW8NXqo.js");return{default:e}},[])).default},Z1e={iconBackground:"transparent",iconUrl:async()=>(await is(async()=>{const{default:e}=await import("./flow-NBCRNYVF-D2XasjKk.js");return{default:e}},[])).default},LFt={iconBackground:"#04795c",iconUrl:async()=>(await is(async()=>{const{default:e}=await import("./gnosis-Y56LN66M-D4_J-ZQH.js");return{default:e}},[])).default},J1e={iconBackground:"#000000",iconUrl:async()=>(await is(async()=>{const{default:e}=await import("./gravity-LMEBVSFN-DLxWpxhy.js");return{default:e}},[])).default},DFt={iconBackground:"#f9f7ec",iconUrl:async()=>(await is(async()=>{const{default:e}=await import("./hardhat-NEEC6JX7-DzuWQYyS.js");return{default:e}},[])).default},BFt={iconBackground:"#000000",iconUrl:async()=>(await is(async()=>{const{default:e}=await import("./hyperevm-J6CONVCX-C6oeYIAP.js");return{default:e}},[])).default},ebe={iconBackground:"#7132F5",iconUrl:async()=>(await is(async()=>{const{default:e}=await import("./ink-4U4ZVNAB-AlM1MLfQ.js");return{default:e}},[])).default},tbe={iconBackground:"transparent",iconUrl:async()=>(await is(async()=>{const{default:e}=await import("./kaia-A33DVQBT-Fgclbhio.js");return{default:e}},[])).default},iW={iconBackground:"#ffffff",iconUrl:async()=>(await is(async()=>{const{default:e}=await import("./linea-IALBSJQC-Cmyd7vgA.js");return{default:e}},[])).default},aW={iconBackground:"#ffffff",iconUrl:async()=>(await is(async()=>{const{default:e}=await import("./manta-5V6W5D7G-BnjsGzeJ.js");return{default:e}},[])).default},nbe={iconBackground:"#000000",iconUrl:async()=>(await is(async()=>{const{default:e}=await import("./mantle-KBL3OIYT-DIpe0poV.js");return{default:e}},[])).default},gP={iconBackground:"#ff5a57",iconUrl:async()=>(await is(async()=>{const{default:e}=await import("./optimism-YWJ3IQHA-DYER-OR5.js");return{default:e}},[])).default},oW={iconBackground:"#9f71ec",iconUrl:async()=>(await is(async()=>{const{default:e}=await import("./polygon-WWEUOMKW-CNBYSB1T.js");return{default:e}},[])).default},$Ft={iconBackground:"#1273EA",iconUrl:async()=>(await is(async()=>{const{default:e}=await import("./ronin-PNHX5V6H-BS-WPXjQ.js");return{default:e}},[])).default},UFt={iconBackground:"#000000",iconUrl:async()=>(await is(async()=>{const{default:e}=await import("./sanko-RHQYXGM5-OX010CbN.js");return{default:e}},[])).default},rbe={iconBackground:"#FFEEDA",iconUrl:async()=>(await is(async()=>{const{default:e}=await import("./scroll-MCKFTBRS-C2gqZSab.js");return{default:e}},[])).default},sbe={iconBackground:"#F50DB4",iconUrl:async()=>(await is(async()=>{const{default:e}=await import("./unichain-OQ3BZUDH-CyMLDmFg.js");return{default:e}},[])).default},ibe={iconBackground:"#f9f7ec",iconUrl:async()=>(await is(async()=>{const{default:e}=await import("./xdc-X7V4QFNF-CSGs0o6M.js");return{default:e}},[])).default},abe={iconBackground:"#000000",iconUrl:async()=>(await is(async()=>{const{default:e}=await import("./zetachain-BMJKVYBN-IK2CZBr3.js");return{default:e}},[])).default},obe={iconBackground:"#f9f7ec",iconUrl:async()=>(await is(async()=>{const{default:e}=await import("./zksync-UWUXFL74-Bt0brpXu.js");return{default:e}},[])).default},lW={iconBackground:"#000000",iconUrl:async()=>(await is(async()=>{const{default:e}=await import("./zora-YZH32HP3-CY3tp3EJ.js");return{default:e}},[])).default},zFt={apechain:{chainId:33139,name:"ApeChain",...q1e},apechainCurtis:{chainId:33111,name:"ApeChain Curtis",...q1e},arbitrum:{chainId:42161,name:"Arbitrum",...nW},arbitrumGoerli:{chainId:421613,...nW},arbitrumSepolia:{chainId:421614,...nW},avalanche:{chainId:43114,...G1e},avalancheFuji:{chainId:43113,...G1e},base:{chainId:8453,name:"Base",...rW},baseGoerli:{chainId:84531,...rW},baseSepolia:{chainId:84532,...rW},berachain:{chainId:80094,name:"Berachain",...sW},berachainArtio:{chainId:80085,name:"Berachain Artio",...sW},berachainBArtio:{chainId:80084,name:"Berachain bArtio",...sW},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",...RFt},flow:{chainId:747,...Z1e},flowTestnet:{chainId:545,...Z1e},gnosis:{chainId:100,name:"Gnosis",...LFt},goerli:{chainId:5,...mb},gravity:{chainId:1625,name:"Gravity",...J1e},gravitySepolia:{chainId:13505,name:"Gravity Sepolia",...J1e},hardhat:{chainId:31337,...DFt},holesky:{chainId:17e3,...mb},hyperevm:{chainId:999,...BFt},ink:{chainId:57073,...ebe},inkSepolia:{chainId:763373,...ebe},kaia:{chainId:8217,name:"Kaia",...tbe},kairos:{chainId:1001,name:"Kairos",...tbe},kovan:{chainId:42,...mb},linea:{chainId:59144,name:"Linea",...iW},lineaGoerli:{chainId:59140,name:"Linea Goerli",...iW},lineaSepolia:{chainId:59141,name:"Linea Sepolia",...iW},localhost:{chainId:1337,...mb},mainnet:{chainId:1,name:"Ethereum",...mb},manta:{chainId:169,name:"Manta",...aW},mantaSepolia:{chainId:3441006,...aW},mantaTestnet:{chainId:3441005,...aW},mantle:{chainId:5e3,...nbe},mantleTestnet:{chainId:5001,...nbe},optimism:{chainId:10,name:"Optimism",...gP},optimismGoerli:{chainId:420,...gP},optimismKovan:{chainId:69,...gP},optimismSepolia:{chainId:11155420,...gP},polygon:{chainId:137,name:"Polygon",...oW},polygonAmoy:{chainId:80002,...oW},polygonMumbai:{chainId:80001,...oW},rinkeby:{chainId:4,...mb},ronin:{chainId:2020,...$Ft},ropsten:{chainId:3,...mb},sanko:{chainId:1996,name:"Sanko",...UFt},scroll:{chainId:534352,...rbe},scrollSepolia:{chainId:534351,...rbe},sepolia:{chainId:11155111,...mb},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",...lW},zoraSepolia:{chainId:999999999,...lW},zoraTestnet:{chainId:999,...lW}},HFt=Object.fromEntries(Object.values(zFt).filter(kRe).map(({chainId:e,...t})=>[e,t])),VFt=e=>e.map(t=>{const n=HFt[t.id]??{};return{...t,name:n.name??t.name,iconUrl:t.iconUrl??n.iconUrl,iconBackground:t.iconBackground??n.iconBackground}}),sle=m.createContext({chains:[]});function WFt({children:e,initialChain:t}){const{chains:n}=El();return Ae.createElement(sle.Provider,{value:m.useMemo(()=>({chains:VFt(n),initialChainId:typeof t=="number"?t:t==null?void 0:t.id}),[n,t])},e)}var UA=()=>m.useContext(sle).chains,qFt=()=>m.useContext(sle).initialChainId,GFt=()=>{const e=UA();return m.useMemo(()=>{const t={};for(const n of e)t[n.id]=n;return t},[e])},TRe=m.createContext({showBalance:void 0,setShowBalance:()=>{}});function KFt({children:e}){const[t,n]=m.useState();return Ae.createElement(TRe.Provider,{value:{showBalance:t,setShowBalance:n}},e)}var YFt=()=>m.useContext(TRe);function XFt(){const[e,t]=m.useState(!1);return m.useEffect(()=>(t(!0),()=>{t(!1)}),[]),m.useCallback(()=>e,[e])}function IRe(){const e=UA(),t=ZE.id;return e.some(r=>r.id===t)}function QFt(e){const t=IRe(),n=s=>{try{return KIt(s)}catch{}},{data:r}=ogt({chainId:ZE.id,name:e?n(e):void 0,query:{enabled:t}});return r}async function uv(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}${JFt(a)}`,{...l,body:c,headers:{Accept:"application/json","Content-Type":"application/json",...o},signal:n.signal});clearTimeout(r);const d=await ZFt(u);if(u.ok){const{headers:g,status:v}=u;return{data:d,headers:g,status:v}}throw eOt({requestBody:s,response:u,responseBody:typeof d=="string"?{error:d}:d})}function ZFt(e){const t=e.headers.get("Content-Type");return t!=null&&t.startsWith("application/json")?e.json():e.text()}function JFt(e){return e&&Object.keys(e).length?`?${new URLSearchParams(e)}`:""}function eOt({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 tOt=class{constructor(e={}){const{baseUrl:t="",...n}=e;this.baseUrl=t,this.opts=n}get(e,t){return uv(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"get"})}delete(e,t){return uv(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"delete"})}head(e,t){return uv(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"head"})}options(e,t){return uv(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"options"})}post(e,t,n){return uv(`${this.baseUrl}${e}`,{...this.opts,...n||{},body:t,method:"post"})}put(e,t,n){return uv(`${this.baseUrl}${e}`,{...this.opts,...n||{},body:t,method:"put"})}patch(e,t,n){return uv(`${this.baseUrl}${e}`,{...this.opts,...n||{},body:t,method:"patch"})}};function nOt({baseUrl:e,headers:t,params:n,timeout:r}){return new tOt({baseUrl:e,headers:t,params:n,timeout:r})}var rOt=!!(typeof process<"u"&&typeof MR<"u"&&MR.RAINBOW_PROVIDER_API_KEY),sOt=nOt({baseUrl:"https://enhanced-provider.rainbow.me",headers:{"x-api-key":typeof process<"u"&&typeof MR<"u"&&MR.RAINBOW_PROVIDER_API_KEY||"LzbasoBiLqltex3VkcQ7LRmL4PtfiiZ1EMJrizrgfonWN6byJReu/l6yrUoo3zLW"}});function iOt(e,t,n={}){return[e,t,n]}function yO(e){return`rk-ens-name-${e}`}function aOt(e){try{const t=e?JSON.parse(e):null;return typeof t=="object"?t:null}catch{return null}}function oOt(e,t){if(!ic(e))return;const n=new Date,r=new Date(n.getTime()+180*6e4);localStorage.setItem(yO(e),JSON.stringify({ensName:t,expires:r.getTime()}))}function lOt(e){const t=aOt(localStorage.getItem(yO(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(yO(e)),null):n}async function cOt({address:e}){const t=lOt(e);if(t)return t;const r=(await sOt.get("/v1/resolve-ens",{params:{address:e}})).data.data;return r&&oOt(e,r),r}function uOt(e){const t=IRe(),{data:n}=lgt({chainId:ZE.id,address:e,query:{enabled:t}}),{data:r}=m_e({queryKey:iOt("address",e),queryFn:()=>cOt({address:e}),enabled:!t&&!!e&&rOt,staleTime:10*(60*1e3),retry:1});return n||r}function PRe({address:e,includeBalance:t}){const n=uOt(e),r=QFt(n),{data:s}=x_e({address:t?e:void 0});return{ensName:n,ensAvatar:r,balance:s}}function ile(){const{chain:e}=ts();return(e==null?void 0:e.id)??null}var FRe="rk-transactions";function dOt(e){try{const t=e?JSON.parse(e):{};return typeof t=="object"?t:{}}catch{return{}}}function lbe(){return dOt(typeof localStorage<"u"?localStorage.getItem(FRe):null)}var fOt=/^0x([A-Fa-f0-9]{64})$/;function hOt(e){const t=[];return fOt.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 pOt({provider:e}){let t=lbe(),n=e;const r=new Set,s=new Set,a=new Map;function o(P){n=P}function l(P,I){var R;return((R=t[P])==null?void 0:R[I])??[]}function c(P,I,R){const O=hOt(R);if(O.length>0)throw new Error(["Unable to add transaction",...O].join(`
`));x(P,I,U=>[{...R,status:"pending"},...U.filter(({hash:L})=>L!==R.hash)])}function u(P,I){x(P,I,()=>[])}function d(P,I,R,O){x(P,I,U=>U.map(L=>L.hash===R?{...L,status:O}:L))}async function f(P,I){await Promise.all(l(P,I).filter(R=>R.status==="pending").map(async R=>{const{confirmations:O,hash:U}=R,L=a.get(U);if(L)return await L;const z=n.waitForTransactionReceipt({confirmations:O,hash:U,timeout:3e5}).then(({status:X})=>{a.delete(U),X!==void 0&&(d(P,I,U,X===0||X==="reverted"?"failed":"confirmed"),w(X))}).catch(()=>{d(P,I,U,"failed")});return a.set(U,z),await z}))}function x(P,I,R){t=lbe(),t[P]=t[P]??{};let O=0;const U=10,L=R(t[P][I]??[]).filter(({status:z})=>z==="pending"?!0:O++<=U);t[P][I]=L.length>0?L:void 0,g(),v(),f(P,I)}function g(){localStorage.setItem(FRe,JSON.stringify(t))}function v(){for(const P of r)P()}function w(P){for(const I of s)I(P)}function C(P){return r.add(P),()=>{r.delete(P)}}function N(P){return s.add(P),()=>{s.delete(P)}}return{addTransaction:c,clearTransactions:u,getTransactions:l,onTransactionStatus:N,onChange:C,setProvider:o,waitForPendingTransactions:f}}var cbe,ORe=Ae.createContext(null);function mOt({children:e}){const t=g_e(),{address:n}=ts(),r=ile(),{refetch:s}=x_e({address:n,query:{enabled:!1}}),[a]=Ae.useState(()=>cbe??(cbe=pOt({provider:t}))),o=Ae.useCallback(l=>{l==="success"&&s()},[s]);return Ae.useEffect(()=>{a.setProvider(t)},[a,t]),Ae.useEffect(()=>{n&&r&&a.waitForPendingTransactions(n,r)},[a,n,r]),Ae.useEffect(()=>{if(a&&n&&r)return a.onTransactionStatus(o)},[a,n,r,o]),Ae.createElement(ORe.Provider,{value:a},e)}function MRe(){const e=Ae.useContext(ORe);if(!e)throw new Error("Transaction hooks must be used within RainbowKitProvider");return e}function RRe(){const e=MRe(),{address:t}=ts(),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 xOt(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(xOt(e,t)).map(([n,r])=>`${n}:${r.replace(/[:;{}</>]/g,"")};`).join("")}var LRe={appName:void 0,disclaimer:void 0,learnMoreUrl:"https://learn.rainbow.me/understanding-web3?utm_source=rainbowkit&utm_campaign=learnmore"},iT=m.createContext(LRe),DRe=m.createContext(!1);function gOt(e,t){let n;return()=>{n&&clearTimeout(n),n=setTimeout(()=>{n=null,e()},t)}}var BRe=()=>{const[e,t]=m.useState({height:void 0,width:void 0});return m.useEffect(()=>{const n=gOt(()=>{t({height:window.innerHeight,width:window.innerWidth})},500);return window.addEventListener("resize",n),n(),()=>window.removeEventListener("resize",n)},[]),e},aT=m.createContext({connector:null,setConnector:()=>{}});function bOt({children:e}){const[t,n]=m.useState(null);return Ae.createElement(aT.Provider,{value:m.useMemo(()=>({connector:t,setConnector:n}),[t])},e)}var oT={COMPACT:"compact",WIDE:"wide"},E$=m.createContext(oT.WIDE);function yOt({children:e,modalSize:t}){const{width:n}=BRe(),r=n&&n<hFt,{connector:s}=m.useContext(aT);return Ae.createElement(E$.Provider,{value:r||s?oT.COMPACT:t},e)}var ale=m.createContext(!1),vOt="rk-version";function wOt({version:e}){localStorage.setItem(vOt,e)}function COt(){const e=m.useCallback(()=>{wOt({version:"2.2.4"})},[]);m.useEffect(()=>{e()},[e])}function SOt(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 NOt(){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":NOt()?"Arc":(e==null?void 0:e.indexOf("chrome"))>-1?"Chrome":(e==null?void 0:e.indexOf("firefox"))>-1?"Firefox":ole()?"Safari":"Browser"}var AOt=UPt.UAParser(),{os:cle}=AOt;function jOt(){return cle.name==="Windows"}function EOt(){return cle.name==="Mac OS"}function _Ot(){return["Ubuntu","Mint","Fedora","Debian","Arch","Linux"].includes(cle.name)}function ule(){return jOt()?"Windows":EOt()?"macOS":_Ot()?"Linux":"Desktop"}var kOt=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)},TOt=e=>{var n,r,s;return(b5()?(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)},IOt=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)},$Re=(e,t)=>e.some(n=>n.id===t),POt=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)},FOt=(e,t)=>e.id==="walletConnect"&&t?{...e,walletConnectModalConnector:t}:e,OOt=({wallets:e,recentWallets:t})=>[...t,...e.filter(n=>!$Re(t,n.id))],URe="rk-recent";function MOt(e){try{const t=e?JSON.parse(e):[];return Array.isArray(t)?t:[]}catch{return[]}}function zRe(){return typeof localStorage<"u"?MOt(localStorage.getItem(URe)):[]}function ROt(e){return[...new Set(e)]}function LOt(e){const t=ROt([e,...zRe()]);localStorage.setItem(URe,JSON.stringify(t))}function e_(e=!1){var R,O,U;const t=UA(),n=qFt(),{connectAsync:r,connectors:s}=igt(),a=s,{setIsWalletConnectModalOpen:o}=hLe(),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:K})=>K===z))==null?void 0:ne.id)??((J=t[0])==null?void 0:J.id),connector:L});return X&&LOt(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(POt).filter(L=>!L.isWalletConnectModalConnector).filter(L=>e?!x.some(X=>X.id===L.rdns):!0).map(L=>FOt(L,f)),v=[...x,...g],w=SOt(v,L=>L.id),N=zRe().map(L=>w[L]).filter(Boolean).slice(0,3),P=[],I=OOt({wallets:v,recentWallets:N});for(const L of I){if(!L)continue;const z=fbe(L),X=$Re(N,L.id);if(z){P.push({...L,iconUrl:L.icon,ready:!0,connect:()=>c(L),groupName:"Installed",recent:X});continue}P.push({...L,ready:L.installed??!0,connect:()=>c(L),desktopDownloadUrl:IOt(L),extensionDownloadUrl:kOt(L),groupName:L.groupName,mobileDownloadUrl:TOt(L),getQrCodeUri:(R=L.qrCode)!=null&&R.getUri?()=>d(L,L.qrCode.getUri):void 0,getDesktopUri:(O=L.desktop)!=null&&O.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 P}var HRe=async()=>(await is(async()=>{const{default:e}=await import("./assets-NU2OP443-COMs-Mo6.js");return{default:e}},[])).default,DOt=()=>ix(HRe),BOt=()=>Ae.createElement(Fc,{background:"#d0d5de",borderRadius:"10",height:"48",src:HRe,width:"48"}),VRe=async()=>(await is(async()=>{const{default:e}=await import("./login-CWDTIDNK-DhDUYE4b.js");return{default:e}},[])).default,$Ot=()=>ix(VRe),UOt=()=>Ae.createElement(Fc,{background:"#d0d5de",borderRadius:"10",height:"48",src:VRe,width:"48"}),Ms=Ae.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)=>Ae.createElement(wn,{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));Ms.displayName="Text";var zOt={large:{fontSize:"16",paddingX:"24",paddingY:"10"},medium:{fontSize:"14",height:"28",paddingX:"12",paddingY:"4"},small:{fontSize:"14",paddingX:"10",paddingY:"5"}};function md({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=lu(),x=e?"actionButtonSecondaryBackground":u?"accentColor":d?"actionButtonSecondaryBackground":null,{fontSize:g,height:v,paddingX:w,paddingY:C}=zOt[a],N=!f||!d;return Ae.createElement(wn,{...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&&au({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}:{}},Ae.createElement(Ms,{color:e?"modalTextSecondary":u?"accentColorForeground":"accentColor",size:g,weight:"bold"},n))}var HOt=()=>lu()?Ae.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"},Ae.createElement("title",null,"Close"),Ae.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"})):Ae.createElement("svg",{"aria-hidden":!0,fill:"none",height:"10",viewBox:"0 0 10 10",width:"10",xmlns:"http://www.w3.org/2000/svg"},Ae.createElement("title",null,"Close"),Ae.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"})),W3=({"aria-label":e="Close",onClose:t})=>{const n=lu();return Ae.createElement(wn,{alignItems:"center","aria-label":e,as:"button",background:"closeButtonBackground",borderColor:"actionButtonBorder",borderRadius:"full",borderStyle:"solid",borderWidth:n?"0":"1",className:au({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"},Ae.createElement(HOt,null))},WRe=async()=>(await is(async()=>{const{default:e}=await import("./sign-A7IJEUT5-CGsRnPrd.js");return{default:e}},[])).default;function VOt({onClose:e,onCloseModal:t}){const{i18n:n}=m.useContext(cc),[{status:r,...s},a]=Ae.useState({status:"idle"}),o=bFt(),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);Ae.useEffect(()=>{c.current||(c.current=!0,l())},[l]);const u=lu(),{address:d,chain:f}=ts(),{signMessageAsync:x}=b_e(),g=async()=>{try{const v=f==null?void 0:f.id,{nonce:w}=s;if(!d||!v||!w)return;a(P=>({...P,errorMessage:void 0,status:"signing"}));const C=o.createMessage({address:d,chainId:v,nonce:w});let N;try{N=await x({message:C})}catch(P){return P instanceof yo?a(I=>({...I,status:"idle"})):a(I=>({...I,errorMessage:n.t("sign_in.signature.signing_error"),status:"idle"}))}a(P=>({...P,status:"verifying"}));try{if(await o.verify({message:C,signature:N})){t();return}throw new Error}catch{return a(P=>({...P,errorMessage:n.t("sign_in.signature.verifying_error"),status:"idle"}))}}catch{a({errorMessage:n.t("sign_in.signature.oops_error"),status:"idle"})}};return Ae.createElement(wn,{position:"relative"},Ae.createElement(wn,{display:"flex",paddingRight:"16",paddingTop:"16",position:"absolute",right:"0"},Ae.createElement(W3,{onClose:e})),Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:u?"32":"24",padding:"24",paddingX:"18",style:{paddingTop:u?"60px":"36px"}},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:u?"6":"4",style:{maxWidth:u?320:280}},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:u?"32":"16"},Ae.createElement(Fc,{height:40,src:WRe,width:40}),Ae.createElement(Ms,{color:"modalText",size:u?"20":"18",textAlign:"center",weight:"heavy"},n.t("sign_in.label"))),Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:u?"16":"12"},Ae.createElement(Ms,{color:"modalTextSecondary",size:u?"16":"14",textAlign:"center"},n.t("sign_in.description")),r==="idle"&&s.errorMessage?Ae.createElement(Ms,{color:"error",size:u?"16":"14",textAlign:"center",weight:"bold"},s.errorMessage):null)),Ae.createElement(wn,{alignItems:u?void 0:"center",display:"flex",flexDirection:"column",gap:"8",width:"full"},Ae.createElement(md,{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?Ae.createElement(md,{label:"Cancel",onClick:e,size:"large",type:"secondary"}):Ae.createElement(wn,{as:"button",borderRadius:"full",className:au({active:"shrink",hover:"grow"}),display:"block",onClick:e,paddingX:"10",paddingY:"5",rel:"noreferrer",style:{willChange:"transform"},target:"_blank",transition:"default"},Ae.createElement(Ms,{color:"closeButton",size:u?"16":"14",weight:"bold"},n.t("sign_in.message.cancel"))))))}function WOt(){const e=UA(),t=e_(),n=j$()==="unauthenticated",r=m.useCallback(()=>{ix(...t.map(s=>s.iconUrl),...e.map(s=>s.iconUrl).filter(kRe)),lu()||(DOt(),$Ot()),n&&ix(WRe)},[t,e,n]);m.useEffect(()=>{r()},[r])}var qRe="WALLETCONNECT_DEEPLINK_CHOICE";function qOt({mobileUri:e,name:t}){localStorage.setItem(qRe,JSON.stringify({href:e.split("?")[0],name:t}))}function GOt(){localStorage.removeItem(qRe)}var GRe=m.createContext(void 0),Zee="data-rk",KRe=e=>({[Zee]:e||""}),KOt=e=>{if(e&&!/^[a-zA-Z0-9_]+$/.test(e))throw new Error(`Invalid ID: ${e}`);return e?`[${Zee}="${e}"]`:`[${Zee}]`},YOt=()=>{const e=m.useContext(GRe);return KRe(e)},XOt=uMe();function QOt({appInfo:e,avatar:t,children:n,coolMode:r=!1,id:s,initialChain:a,locale:o,modalSize:l=oT.WIDE,showRecentTransactions:c=!1,theme:u=XOt}){if(WOt(),COt(),t_e({onDisconnect:GOt}),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=KOt(s),f={...LRe,...e},x=t??ERe;return Ae.createElement(WFt,{initialChain:a},Ae.createElement(bOt,null,Ae.createElement(MFt,{locale:o},Ae.createElement(DRe.Provider,{value:r},Ae.createElement(yOt,{modalSize:l},Ae.createElement(ale.Provider,{value:c},Ae.createElement(mOt,null,Ae.createElement(_Re.Provider,{value:x},Ae.createElement(iT.Provider,{value:f},Ae.createElement(GRe.Provider,{value:s},Ae.createElement(KFt,null,Ae.createElement(fRt,null,u?Ae.createElement("div",{...KRe(s)},Ae.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 ZOt="_9pm4ki5 ju367va ju367v15 ju367v8r",JOt="_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 eMt(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()}},[]),Ae.createElement(Ae.Fragment,null,Ae.createElement("div",{onFocus:m.useCallback(()=>t.current&&hbe(t.current,"end"),[]),tabIndex:0}),Ae.createElement("div",{ref:t,style:{outline:"none"},tabIndex:-1,...e}),Ae.createElement("div",{onFocus:m.useCallback(()=>t.current&&hbe(t.current,"start"),[]),tabIndex:0}))}var tMt=e=>e.stopPropagation();function RR({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=YOt(),c=lu();return Ae.createElement(Ae.Fragment,null,n?Na.createPortal(Ae.createElement(gRe,{enabled:s},Ae.createElement(wn,{...l},Ae.createElement(wn,{...l,alignItems:c?"flex-end":"center","aria-labelledby":r,"aria-modal":!0,className:JOt,onClick:o,position:"fixed",role:"dialog"},Ae.createElement(eMt,{className:ZOt,onClick:tMt,role:"document"},e)))),document.body):null)}var nMt="_1ckjpok7",rMt="_1ckjpok1 ju367vb6 ju367vdr ju367vp ju367vt ju367vv ju367vel ju367va ju367v15 ju367v6c ju367v8r",sMt="_1ckjpok4 _1ckjpok1 ju367vb6 ju367vdr ju367vp ju367vt ju367vv ju367vel ju367va ju367v15 ju367v6c ju367v8r",iMt="_1ckjpok6 ju367vq",aMt="_1ckjpok3 _1ckjpok1 ju367vb6 ju367vdr ju367vp ju367vt ju367vv ju367vel ju367va ju367v15 ju367v6c ju367v8r",oMt="_1ckjpok2 _1ckjpok1 ju367vb6 ju367vdr ju367vp ju367vt ju367vv ju367vel ju367va ju367v15 ju367v6c ju367v8r";function LR({bottomSheetOnMobile:e=!1,children:t,marginTop:n,padding:r="16",paddingBottom:s,wide:a=!1}){const o=lu(),c=m.useContext(E$)===oT.COMPACT;return Ae.createElement(wn,{marginTop:n},Ae.createElement(wn,{className:[a?o?oMt:c?sMt:aMt:rMt,o?iMt:null,o&&e?nMt:null].join(" ")},Ae.createElement(wn,{padding:r,paddingBottom:s??r},t)))}var pbe=["k","m","b","t"];function bP(e,t=1){return e.toString().replace(new RegExp(`(.+\\.\\d{${t}})\\d+`),"$1").replace(/(\.[1-9]*)0+$/,"$1").replace(/\.$/,"")}function YRe(e){if(e<1)return bP(e,3);if(e<10**2)return bP(e,2);if(e<10**4)return new Intl.NumberFormat().format(Number.parseFloat(bP(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=bP(e,1)+pbe[r];break}}return n}function XRe(e){return e.length<8?e:`${e.substring(0,4)}…${e.substring(e.length-4)}`}function QRe(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 lMt=()=>Ae.createElement("svg",{fill:"none",height:"13",viewBox:"0 0 13 13",width:"13",xmlns:"http://www.w3.org/2000/svg"},Ae.createElement("title",null,"Copied"),Ae.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"})),cMt=()=>Ae.createElement("svg",{fill:"none",height:"16",viewBox:"0 0 17 16",width:"17",xmlns:"http://www.w3.org/2000/svg"},Ae.createElement("title",null,"Copy"),Ae.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"})),uMt=()=>Ae.createElement("svg",{fill:"none",height:"16",viewBox:"0 0 18 16",width:"18",xmlns:"http://www.w3.org/2000/svg"},Ae.createElement("title",null,"Disconnect"),Ae.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 dMt(){const e=MRe(),{address:t}=ts(),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 ZRe=e=>{var t,n;return(n=(t=e==null?void 0:e.blockExplorers)==null?void 0:t.default)==null?void 0:n.url},JRe=()=>Ae.createElement("svg",{fill:"none",height:"19",viewBox:"0 0 20 19",width:"20",xmlns:"http://www.w3.org/2000/svg"},Ae.createElement("title",null,"Link"),Ae.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"})),fMt=()=>Ae.createElement("svg",{fill:"none",height:"19",viewBox:"0 0 20 19",width:"20",xmlns:"http://www.w3.org/2000/svg"},Ae.createElement("title",null,"Cancel"),Ae.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"})),hMt=()=>Ae.createElement("svg",{fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},Ae.createElement("title",null,"Success"),Ae.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"})),pMt=e=>{switch(e){case"pending":return JE;case"confirmed":return hMt;case"failed":return fMt;default:return JE}};function mMt({tx:e}){const t=lu(),n=pMt(e.status),r=e.status==="failed"?"error":"accentColor",{chain:s}=ts(),a=e.status==="confirmed"?"Confirmed":e.status==="failed"?"Failed":"Pending",o=ZRe(s);return Ae.createElement(Ae.Fragment,null,Ae.createElement(wn,{...o?{as:"a",background:{hover:"profileForeground"},borderRadius:"menuButton",className:au({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"},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"row",gap:t?"16":"14"},Ae.createElement(wn,{color:r},Ae.createElement(n,null)),Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:t?"3":"1"},Ae.createElement(wn,null,Ae.createElement(Ms,{color:"modalText",font:"body",size:t?"16":"14",weight:"bold"},e==null?void 0:e.description)),Ae.createElement(wn,null,Ae.createElement(Ms,{color:e.status==="pending"?"modalTextSecondary":r,font:"body",size:"14",weight:t?"medium":"regular"},a)))),o&&Ae.createElement(wn,{alignItems:"center",color:"modalTextDim",display:"flex"},Ae.createElement(JRe,null))))}var xMt=3;function gMt({address:e}){const t=RRe(),n=dMt(),{chain:r}=ts(),s=ZRe(r),a=t.slice(0,xMt),o=a.length>0,l=lu(),{appName:c}=m.useContext(iT),{i18n:u}=m.useContext(cc);return Ae.createElement(Ae.Fragment,null,Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"10",paddingBottom:"2",paddingTop:"16",paddingX:l?"8":"18"},o&&Ae.createElement(wn,{paddingBottom:l?"4":"0",paddingTop:"8",paddingX:l?"12":"6"},Ae.createElement(wn,{display:"flex",justifyContent:"space-between"},Ae.createElement(Ms,{color:"modalTextSecondary",size:l?"16":"14",weight:"semibold"},u.t("profile.transactions.recent.title")),Ae.createElement(wn,{style:{marginBottom:-6,marginLeft:-10,marginRight:-10,marginTop:-6}},Ae.createElement(wn,{as:"button",background:{hover:"profileForeground"},borderRadius:"actionButton",className:au({active:"shrink"}),onClick:n,paddingX:l?"8":"12",paddingY:l?"4":"5",transition:"default",type:"button"},Ae.createElement(Ms,{color:"modalTextSecondary",size:l?"16":"14",weight:"semibold"},u.t("profile.transactions.clear.label")))))),Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"4"},o?a.map(d=>Ae.createElement(mMt,{key:d.hash,tx:d})):Ae.createElement(Ae.Fragment,null,Ae.createElement(wn,{padding:l?"12":"8"},Ae.createElement(Ms,{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&&Ae.createElement(wn,{background:"generalBorderDim",height:"1",marginX:"12",marginY:"8"})))),s&&Ae.createElement(wn,{paddingBottom:"18",paddingX:l?"8":"18"},Ae.createElement(wn,{alignItems:"center",as:"a",background:{hover:"profileForeground"},borderRadius:"menuButton",className:au({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"}:{}},Ae.createElement(Ms,{color:"modalText",font:"body",size:l?"16":"14",weight:l?"semibold":"bold"},u.t("profile.explorer.label")),Ae.createElement(JRe,null))))}function mbe({action:e,icon:t,label:n,testId:r,url:s}){const a=lu();return Ae.createElement(wn,{...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:au({active:"shrinkSm",hover:a?void 0:"grow"}),display:"flex",onClick:e,padding:a?"6":"8",style:{willChange:"transform"},testId:r,transition:"default",width:"full"},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"1",justifyContent:"center",paddingTop:"2",width:"full"},Ae.createElement(wn,{color:"modalText",height:"max"},t),Ae.createElement(wn,null,Ae.createElement(Ms,{color:"modalText",size:a?"12":"13",weight:"semibold"},n))))}function bMt({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?QRe(n):XRe(e),f=r==null?void 0:r.formatted,x=f?YRe(Number.parseFloat(f)):void 0,g="rk_profile_title",v=lu(),{i18n:w}=m.useContext(cc);return Ae.createElement(Ae.Fragment,null,Ae.createElement(wn,{display:"flex",flexDirection:"column"},Ae.createElement(wn,{background:"profileForeground",padding:"16"},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:v?"16":"12",justifyContent:"center",margin:"8",style:{textAlign:"center"}},Ae.createElement(wn,{style:{position:"absolute",right:16,top:16,willChange:"transform"}},Ae.createElement(W3,{onClose:s}))," ",Ae.createElement(wn,{marginTop:v?"24":"0"},Ae.createElement(IFt,{address:e,imageUrl:t,size:v?82:74})),Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:v?"4":"0",textAlign:"center"},Ae.createElement(wn,{textAlign:"center"},Ae.createElement(Ms,{as:"h1",color:"modalText",id:g,size:v?"20":"18",weight:"heavy"},d)),!!r&&Ae.createElement(wn,{textAlign:"center"},Ae.createElement(Ms,{as:"h1",color:"modalTextSecondary",id:g,size:v?"16":"14",weight:"semibold"},x," ",r.symbol)))),Ae.createElement(wn,{display:"flex",flexDirection:"row",gap:"8",margin:"2",marginTop:"16"},Ae.createElement(mbe,{action:u,icon:l?Ae.createElement(lMt,null):Ae.createElement(cMt,null),label:l?w.t("profile.copy_address.copied"):w.t("profile.copy_address.label")}),Ae.createElement(mbe,{action:a,icon:Ae.createElement(uMt,null),label:w.t("profile.disconnect.label"),testId:"disconnect-button"}))),o&&Ae.createElement(Ae.Fragment,null,Ae.createElement(wn,{background:"generalBorder",height:"1",marginTop:"-1"}),Ae.createElement(wn,null,Ae.createElement(gMt,{address:e})))))}function yMt({onClose:e,open:t}){const{address:n}=ts(),{balance:r,ensAvatar:s,ensName:a}=PRe({address:n,includeBalance:t}),{disconnect:o}=wB();return n?Ae.createElement(Ae.Fragment,null,n&&Ae.createElement(RR,{onClose:e,open:t,titleId:"rk_account_modal_title"},Ae.createElement(LR,{bottomSheetOnMobile:!0,padding:"0"},Ae.createElement(bMt,{address:n,ensAvatar:s,ensName:a,balance:r,onClose:e,onDisconnect:o})))):null}var vMt=({size:e})=>Ae.createElement("svg",{fill:"none",height:e,viewBox:"0 0 28 28",width:e,xmlns:"http://www.w3.org/2000/svg"},Ae.createElement("title",null,"Disconnect"),Ae.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"})),wMt="v9horb0",dle=Ae.forwardRef(({children:e,currentlySelected:t=!1,onClick:n,testId:r,...s},a)=>{const o=lu();return Ae.createElement(wn,{as:"button",borderRadius:"menuButton",disabled:t,display:"flex",onClick:n,ref:a,testId:r,type:"button"},Ae.createElement(wn,{borderRadius:"menuButton",className:[o?wMt:void 0,!t&&au({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 CMt=({chainId:e,currentChainId:t,switchChain:n,chainIconSize:r,isLoading:s,src:a,name:o,iconBackground:l,idx:c})=>{const u=lu(),{i18n:d}=m.useContext(cc),f=UA(),x=t===e;return Ae.createElement(m.Fragment,null,Ae.createElement(dle,{currentlySelected:x,onClick:x?void 0:()=>n({chainId:e}),testId:`chain-option-${e}`},Ae.createElement(wn,{fontFamily:"body",fontSize:"16",fontWeight:"bold"},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"row",justifyContent:"space-between"},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"4",height:r},a&&Ae.createElement(wn,{height:"full",marginRight:"8"},Ae.createElement(Fc,{alt:o,background:l,borderRadius:"full",height:r,src:a,width:r,testId:`chain-option-${e}-icon`})),Ae.createElement("div",null,o??o)),x&&Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"row",marginRight:"6"},Ae.createElement(Ms,{color:"accentColorForeground",size:"14",weight:"medium"},d.t("chains.connected")),Ae.createElement(wn,{background:"connectionIndicator",borderColor:"selectedOptionBorder",borderRadius:"full",borderStyle:"solid",borderWidth:"1",height:"8",marginLeft:"8",width:"8"})),s&&Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"row",marginRight:"6"},Ae.createElement(Ms,{color:"modalText",size:"14",weight:"medium"},d.t("chains.confirm")),Ae.createElement(wn,{background:"standby",borderRadius:"full",height:"8",marginLeft:"8",width:"8"}))))),u&&c<f.length-1&&Ae.createElement(wn,{background:"generalBorderDim",height:"1",marginX:"8"}))},SMt=CMt,NMt="_18dqw9x0",AMt="_18dqw9x1";function jMt({onClose:e,open:t}){const{chainId:n}=ts(),{chains:r}=El(),[s,a]=m.useState(null),{switchChain:o}=Hie({mutation:{onMutate:({chainId:v})=>{a(v)},onSuccess:()=>{s&&a(null)},onError:()=>{s&&a(null)},onSettled:()=>{e()}}}),{i18n:l}=m.useContext(cc),{disconnect:c}=wB(),u="rk_chain_modal_title",d=lu(),f=r.some(v=>v.id===n),x=d?"36":"28",g=UA();return n?Ae.createElement(RR,{onClose:e,open:t,titleId:u},Ae.createElement(LR,{bottomSheetOnMobile:!0,paddingBottom:"0"},Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"14"},Ae.createElement(wn,{display:"flex",flexDirection:"row",justifyContent:"space-between"},d&&Ae.createElement(wn,{width:"30"}),Ae.createElement(wn,{paddingBottom:"0",paddingLeft:"8",paddingTop:"4"},Ae.createElement(Ms,{as:"h1",color:"modalText",id:u,size:d?"20":"18",weight:"heavy"},l.t("chains.title"))),Ae.createElement(W3,{onClose:e})),!f&&Ae.createElement(wn,{marginX:"8",textAlign:d?"center":"left"},Ae.createElement(Ms,{color:"modalTextSecondary",size:"14",weight:"medium"},l.t("chains.wrong_network"))),Ae.createElement(wn,{className:d?AMt:NMt,display:"flex",flexDirection:"column",gap:"4",padding:"2",paddingBottom:"16"},g.map(({iconBackground:v,iconUrl:w,id:C,name:N},P)=>Ae.createElement(SMt,{key:C,chainId:C,currentChainId:n,switchChain:o,chainIconSize:x,isLoading:s===C,src:w,name:N,iconBackground:v,idx:P})),!f&&Ae.createElement(Ae.Fragment,null,Ae.createElement(wn,{background:"generalBorderDim",height:"1",marginX:"8"}),Ae.createElement(dle,{onClick:()=>c(),testId:"chain-option-disconnect"},Ae.createElement(wn,{color:"error",fontFamily:"body",fontSize:"16",fontWeight:"bold"},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"row",justifyContent:"space-between"},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"4",height:x},Ae.createElement(wn,{alignItems:"center",color:"error",height:x,justifyContent:"center",marginRight:"8"},Ae.createElement(vMt,{size:Number(x)})),Ae.createElement("div",null,l.t("chains.disconnect"))))))))))):null}function EMt(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})=>Ae.createElement(wn,{as:"a",color:"accentColor",href:t,rel:"noreferrer",target:"_blank"},e),hle=({children:e})=>Ae.createElement(Ms,{color:"modalTextSecondary",size:"12",weight:"medium"},e);function xbe({compactModeEnabled:e=!1,getWallet:t}){const{disclaimer:n,learnMoreUrl:r}=m.useContext(iT),{i18n:s}=m.useContext(cc);return Ae.createElement(Ae.Fragment,null,Ae.createElement(wn,{alignItems:"center",color:"accentColor",display:"flex",flexDirection:"column",height:"full",justifyContent:"space-around"},Ae.createElement(wn,{marginBottom:"10"},!e&&Ae.createElement(Ms,{color:"modalText",size:"18",weight:"heavy"},s.t("intro.title"))),Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"32",justifyContent:"center",marginY:"20",style:{maxWidth:312}},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16"},Ae.createElement(wn,{borderRadius:"6",height:"48",minWidth:"48",width:"48"},Ae.createElement(BOt,null)),Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"4"},Ae.createElement(Ms,{color:"modalText",size:"14",weight:"bold"},s.t("intro.digital_asset.title")),Ae.createElement(Ms,{color:"modalTextSecondary",size:"14",weight:"medium"},s.t("intro.digital_asset.description")))),Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16"},Ae.createElement(wn,{borderRadius:"6",height:"48",minWidth:"48",width:"48"},Ae.createElement(UOt,null)),Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"4"},Ae.createElement(Ms,{color:"modalText",size:"14",weight:"bold"},s.t("intro.login.title")),Ae.createElement(Ms,{color:"modalTextSecondary",size:"14",weight:"medium"},s.t("intro.login.description"))))),Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"12",justifyContent:"center",margin:"10"},Ae.createElement(md,{label:s.t("intro.get.label"),onClick:t}),Ae.createElement(wn,{as:"a",className:au({active:"shrink",hover:"grow"}),display:"block",href:r,paddingX:"12",paddingY:"4",rel:"noreferrer",style:{willChange:"transform"},target:"_blank",transition:"default"},Ae.createElement(Ms,{color:"accentColor",size:"14",weight:"bold"},s.t("intro.learn_more.label")))),n&&!e&&Ae.createElement(wn,{marginBottom:"8",marginTop:"12",textAlign:"center"},Ae.createElement(n,{Link:fle,Text:hle}))))}var eLe=()=>Ae.createElement("svg",{fill:"none",height:"17",viewBox:"0 0 11 17",width:"11",xmlns:"http://www.w3.org/2000/svg"},Ae.createElement("title",null,"Back"),Ae.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"})),_Mt=()=>Ae.createElement("svg",{fill:"none",height:"12",viewBox:"0 0 8 12",width:"8",xmlns:"http://www.w3.org/2000/svg"},Ae.createElement("title",null,"Info"),Ae.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"})),kMt=({"aria-label":e="Info",onClick:t})=>{const n=lu();return Ae.createElement(wn,{alignItems:"center","aria-label":e,as:"button",background:"closeButtonBackground",borderColor:"actionButtonBorder",borderRadius:"full",borderStyle:"solid",borderWidth:n?"0":"1",className:au({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"},Ae.createElement(_Mt,null))},tLe=e=>{const t=m.useRef(null),n=m.useContext(DRe),r=rle(e);return m.useEffect(()=>{if(n&&t.current&&r)return IMt(t.current,r)},[n,r]),t},TMt=()=>{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 IMt(e,t){gbe++;const n=[15,20,25,35,45],r=35;let s=[],a=!1,o=0,l=0;const c=TMt();function u(){const R=n[Math.floor(Math.random()*n.length)],O=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,K=document.createElement("div");K.innerHTML=`<img src="${t}" width="${R}" height="${R}" style="border-radius: 25%">`,K.setAttribute("style",["position:absolute","will-change:transform",`top:${X}px`,`left:${ne}px`,`transform:rotate(${L}deg)`].join(";")),c.appendChild(K),s.push({direction:J,element:K,left:ne,size:R,speedHorz:O,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(O=>O!==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 O,U;"touches"in R?(o=(O=R.touches)==null?void 0:O[0].clientX,l=(U=R.touches)==null?void 0:U[0].clientY):(o=R.clientX,l=R.clientY)},P=R=>{N(R),a=!0},I=()=>{a=!1};return e.addEventListener(C,N,{passive:!1}),e.addEventListener(v,P),e.addEventListener(w,I),e.addEventListener("mouseleave",I),()=>{e.removeEventListener(C,N),e.removeEventListener(v,P),e.removeEventListener(w,I),e.removeEventListener("mouseleave",I);const R=setInterval(()=>{f&&s.length===0&&(cancelAnimationFrame(f),clearInterval(R),--gbe===0&&c.remove())},500)}}var PMt="g5kl0l0",nLe=({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=tLe(r),[x,g]=Ae.useState(!1),{i18n:v}=Ae.useContext(cc);return Ae.createElement(wn,{display:"flex",flexDirection:"column",onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),ref:f},Ae.createElement(wn,{as:e,borderRadius:"menuButton",borderStyle:"solid",borderWidth:"1",className:t?void 0:[PMt,au({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},Ae.createElement(wn,{color:t?"accentColorForeground":"modalText",disabled:!o,fontFamily:"body",fontSize:"16",fontWeight:"bold",transition:"default"},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"12"},Ae.createElement(Fc,{background:n,...!x&&u?{borderColor:"actionButtonBorder"}:{},useAsImage:!u,borderRadius:"6",height:"28",src:r,width:"28"}),Ae.createElement(wn,null,Ae.createElement(wn,{style:{marginTop:l?-2:void 0},maxWidth:"200"},s),l&&Ae.createElement(Ms,{color:t?"accentColorForeground":"accentColor",size:"12",style:{lineHeight:1,marginTop:-1},weight:"medium"},v.t("connect.recent")))))))};nLe.displayName="ModalSelection";var FMt="rk-latest-id";function OMt(e){localStorage.setItem(FMt,e)}var cW=(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})`},MMt=e=>e?[cW(e,.2),cW(e,.14),cW(e,.1)]:null,RMt=e=>/^#([0-9a-f]{3}){1,2}$/i.test(e),rLe=async()=>(await is(async()=>{const{default:e}=await import("./connect-MR6XDLIE-BET5HMNk.js");return{default:e}},[])).default,LMt=()=>ix(rLe),DMt=()=>Ae.createElement(Fc,{background:"#515a70",borderColor:"generalBorder",borderRadius:"10",height:"48",src:rLe,width:"48"}),sLe=async()=>(await is(async()=>{const{default:e}=await import("./create-X4WFHLCW-De9pC3ym.js");return{default:e}},[])).default,iLe=()=>ix(sLe),BMt=()=>Ae.createElement(Fc,{background:"#e3a5e8",borderColor:"generalBorder",borderRadius:"10",height:"48",src:sLe,width:"48"}),aLe=async()=>(await is(async()=>{const{default:e}=await import("./refresh-HJGJRASX-D0rkc63_.js");return{default:e}},[])).default,$Mt=()=>ix(aLe),UMt=()=>Ae.createElement(Fc,{background:"#515a70",borderColor:"generalBorder",borderRadius:"10",height:"48",src:aLe,width:"48"}),oLe=async()=>(await is(async()=>{const{default:e}=await import("./scan-DEOT2M37-1-mJ5OyF.js");return{default:e}},[])).default,lLe=()=>ix(oLe),zMt=()=>Ae.createElement(Fc,{background:"#515a70",borderColor:"generalBorder",borderRadius:"10",height:"48",src:oLe,width:"48"}),HMt="_1vwt0cg0",VMt="_1vwt0cg2 ju367v7a ju367v7v",WMt="_1vwt0cg3",qMt="_1vwt0cg4",GMt=(e,t)=>{const n=Array.prototype.slice.call(uFt.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 cLe({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=GMt(o,e),v=c/g.length;[{x:0,y:0},{x:1,y:0},{x:0,y:1}].forEach(({x:I,y:R})=>{const O=(g.length-7)*v*I,U=(g.length-7)*v*R;for(let L=0;L<3;L++)x.push(Ae.createElement("rect",{fill:L%2!==0?"white":"black",height:v*(7-L*2),key:`${L}-${I}-${R}`,rx:(L-2)*-5+(L===0?2:0),ry:(L-2)*-5+(L===0?2:0),width:v*(7-L*2),x:O+v*L,y:U+v*L}))});const C=Math.floor((r+25)/v),N=g.length/2-C/2,P=g.length/2+C/2-1;return g.forEach((I,R)=>{I.forEach((O,U)=>{g[R][U]&&(R<7&&U<7||R>g.length-8&&U<7||R<7&&U>g.length-8||R>N&&R<P&&U>N&&U<P||x.push(Ae.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 Ae.createElement(wn,{borderColor:"generalBorder",borderRadius:"menuButton",borderStyle:"solid",borderWidth:"1",className:HMt,padding:l,width:"max"},Ae.createElement(wn,{style:{height:c,userSelect:"none",width:c},userSelect:"none"},Ae.createElement(wn,{display:"flex",justifyContent:"center",position:"relative",style:{height:0,top:d,width:c},width:"full"},Ae.createElement(Fc,{background:t,borderColor:{custom:"rgba(0, 0, 0, 0.06)"},borderRadius:"13",height:r,src:s,width:r})),Ae.createElement("svg",{height:c,style:{all:"revert"},width:c},Ae.createElement("title",null,"QR Code"),Ae.createElement("defs",null,Ae.createElement("clipPath",{id:"clip-wrapper"},Ae.createElement("rect",{height:f,width:f})),Ae.createElement("clipPath",{id:"clip-logo"},Ae.createElement("rect",{height:r,width:r}))),Ae.createElement("rect",{fill:"transparent",height:c,width:c}),u)))}var uLe=async()=>{switch(lle()){case"Arc":return(await is(async()=>{const{default:t}=await import("./Arc-R3PUWRPJ-CUdEQO8X.js");return{default:t}},[])).default;case"Brave":return(await is(async()=>{const{default:t}=await import("./Brave-24BM36UM-C6C5mkTK.js");return{default:t}},[])).default;case"Chrome":return(await is(async()=>{const{default:t}=await import("./Chrome-TLI42HDP-BgiVz-ma.js");return{default:t}},[])).default;case"Edge":return(await is(async()=>{const{default:t}=await import("./Edge-AZ34LAFM-EBh9cG_z.js");return{default:t}},[])).default;case"Firefox":return(await is(async()=>{const{default:t}=await import("./Firefox-ZDK7RHKK-5nyhB0sj.js");return{default:t}},[])).default;case"Opera":return(await is(async()=>{const{default:t}=await import("./Opera-BKMCKUXC-CCypmVaM.js");return{default:t}},[])).default;case"Safari":return(await is(async()=>{const{default:t}=await import("./Safari-PXQIVS6N-B-Lfxb9r.js");return{default:t}},[])).default;default:return(await is(async()=>{const{default:t}=await import("./Browser-4R4QKTV2-D3ON1q-S.js");return{default:t}},[])).default}},KMt=()=>ix(uLe),dLe=async()=>{switch(ule()){case"Windows":return(await is(async()=>{const{default:t}=await import("./Windows-GTAT3OTE-K9Pt3pUF.js");return{default:t}},[])).default;case"macOS":return(await is(async()=>{const{default:t}=await import("./Macos-5QL4JBJE-DLNYPiln.js");return{default:t}},[])).default;case"Linux":return(await is(async()=>{const{default:t}=await import("./Linux-VYP66PDO--MOvpQUa.js");return{default:t}},[])).default;default:return(await is(async()=>{const{default:t}=await import("./Linux-VYP66PDO--MOvpQUa.js");return{default:t}},[])).default}},YMt=()=>ix(dLe);function XMt({getWalletDownload:e,compactModeEnabled:t}){const r=e_().filter(a=>a.isRainbowKitConnector).splice(0,5),{i18n:s}=m.useContext(cc);return Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",marginTop:"18",width:"full"},Ae.createElement(wn,{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 Ae.createElement(wn,{alignItems:"center",display:"flex",gap:"16",justifyContent:"space-between",key:a.id,width:"full"},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16"},Ae.createElement(Fc,{background:l,borderColor:"actionButtonBorder",borderRadius:"10",height:"48",src:c,width:"48"}),Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"2"},Ae.createElement(Ms,{color:"modalText",size:"14",weight:"bold"},d),Ae.createElement(Ms,{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))),Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"4"},Ae.createElement(md,{label:s.t("get.action.label"),onClick:()=>e(u),type:"secondary"})))})),Ae.createElement(wn,{alignItems:"center",borderRadius:"10",display:"flex",flexDirection:"column",gap:"8",justifyContent:"space-between",marginBottom:"4",paddingY:"8",style:{maxWidth:275,textAlign:"center"}},Ae.createElement(Ms,{color:"modalText",size:"14",weight:"bold"},s.t("get.looking_for.title")),Ae.createElement(Ms,{color:"modalTextSecondary",size:"14",weight:"medium"},t?s.t("get.looking_for.desktop.compact_description"):s.t("get.looking_for.desktop.wide_description"))))}var uW="44";function QMt({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(cc),P=!!o.extensionDownloadUrl,I=(l==null?void 0:l.qrCode)&&P,R=(l==null?void 0:l.qrCode)&&!!o.desktopDownloadUrl,O=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()}}:O?{description:N.t("connect.secondary_action.get.description",{wallet:d}),label:N.t("connect.secondary_action.get.label"),onClick:()=>e(I||R?"DOWNLOAD_OPTIONS":"DOWNLOAD")}:null,{width:z}=BRe(),X=z&&z<768;return m.useEffect(()=>{KMt(),YMt()},[]),Ae.createElement(wn,{display:"flex",flexDirection:"column",height:"full",width:"full"},O?Ae.createElement(wn,{alignItems:"center",display:"flex",height:"full",justifyContent:"center"},Ae.createElement(cLe,{logoBackground:c,logoSize:t?60:72,logoUrl:u,size:t?318:X?Math.max(280,Math.min(z-308,382)):382,uri:s})):Ae.createElement(wn,{alignItems:"center",display:"flex",justifyContent:"center",style:{flexGrow:1}},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"8"},Ae.createElement(wn,{borderRadius:"10",height:uW,overflow:"hidden"},Ae.createElement(Fc,{useAsImage:!o.isRainbowKitConnector,height:uW,src:u,width:uW})),Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"4",paddingX:"32",style:{textAlign:"center"}},Ae.createElement(Ms,{color:"modalText",size:"18",weight:"bold"},x?N.t("connect.status.opening",{wallet:d}):P?N.t("connect.status.not_installed",{wallet:d}):N.t("connect.status.not_available",{wallet:d})),!x&&P?Ae.createElement(wn,{paddingTop:"20"},Ae.createElement(md,{href:o.extensionDownloadUrl,label:N.t("connect.secondary_action.install.label"),type:"secondary"})):null,x&&!O&&Ae.createElement(Ae.Fragment,null,Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",justifyContent:"center"},Ae.createElement(Ms,{color:"modalTextSecondary",size:"14",textAlign:"center",weight:"medium"},N.t("connect.status.confirm"))),Ae.createElement(wn,{alignItems:"center",color:"modalText",display:"flex",flexDirection:"row",height:"32",marginTop:"8"},n?Ae.createElement(md,{label:N.t("connect.secondary_action.retry.label"),onClick:async()=>{w&&U(),a(o)}}):Ae.createElement(wn,{color:"modalTextSecondary"},Ae.createElement(JE,null))))))),Ae.createElement(wn,{alignItems:"center",borderRadius:"10",display:"flex",flexDirection:"row",gap:"8",height:"28",justifyContent:"space-between",marginTop:"12"},x&&L&&Ae.createElement(Ae.Fragment,null,Ae.createElement(Ms,{color:"modalTextSecondary",size:"14",weight:"medium"},L.description),Ae.createElement(md,{label:L.label,onClick:L.onClick,type:"secondary"}))))}var dW=({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&&MMt(n);return Ae.createElement(wn,{alignItems:"center",borderRadius:"13",display:"flex",justifyContent:"center",overflow:"hidden",paddingX:a?"18":"44",position:"relative",style:{flex:1,isolation:"isolate"},width:"full"},Ae.createElement(wn,{borderColor:"actionButtonBorder",borderRadius:"13",borderStyle:"solid",borderWidth:"1",style:{bottom:"0",left:"0",position:"absolute",right:"0",top:"0",zIndex:1}}),d&&Ae.createElement(wn,{background:"downloadTopCardBackground",height:"full",position:"absolute",style:{zIndex:0},width:"full"},Ae.createElement(wn,{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)"}},Ae.createElement(wn,{style:{filter:"blur(100px)",marginLeft:-27,marginTop:-20,opacity:.6,transform:"translate3d(0, 0, 0)"}},Ae.createElement(Fc,{borderRadius:"full",height:"200",src:s,width:"200"})),Ae.createElement(wn,{style:{filter:"blur(100px)",marginRight:0,marginTop:105,opacity:.6,overflow:"auto",transform:"translate3d(0, 0, 0)"}},Ae.createElement(Fc,{borderRadius:"full",height:"200",src:s,width:"200"})))),!d&&f&&Ae.createElement(wn,{background:"downloadBottomCardBackground",style:{bottom:"0",left:"0",position:"absolute",right:"0",top:"0"}},Ae.createElement(wn,{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}}),Ae.createElement(wn,{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}})),Ae.createElement(wn,{alignItems:"flex-start",display:"flex",flexDirection:"row",gap:"24",height:"max",justifyContent:"center",style:{zIndex:1}},Ae.createElement(wn,null,Ae.createElement(Fc,{height:"60",src:s,width:"60",...r?{background:r,borderColor:"generalBorder",borderRadius:"10"}:null})),Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"4",style:{flex:1},width:"full"},Ae.createElement(Ms,{color:"modalText",size:"14",weight:"bold"},l),Ae.createElement(Ms,{color:"modalTextSecondary",size:"14",weight:"medium"},t),Ae.createElement(wn,{marginTop:"14",width:"max"},Ae.createElement(md,{href:c,label:e,onClick:o,size:"medium"})))))};function ZMt({changeWalletStep:e,wallet:t}){const n=lle(),r=ule(),a=m.useContext(E$)==="compact",{desktop:o,desktopDownloadUrl:l,extension:c,extensionDownloadUrl:u,mobileDownloadUrl:d}=t,{i18n:f}=m.useContext(cc);return m.useEffect(()=>{iLe(),lLe(),$Mt(),LMt()},[]),Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"24",height:"full",marginBottom:"8",marginTop:"4",width:"full"},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"8",height:"full",justifyContent:"center",width:"full"},u&&Ae.createElement(dW,{actionLabel:f.t("get_options.extension.download.label",{browser:n}),description:f.t("get_options.extension.description"),iconUrl:uLe,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&&Ae.createElement(dW,{actionLabel:f.t("get_options.desktop.download.label",{platform:r}),description:f.t("get_options.desktop.description"),iconUrl:dLe,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&&Ae.createElement(dW,{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 JMt({changeWalletStep:e,wallet:t}){const{downloadUrls:n,qrCode:r}=t,{i18n:s}=m.useContext(cc);return m.useEffect(()=>{iLe(),lLe()},[]),Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"24",height:"full",width:"full"},Ae.createElement(wn,{style:{maxWidth:220,textAlign:"center"}},Ae.createElement(Ms,{color:"modalTextSecondary",size:"14",weight:"semibold"},s.t("get_mobile.description"))),Ae.createElement(wn,{height:"full"},n!=null&&n.qrCode?Ae.createElement(cLe,{logoSize:0,size:268,uri:n.qrCode}):null),Ae.createElement(wn,{alignItems:"center",borderRadius:"10",display:"flex",flexDirection:"row",gap:"8",height:"34",justifyContent:"space-between",marginBottom:"12",paddingY:"8"},Ae.createElement(md,{label:s.t("get_mobile.continue.label"),onClick:()=>e(r!=null&&r.instructions?"INSTRUCTIONS_MOBILE":"CONNECT")})))}var Gg={connect:()=>Ae.createElement(DMt,null),create:()=>Ae.createElement(BMt,null),install:e=>Ae.createElement(Fc,{background:e.iconBackground,borderColor:"generalBorder",borderRadius:"10",height:"48",src:e.iconUrl,width:"48"}),refresh:()=>Ae.createElement(UMt,null),scan:()=>Ae.createElement(zMt,null)};function eRt({connectWallet:e,wallet:t}){var r,s,a,o;const{i18n:n}=m.useContext(cc);return Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",width:"full"},Ae.createElement(wn,{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 Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16",key:c},Ae.createElement(wn,{borderRadius:"10",height:"48",minWidth:"48",overflow:"hidden",position:"relative",width:"48"},(u=Gg[l.step])==null?void 0:u.call(Gg,t)),Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"4"},Ae.createElement(Ms,{color:"modalText",size:"14",weight:"bold"},n.t(l.title,void 0,{rawKeyIfTranslationMissing:!0})),Ae.createElement(Ms,{color:"modalTextSecondary",size:"14",weight:"medium"},n.t(l.description,void 0,{rawKeyIfTranslationMissing:!0}))))})),Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"12",justifyContent:"center",marginBottom:"16"},Ae.createElement(md,{label:n.t("get_instructions.mobile.connect.label"),onClick:()=>e(t)}),Ae.createElement(wn,{as:"a",className:au({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"},Ae.createElement(Ms,{color:"accentColor",size:"14",weight:"bold"},n.t("get_instructions.mobile.learn_more.label")))))}function tRt({wallet:e}){var n,r,s,a;const{i18n:t}=m.useContext(cc);return Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",width:"full"},Ae.createElement(wn,{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 Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16",key:l},Ae.createElement(wn,{borderRadius:"10",height:"48",minWidth:"48",overflow:"hidden",position:"relative",width:"48"},(c=Gg[o.step])==null?void 0:c.call(Gg,e)),Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"4"},Ae.createElement(Ms,{color:"modalText",size:"14",weight:"bold"},t.t(o.title,void 0,{rawKeyIfTranslationMissing:!0})),Ae.createElement(Ms,{color:"modalTextSecondary",size:"14",weight:"medium"},t.t(o.description,void 0,{rawKeyIfTranslationMissing:!0}))))})),Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"12",justifyContent:"center",marginBottom:"16"},Ae.createElement(md,{label:t.t("get_instructions.extension.refresh.label"),onClick:window.location.reload.bind(window.location)}),Ae.createElement(wn,{as:"a",className:au({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"},Ae.createElement(Ms,{color:"accentColor",size:"14",weight:"bold"},t.t("get_instructions.extension.learn_more.label")))))}function nRt({connectWallet:e,wallet:t}){var r,s,a,o;const{i18n:n}=m.useContext(cc);return Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",width:"full"},Ae.createElement(wn,{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 Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16",key:c},Ae.createElement(wn,{borderRadius:"10",height:"48",minWidth:"48",overflow:"hidden",position:"relative",width:"48"},(u=Gg[l.step])==null?void 0:u.call(Gg,t)),Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"4"},Ae.createElement(Ms,{color:"modalText",size:"14",weight:"bold"},n.t(l.title,void 0,{rawKeyIfTranslationMissing:!0})),Ae.createElement(Ms,{color:"modalTextSecondary",size:"14",weight:"medium"},n.t(l.description,void 0,{rawKeyIfTranslationMissing:!0}))))})),Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"12",justifyContent:"center",marginBottom:"16"},Ae.createElement(md,{label:n.t("get_instructions.desktop.connect.label"),onClick:()=>e(t)}),Ae.createElement(wn,{as:"a",className:au({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"},Ae.createElement(Ms,{color:"accentColor",size:"14",weight:"bold"},n.t("get_instructions.desktop.learn_more.label")))))}function rRt({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(E$)===oT.COMPACT,{disclaimer:g}=m.useContext(iT),{i18n:v}=m.useContext(cc),w=ole(),C=m.useRef(!1),{connector:N}=m.useContext(aT),I=e_(!N).filter(me=>me.ready||!!me.extensionDownloadUrl).sort((me,we)=>me.groupIndex-we.groupIndex),R=e_(),O=EMt(I,me=>me.groupName),U=["Recommended","Other","Popular","More","Others","Installed"];m.useEffect(()=>{N&&!C.current&&(re("CONNECT"),ne(N),C.current=!0)},[N]);const L=me=>{var we,xe;d(!1),me.ready&&((xe=(we=me==null?void 0:me.connect)==null?void 0:we.call(me))==null||xe.catch(()=>{d(!0)}))},z=async me=>{const we=I.find(xe=>me.id===xe.id);we!=null&&we.getDesktopUri&&setTimeout(async()=>{var ye;const xe=await((ye=we==null?void 0:we.getDesktopUri)==null?void 0:ye.call(we));xe&&window.open(xe,w?"_blank":"_self")},0)},X=async me=>{var ye;const we=I.find(je=>me.id===je.id),xe=await((ye=we==null?void 0:we.getQrCodeUri)==null?void 0:ye.call(we));l(xe),setTimeout(()=>{a(we),re("CONNECT")},xe?0:50)},ne=async me=>{OMt(me.id),me.ready&&(X(me),z(me)),L(me),r(me.id),me.ready||(a(me),re(me!=null&&me.extensionDownloadUrl?"DOWNLOAD_OPTIONS":"CONNECT"))},J=me=>{var Pe;const we=R.find(Re=>me===Re.id),xe=(Pe=we==null?void 0:we.downloadUrls)==null?void 0:Pe.qrCode,ye=!!(we!=null&&we.desktopDownloadUrl),je=!!(we!=null&&we.extensionDownloadUrl);a(we),re(xe&&(je||ye)?"DOWNLOAD_OPTIONS":xe?"DOWNLOAD":ye?"INSTRUCTIONS_DESKTOP":"INSTRUCTIONS_EXTENSION")},K=()=>{r(void 0),a(void 0),l(void 0)},re=(me,we=!1)=>{we&&me==="GET"&&he==="GET"?K():!we&&me==="GET"?Q("GET"):!we&&me==="CONNECT"&&Q("CONNECT"),oe(me)},[he,Q]=m.useState("NONE"),[ie,oe]=m.useState("NONE");let G=null,V=null,te=null,ae;m.useEffect(()=>{d(!1)},[ie,s]);const Ne=!!(!!(s!=null&&s.extensionDownloadUrl)&&(s!=null&&s.mobileDownloadUrl));switch(ie){case"NONE":G=Ae.createElement(xbe,{getWallet:()=>re("GET")});break;case"LEARN_COMPACT":G=Ae.createElement(xbe,{compactModeEnabled:x,getWallet:()=>re("GET")}),V=v.t("intro.title"),te="NONE";break;case"GET":G=Ae.createElement(XMt,{getWalletDownload:J,compactModeEnabled:x}),V=v.t("get.title"),te=x?"LEARN_COMPACT":"NONE";break;case"CONNECT":G=s&&Ae.createElement(QMt,{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})),te=x?N?null:"NONE":null,ae=x?N?()=>{}:K:()=>{};break;case"DOWNLOAD_OPTIONS":G=s&&Ae.createElement(ZMt,{changeWalletStep:re,wallet:s}),V=s&&v.t("get_options.short_title",{wallet:s.name}),te=N?"CONNECT":x?"NONE":he;break;case"DOWNLOAD":G=s&&Ae.createElement(JMt,{changeWalletStep:re,wallet:s}),V=s&&v.t("get_mobile.title",{wallet:s.name}),te=Ne?"DOWNLOAD_OPTIONS":he;break;case"INSTRUCTIONS_MOBILE":G=s&&Ae.createElement(eRt,{connectWallet:ne,wallet:s}),V=s&&v.t("get_options.title",{wallet:x&&s.shortName||s.name}),te="DOWNLOAD";break;case"INSTRUCTIONS_EXTENSION":G=s&&Ae.createElement(tRt,{wallet:s}),V=s&&v.t("get_options.title",{wallet:x&&s.shortName||s.name}),te="DOWNLOAD_OPTIONS";break;case"INSTRUCTIONS_DESKTOP":G=s&&Ae.createElement(nRt,{connectWallet:ne,wallet:s}),V=s&&v.t("get_options.title",{wallet:x&&s.shortName||s.name}),te="DOWNLOAD_OPTIONS";break}return Ae.createElement(wn,{display:"flex",flexDirection:"row",style:{maxHeight:x?468:504}},(x?ie==="NONE":!0)&&Ae.createElement(wn,{className:x?qMt:WMt,display:"flex",flexDirection:"column",marginTop:"16"},Ae.createElement(wn,{display:"flex",justifyContent:"space-between"},x&&g&&Ae.createElement(wn,{marginLeft:"16",width:"28"},Ae.createElement(kMt,{onClick:()=>re("LEARN_COMPACT")})),x&&!g&&Ae.createElement(wn,{marginLeft:"16",width:"28"}),Ae.createElement(wn,{marginLeft:x?"0":"6",paddingBottom:"8",paddingTop:"2",paddingX:"18"},Ae.createElement(Ms,{as:"h1",color:"modalText",id:t,size:"18",weight:"heavy",testId:"connect-header-label"},v.t("connect.title"))),x&&Ae.createElement(wn,{marginRight:"16"},Ae.createElement(W3,{onClose:e}))),Ae.createElement(wn,{className:VMt,paddingBottom:"18"},Object.entries(O).map(([me,we],xe)=>we.length>0&&Ae.createElement(m.Fragment,{key:xe},me?Ae.createElement(wn,{marginBottom:"8",marginTop:"16",marginX:"6"},Ae.createElement(Ms,{color:me==="Installed"?"accentColor":"modalTextSecondary",size:"14",weight:"bold"},U.includes(me)?v.t(`connector_group.${me.toLowerCase()}`):me)):null,Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"4"},we.map(ye=>Ae.createElement(nLe,{currentlySelected:ye.id===n,iconBackground:ye.iconBackground,iconUrl:ye.iconUrl,key:ye.id,name:ye.name,onClick:()=>ne(ye),ready:ye.ready,recent:ye.recent,testId:`wallet-option-${ye.id}`,isRainbowKitConnector:ye.isRainbowKitConnector})))))),x&&Ae.createElement(Ae.Fragment,null,Ae.createElement(wn,{background:"generalBorder",height:"1",marginTop:"-1"}),g?Ae.createElement(wn,{paddingX:"24",paddingY:"16",textAlign:"center"},Ae.createElement(g,{Link:fle,Text:hle})):Ae.createElement(wn,{alignItems:"center",display:"flex",justifyContent:"space-between",paddingX:"24",paddingY:"16"},Ae.createElement(wn,{paddingY:"4"},Ae.createElement(Ms,{color:"modalTextSecondary",size:"14",weight:"medium"},v.t("connect.new_to_ethereum.description"))),Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"4",justifyContent:"center"},Ae.createElement(wn,{className:au({active:"shrink",hover:"grow"}),cursor:"pointer",onClick:()=>re("LEARN_COMPACT"),paddingY:"4",style:{willChange:"transform"},transition:"default"},Ae.createElement(Ms,{color:"accentColor",size:"14",weight:"bold"},v.t("connect.new_to_ethereum.learn_more.label"))))))),(x?ie!=="NONE":!0)&&Ae.createElement(Ae.Fragment,null,!x&&Ae.createElement(wn,{background:"generalBorder",minWidth:"1",width:"1"}),Ae.createElement(wn,{display:"flex",flexDirection:"column",margin:"16",style:{flexGrow:1}},Ae.createElement(wn,{alignItems:"center",display:"flex",justifyContent:"space-between",marginBottom:"12"},Ae.createElement(wn,{width:"28"},te&&Ae.createElement(wn,{as:"button",className:au({active:"shrinkSm",hover:"growLg"}),color:"accentColor",onClick:()=>{te&&re(te,!0),ae==null||ae()},paddingX:"8",paddingY:"4",style:{boxSizing:"content-box",height:17,willChange:"transform"},transition:"default",type:"button"},Ae.createElement(eLe,null))),Ae.createElement(wn,{display:"flex",justifyContent:"center",style:{flexGrow:1}},V&&Ae.createElement(Ms,{color:"modalText",size:"18",textAlign:"center",weight:"heavy"},V)),Ae.createElement(W3,{onClose:e})),Ae.createElement(wn,{display:"flex",flexDirection:"column",style:{minHeight:x?396:432}},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"6",height:"full",justifyContent:"center",marginX:"8"},G)))))}var sRt="_1am14412",iRt="_1am14410",aRt="_1am14413",oRt=({wallet:e})=>Ae.createElement("svg",{className:aRt,viewBox:"0 0 86 86",width:"86",height:"86"},Ae.createElement("title",null,"Loading"),Ae.createElement("rect",{x:"3",y:"3",width:80,height:80,rx:20,ry:20,strokeDasharray:`${160/3} ${2*160/3}`,strokeDashoffset:160,className:sRt,style:{stroke:(e==null?void 0:e.iconAccent)||"#0D3887"}}));function fLe({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=tLe(a),g=m.useRef(!1),{i18n:v}=m.useContext(cc),w=m.useCallback(async()=>{if(o!=="walletConnect"&&(async()=>{const N=await(c==null?void 0:c());if(N)if(N&&qOt({mobileUri:N,name:l}),N.startsWith("http")){const P=document.createElement("a");P.href=N,P.target="_blank",P.rel="noreferrer noopener",P.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]),Ae.createElement(wn,{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"},Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",justifyContent:"center"},Ae.createElement(wn,{display:"flex",alignItems:"center",justifyContent:"center",paddingBottom:"8",paddingTop:"10",position:"relative"},n?Ae.createElement(oRt,{wallet:t}):null,Ae.createElement(Fc,{background:s,borderRadius:"13",boxShadow:"walletLogo",height:"60",src:a,width:"60"})),n?null:Ae.createElement(wn,{display:"flex",flexDirection:"column",textAlign:"center"},Ae.createElement(Ms,{as:"h2",color:t.ready?"modalText":"modalTextSecondary",size:"13",weight:"medium"},Ae.createElement(wn,{as:"span",position:"relative"},d??l,!t.ready&&" (unsupported)")),t.recent&&Ae.createElement(Ms,{color:"accentColor",size:"12",weight:"medium"},v.t("connect.recent")))))}function lRt({onClose:e}){var g;const t="rk_connect_title",n=e_().filter(v=>v.isRainbowKitConnector),{disclaimer:r,learnMoreUrl:s}=m.useContext(iT);let a=null,o=null,l=!1,c=null;const[u,d]=m.useState("CONNECT"),{i18n:f}=m.useContext(cc),x=b5();switch(u){case"CONNECT":{a=f.t("connect.title"),l=!0,o=Ae.createElement(wn,null,Ae.createElement(wn,{background:"profileForeground",className:iRt,display:"flex",paddingBottom:"20",paddingTop:"6"},Ae.createElement(wn,{display:"flex",style:{margin:"0 auto"}},n.filter(v=>v.ready).map(v=>Ae.createElement(wn,{key:v.id,paddingX:"20"},Ae.createElement(wn,{width:"60"},Ae.createElement(fLe,{onClose:e,wallet:v})))))),Ae.createElement(wn,{background:"generalBorder",height:"1",marginBottom:"32",marginTop:"-1"}),Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"32",paddingX:"32",style:{textAlign:"center"}},Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"8",textAlign:"center"},Ae.createElement(Ms,{color:"modalText",size:"16",weight:"bold"},f.t("intro.title")),Ae.createElement(Ms,{color:"modalTextSecondary",size:"16"},f.t("intro.description")))),Ae.createElement(wn,{paddingTop:"32",paddingX:"20"},Ae.createElement(wn,{display:"flex",gap:"14",justifyContent:"center"},Ae.createElement(md,{label:f.t("intro.get.label"),onClick:()=>d("GET"),size:"large",type:"secondary"}),Ae.createElement(md,{href:s,label:f.t("intro.learn_more.label"),size:"large",type:"secondary"}))),r&&Ae.createElement(wn,{marginTop:"28",marginX:"32",textAlign:"center"},Ae.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,P;return((C=w.downloadUrls)==null?void 0:C.ios)||((N=w.downloadUrls)==null?void 0:N.android)||((P=w.downloadUrls)==null?void 0:P.mobile)}))==null?void 0:g.splice(0,3);o=Ae.createElement(wn,null,Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",marginBottom:"36",marginTop:"5",paddingTop:"12",width:"full"},v.map((w,C)=>{const{downloadUrls:N,iconBackground:P,iconUrl:I,name:R}=w;return!(N!=null&&N.ios)&&!(N!=null&&N.android)&&!(N!=null&&N.mobile)?null:Ae.createElement(wn,{display:"flex",gap:"16",key:w.id,paddingX:"20",width:"full"},Ae.createElement(wn,{style:{minHeight:48,minWidth:48}},Ae.createElement(Fc,{background:P,borderColor:"generalBorder",borderRadius:"10",height:"48",src:I,width:"48"})),Ae.createElement(wn,{display:"flex",flexDirection:"column",width:"full"},Ae.createElement(wn,{alignItems:"center",display:"flex",height:"48"},Ae.createElement(wn,{width:"full"},Ae.createElement(Ms,{color:"modalText",size:"18",weight:"bold"},R)),Ae.createElement(md,{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&&Ae.createElement(wn,{background:"generalBorderDim",height:"1",marginY:"10",width:"full"})))})),Ae.createElement(wn,{style:{marginBottom:"42px"}}),Ae.createElement(wn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"36",paddingX:"36",style:{textAlign:"center"}},Ae.createElement(wn,{display:"flex",flexDirection:"column",gap:"12",textAlign:"center"},Ae.createElement(Ms,{color:"modalText",size:"16",weight:"bold"},f.t("get.looking_for.title")),Ae.createElement(Ms,{color:"modalTextSecondary",size:"16"},f.t("get.looking_for.mobile.description")))));break}}return Ae.createElement(wn,{display:"flex",flexDirection:"column",paddingBottom:"36"},Ae.createElement(wn,{background:l?"profileForeground":"modalBackground",display:"flex",flexDirection:"column",paddingBottom:"4",paddingTop:"14"},Ae.createElement(wn,{display:"flex",justifyContent:"center",paddingBottom:"6",paddingX:"20",position:"relative"},c&&Ae.createElement(wn,{display:"flex",position:"absolute",style:{left:0,marginBottom:-20,marginTop:-20}},Ae.createElement(wn,{alignItems:"center",as:"button",className:au({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"},Ae.createElement(eLe,null))),Ae.createElement(wn,{marginTop:"4",textAlign:"center",width:"full"},Ae.createElement(Ms,{as:"h1",color:"modalText",id:t,size:"20",weight:"bold"},a)),Ae.createElement(wn,{alignItems:"center",display:"flex",height:"32",paddingRight:"14",position:"absolute",right:"0"},Ae.createElement(wn,{style:{marginBottom:-20,marginTop:-20}},Ae.createElement(W3,{onClose:e}))))),Ae.createElement(wn,{display:"flex",flexDirection:"column"},o))}var cRt=({onClose:e})=>{const{connector:t}=m.useContext(aT),{i18n:n}=m.useContext(cc),r=(t==null?void 0:t.name)||"";return Ae.createElement(wn,null,Ae.createElement(wn,{display:"flex",paddingBottom:"32",justifyContent:"center",alignItems:"center",background:"profileForeground",flexDirection:"column"},Ae.createElement(wn,{width:"full",display:"flex",justifyContent:"flex-end",marginTop:"18",marginRight:"24"},Ae.createElement(W3,{onClose:e})),Ae.createElement(wn,{width:"60"},Ae.createElement(fLe,{onClose:e,wallet:t,connecting:!0})),Ae.createElement(wn,{marginTop:"20"},Ae.createElement(Ms,{textAlign:"center",color:"modalText",size:"18",weight:"semibold"},n.t("connect.status.connect_mobile",{wallet:r}))),Ae.createElement(wn,{maxWidth:"full",marginTop:"8"},Ae.createElement(Ms,{textAlign:"center",color:"modalText",size:"16",weight:"medium"},n.t("connect.status.confirm_mobile",{wallet:r})))))};function uRt({onClose:e}){const{connector:t}=m.useContext(aT);return lu()?t?Ae.createElement(cRt,{onClose:e}):Ae.createElement(lRt,{onClose:e}):Ae.createElement(rRt,{onClose:e})}function dRt({onClose:e,open:t}){const n="rk_connect_title",r=NRe(),{disconnect:s}=wB(),{isConnecting:a}=ts(),o=Ae.useCallback(()=>{e(),s()},[e,s]),l=Ae.useCallback(()=>{a&&s(),e()},[e,s,a]);return r==="disconnected"?Ae.createElement(RR,{onClose:l,open:t,titleId:n},Ae.createElement(LR,{bottomSheetOnMobile:!0,padding:"0",wide:!0},Ae.createElement(uRt,{onClose:l}))):r==="unauthenticated"?Ae.createElement(RR,{onClose:o,open:t,titleId:n},Ae.createElement(LR,{bottomSheetOnMobile:!0,padding:"0"},Ae.createElement(VOt,{onClose:o,onCloseModal:e}))):null}function fW(){const[e,t]=m.useState(!1);return{closeModal:m.useCallback(()=>t(!1),[]),isModalOpen:e,openModal:m.useCallback(()=>t(!0),[])}}var zA=m.createContext({accountModalOpen:!1,chainModalOpen:!1,connectModalOpen:!1,isWalletConnectModalOpen:!1,setIsWalletConnectModalOpen:()=>{}});function fRt({children:e}){const{closeModal:t,isModalOpen:n,openModal:r}=fW(),{closeModal:s,isModalOpen:a,openModal:o}=fW(),{closeModal:l,isModalOpen:c,openModal:u}=fW(),[d,f]=m.useState(!1),x=NRe(),{chainId:g}=ts(),{chains:v}=El(),w=v.some(P=>P.id===g),C=m.useCallback(({keepConnectModalOpen:P=!1}={})=>{P||t(),s(),l()},[t,s,l]),N=j$()==="unauthenticated";return t_e({onConnect:()=>C({keepConnectModalOpen:N}),onDisconnect:()=>C()}),m.useEffect(()=>{N&&C()},[N,C]),Ae.createElement(zA.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,Ae.createElement(dRt,{onClose:t,open:n}),Ae.createElement(yMt,{onClose:s,open:a}),Ae.createElement(jMt,{onClose:l,open:c}))}function hRt(){const{accountModalOpen:e,chainModalOpen:t,connectModalOpen:n}=m.useContext(zA);return{accountModalOpen:e,chainModalOpen:t,connectModalOpen:n}}function pRt(){const{accountModalOpen:e,openAccountModal:t}=m.useContext(zA);return{accountModalOpen:e,openAccountModal:t}}function mRt(){const{chainModalOpen:e,openChainModal:t}=m.useContext(zA);return{chainModalOpen:e,openChainModal:t}}function hLe(){const{isWalletConnectModalOpen:e,setIsWalletConnectModalOpen:t}=m.useContext(zA);return{isWalletConnectModalOpen:e,setIsWalletConnectModalOpen:t}}function y5(){const{connectModalOpen:e,openConnectModal:t}=m.useContext(zA),{isWalletConnectModalOpen:n}=hLe();return{connectModalOpen:e||n,openConnectModal:t}}var hW=()=>{};function xRt({children:e}){const t=XFt(),{address:n}=ts(),{chainId:r}=ts(),{chains:s}=El(),a=s.some(K=>K.id===r),o=GFt(),l=j$()??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=RRe().some(({status:K})=>K==="pending")&&g,{showBalance:w}=YFt(),N=typeof w=="boolean"?w:w?pFt(w)[lu()?"smallScreen":"largeScreen"]:!0,{balance:P,ensAvatar:I,ensName:R}=PRe({address:n,includeBalance:N}),O=P?`${YRe(Number.parseFloat(P.formatted))} ${P.symbol}`:void 0,{openConnectModal:U}=y5(),{openChainModal:L}=mRt(),{openAccountModal:z}=pRt(),{accountModalOpen:X,chainModalOpen:ne,connectModalOpen:J}=hRt();return Ae.createElement(Ae.Fragment,null,e({account:n?{address:n,balanceDecimals:P==null?void 0:P.decimals,balanceFormatted:P==null?void 0:P.formatted,balanceSymbol:P==null?void 0:P.symbol,displayBalance:O,displayName:R?QRe(R):XRe(n),ensAvatar:I??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??hW,openChainModal:L??hW,openConnectModal:U??hW}))}xRt.displayName="ConnectButton.Custom";var pLe=({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 gRt(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>n!==void 0))}function bRt(e,t){const n=[];for(const r of e)n.some(s=>s[t]===r[t])||n.push(r);return n}var yRt=(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=pLe({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&&!RMt(N==null?void 0:N.iconAccent))throw new Error(`Property \`iconAccent\` is not a hex value for wallet: ${N.name}`);const P={...N,groupIndex:g+1,groupName:v,index:l};typeof N.hidden=="function"?d.push(P):u.push(P)}const x=bRt([...u,...d],"id");for(const{createConnector:g,groupIndex:v,groupName:w,hidden:C,...N}of x){if(typeof C=="function"&&C())continue;const P=O=>({rkDetails:gRt({...N,groupIndex:v,groupName:w,isRainbowKitConnector:!0,...O||{}})});N.id==="walletConnect"&&c.push(g(P({isWalletConnectModalConnector:!0,showQrModal:!0})));const R=g(P());c.push(R)}return c},bbe=new Map,vRt=({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 wRt({projectId:e,walletDetails:t,walletConnectParameters:n}){return r=>({...vRt({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=>wRt({projectId:e,walletDetails:r,walletConnectParameters:t})}function mLe(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 xLe(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 gLe({flag:e,namespace:t}){return!!(t&&typeof xLe(t)<"u"||e&&typeof mLe(e)<"u")}function CRt({flag:e,namespace:t}){var s;const n=typeof window<"u"?window:void 0;if(typeof n>"u")return;if(t){const a=xLe(t);if(a)return a}const r=(s=n.ethereum)==null?void 0:s.providers;if(e){const a=mLe(e);if(a)return a}return typeof r<"u"&&r.length>0?r[0]:n.ethereum}function SRt(e){return t=>{const n=e?{target:()=>({id:t.rkDetails.id,name:t.rkDetails.name,provider:e})}:{};return r=>({...bB(n)(r),...t})}}function bLe({flag:e,namespace:t,target:n}){const r=n||CRt({flag:e,namespace:t});return SRt(r)}var yLe=({appName:e,appIcon:t})=>{const n=s=>s,r=b5();return{id:"coinbase",name:"Coinbase Wallet",shortName:"Coinbase",rdns:"com.coinbase.wallet",iconUrl:async()=>(await is(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=A$({appName:e,appLogoUrl:t,preference:yLe.preference});return o=>({...a(o),...s})}}};function NRt(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 ARt=({projectId:e,walletConnectParameters:t})=>{var a,o;const n=gLe({flag:"isMetaMask"}),r=!n,s=l=>nle()?l:b5()?`metamask://wc?uri=${encodeURIComponent(l)}`:`https://metamask.app.link/wc?uri=${encodeURIComponent(l)}`;return{id:"metaMask",name:"MetaMask",rdns:"io.metamask",iconUrl:async()=>(await is(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}):bLe({target:typeof window<"u"?((o=(a=window.ethereum)==null?void 0:a.providers)==null?void 0:o.find(NRt))??window.ethereum:void 0})}},jRt=({projectId:e,walletConnectParameters:t})=>{const n=gLe({flag:"isRainbow"}),r=!n,s=a=>nle()?a:b5()?`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 is(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}):bLe({flag:"isRainbow"})}},ERt=()=>({id:"safe",name:"Safe",iconAccent:"#12ff80",iconBackground:"#fff",iconUrl:async()=>(await is(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})}),_Rt=({projectId:e,options:t})=>({id:"walletConnect",name:"WalletConnect",installed:void 0,iconUrl:async()=>(await is(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})}),kRt=e=>e.reduce((n,r)=>{const s=r.id;return n[s]=uj(),n},{}),TRt=({appName:e,appDescription:t,appUrl:n,appIcon:r,wallets:s,projectId:a,...o})=>{const{transports:l,chains:c,...u}=o,d=pLe({appName:e,appDescription:t,appUrl:n,appIcon:r}),f=yRt(s||[{groupName:"Popular",wallets:[ERt,jRt,yLe,ARt,_Rt]}],{projectId:a,appName:e,appDescription:t,appUrl:n,appIcon:r,walletConnectParameters:{metadata:d}});return G0t({connectors:f,chains:c,transports:l||kRt(c),...u})};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:"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(IRt);function PRt({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 xy=m.forwardRef(PRt);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:"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 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:"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 RRt=m.forwardRef(MRt);function LRt({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 DRt=m.forwardRef(LRt),BRt=()=>{const{address:e}=ts(),{disconnect:t}=wB(),{subsExpireDay:n}=m.useContext(Qr),[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(f5,{open:r,setOpen:s,handleListRequest:()=>{},handlePageChange:()=>{}}),i.jsxs(MD,{as:"div",className:"relative inline-block text-left font-manrope",children:[i.jsx("div",{children:i.jsxs(FD,{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(ORt,{className:"size-4 fill-white/60"})]})}),i.jsx(OD,{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(EC,{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:nke,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"})]})})})]})]})},$Rt=()=>{const e=Wo(),[t,n]=m.useState(Date.now()),{isConnected:r,address:s,isDisconnected:a}=ts(),{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:P,setHyperAddress:I,setSignModalOpen:R,signInConnectButtonOpen:O,setSignInConnectButtonOpen:U}=m.useContext(Qr),{openConnectModal:L}=y5(),z=typeof window<"u"&&window.matchMedia("(max-width:640px)").matches;m.useEffect(()=>{!a&&s==null&&!z&&(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),P(""),I(""))},[a]);const X=()=>{window.localStorage.getItem("hyperToken")&&c?o():l(1)};m.useEffect(()=>{O&&(R(!0),U(!1))},[O]),m.useEffect(()=>{s!=null&&window.localStorage.getItem("hyperAddress")!=null&&window.localStorage.getItem("hyperAddress").toLowerCase()!==s.toLowerCase()&&!z&&(window.localStorage.removeItem("hyperToken"),P(""))},[s,u]);const ne=m.useRef(!1);return m.useEffect(()=>{const J=async()=>{var Q,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 _i(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((Q=oe==null?void 0:oe.mushboomer_counts)==null?void 0:Q.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),P(re),I(he)):(window.localStorage.removeItem("hyperAddress"),window.localStorage.removeItem("hyperToken"),P(""),I(""))}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}},K=()=>{if(document.visibilityState==="visible"){const re=Date.now();re-t>1e3&&J(),n(re)}};return document.addEventListener("visibilitychange",K),()=>{document.removeEventListener("visibilitychange",K)}},[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(BRt,{}),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:qbt,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:Gbt,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 X6={},pW={exports:{}},mW,vbe;function URt(){if(vbe)return mW;vbe=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return mW=e,mW}var xW,wbe;function zRt(){if(wbe)return xW;wbe=1;var e=URt();function t(){}function n(){}return n.resetWarningCache=t,xW=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},xW}var Cbe;function _$(){return Cbe||(Cbe=1,pW.exports=zRt()()),pW.exports}var gW,Sbe;function vLe(){return Sbe||(Sbe=1,gW={L:1,M:0,Q:3,H:2}),gW}var bW,Nbe;function wLe(){return Nbe||(Nbe=1,bW={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8}),bW}var yW,Abe;function HRt(){if(Abe)return yW;Abe=1;var e=wLe();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)}},yW=t,yW}var vW,jbe;function VRt(){if(jbe)return vW;jbe=1;var e=vLe();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}},vW=t,vW}var wW,Ebe;function WRt(){if(Ebe)return wW;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++}},wW=e,wW}var CW,_be;function CLe(){if(_be)return CW;_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 CW=e,CW}var SW,kbe;function SLe(){if(kbe)return SW;kbe=1;var e=CLe();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)}},SW=t,SW}var NW,Tbe;function qRt(){if(Tbe)return NW;Tbe=1;var e=wLe(),t=SLe(),n=CLe(),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 NW=s,NW}var AW,Ibe;function GRt(){if(Ibe)return AW;Ibe=1;var e=HRt(),t=VRt(),n=WRt(),r=qRt(),s=SLe();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 P=r.getErrorCorrectPolynomial(C),I=new s(x[v],P.getLength()-1),R=I.mod(P);g[v]=new Array(P.getLength()-1);for(var N=0;N<g[v].length;N++){var O=N+R.getLength()-g[v].length;g[v][N]=O>=0?R.get(O):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},AW=a,AW}var yP={},Pbe;function KRt(){if(Pbe)return yP;Pbe=1,Object.defineProperty(yP,"__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=_$(),n=a(t),r=ox(),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,P=u.xmlns,I=P===void 0?"http://www.w3.org/2000/svg":P,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:I}),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,yP.default=c,yP}var Fbe;function YRt(){if(Fbe)return X6;Fbe=1,Object.defineProperty(X6,"__esModule",{value:!0}),X6.QRCode=void 0;var e=Object.assign||function(w){for(var C=1;C<arguments.length;C++){var N=arguments[C];for(var P in N)Object.prototype.hasOwnProperty.call(N,P)&&(w[P]=N[P])}return w},t=_$(),n=f(t),r=vLe(),s=f(r),a=GRt(),o=f(a),l=ox(),c=f(l),u=KRt(),d=f(u);function f(w){return w&&w.__esModule?w:{default:w}}function x(w,C){var N={};for(var P in w)C.indexOf(P)>=0||Object.prototype.hasOwnProperty.call(w,P)&&(N[P]=w[P]);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,P=N===void 0?"#FFFFFF":N,I=w.fgColor,R=I===void 0?"#000000":I,O=w.level,U=O===void 0?"L":O,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 K=J.modules;return c.default.createElement(d.default,e({},ne,{bgColor:P,bgD:K.map(function(re,he){return re.map(function(Q,ie){return Q?"":"M "+ie+" "+he+" l 1 0 0 1 -1 0 Z"}).join(" ")}).join(" "),fgColor:R,fgD:K.map(function(re,he){return re.map(function(Q,ie){return Q?"M "+ie+" "+he+" l 1 0 0 1 -1 0 Z":""}).join(" ")}).join(" "),ref:C,size:z,viewBoxSize:K.length}))});return X6.QRCode=v,v.displayName="QRCode",v.propTypes=g,X6.default=v,X6}var XRt=YRt();const QRt=Ii(XRt),dp=({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?Na.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},ZRt=({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"})]})},JRt=()=>{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 P=null;return n&&(l(15),P=setInterval(()=>{l(I=>I<=1?(clearInterval(P),v(),0):I-1)},1e3)),()=>{P&&clearInterval(P)}},[n]);const g=()=>{r(null),a(0),t(!0)},v=()=>{t(!1),N()},w=()=>{a(0),f.current=Date.now(),d.current=setInterval(()=>{const I=(Date.now()-f.current)/x,R=Math.min(I*100,100);a(R),I>=1&&(clearInterval(d.current),d.current=null,a(100),hs.post("https://dextrabothypev2.nftinit.io/api/subscriber/sign_mobile_start/",{address:u,token:c}).then(O=>{const{temp_mobile_password:U}=O.data;r(U)}).catch(O=>{console.error("Axios error:",O)}))},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(_6t,{className:"mr-2"})}),i.jsx(dp,{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:Ki,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(QRt,{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:Ki,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(ZRt,{progress:s,size:16,strokeWidth:3})}),i.jsx("span",{children:"Hold to Reveal"})]})]})})})]})},Fs=({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"})]}),Oa=({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"})})]}),eLt=()=>{const{hyperToken:e,notificationData:t,setNotificationData:n,announcementData:r,setAnnouncementData:s,handleAnnouncement:a}=m.useContext(Qr),{isConnected:o,address:l}=ts(),[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),[P,I]=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 K=JSON.parse(J.newValue||"[]");n(K)}};return window.addEventListener("storage",ne),()=>window.removeEventListener("storage",ne)},[e,l]),m.useEffect(()=>{const L=window.localStorage.getItem("hyperToken");if(!P||c!="notification"||!L)return;const X=`notificationsFeedSocket_${l==null?void 0:l.toLowerCase()}`;if(!t.some(K=>!K.is_read))return;const J=setTimeout(()=>{const K=t.map(re=>re.is_read?re:{...re,is_read:!0});n(K),localStorage.setItem(X,JSON.stringify(K))},1e3);return()=>clearTimeout(J)},[t,P,c]),m.useEffect(()=>{var X;if(!P||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(K=>K.id).filter(K=>!ne.includes(K));if(J.length>0){const K=[...ne,...J];localStorage.setItem(L,JSON.stringify(K))}},1e3);return()=>clearTimeout(z)},[r,P,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(()=>{!P||c!=="announcement"||(r==null?void 0:r.new_announcement_count)>0&&e&&o&&R()},[P,c]);const O=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",K=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(Q=>{const ie=new Date(Q==null?void 0:Q.created_at);return!K.has(String(Q==null?void 0:Q.id))&&ie>=he}).length}if(L&&z&&(r==null?void 0:r.new_announcement_count)>0){const J="readNotSignAnnouncementIds",K=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&&!K.has(String(he.id))).length)||0}return(r==null?void 0:r.new_announcement_count)||0})();return i.jsx(MD,{as:"div",className:"relative hidden sm:inline-block text-left",children:({open:L,close:z})=>{var X,ne;return m.useEffect(()=>{I(L)},[L]),i.jsxs(i.Fragment,{children:[i.jsx("div",{children:i.jsxs(FD,{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:yyt,alt:"",className:`${U>0?"bg-transparent":"bg-[#1a1a1a]"} w-[18px] h-[18px] min-w-[18px] min-h-[18px] relative z-10`})]}),(U>0||O>0)&&i.jsx("span",{className:`${U+O>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+O>99?"99+":U+O})]})}),i.jsx(o8e,{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(OD,{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:nke})}),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(DRt,{onClick:J=>{J.preventDefault();const K=window.localStorage.getItem("hyperToken");if(!l||!K)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(Oa,{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",O>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:O})})]}),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,K)=>i.jsx(tLt,{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},K))}):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,K)=>i.jsx(nLt,{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},K))}):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:iyt,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"})]})})]})})]})}})},tLt=({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,P]=m.useState(Ro(C));return m.useEffect(()=>{const I=setInterval(()=>{P(Ro(C))},1e3);return()=>clearInterval(I)},[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=>hm(C)}),g==="hyper"?i.jsx("div",{className:"flex justify-start items-center gap-2",children:i.jsx("img",{src:S1,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(up,{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(Fs,{className:"text-[#67FFBD] rotate-180 w-2.5 h-2.5"}):s==="Long > Short"?i.jsx(Fs,{className:"text-[#FF797C] w-2.5 h-2.5"}):i.jsx(Fs,{className:"text-[#67FFBD] rotate-180 w-2.5 h-2.5"}):s=="Buy"?i.jsx(Fs,{className:"text-[#67FFBD] rotate-180 w-2.5 h-2.5"}):i.jsx(Fs,{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),tn.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:Co,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:tae,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}):iu(l)})]})]})]})},nLt=({address:e,content:t,createdAt:n,typeId:r,isDateAnnouncementFormat:s,setIsDateAnnouncementFormat:a})=>{function o({date:u}){const[d,f]=m.useState(Ro(u));return m.useEffect(()=>{const x=setInterval(()=>{f(Ro(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?byt:r==2?c||wyt:vyt,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=>hm(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:tae,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}):iu(n)})})]})]})},rLt=()=>{const{hyperToken:e}=m.useContext(Qr),[t,n]=m.useState(!1);return i.jsxs(i.Fragment,{children:[i.jsx(w$,{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(ZTt,{}),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(w0,{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(oMe,{})}),e&&i.jsx(JRt,{}),i.jsx(eLt,{}),i.jsx("span",{className:"hidden sm:block ml-2",children:i.jsx($Rt,{})})]})]})})]})},rd=({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 As;(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"})(As||(As={}));var Obe=new Map([[As.QR_CODE,"QR_CODE"],[As.AZTEC,"AZTEC"],[As.CODABAR,"CODABAR"],[As.CODE_39,"CODE_39"],[As.CODE_93,"CODE_93"],[As.CODE_128,"CODE_128"],[As.DATA_MATRIX,"DATA_MATRIX"],[As.MAXICODE,"MAXICODE"],[As.ITF,"ITF"],[As.EAN_13,"EAN_13"],[As.EAN_8,"EAN_8"],[As.PDF_417,"PDF_417"],[As.RSS_14,"RSS_14"],[As.RSS_EXPANDED,"RSS_EXPANDED"],[As.UPC_A,"UPC_A"],[As.UPC_E,"UPC_E"],[As.UPC_EAN_EXTENSION,"UPC_EAN_EXTENSION"]]),Mbe;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.URL=1]="URL"})(Mbe||(Mbe={}));function sLt(e){return Object.values(As).includes(e)}var DR;(function(e){e[e.SCAN_TYPE_CAMERA=0]="SCAN_TYPE_CAMERA",e[e.SCAN_TYPE_FILE=1]="SCAN_TYPE_FILE"})(DR||(DR={}));var iLt=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=[DR.SCAN_TYPE_CAMERA,DR.SCAN_TYPE_FILE],e}(),NLe=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}(),Jee;(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"})(Jee||(Jee={}));var aLt=function(){function e(){}return e.createFrom=function(t){return{errorMessage:t,type:Jee.UNKWOWN_ERROR}},e}(),oLt=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 ig(e){return typeof e>"u"||e===null}var DC=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}(),ALe=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}(),jj={exports:{}},lLt=jj.exports,Lbe;function cLt(){return Lbe||(Lbe=1,function(e,t){(function(n,r){r(t)})(lLt,function(n){function r(dt){return dt==null}var s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(dt,y){dt.__proto__=y}||function(dt,y){for(var E in y)y.hasOwnProperty(E)&&(dt[E]=y[E])};function a(dt,y){s(dt,y);function E(){this.constructor=dt}dt.prototype=y===null?Object.create(y):(E.prototype=y.prototype,new E)}function o(dt,y){var E=Object.setPrototypeOf;E?E(dt,y):dt.__proto__=y}function l(dt,y){y===void 0&&(y=dt.constructor);var E=Error.captureStackTrace;E&&E(dt,y)}var c=function(dt){a(y,dt);function y(E){var F=this.constructor,$=dt.call(this,E)||this;return Object.defineProperty($,"name",{value:F.name,enumerable:!1}),o($,F.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,F,$){const H=this.binarizer.getLuminanceSource().crop(y,E,F,$);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,F,$,H){for(;H--;)F[$++]=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 P{static fill(y,E){for(let F=0,$=y.length;F<$;F++)y[F]=E}static fillWithin(y,E,F,$){P.rangeCheck(y.length,E,F);for(let H=E;H<F;H++)y[H]=$}static rangeCheck(y,E,F){if(E>F)throw new f("fromIndex("+E+") > toIndex("+F+")");if(E<0)throw new N(E);if(F>y)throw new N(F)}static asList(...y){return y}static create(y,E,F){return Array.from({length:y}).map(H=>Array.from({length:E}).fill(F))}static createInt32Array(y,E,F){return Array.from({length:y}).map(H=>Int32Array.from({length:E}).fill(F))}static equals(y,E){if(!y||!E||!y.length||!E.length||y.length!==E.length)return!1;for(let F=0,$=y.length;F<$;F++)if(y[F]!==E[F])return!1;return!0}static hashCode(y){if(y===null)return 0;let E=1;for(const F of y)E=31*E+F;return E}static fillUint8Array(y,E){for(let F=0;F!==y.length;F++)y[F]=E}static copyOf(y,E){return y.slice(0,E)}static copyOfUint8Array(y,E){if(y.length<=E){const F=new Uint8Array(E);return F.set(y),F}return y.slice(0,E)}static copyOfRange(y,E,F){const $=F-E,H=new Int32Array($);return w.arraycopy(y,E,H,0,$),H}static binarySearch(y,E,F){F===void 0&&(F=P.numberComparator);let $=0,H=y.length-1;for(;$<=H;){const Y=H+$>>1,le=F(E,y[Y]);if(le>0)$=Y+1;else if(le<0)H=Y-1;else return Y}return-$-1}static numberComparator(y,E){return y-E}}class I{static numberOfTrailingZeros(y){let E;if(y===0)return 32;let F=31;return E=y<<16,E!==0&&(F-=16,y=E),E=y<<8,E!==0&&(F-=8,y=E),E=y<<4,E!==0&&(F-=4,y=E),E=y<<2,E!==0&&(F-=2,y=E),F-(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)}}I.MIN_VALUE_32_BITS=-2147483648,I.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 F=this.bits;let $=Math.floor(y/32),H=F[$];H&=~((1<<(y&31))-1);const Y=F.length;for(;H===0;){if(++$===Y)return E;H=F[$]}const le=$*32+I.numberOfTrailingZeros(H);return le>E?E:le}getNextUnset(y){const E=this.size;if(y>=E)return E;const F=this.bits;let $=Math.floor(y/32),H=~F[$];H&=~((1<<(y&31))-1);const Y=F.length;for(;H===0;){if(++$===Y)return E;H=~F[$]}const le=$*32+I.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 F=Math.floor(y/32),$=Math.floor(E/32),H=this.bits;for(let Y=F;Y<=$;Y++){const le=Y>F?0:y&31,Te=(2<<(Y<$?31:E&31))-(1<<le);H[Y]|=Te}}clear(){const y=this.bits.length,E=this.bits;for(let F=0;F<y;F++)E[F]=0}isRange(y,E,F){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),Y=this.bits;for(let le=$;le<=H;le++){const ve=le>$?0:y&31,Qe=(2<<(le<H?31:E&31))-(1<<ve)&4294967295;if((Y[le]&Qe)!==(F?Qe: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 F=E;F>0;F--)this.appendBit((y>>F-1&1)===1)}appendBitArray(y){const E=y.size;this.ensureCapacity(this.size+E);for(let F=0;F<E;F++)this.appendBit(y.get(F))}xor(y){if(this.size!==y.size)throw new f("Sizes don't match");const E=this.bits;for(let F=0,$=E.length;F<$;F++)E[F]^=y.bits[F]}toBytes(y,E,F,$){for(let H=0;H<$;H++){let Y=0;for(let le=0;le<8;le++)this.get(y)&&(Y|=1<<7-le),y++;E[F+H]=Y}}getBitArray(){return this.bits}reverse(){const y=new Int32Array(this.bits.length),E=Math.floor((this.size-1)/32),F=E+1,$=this.bits;for(let H=0;H<F;H++){let Y=$[H];Y=Y>>1&1431655765|(Y&1431655765)<<1,Y=Y>>2&858993459|(Y&858993459)<<2,Y=Y>>4&252645135|(Y&252645135)<<4,Y=Y>>8&16711935|(Y&16711935)<<8,Y=Y>>16&65535|(Y&65535)<<16,y[E-H]=Y}if(this.size!==F*32){const H=F*32-this.size;let Y=y[0]>>>H;for(let le=1;le<F;le++){const ve=y[le];Y|=ve<<32-H,y[le-1]=Y,Y=ve>>>H}y[F-1]=Y}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&&P.equals(this.bits,E.bits)}hashCode(){return 31*this.size+P.hashCode(this.bits)}toString(){let y="";for(let E=0,F=this.size;E<F;E++)E&7||(y+=" "),y+=this.get(E)?"X":".";return y}clone(){return new R(this.size,this.bits.slice())}}var O;(function(dt){dt[dt.OTHER=0]="OTHER",dt[dt.PURE_BARCODE=1]="PURE_BARCODE",dt[dt.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",dt[dt.TRY_HARDER=3]="TRY_HARDER",dt[dt.CHARACTER_SET=4]="CHARACTER_SET",dt[dt.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",dt[dt.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",dt[dt.ASSUME_GS1=7]="ASSUME_GS1",dt[dt.RETURN_CODABAR_START_END=8]="RETURN_CODABAR_START_END",dt[dt.NEED_RESULT_POINT_CALLBACK=9]="NEED_RESULT_POINT_CALLBACK",dt[dt.ALLOWED_EAN_EXTENSIONS=10]="ALLOWED_EAN_EXTENSIONS"})(O||(O={}));var U=O;class L extends u{static getFormatInstance(){return new L}}L.kind="FormatException";var z;(function(dt){dt[dt.Cp437=0]="Cp437",dt[dt.ISO8859_1=1]="ISO8859_1",dt[dt.ISO8859_2=2]="ISO8859_2",dt[dt.ISO8859_3=3]="ISO8859_3",dt[dt.ISO8859_4=4]="ISO8859_4",dt[dt.ISO8859_5=5]="ISO8859_5",dt[dt.ISO8859_6=6]="ISO8859_6",dt[dt.ISO8859_7=7]="ISO8859_7",dt[dt.ISO8859_8=8]="ISO8859_8",dt[dt.ISO8859_9=9]="ISO8859_9",dt[dt.ISO8859_10=10]="ISO8859_10",dt[dt.ISO8859_11=11]="ISO8859_11",dt[dt.ISO8859_13=12]="ISO8859_13",dt[dt.ISO8859_14=13]="ISO8859_14",dt[dt.ISO8859_15=14]="ISO8859_15",dt[dt.ISO8859_16=15]="ISO8859_16",dt[dt.SJIS=16]="SJIS",dt[dt.Cp1250=17]="Cp1250",dt[dt.Cp1251=18]="Cp1251",dt[dt.Cp1252=19]="Cp1252",dt[dt.Cp1256=20]="Cp1256",dt[dt.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",dt[dt.UTF8=22]="UTF8",dt[dt.ASCII=23]="ASCII",dt[dt.Big5=24]="Big5",dt[dt.GB18030=25]="GB18030",dt[dt.EUC_KR=26]="EUC_KR"})(z||(z={}));class X{constructor(y,E,F,...$){this.valueIdentifier=y,this.name=F,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(F,this);const H=this.values;for(let Y=0,le=H.length;Y!==le;Y++){const ve=H[Y];X.VALUES_TO_ECI.set(ve,this)}for(const Y of $)X.NAME_TO_ECI.set(Y,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 F=this.encodingName(E);return this.customDecoder?this.customDecoder(y,F):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(F)?this.decodeFallback(y,F):new TextDecoder(F).decode(y)}static shouldDecodeOnFallback(y){return!J.isBrowser()&&y==="ISO-8859-1"}static encode(y,E){const F=this.encodingName(E);return this.customEncoder?this.customEncoder(y,F):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 F=this.encodingCharacterSet(E);if(J.isDecodeFallbackSupported(F)){let $="";for(let H=0,Y=y.length;H<Y;H++){let le=y[H].toString(16);le.length<2&&(le="0"+le),$+="%"+le}return decodeURIComponent($)}if(F.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 F=btoa(unescape(encodeURIComponent(y))).split(""),$=[];for(let H=0;H<F.length;H++)$.push(F[H].charCodeAt(0));return new Uint8Array($)}}class K{static castAsNonUtf8Char(y,E=null){const F=E?E.getName():this.ISO88591;return J.decode(new Uint8Array([y]),F)}static guessEncoding(y,E){if(E!=null&&E.get(U.CHARACTER_SET)!==void 0)return E.get(U.CHARACTER_SET).toString();const F=y.length;let $=!0,H=!0,Y=!0,le=0,ve=0,Te=0,Qe=0,xt=0,It=0,Qt=0,St=0,zt=0,Wt=0,jn=0;const mr=y.length>3&&y[0]===239&&y[1]===187&&y[2]===191;for(let Sr=0;Sr<F&&($||H||Y);Sr++){const Ar=y[Sr]&255;Y&&(le>0?Ar&128?le--:Y=!1:Ar&128&&(Ar&64?(le++,Ar&32?(le++,Ar&16?(le++,Ar&8?Y=!1:Qe++):Te++):ve++):Y=!1)),$&&(Ar>127&&Ar<160?$=!1:Ar>159&&(Ar<192||Ar===215||Ar===247)&&jn++),H&&(xt>0?Ar<64||Ar===127||Ar>252?H=!1:xt--:Ar===128||Ar===160||Ar>239?H=!1:Ar>160&&Ar<224?(It++,St=0,Qt++,Qt>zt&&(zt=Qt)):Ar>127?(xt++,Qt=0,St++,St>Wt&&(Wt=St)):(Qt=0,St=0))}return Y&&le>0&&(Y=!1),H&&xt>0&&(H=!1),Y&&(mr||ve+Te+Qe>0)?K.UTF8:H&&(K.ASSUME_SHIFT_JIS||zt>=3||Wt>=3)?K.SHIFT_JIS:$&&H?zt===2&&It===2||jn*10>=F?K.SHIFT_JIS:K.ISO88591:$?K.ISO88591:H?K.SHIFT_JIS:Y?K.UTF8:K.PLATFORM_DEFAULT_ENCODING}static format(y,...E){let F=-1;function $(Y,le,ve,Te,Qe,xt){if(Y==="%%")return"%";if(E[++F]===void 0)return;Y=Te?parseInt(Te.substr(1)):void 0;let It=Qe?parseInt(Qe.substr(1)):void 0,Qt;switch(xt){case"s":Qt=E[F];break;case"c":Qt=E[F][0];break;case"f":Qt=parseFloat(E[F]).toFixed(Y);break;case"p":Qt=parseFloat(E[F]).toPrecision(Y);break;case"e":Qt=parseFloat(E[F]).toExponential(Y);break;case"x":Qt=parseInt(E[F]).toString(It||16);break;case"d":Qt=parseFloat(parseInt(E[F],It||10).toPrecision(Y)).toFixed(0);break}Qt=typeof Qt=="object"?JSON.stringify(Qt):(+Qt).toString(It);let St=parseInt(ve),zt=ve&&ve[0]+""=="0"?"0":" ";for(;Qt.length<St;)Qt=le!==void 0?Qt+zt:zt+Qt;return Qt}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)}}K.SHIFT_JIS=X.SJIS.getName(),K.GB2312="GB2312",K.ISO88591=X.ISO8859_1.getName(),K.EUC_JP="EUC_JP",K.UTF8=X.UTF8.getName(),K.PLATFORM_DEFAULT_ENCODING=K.UTF8,K.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+=K.castAsNonUtf8Char(y,this.encoding):this.value+=String.fromCharCode(y),this}appendChars(y,E,F){for(let $=E;E<E+F;$++)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,F,$){if(this.width=y,this.height=E,this.rowSize=F,this.bits=$,E==null&&(E=y),this.height=E,y<1||E<1)throw new f("Both dimensions must be greater than 0");F==null&&(F=Math.floor((y+31)/32)),this.rowSize=F,$==null&&(this.bits=new Int32Array(this.rowSize*this.height))}static parseFromBooleanArray(y){const E=y.length,F=y[0].length,$=new he(F,E);for(let H=0;H<E;H++){const Y=y[H];for(let le=0;le<F;le++)Y[le]&&$.set(le,H)}return $}static parseFromString(y,E,F){if(y===null)throw new f("stringRepresentation cannot be null");const $=new Array(y.length);let H=0,Y=0,le=-1,ve=0,Te=0;for(;Te<y.length;)if(y.charAt(Te)===`
`||y.charAt(Te)==="\r"){if(H>Y){if(le===-1)le=H-Y;else if(H-Y!==le)throw new f("row lengths do not match");Y=H,ve++}Te++}else if(y.substring(Te,Te+E.length)===E)Te+=E.length,$[H]=!0,H++;else if(y.substring(Te,Te+F.length)===F)Te+=F.length,$[H]=!1,H++;else throw new f("illegal character encountered: "+y.substring(Te));if(H>Y){if(le===-1)le=H-Y;else if(H-Y!==le)throw new f("row lengths do not match");ve++}const Qe=new he(le,ve);for(let xt=0;xt<H;xt++)$[xt]&&Qe.set(Math.floor(xt%le),Math.floor(xt/le));return Qe}get(y,E){const F=E*this.rowSize+Math.floor(y/32);return(this.bits[F]>>>(y&31)&1)!==0}set(y,E){const F=E*this.rowSize+Math.floor(y/32);this.bits[F]|=1<<(y&31)&4294967295}unset(y,E){const F=E*this.rowSize+Math.floor(y/32);this.bits[F]&=~(1<<(y&31)&4294967295)}flip(y,E){const F=E*this.rowSize+Math.floor(y/32);this.bits[F]^=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),F=this.rowSize,$=this.bits;for(let H=0,Y=this.height;H<Y;H++){const le=H*F,ve=y.getRow(H,E).getBitArray();for(let Te=0;Te<F;Te++)$[le+Te]^=ve[Te]}}clear(){const y=this.bits,E=y.length;for(let F=0;F<E;F++)y[F]=0}setRegion(y,E,F,$){if(E<0||y<0)throw new f("Left and top must be nonnegative");if($<1||F<1)throw new f("Height and width must be at least 1");const H=y+F,Y=E+$;if(Y>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<Y;Te++){const Qe=Te*le;for(let xt=y;xt<H;xt++)ve[Qe+Math.floor(xt/32)]|=1<<(xt&31)&4294967295}}getRow(y,E){E==null||E.getSize()<this.width?E=new R(this.width):E.clear();const F=this.rowSize,$=this.bits,H=y*F;for(let Y=0;Y<F;Y++)E.setBulk(Y*32,$[H+Y]);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 F=new R(y),$=new R(y);for(let H=0,Y=Math.floor((E+1)/2);H<Y;H++)F=this.getRow(H,F),$=this.getRow(E-1-H,$),F.reverse(),$.reverse(),this.setRow(H,$),this.setRow(E-1-H,F)}getEnclosingRectangle(){const y=this.width,E=this.height,F=this.rowSize,$=this.bits;let H=y,Y=E,le=-1,ve=-1;for(let Te=0;Te<E;Te++)for(let Qe=0;Qe<F;Qe++){const xt=$[Te*F+Qe];if(xt!==0){if(Te<Y&&(Y=Te),Te>ve&&(ve=Te),Qe*32<H){let It=0;for(;!(xt<<31-It&4294967295);)It++;Qe*32+It<H&&(H=Qe*32+It)}if(Qe*32+31>le){let It=31;for(;!(xt>>>It);)It--;Qe*32+It>le&&(le=Qe*32+It)}}}return le<H||ve<Y?null:Int32Array.from([H,Y,le-H+1,ve-Y+1])}getTopLeftOnBit(){const y=this.rowSize,E=this.bits;let F=0;for(;F<E.length&&E[F]===0;)F++;if(F===E.length)return null;const $=F/y;let H=F%y*32;const Y=E[F];let le=0;for(;!(Y<<31-le&4294967295);)le++;return H+=le,Int32Array.from([H,$])}getBottomRightOnBit(){const y=this.rowSize,E=this.bits;let F=E.length-1;for(;F>=0&&E[F]===0;)F--;if(F<0)return null;const $=Math.floor(F/y);let H=Math.floor(F%y)*32;const Y=E[F];let le=31;for(;!(Y>>>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&&P.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+P.hashCode(this.bits),y}toString(y="X ",E="  ",F=`
`){return this.buildToString(y,E,F)}buildToString(y,E,F){let $=new re;for(let H=0,Y=this.height;H<Y;H++){for(let le=0,ve=this.width;le<ve;le++)$.append(this.get(le,H)?y:E);$.append(F)}return $.toString()}clone(){return new he(this.width,this.height,this.rowSize,this.bits.slice())}}class Q extends u{static getNotFoundInstance(){return new Q}}Q.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 F=this.getLuminanceSource(),$=F.getWidth();E==null||E.getSize()<$?E=new R($):E.clear(),this.initArrays($);const H=F.getRow(y,this.luminances),Y=this.buckets;for(let ve=0;ve<$;ve++)Y[(H[ve]&255)>>ie.LUMINANCE_SHIFT]++;const le=ie.estimateBlackPoint(Y);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 Qe=1;Qe<$-1;Qe++){const xt=H[Qe+1]&255;(Te*4-ve-xt)/2<le&&E.set(Qe),ve=Te,Te=xt}}return E}getBlackMatrix(){const y=this.getLuminanceSource(),E=y.getWidth(),F=y.getHeight(),$=new he(E,F);this.initArrays(E);const H=this.buckets;for(let ve=1;ve<5;ve++){const Te=Math.floor(F*ve/5),Qe=y.getRow(Te,this.luminances),xt=Math.floor(E*4/5);for(let It=Math.floor(E/5);It<xt;It++){const Qt=Qe[It]&255;H[Qt>>ie.LUMINANCE_SHIFT]++}}const Y=ie.estimateBlackPoint(H),le=y.getMatrix();for(let ve=0;ve<F;ve++){const Te=ve*E;for(let Qe=0;Qe<E;Qe++)(le[Te+Qe]&255)<Y&&$.set(Qe,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 F=0;F<ie.LUMINANCE_BUCKETS;F++)E[F]=0}static estimateBlackPoint(y){const E=y.length;let F=0,$=0,H=0;for(let Qe=0;Qe<E;Qe++)y[Qe]>H&&($=Qe,H=y[Qe]),y[Qe]>F&&(F=y[Qe]);let Y=0,le=0;for(let Qe=0;Qe<E;Qe++){const xt=Qe-$,It=y[Qe]*xt*xt;It>le&&(Y=Qe,le=It)}if($>Y){const Qe=$;$=Y,Y=Qe}if(Y-$<=E/16)throw new Q;let ve=Y-1,Te=-1;for(let Qe=Y-1;Qe>$;Qe--){const xt=Qe-$,It=xt*xt*(Y-Qe)*(F-y[Qe]);It>Te&&(ve=Qe,Te=It)}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(),F=y.getHeight();if(E>=oe.MINIMUM_DIMENSION&&F>=oe.MINIMUM_DIMENSION){const $=y.getMatrix();let H=E>>oe.BLOCK_SIZE_POWER;E&oe.BLOCK_SIZE_MASK&&H++;let Y=F>>oe.BLOCK_SIZE_POWER;F&oe.BLOCK_SIZE_MASK&&Y++;const le=oe.calculateBlackPoints($,H,Y,E,F),ve=new he(E,F);oe.calculateThresholdForBlock($,H,Y,E,F,le,ve),this.matrix=ve}else this.matrix=super.getBlackMatrix();return this.matrix}createBinarizer(y){return new oe(y)}static calculateThresholdForBlock(y,E,F,$,H,Y,le){const ve=H-oe.BLOCK_SIZE,Te=$-oe.BLOCK_SIZE;for(let Qe=0;Qe<F;Qe++){let xt=Qe<<oe.BLOCK_SIZE_POWER;xt>ve&&(xt=ve);const It=oe.cap(Qe,2,F-3);for(let Qt=0;Qt<E;Qt++){let St=Qt<<oe.BLOCK_SIZE_POWER;St>Te&&(St=Te);const zt=oe.cap(Qt,2,E-3);let Wt=0;for(let mr=-2;mr<=2;mr++){const Sr=Y[It+mr];Wt+=Sr[zt-2]+Sr[zt-1]+Sr[zt]+Sr[zt+1]+Sr[zt+2]}const jn=Wt/25;oe.thresholdBlock(y,St,xt,jn,$,le)}}}static cap(y,E,F){return y<E?E:y>F?F:y}static thresholdBlock(y,E,F,$,H,Y){for(let le=0,ve=F*H+E;le<oe.BLOCK_SIZE;le++,ve+=H)for(let Te=0;Te<oe.BLOCK_SIZE;Te++)(y[ve+Te]&255)<=$&&Y.set(E+Te,F+le)}static calculateBlackPoints(y,E,F,$,H){const Y=H-oe.BLOCK_SIZE,le=$-oe.BLOCK_SIZE,ve=new Array(F);for(let Te=0;Te<F;Te++){ve[Te]=new Int32Array(E);let Qe=Te<<oe.BLOCK_SIZE_POWER;Qe>Y&&(Qe=Y);for(let xt=0;xt<E;xt++){let It=xt<<oe.BLOCK_SIZE_POWER;It>le&&(It=le);let Qt=0,St=255,zt=0;for(let jn=0,mr=Qe*$+It;jn<oe.BLOCK_SIZE;jn++,mr+=$){for(let Sr=0;Sr<oe.BLOCK_SIZE;Sr++){const Ar=y[mr+Sr]&255;Qt+=Ar,Ar<St&&(St=Ar),Ar>zt&&(zt=Ar)}if(zt-St>oe.MIN_DYNAMIC_RANGE)for(jn++,mr+=$;jn<oe.BLOCK_SIZE;jn++,mr+=$)for(let Sr=0;Sr<oe.BLOCK_SIZE;Sr++)Qt+=y[mr+Sr]&255}let Wt=Qt>>oe.BLOCK_SIZE_POWER*2;if(zt-St<=oe.MIN_DYNAMIC_RANGE&&(Wt=St/2,Te>0&&xt>0)){const jn=(ve[Te-1][xt]+2*ve[Te][xt-1]+ve[Te-1][xt-1])/4;St<jn&&(Wt=jn)}ve[Te][xt]=Wt}}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,F,$){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 F=0;F<this.height;F++){const $=this.getRow(F,y);for(let H=0;H<this.width;H++){const Y=$[H]&255;let le;Y<64?le="#":Y<128?le="+":Y<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 F=this.delegate.getRow(y,E),$=this.getWidth();for(let H=0;H<$;H++)F[H]=255-(F[H]&255);return F}getMatrix(){const y=this.delegate.getMatrix(),E=this.getWidth()*this.getHeight(),F=new Uint8ClampedArray(E);for(let $=0;$<E;$++)F[$]=255-(y[$]&255);return F}isCropSupported(){return this.delegate.isCropSupported()}crop(y,E,F,$){return new V(this.delegate.crop(y,E,F,$))}isRotateSupported(){return this.delegate.isRotateSupported()}invert(){return this.delegate}rotateCounterClockwise(){return new V(this.delegate.rotateCounterClockwise())}rotateCounterClockwise45(){return new V(this.delegate.rotateCounterClockwise45())}}class te extends G{constructor(y){super(y.width,y.height),this.canvas=y,this.tempCanvasElement=null,this.buffer=te.makeBufferFromCanvasImageData(y)}static makeBufferFromCanvasImageData(y){const E=y.getContext("2d").getImageData(0,0,y.width,y.height);return te.toGrayscaleBuffer(E.data,y.width,y.height)}static toGrayscaleBuffer(y,E,F){const $=new Uint8ClampedArray(E*F);for(let H=0,Y=0,le=y.length;H<le;H+=4,Y++){let ve;if(y[H+3]===0)ve=255;else{const Qe=y[H],xt=y[H+1],It=y[H+2];ve=306*Qe+601*xt+117*It+512>>10}$[Y]=ve}return $}getRow(y,E){if(y<0||y>=this.getHeight())throw new f("Requested row is outside the image: "+y);const F=this.getWidth(),$=y*F;return E===null?E=this.buffer.slice($,$+F):(E.length<F&&(E=new Uint8ClampedArray(F)),E.set(this.buffer.slice($,$+F))),E}getMatrix(){return this.buffer}isCropSupported(){return!0}crop(y,E,F,$){return super.crop(y,E,F,$),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(),F=E.getContext("2d"),$=y*te.DEGREE_TO_RADIANS,H=this.canvas.width,Y=this.canvas.height,le=Math.ceil(Math.abs(Math.cos($))*H+Math.abs(Math.sin($))*Y),ve=Math.ceil(Math.abs(Math.sin($))*H+Math.abs(Math.cos($))*Y);return E.width=le,E.height=ve,F.translate(le/2,ve/2),F.rotate($),F.drawImage(this.canvas,H/-2,Y/-2),this.buffer=te.makeBufferFromCanvasImageData(E),this}invert(){return new V(this)}}te.DEGREE_TO_RADIANS=Math.PI/180;class ae{constructor(y,E,F){this.deviceId=y,this.label=E,this.kind="videoinput",this.groupId=F||void 0}toJSON(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}}}var fe=(globalThis||Iu||self||window||void 0)&&(globalThis||Iu||self||window||void 0).__awaiter||function(dt,y,E,F){function $(H){return H instanceof E?H:new E(function(Y){Y(H)})}return new(E||(E=Promise))(function(H,Y){function le(Qe){try{Te(F.next(Qe))}catch(xt){Y(xt)}}function ve(Qe){try{Te(F.throw(Qe))}catch(xt){Y(xt)}}function Te(Qe){Qe.done?H(Qe.value):$(Qe.value).then(le,ve)}Te((F=F.apply(dt,y||[])).next())})};class Ne{constructor(y,E=500,F){this.reader=y,this.timeBetweenScansMillis=E,this._hints=F,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 F of y){const $=F.kind==="video"?"videoinput":F.kind;if($!=="videoinput")continue;const H=F.deviceId||F.id,Y=F.label||`Video device ${E.length+1}`,le=F.groupId,ve={deviceId:H,label:Y,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(F=>F.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 F;y?F={deviceId:{exact:y}}:F={facingMode:"environment"};const $={video:F};return yield this.decodeOnceFromConstraints($,E)})}decodeOnceFromConstraints(y,E){return fe(this,void 0,void 0,function*(){const F=yield navigator.mediaDevices.getUserMedia(y);return yield this.decodeOnceFromStream(F,E)})}decodeOnceFromStream(y,E){return fe(this,void 0,void 0,function*(){this.reset();const F=yield this.attachStreamToVideo(y,E);return yield this.decodeOnce(F)})}decodeFromInputVideoDeviceContinuously(y,E,F){return fe(this,void 0,void 0,function*(){return yield this.decodeFromVideoDevice(y,E,F)})}decodeFromVideoDevice(y,E,F){return fe(this,void 0,void 0,function*(){let $;y?$={deviceId:{exact:y}}:$={facingMode:"environment"};const H={video:$};return yield this.decodeFromConstraints(H,E,F)})}decodeFromConstraints(y,E,F){return fe(this,void 0,void 0,function*(){const $=yield navigator.mediaDevices.getUserMedia(y);return yield this.decodeFromStream($,E,F)})}decodeFromStream(y,E,F){return fe(this,void 0,void 0,function*(){this.reset();const $=yield this.attachStreamToVideo(y,E);return yield this.decodeContinuously($,F)})}stopAsyncDecode(){this._stopAsyncDecode=!0}stopContinuousDecode(){this._stopContinuousDecode=!0}attachStreamToVideo(y,E){return fe(this,void 0,void 0,function*(){const F=this.prepareVideoElement(E);return this.addVideoSource(F,y),this.videoElement=F,this.stream=y,yield this.playVideoOnLoadAsync(F),F})}playVideoOnLoadAsync(y){return new Promise((E,F)=>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 F=document.getElementById(y);if(!F)throw new d(`element with id '${y}' not found`);if(F.nodeName.toLowerCase()!==E.toLowerCase())throw new d(`element with id '${y}' must be an ${E} element`);return F}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,F){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,F):this.decodeFromVideoElementContinuously(y,F)}decodeFromImageElement(y){if(!y)throw new d("An image element must be provided.");this.reset();const E=this.prepareImageElement(y);this.imageElement=E;let F;return this.isImageLoaded(E)?F=this.decodeOnce(E,!1,!0):F=this._decodeOnLoadImage(E),F}decodeFromVideoElement(y){const E=this._decodeFromVideoElementSetup(y);return this._decodeOnLoadVideo(E)}decodeFromVideoElementContinuously(y,E){const F=this._decodeFromVideoElementSetup(y);return this._decodeOnLoadVideoContinuously(F,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 F=this._decodeOnLoadImage(E);return E.src=y,F}decodeFromVideoUrl(y){if(!y)throw new d("An URL must be provided.");this.reset();const E=this.prepareVideoElement(),F=this.decodeFromVideoElement(E);return E.src=y,F}decodeFromVideoUrlContinuously(y,E){if(!y)throw new d("An URL must be provided.");this.reset();const F=this.prepareVideoElement(),$=this.decodeFromVideoElementContinuously(F,E);return F.src=y,$}_decodeOnLoadImage(y){return new Promise((E,F)=>{this.imageLoadedListener=()=>this.decodeOnce(y,!1,!0).then(E,F),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,F=!0){this._stopAsyncDecode=!1;const $=(H,Y)=>{if(this._stopAsyncDecode){Y(new Q("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 Q,Qe=(le instanceof g||le instanceof L)&&F;if(ve||Qe)return setTimeout($,this._timeBetweenDecodingAttempts,H,Y);Y(le)}};return new Promise((H,Y)=>$(H,Y))}decodeContinuously(y,E){this._stopContinuousDecode=!1;const F=()=>{if(this._stopContinuousDecode){this._stopContinuousDecode=void 0;return}try{const $=this.decode(y);E($,null),setTimeout(F,this.timeBetweenScansMillis)}catch($){E(null,$);const H=$ instanceof g||$ instanceof L,Y=$ instanceof Q;(H||Y)&&setTimeout(F,this._timeBetweenDecodingAttempts)}};F()}decode(y){const E=this.createBinaryBitmap(y);return this.decodeBitmap(E)}_isHTMLVideoElement(y){return y.videoWidth!==0}drawFrameOnCanvas(y,E,F){E||(E={sx:0,sy:0,sWidth:y.videoWidth,sHeight:y.videoHeight,dx:0,dy:0,dWidth:y.videoWidth,dHeight:y.videoHeight}),F||(F=this.captureCanvasContext),F.drawImage(y,E.sx,E.sy,E.sWidth,E.sHeight,E.dx,E.dy,E.dWidth,E.dHeight)}drawImageOnCanvas(y,E,F=this.captureCanvasContext){E||(E={sx:0,sy:0,sWidth:y.naturalWidth,sHeight:y.naturalHeight,dx:0,dy:0,dWidth:y.naturalWidth,dHeight:y.naturalHeight}),F||(F=this.captureCanvasContext),F.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),F=new te(E),$=new oe(F);return new x($)}getCaptureCanvasContext(y){if(!this.captureCanvasContext){const F=this.getCaptureCanvas(y).getContext("2d");this.captureCanvasContext=F}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 F,$;return typeof y<"u"&&(y instanceof HTMLVideoElement?(F=y.videoWidth,$=y.videoHeight):y instanceof HTMLImageElement&&(F=y.naturalWidth||y.width,$=y.naturalHeight||y.height)),E.style.width=F+"px",E.style.height=$+"px",E.width=F,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 me{constructor(y,E,F=E==null?0:8*E.length,$,H,Y=w.currentTimeMillis()){this.text=y,this.rawBytes=E,this.numBits=F,this.resultPoints=$,this.format=H,this.timestamp=Y,this.text=y,this.rawBytes=E,F==null?this.numBits=E==null?0:8*E.length:this.numBits=F,this.resultPoints=$,this.format=H,this.resultMetadata=null,Y==null?this.timestamp=w.currentTimeMillis():this.timestamp=Y}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 F=new Array(E.length+y.length);w.arraycopy(E,0,F,0,E.length),w.arraycopy(y,0,F,E.length,y.length),this.resultPoints=F}}getTimestamp(){return this.timestamp}toString(){return this.text}}var we;(function(dt){dt[dt.AZTEC=0]="AZTEC",dt[dt.CODABAR=1]="CODABAR",dt[dt.CODE_39=2]="CODE_39",dt[dt.CODE_93=3]="CODE_93",dt[dt.CODE_128=4]="CODE_128",dt[dt.DATA_MATRIX=5]="DATA_MATRIX",dt[dt.EAN_8=6]="EAN_8",dt[dt.EAN_13=7]="EAN_13",dt[dt.ITF=8]="ITF",dt[dt.MAXICODE=9]="MAXICODE",dt[dt.PDF_417=10]="PDF_417",dt[dt.QR_CODE=11]="QR_CODE",dt[dt.RSS_14=12]="RSS_14",dt[dt.RSS_EXPANDED=13]="RSS_EXPANDED",dt[dt.UPC_A=14]="UPC_A",dt[dt.UPC_E=15]="UPC_E",dt[dt.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(we||(we={}));var xe=we,ye;(function(dt){dt[dt.OTHER=0]="OTHER",dt[dt.ORIENTATION=1]="ORIENTATION",dt[dt.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",dt[dt.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",dt[dt.ISSUE_NUMBER=4]="ISSUE_NUMBER",dt[dt.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",dt[dt.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",dt[dt.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",dt[dt.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",dt[dt.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",dt[dt.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"})(ye||(ye={}));var je=ye;class Pe{constructor(y,E,F,$,H=-1,Y=-1){this.rawBytes=y,this.text=E,this.byteSegments=F,this.ecLevel=$,this.structuredAppendSequenceNumber=H,this.structuredAppendParity=Y,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 Xe{constructor(y,E){if(E.length===0)throw new f;this.field=y;const F=E.length;if(F>1&&E[0]===0){let $=1;for(;$<F&&E[$]===0;)$++;$===F?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(F-$),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 F;if(y===1){F=0;for(let Y=0,le=E.length;Y!==le;Y++){const ve=E[Y];F=Re.addOrSubtract(F,ve)}return F}F=E[0];const $=E.length,H=this.field;for(let Y=1;Y<$;Y++)F=Re.addOrSubtract(H.multiply(y,F),E[Y]);return F}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,F=y.coefficients;if(E.length>F.length){const Y=E;E=F,F=Y}let $=new Int32Array(F.length);const H=F.length-E.length;w.arraycopy(F,0,$,0,H);for(let Y=H;Y<F.length;Y++)$[Y]=Re.addOrSubtract(E[Y-H],F[Y]);return new Xe(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,F=E.length,$=y.coefficients,H=$.length,Y=new Int32Array(F+H-1),le=this.field;for(let ve=0;ve<F;ve++){const Te=E[ve];for(let Qe=0;Qe<H;Qe++)Y[ve+Qe]=Re.addOrSubtract(Y[ve+Qe],le.multiply(Te,$[Qe]))}return new Xe(le,Y)}multiplyScalar(y){if(y===0)return this.field.getZero();if(y===1)return this;const E=this.coefficients.length,F=this.field,$=new Int32Array(E),H=this.coefficients;for(let Y=0;Y<E;Y++)$[Y]=F.multiply(H[Y],y);return new Xe(F,$)}multiplyByMonomial(y,E){if(y<0)throw new f;if(E===0)return this.field.getZero();const F=this.coefficients,$=F.length,H=new Int32Array($+y),Y=this.field;for(let le=0;le<$;le++)H[le]=Y.multiply(F[le],E);return new Xe(Y,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 F=E.getZero(),$=this;const H=y.getCoefficient(y.getDegree()),Y=E.inverse(H);for(;$.getDegree()>=y.getDegree()&&!$.isZero();){const le=$.getDegree()-y.getDegree(),ve=E.multiply($.getCoefficient($.getDegree()),Y),Te=y.multiplyByMonomial(le,ve),Qe=E.buildMonomial(le,ve);F=F.addOrSubtract(Qe),$=$.addOrSubtract(Te)}return[F,$]}toString(){let y="";for(let E=this.getDegree();E>=0;E--){let F=this.getCoefficient(E);if(F!==0){if(F<0?(y+=" - ",F=-F):y.length>0&&(y+=" + "),E===0||F!==1){const $=this.field.log(F);$===0?y+="1":$===1?y+="a":(y+="a^",y+=$)}E!==0&&(E===1?y+="x":(y+="x^",y+=E))}}return y}}class Ke extends u{}Ke.kind="ArithmeticException";class ut extends Re{constructor(y,E,F){super(),this.primitive=y,this.size=E,this.generatorBase=F;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 Y=new Int32Array(E);for(let le=0;le<E-1;le++)Y[$[le]]=le;this.logTable=Y,this.zero=new Xe(this,Int32Array.from([0])),this.one=new Xe(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 F=new Int32Array(y+1);return F[0]=E,new Xe(this,F)}inverse(y){if(y===0)throw new Ke;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"+I.toHexString(this.primitive)+","+this.size+")"}equals(y){return y===this}}ut.AZTEC_DATA_12=new ut(4201,4096,1),ut.AZTEC_DATA_10=new ut(1033,1024,1),ut.AZTEC_DATA_6=new ut(67,64,1),ut.AZTEC_PARAM=new ut(19,16,1),ut.QR_CODE_FIELD_256=new ut(285,256,0),ut.DATA_MATRIX_FIELD_256=new ut(301,256,1),ut.AZTEC_DATA_8=ut.DATA_MATRIX_FIELD_256,ut.MAXICODE_FIELD_64=ut.AZTEC_DATA_6;class et extends u{}et.kind="ReedSolomonException";class tt extends u{}tt.kind="IllegalStateException";class Le{constructor(y){this.field=y}decode(y,E){const F=this.field,$=new Xe(F,y),H=new Int32Array(E);let Y=!0;for(let Qt=0;Qt<E;Qt++){const St=$.evaluateAt(F.exp(Qt+F.getGeneratorBase()));H[H.length-1-Qt]=St,St!==0&&(Y=!1)}if(Y)return;const le=new Xe(F,H),ve=this.runEuclideanAlgorithm(F.buildMonomial(E,1),le,E),Te=ve[0],Qe=ve[1],xt=this.findErrorLocations(Te),It=this.findErrorMagnitudes(Qe,xt);for(let Qt=0;Qt<xt.length;Qt++){const St=y.length-1-F.log(xt[Qt]);if(St<0)throw new et("Bad error location");y[St]=ut.addOrSubtract(y[St],It[Qt])}}runEuclideanAlgorithm(y,E,F){if(y.getDegree()<E.getDegree()){const Qt=y;y=E,E=Qt}const $=this.field;let H=y,Y=E,le=$.getZero(),ve=$.getOne();for(;Y.getDegree()>=(F/2|0);){let Qt=H,St=le;if(H=Y,le=ve,H.isZero())throw new et("r_{i-1} was zero");Y=Qt;let zt=$.getZero();const Wt=H.getCoefficient(H.getDegree()),jn=$.inverse(Wt);for(;Y.getDegree()>=H.getDegree()&&!Y.isZero();){const mr=Y.getDegree()-H.getDegree(),Sr=$.multiply(Y.getCoefficient(Y.getDegree()),jn);zt=zt.addOrSubtract($.buildMonomial(mr,Sr)),Y=Y.addOrSubtract(H.multiplyByMonomial(mr,Sr))}if(ve=zt.multiply(le).addOrSubtract(St),Y.getDegree()>=H.getDegree())throw new tt("Division algorithm failed to reduce polynomial?")}const Te=ve.getCoefficient(0);if(Te===0)throw new et("sigmaTilde(0) was zero");const Qe=$.inverse(Te),xt=ve.multiplyScalar(Qe),It=Y.multiplyScalar(Qe);return[xt,It]}findErrorLocations(y){const E=y.getDegree();if(E===1)return Int32Array.from([y.getCoefficient(1)]);const F=new Int32Array(E);let $=0;const H=this.field;for(let Y=1;Y<H.getSize()&&$<E;Y++)y.evaluateAt(Y)===0&&(F[$]=H.inverse(Y),$++);if($!==E)throw new et("Error locator degree does not match number of roots");return F}findErrorMagnitudes(y,E){const F=E.length,$=new Int32Array(F),H=this.field;for(let Y=0;Y<F;Y++){const le=H.inverse(E[Y]);let ve=1;for(let Te=0;Te<F;Te++)if(Y!==Te){const Qe=H.multiply(E[Te],le),xt=Qe&1?Qe&-2:Qe|1;ve=H.multiply(ve,xt)}$[Y]=H.multiply(y.evaluateAt(le),H.inverse(ve)),H.getGeneratorBase()!==0&&($[Y]=H.multiply($[Y],le))}return $}}var $e;(function(dt){dt[dt.UPPER=0]="UPPER",dt[dt.LOWER=1]="LOWER",dt[dt.MIXED=2]="MIXED",dt[dt.DIGIT=3]="DIGIT",dt[dt.PUNCT=4]="PUNCT",dt[dt.BINARY=5]="BINARY"})($e||($e={}));class ht{decode(y){this.ddata=y;let E=y.getBits(),F=this.extractBits(E),$=this.correctBits(F),H=ht.convertBoolArrayToByteArray($),Y=ht.getEncodedData($),le=new Pe(H,Y,null,null);return le.setNumBits($.length),le}static highLevelDecode(y){return this.getEncodedData(y)}static getEncodedData(y){let E=y.length,F=$e.UPPER,$=$e.UPPER,H="",Y=0;for(;Y<E;)if($===$e.BINARY){if(E-Y<5)break;let le=ht.readCode(y,Y,5);if(Y+=5,le===0){if(E-Y<11)break;le=ht.readCode(y,Y,11)+31,Y+=11}for(let ve=0;ve<le;ve++){if(E-Y<8){Y=E;break}const Te=ht.readCode(y,Y,8);H+=K.castAsNonUtf8Char(Te),Y+=8}$=F}else{let le=$===$e.DIGIT?4:5;if(E-Y<le)break;let ve=ht.readCode(y,Y,le);Y+=le;let Te=ht.getCharacter($,ve);Te.startsWith("CTRL_")?(F=$,$=ht.getTable(Te.charAt(5)),Te.charAt(6)==="L"&&(F=$)):(H+=Te,$=F)}return H}static getTable(y){switch(y){case"L":return $e.LOWER;case"P":return $e.PUNCT;case"M":return $e.MIXED;case"D":return $e.DIGIT;case"B":return $e.BINARY;case"U":default:return $e.UPPER}}static getCharacter(y,E){switch(y){case $e.UPPER:return ht.UPPER_TABLE[E];case $e.LOWER:return ht.LOWER_TABLE[E];case $e.MIXED:return ht.MIXED_TABLE[E];case $e.PUNCT:return ht.PUNCT_TABLE[E];case $e.DIGIT:return ht.DIGIT_TABLE[E];default:throw new tt("Bad table")}}correctBits(y){let E,F;this.ddata.getNbLayers()<=2?(F=6,E=ut.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(F=8,E=ut.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(F=10,E=ut.AZTEC_DATA_10):(F=12,E=ut.AZTEC_DATA_12);let $=this.ddata.getNbDatablocks(),H=y.length/F;if(H<$)throw new L;let Y=y.length%F,le=new Int32Array(H);for(let It=0;It<H;It++,Y+=F)le[It]=ht.readCode(y,Y,F);try{new Le(E).decode(le,H-$)}catch(It){throw new L(It)}let ve=(1<<F)-1,Te=0;for(let It=0;It<$;It++){let Qt=le[It];if(Qt===0||Qt===ve)throw new L;(Qt===1||Qt===ve-1)&&Te++}let Qe=new Array($*F-Te),xt=0;for(let It=0;It<$;It++){let Qt=le[It];if(Qt===1||Qt===ve-1)Qe.fill(Qt>1,xt,xt+F-1),xt+=F-1;else for(let St=F-1;St>=0;--St)Qe[xt++]=(Qt&1<<St)!==0}return Qe}extractBits(y){let E=this.ddata.isCompact(),F=this.ddata.getNbLayers(),$=(E?11:14)+F*4,H=new Int32Array($),Y=new Array(this.totalBitsInLayer(F,E));if(E)for(let le=0;le<H.length;le++)H[le]=le;else{let le=$+1+2*I.truncDivision(I.truncDivision($,2)-1,15),ve=$/2,Te=I.truncDivision(le,2);for(let Qe=0;Qe<ve;Qe++){let xt=Qe+I.truncDivision(Qe,15);H[ve-Qe-1]=Te-xt-1,H[ve+Qe]=Te+xt+1}}for(let le=0,ve=0;le<F;le++){let Te=(F-le)*4+(E?9:12),Qe=le*2,xt=$-1-Qe;for(let It=0;It<Te;It++){let Qt=It*2;for(let St=0;St<2;St++)Y[ve+Qt+St]=y.get(H[Qe+St],H[Qe+It]),Y[ve+2*Te+Qt+St]=y.get(H[Qe+It],H[xt-St]),Y[ve+4*Te+Qt+St]=y.get(H[xt-St],H[xt-It]),Y[ve+6*Te+Qt+St]=y.get(H[xt-It],H[Qe+St])}ve+=Te*8}return Y}static readCode(y,E,F){let $=0;for(let H=E;H<E+F;H++)$<<=1,y[H]&&($|=1);return $}static readByte(y,E){let F=y.length-E;return F>=8?ht.readCode(y,E,8):ht.readCode(y,E,F)<<8-F}static convertBoolArrayToByteArray(y){let E=new Uint8Array((y.length+7)/8);for(let F=0;F<E.length;F++)E[F]=ht.readByte(y,8*F);return E}totalBitsInLayer(y,E){return((E?88:112)+16*y)*y}}ht.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"],ht.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"],ht.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"],ht.PUNCT_TABLE=["","\r",`\r
`,". ",", ",": ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}","CTRL_UL"],ht.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"];class pt{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,F,$){const H=y-F,Y=E-$;return Math.sqrt(H*H+Y*Y)}static sum(y){let E=0;for(let F=0,$=y.length;F!==$;F++){const H=y[F];E+=H}return E}}class Kt{static floatToIntBits(y){return y}}Kt.MAX_VALUE=Number.MAX_SAFE_INTEGER;class wt{constructor(y,E){this.x=y,this.y=E}getX(){return this.x}getY(){return this.y}equals(y){if(y instanceof wt){const E=y;return this.x===E.x&&this.y===E.y}return!1}hashCode(){return 31*Kt.floatToIntBits(this.x)+Kt.floatToIntBits(this.y)}toString(){return"("+this.x+","+this.y+")"}static orderBestPatterns(y){const E=this.distance(y[0],y[1]),F=this.distance(y[1],y[2]),$=this.distance(y[0],y[2]);let H,Y,le;if(F>=E&&F>=$?(Y=y[0],H=y[1],le=y[2]):$>=F&&$>=E?(Y=y[1],H=y[0],le=y[2]):(Y=y[2],H=y[0],le=y[1]),this.crossProductZ(H,Y,le)<0){const ve=H;H=le,le=ve}y[0]=H,y[1]=Y,y[2]=le}static distance(y,E){return pt.distance(y.x,y.y,E.x,E.y)}static crossProductZ(y,E,F){const $=E.x,H=E.y;return(F.x-$)*(y.y-H)-(F.y-H)*(y.x-$)}}class nn{constructor(y,E){this.bits=y,this.points=E}getBits(){return this.bits}getPoints(){return this.points}}class cn extends nn{constructor(y,E,F,$,H){super(y,E),this.compact=F,this.nbDatablocks=$,this.nbLayers=H}getNbLayers(){return this.nbLayers}getNbDatablocks(){return this.nbDatablocks}isCompact(){return this.compact}}class zn{constructor(y,E,F,$){this.image=y,this.height=y.getHeight(),this.width=y.getWidth(),E==null&&(E=zn.INIT_SIZE),F==null&&(F=y.getWidth()/2|0),$==null&&($=y.getHeight()/2|0);const H=E/2|0;if(this.leftInit=F-H,this.rightInit=F+H,this.upInit=$-H,this.downInit=$+H,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new Q}detect(){let y=this.leftInit,E=this.rightInit,F=this.upInit,$=this.downInit,H=!1,Y=!0,le=!1,ve=!1,Te=!1,Qe=!1,xt=!1;const It=this.width,Qt=this.height;for(;Y;){Y=!1;let St=!0;for(;(St||!ve)&&E<It;)St=this.containsBlackPoint(F,$,E,!1),St?(E++,Y=!0,ve=!0):ve||E++;if(E>=It){H=!0;break}let zt=!0;for(;(zt||!Te)&&$<Qt;)zt=this.containsBlackPoint(y,E,$,!0),zt?($++,Y=!0,Te=!0):Te||$++;if($>=Qt){H=!0;break}let Wt=!0;for(;(Wt||!Qe)&&y>=0;)Wt=this.containsBlackPoint(F,$,y,!1),Wt?(y--,Y=!0,Qe=!0):Qe||y--;if(y<0){H=!0;break}let jn=!0;for(;(jn||!xt)&&F>=0;)jn=this.containsBlackPoint(y,E,F,!0),jn?(F--,Y=!0,xt=!0):xt||F--;if(F<0){H=!0;break}Y&&(le=!0)}if(!H&&le){const St=E-y;let zt=null;for(let Sr=1;zt===null&&Sr<St;Sr++)zt=this.getBlackPointOnSegment(y,$-Sr,y+Sr,$);if(zt==null)throw new Q;let Wt=null;for(let Sr=1;Wt===null&&Sr<St;Sr++)Wt=this.getBlackPointOnSegment(y,F+Sr,y+Sr,F);if(Wt==null)throw new Q;let jn=null;for(let Sr=1;jn===null&&Sr<St;Sr++)jn=this.getBlackPointOnSegment(E,F+Sr,E-Sr,F);if(jn==null)throw new Q;let mr=null;for(let Sr=1;mr===null&&Sr<St;Sr++)mr=this.getBlackPointOnSegment(E,$-Sr,E-Sr,$);if(mr==null)throw new Q;return this.centerEdges(mr,zt,jn,Wt)}else throw new Q}getBlackPointOnSegment(y,E,F,$){const H=pt.round(pt.distance(y,E,F,$)),Y=(F-y)/H,le=($-E)/H,ve=this.image;for(let Te=0;Te<H;Te++){const Qe=pt.round(y+Te*Y),xt=pt.round(E+Te*le);if(ve.get(Qe,xt))return new wt(Qe,xt)}return null}centerEdges(y,E,F,$){const H=y.getX(),Y=y.getY(),le=E.getX(),ve=E.getY(),Te=F.getX(),Qe=F.getY(),xt=$.getX(),It=$.getY(),Qt=zn.CORR;return H<this.width/2?[new wt(xt-Qt,It+Qt),new wt(le+Qt,ve+Qt),new wt(Te-Qt,Qe-Qt),new wt(H+Qt,Y-Qt)]:[new wt(xt+Qt,It+Qt),new wt(le+Qt,ve-Qt),new wt(Te-Qt,Qe+Qt),new wt(H-Qt,Y-Qt)]}containsBlackPoint(y,E,F,$){const H=this.image;if($){for(let Y=y;Y<=E;Y++)if(H.get(Y,F))return!0}else for(let Y=y;Y<=E;Y++)if(H.get(F,Y))return!0;return!1}}zn.INIT_SIZE=10,zn.CORR=1;class Xt{static checkAndNudgePoints(y,E){const F=y.getWidth(),$=y.getHeight();let H=!0;for(let Y=0;Y<E.length&&H;Y+=2){const le=Math.floor(E[Y]),ve=Math.floor(E[Y+1]);if(le<-1||le>F||ve<-1||ve>$)throw new Q;H=!1,le===-1?(E[Y]=0,H=!0):le===F&&(E[Y]=F-1,H=!0),ve===-1?(E[Y+1]=0,H=!0):ve===$&&(E[Y+1]=$-1,H=!0)}H=!0;for(let Y=E.length-2;Y>=0&&H;Y-=2){const le=Math.floor(E[Y]),ve=Math.floor(E[Y+1]);if(le<-1||le>F||ve<-1||ve>$)throw new Q;H=!1,le===-1?(E[Y]=0,H=!0):le===F&&(E[Y]=F-1,H=!0),ve===-1?(E[Y+1]=0,H=!0):ve===$&&(E[Y+1]=$-1,H=!0)}}}class on{constructor(y,E,F,$,H,Y,le,ve,Te){this.a11=y,this.a21=E,this.a31=F,this.a12=$,this.a22=H,this.a32=Y,this.a13=le,this.a23=ve,this.a33=Te}static quadrilateralToQuadrilateral(y,E,F,$,H,Y,le,ve,Te,Qe,xt,It,Qt,St,zt,Wt){const jn=on.quadrilateralToSquare(y,E,F,$,H,Y,le,ve);return on.squareToQuadrilateral(Te,Qe,xt,It,Qt,St,zt,Wt).times(jn)}transformPoints(y){const E=y.length,F=this.a11,$=this.a12,H=this.a13,Y=this.a21,le=this.a22,ve=this.a23,Te=this.a31,Qe=this.a32,xt=this.a33;for(let It=0;It<E;It+=2){const Qt=y[It],St=y[It+1],zt=H*Qt+ve*St+xt;y[It]=(F*Qt+Y*St+Te)/zt,y[It+1]=($*Qt+le*St+Qe)/zt}}transformPointsWithValues(y,E){const F=this.a11,$=this.a12,H=this.a13,Y=this.a21,le=this.a22,ve=this.a23,Te=this.a31,Qe=this.a32,xt=this.a33,It=y.length;for(let Qt=0;Qt<It;Qt++){const St=y[Qt],zt=E[Qt],Wt=H*St+ve*zt+xt;y[Qt]=(F*St+Y*zt+Te)/Wt,E[Qt]=($*St+le*zt+Qe)/Wt}}static squareToQuadrilateral(y,E,F,$,H,Y,le,ve){const Te=y-F+H-le,Qe=E-$+Y-ve;if(Te===0&&Qe===0)return new on(F-y,H-F,y,$-E,Y-$,E,0,0,1);{const xt=F-H,It=le-H,Qt=$-Y,St=ve-Y,zt=xt*St-It*Qt,Wt=(Te*St-It*Qe)/zt,jn=(xt*Qe-Te*Qt)/zt;return new on(F-y+Wt*F,le-y+jn*le,y,$-E+Wt*$,ve-E+jn*ve,E,Wt,jn,1)}}static quadrilateralToSquare(y,E,F,$,H,Y,le,ve){return on.squareToQuadrilateral(y,E,F,$,H,Y,le,ve).buildAdjoint()}buildAdjoint(){return new on(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 on(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 Zt extends Xt{sampleGrid(y,E,F,$,H,Y,le,ve,Te,Qe,xt,It,Qt,St,zt,Wt,jn,mr,Sr){const Ar=on.quadrilateralToQuadrilateral($,H,Y,le,ve,Te,Qe,xt,It,Qt,St,zt,Wt,jn,mr,Sr);return this.sampleGridWithTransform(y,E,F,Ar)}sampleGridWithTransform(y,E,F,$){if(E<=0||F<=0)throw new Q;const H=new he(E,F),Y=new Float32Array(2*E);for(let le=0;le<F;le++){const ve=Y.length,Te=le+.5;for(let Qe=0;Qe<ve;Qe+=2)Y[Qe]=Qe/2+.5,Y[Qe+1]=Te;$.transformPoints(Y),Xt.checkAndNudgePoints(y,Y);try{for(let Qe=0;Qe<ve;Qe+=2)y.get(Math.floor(Y[Qe]),Math.floor(Y[Qe+1]))&&H.set(Qe/2,le)}catch{throw new Q}}return H}}class Ye{static setGridSampler(y){Ye.gridSampler=y}static getInstance(){return Ye.gridSampler}}Ye.gridSampler=new Zt;class Ze{constructor(y,E){this.x=y,this.y=E}toResultPoint(){return new wt(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(),F=this.getBullsEyeCorners(E);if(y){let Y=F[0];F[0]=F[2],F[2]=Y}this.extractParameters(F);let $=this.sampleGrid(this.image,F[this.shift%4],F[(this.shift+1)%4],F[(this.shift+2)%4],F[(this.shift+3)%4]),H=this.getMatrixCornerPoints(F);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 Q;let E=2*this.nbCenterLayers,F=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(F,E);let $=0;for(let Y=0;Y<4;Y++){let le=F[(this.shift+Y)%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 F=0;y.forEach(($,H,Y)=>{let le=($>>E-2<<1)+($&1);F=(F<<3)+le}),F=((F&1)<<11)+(F>>1);for(let $=0;$<4;$++)if(I.bitCount(F^this.EXPECTED_CORNER_BITS[$])<=2)return $;throw new Q}getCorrectedParameterData(y,E){let F,$;E?(F=7,$=2):(F=10,$=4);let H=F-$,Y=new Int32Array(F);for(let ve=F-1;ve>=0;--ve)Y[ve]=y&15,y>>=4;try{new Le(ut.AZTEC_PARAM).decode(Y,H)}catch{throw new Q}let le=0;for(let ve=0;ve<$;ve++)le=(le<<4)+Y[ve];return le}getBullsEyeCorners(y){let E=y,F=y,$=y,H=y,Y=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){let xt=this.getFirstDifferent(E,Y,1,-1),It=this.getFirstDifferent(F,Y,1,1),Qt=this.getFirstDifferent($,Y,-1,1),St=this.getFirstDifferent(H,Y,-1,-1);if(this.nbCenterLayers>2){let zt=this.distancePoint(St,xt)*this.nbCenterLayers/(this.distancePoint(H,E)*(this.nbCenterLayers+2));if(zt<.75||zt>1.25||!this.isWhiteOrBlackRectangle(xt,It,Qt,St))break}E=xt,F=It,$=Qt,H=St,Y=!Y}if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7)throw new Q;this.compact=this.nbCenterLayers===5;let le=new wt(E.getX()+.5,E.getY()-.5),ve=new wt(F.getX()+.5,F.getY()+.5),Te=new wt($.getX()-.5,$.getY()+.5),Qe=new wt(H.getX()-.5,H.getY()-.5);return this.expandSquare([le,ve,Te,Qe],2*this.nbCenterLayers-3,2*this.nbCenterLayers)}getMatrixCenter(){let y,E,F,$;try{let le=new zn(this.image).detect();y=le[0],E=le[1],F=le[2],$=le[3]}catch{let ve=this.image.getWidth()/2,Te=this.image.getHeight()/2;y=this.getFirstDifferent(new Ze(ve+7,Te-7),!1,1,-1).toResultPoint(),E=this.getFirstDifferent(new Ze(ve+7,Te+7),!1,1,1).toResultPoint(),F=this.getFirstDifferent(new Ze(ve-7,Te+7),!1,-1,1).toResultPoint(),$=this.getFirstDifferent(new Ze(ve-7,Te-7),!1,-1,-1).toResultPoint()}let H=pt.round((y.getX()+$.getX()+E.getX()+F.getX())/4),Y=pt.round((y.getY()+$.getY()+E.getY()+F.getY())/4);try{let le=new zn(this.image,15,H,Y).detect();y=le[0],E=le[1],F=le[2],$=le[3]}catch{y=this.getFirstDifferent(new Ze(H+7,Y-7),!1,1,-1).toResultPoint(),E=this.getFirstDifferent(new Ze(H+7,Y+7),!1,1,1).toResultPoint(),F=this.getFirstDifferent(new Ze(H-7,Y+7),!1,-1,1).toResultPoint(),$=this.getFirstDifferent(new Ze(H-7,Y-7),!1,-1,-1).toResultPoint()}return H=pt.round((y.getX()+$.getX()+E.getX()+F.getX())/4),Y=pt.round((y.getY()+$.getY()+E.getY()+F.getY())/4),new Ze(H,Y)}getMatrixCornerPoints(y){return this.expandSquare(y,2*this.nbCenterLayers,this.getDimension())}sampleGrid(y,E,F,$,H){let Y=Ye.getInstance(),le=this.getDimension(),ve=le/2-this.nbCenterLayers,Te=le/2+this.nbCenterLayers;return Y.sampleGrid(y,le,le,ve,ve,Te,ve,Te,Te,ve,Te,E.getX(),E.getY(),F.getX(),F.getY(),$.getX(),$.getY(),H.getX(),H.getY())}sampleLine(y,E,F){let $=0,H=this.distanceResultPoint(y,E),Y=H/F,le=y.getX(),ve=y.getY(),Te=Y*(E.getX()-y.getX())/H,Qe=Y*(E.getY()-y.getY())/H;for(let xt=0;xt<F;xt++)this.image.get(pt.round(le+xt*Te),pt.round(ve+xt*Qe))&&($|=1<<F-xt-1);return $}isWhiteOrBlackRectangle(y,E,F,$){let H=3;y=new Ze(y.getX()-H,y.getY()+H),E=new Ze(E.getX()-H,E.getY()-H),F=new Ze(F.getX()+H,F.getY()-H),$=new Ze($.getX()+H,$.getY()+H);let Y=this.getColor($,y);if(Y===0)return!1;let le=this.getColor(y,E);return le!==Y||(le=this.getColor(E,F),le!==Y)?!1:(le=this.getColor(F,$),le===Y)}getColor(y,E){let F=this.distancePoint(y,E),$=(E.getX()-y.getX())/F,H=(E.getY()-y.getY())/F,Y=0,le=y.getX(),ve=y.getY(),Te=this.image.get(y.getX(),y.getY()),Qe=Math.ceil(F);for(let It=0;It<Qe;It++)le+=$,ve+=H,this.image.get(pt.round(le),pt.round(ve))!==Te&&Y++;let xt=Y/F;return xt>.1&&xt<.9?0:xt<=.1===Te?1:-1}getFirstDifferent(y,E,F,$){let H=y.getX()+F,Y=y.getY()+$;for(;this.isValid(H,Y)&&this.image.get(H,Y)===E;)H+=F,Y+=$;for(H-=F,Y-=$;this.isValid(H,Y)&&this.image.get(H,Y)===E;)H+=F;for(H-=F;this.isValid(H,Y)&&this.image.get(H,Y)===E;)Y+=$;return Y-=$,new Ze(H,Y)}expandSquare(y,E,F){let $=F/(2*E),H=y[0].getX()-y[2].getX(),Y=y[0].getY()-y[2].getY(),le=(y[0].getX()+y[2].getX())/2,ve=(y[0].getY()+y[2].getY())/2,Te=new wt(le+$*H,ve+$*Y),Qe=new wt(le-$*H,ve-$*Y);H=y[1].getX()-y[3].getX(),Y=y[1].getY()-y[3].getY(),le=(y[1].getX()+y[3].getX())/2,ve=(y[1].getY()+y[3].getY())/2;let xt=new wt(le+$*H,ve+$*Y),It=new wt(le-$*H,ve-$*Y);return[Te,xt,Qe,It]}isValid(y,E){return y>=0&&y<this.image.getWidth()&&E>0&&E<this.image.getHeight()}isValidPoint(y){let E=pt.round(y.getX()),F=pt.round(y.getY());return this.isValid(E,F)}distancePoint(y,E){return pt.distance(y.getX(),y.getY(),E.getX(),E.getY())}distanceResultPoint(y,E){return pt.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*(I.truncDivision(this.nbLayers-4,8)+1)+15}}class dn{decode(y,E=null){let F=null,$=new Ft(y.getBlackMatrix()),H=null,Y=null;try{let Qe=$.detectMirror(!1);H=Qe.getPoints(),this.reportFoundResultPoints(E,H),Y=new ht().decode(Qe)}catch(Qe){F=Qe}if(Y==null)try{let Qe=$.detectMirror(!0);H=Qe.getPoints(),this.reportFoundResultPoints(E,H),Y=new ht().decode(Qe)}catch(Qe){throw F??Qe}let le=new me(Y.getText(),Y.getRawBytes(),Y.getNumBits(),H,xe.AZTEC,w.currentTimeMillis()),ve=Y.getByteSegments();ve!=null&&le.putMetadata(je.BYTE_SEGMENTS,ve);let Te=Y.getECLevel();return Te!=null&&le.putMetadata(je.ERROR_CORRECTION_LEVEL,Te),le}reportFoundResultPoints(y,E){if(y!=null){let F=y.get(U.NEED_RESULT_POINT_CALLBACK);F!=null&&E.forEach(($,H,Y)=>{F.foundPossibleResultPoint($)})}}reset(){}}class Yt extends Ne{constructor(y=500){super(new dn,y)}}class Bt{decode(y,E){try{return this.doDecode(y,E)}catch{if(E&&E.get(U.TRY_HARDER)===!0&&y.isRotateSupported()){const H=y.rotateCounterClockwise(),Y=this.doDecode(H,E),le=Y.getResultMetadata();let ve=270;le!==null&&le.get(je.ORIENTATION)===!0&&(ve=ve+le.get(je.ORIENTATION)%360),Y.putMetadata(je.ORIENTATION,ve);const Te=Y.getResultPoints();if(Te!==null){const Qe=H.getHeight();for(let xt=0;xt<Te.length;xt++)Te[xt]=new wt(Qe-Te[xt].getY()-1,Te[xt].getX())}return Y}else throw new Q}}reset(){}doDecode(y,E){const F=y.getWidth(),$=y.getHeight();let H=new R(F);const Y=E&&E.get(U.TRY_HARDER)===!0,le=Math.max(1,$>>(Y?8:5));let ve;Y?ve=$:ve=15;const Te=Math.trunc($/2);for(let Qe=0;Qe<ve;Qe++){const xt=Math.trunc((Qe+1)/2),It=(Qe&1)===0,Qt=Te+le*(It?xt:-xt);if(Qt<0||Qt>=$)break;try{H=y.getBlackRow(Qt,H)}catch{continue}for(let St=0;St<2;St++){if(St===1&&(H.reverse(),E&&E.get(U.NEED_RESULT_POINT_CALLBACK)===!0)){const zt=new Map;E.forEach((Wt,jn)=>zt.set(jn,Wt)),zt.delete(U.NEED_RESULT_POINT_CALLBACK),E=zt}try{const zt=this.decodeRow(Qt,H,E);if(St===1){zt.putMetadata(je.ORIENTATION,180);const Wt=zt.getResultPoints();Wt!==null&&(Wt[0]=new wt(F-Wt[0].getX()-1,Wt[0].getY()),Wt[1]=new wt(F-Wt[1].getX()-1,Wt[1].getY()))}return zt}catch{}}}throw new Q}static recordPattern(y,E,F){const $=F.length;for(let Te=0;Te<$;Te++)F[Te]=0;const H=y.getSize();if(E>=H)throw new Q;let Y=!y.get(E),le=0,ve=E;for(;ve<H;){if(y.get(ve)!==Y)F[le]++;else{if(++le===$)break;F[le]=1,Y=!Y}ve++}if(!(le===$||le===$-1&&ve===H))throw new Q}static recordPatternInReverse(y,E,F){let $=F.length,H=y.get(E);for(;E>0&&$>=0;)y.get(--E)!==H&&($--,H=!H);if($>=0)throw new Q;Bt.recordPattern(y,E+1,F)}static patternMatchVariance(y,E,F){const $=y.length;let H=0,Y=0;for(let Te=0;Te<$;Te++)H+=y[Te],Y+=E[Te];if(H<Y)return Number.POSITIVE_INFINITY;const le=H/Y;F*=le;let ve=0;for(let Te=0;Te<$;Te++){const Qe=y[Te],xt=E[Te]*le,It=Qe>xt?Qe-xt:xt-Qe;if(It>F)return Number.POSITIVE_INFINITY;ve+=It}return ve/H}}class ot extends Bt{static findStartPattern(y){const E=y.getSize(),F=y.getNextSet(0);let $=0,H=Int32Array.from([0,0,0,0,0,0]),Y=F,le=!1;const ve=6;for(let Te=F;Te<E;Te++)if(y.get(Te)!==le)H[$]++;else{if($===ve-1){let Qe=ot.MAX_AVG_VARIANCE,xt=-1;for(let It=ot.CODE_START_A;It<=ot.CODE_START_C;It++){const Qt=Bt.patternMatchVariance(H,ot.CODE_PATTERNS[It],ot.MAX_INDIVIDUAL_VARIANCE);Qt<Qe&&(Qe=Qt,xt=It)}if(xt>=0&&y.isRange(Math.max(0,Y-(Te-Y)/2),Y,!1))return Int32Array.from([Y,Te,xt]);Y+=H[0]+H[1],H=H.slice(2,H.length-1),H[$-1]=0,H[$]=0,$--}else $++;H[$]=1,le=!le}throw new Q}static decodeCode(y,E,F){Bt.recordPattern(y,F,E);let $=ot.MAX_AVG_VARIANCE,H=-1;for(let Y=0;Y<ot.CODE_PATTERNS.length;Y++){const le=ot.CODE_PATTERNS[Y],ve=this.patternMatchVariance(E,le,ot.MAX_INDIVIDUAL_VARIANCE);ve<$&&($=ve,H=Y)}if(H>=0)return H;throw new Q}decodeRow(y,E,F){const $=F&&F.get(U.ASSUME_GS1)===!0,H=ot.findStartPattern(E),Y=H[2];let le=0;const ve=new Uint8Array(20);ve[le++]=Y;let Te;switch(Y){case ot.CODE_START_A:Te=ot.CODE_CODE_A;break;case ot.CODE_START_B:Te=ot.CODE_CODE_B;break;case ot.CODE_START_C:Te=ot.CODE_CODE_C;break;default:throw new L}let Qe=!1,xt=!1,It="",Qt=H[0],St=H[1];const zt=Int32Array.from([0,0,0,0,0,0]);let Wt=0,jn=0,mr=Y,Sr=0,Ar=!0,Ss=!1,Zs=!1;for(;!Qe;){const Fi=xt;switch(xt=!1,Wt=jn,jn=ot.decodeCode(E,zt,St),ve[le++]=jn,jn!==ot.CODE_STOP&&(Ar=!0),jn!==ot.CODE_STOP&&(Sr++,mr+=Sr*jn),Qt=St,St+=zt.reduce((km,F1)=>km+F1,0),jn){case ot.CODE_START_A:case ot.CODE_START_B:case ot.CODE_START_C:throw new L}switch(Te){case ot.CODE_CODE_A:if(jn<64)Zs===Ss?It+=String.fromCharCode(32+jn):It+=String.fromCharCode(32+jn+128),Zs=!1;else if(jn<96)Zs===Ss?It+=String.fromCharCode(jn-64):It+=String.fromCharCode(jn+64),Zs=!1;else switch(jn!==ot.CODE_STOP&&(Ar=!1),jn){case ot.CODE_FNC_1:$&&(It.length===0?It+="]C1":It+="");break;case ot.CODE_FNC_2:case ot.CODE_FNC_3:break;case ot.CODE_FNC_4_A:!Ss&&Zs?(Ss=!0,Zs=!1):Ss&&Zs?(Ss=!1,Zs=!1):Zs=!0;break;case ot.CODE_SHIFT:xt=!0,Te=ot.CODE_CODE_B;break;case ot.CODE_CODE_B:Te=ot.CODE_CODE_B;break;case ot.CODE_CODE_C:Te=ot.CODE_CODE_C;break;case ot.CODE_STOP:Qe=!0;break}break;case ot.CODE_CODE_B:if(jn<96)Zs===Ss?It+=String.fromCharCode(32+jn):It+=String.fromCharCode(32+jn+128),Zs=!1;else switch(jn!==ot.CODE_STOP&&(Ar=!1),jn){case ot.CODE_FNC_1:$&&(It.length===0?It+="]C1":It+="");break;case ot.CODE_FNC_2:case ot.CODE_FNC_3:break;case ot.CODE_FNC_4_B:!Ss&&Zs?(Ss=!0,Zs=!1):Ss&&Zs?(Ss=!1,Zs=!1):Zs=!0;break;case ot.CODE_SHIFT:xt=!0,Te=ot.CODE_CODE_A;break;case ot.CODE_CODE_A:Te=ot.CODE_CODE_A;break;case ot.CODE_CODE_C:Te=ot.CODE_CODE_C;break;case ot.CODE_STOP:Qe=!0;break}break;case ot.CODE_CODE_C:if(jn<100)jn<10&&(It+="0"),It+=jn;else switch(jn!==ot.CODE_STOP&&(Ar=!1),jn){case ot.CODE_FNC_1:$&&(It.length===0?It+="]C1":It+="");break;case ot.CODE_CODE_A:Te=ot.CODE_CODE_A;break;case ot.CODE_CODE_B:Te=ot.CODE_CODE_B;break;case ot.CODE_STOP:Qe=!0;break}break}Fi&&(Te=Te===ot.CODE_CODE_A?ot.CODE_CODE_B:ot.CODE_CODE_A)}const fc=St-Qt;if(St=E.getNextUnset(St),!E.isRange(St,Math.min(E.getSize(),St+(St-Qt)/2),!1))throw new Q;if(mr-=Sr*Wt,mr%103!==Wt)throw new g;const Ja=It.length;if(Ja===0)throw new Q;Ja>0&&Ar&&(Te===ot.CODE_CODE_C?It=It.substring(0,Ja-2):It=It.substring(0,Ja-1));const eo=(H[1]+H[0])/2,fa=Qt+fc/2,ka=ve.length,Go=new Uint8Array(ka);for(let Fi=0;Fi<ka;Fi++)Go[Fi]=ve[Fi];const Cd=[new wt(eo,y),new wt(fa,y)];return new me(It,Go,0,Cd,xe.CODE_128,new Date().getTime())}}ot.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])],ot.MAX_AVG_VARIANCE=.25,ot.MAX_INDIVIDUAL_VARIANCE=.7,ot.CODE_SHIFT=98,ot.CODE_CODE_C=99,ot.CODE_CODE_B=100,ot.CODE_CODE_A=101,ot.CODE_FNC_1=102,ot.CODE_FNC_2=97,ot.CODE_FNC_3=96,ot.CODE_FNC_4_A=101,ot.CODE_FNC_4_B=100,ot.CODE_START_A=103,ot.CODE_START_B=104,ot.CODE_START_C=105,ot.CODE_STOP=106;class De extends Bt{constructor(y=!1,E=!1){super(),this.usingCheckDigit=y,this.extendedMode=E,this.decodeRowResult="",this.counters=new Int32Array(9)}decodeRow(y,E,F){let $=this.counters;$.fill(0),this.decodeRowResult="";let H=De.findAsteriskPattern(E,$),Y=E.getNextSet(H[1]),le=E.getSize(),ve,Te;do{De.recordPattern(E,Y,$);let zt=De.toNarrowWidePattern($);if(zt<0)throw new Q;ve=De.patternToChar(zt),this.decodeRowResult+=ve,Te=Y;for(let Wt of $)Y+=Wt;Y=E.getNextSet(Y)}while(ve!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);let Qe=0;for(let zt of $)Qe+=zt;let xt=Y-Te-Qe;if(Y!==le&&xt*2<Qe)throw new Q;if(this.usingCheckDigit){let zt=this.decodeRowResult.length-1,Wt=0;for(let jn=0;jn<zt;jn++)Wt+=De.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(jn));if(this.decodeRowResult.charAt(zt)!==De.ALPHABET_STRING.charAt(Wt%43))throw new g;this.decodeRowResult=this.decodeRowResult.substring(0,zt)}if(this.decodeRowResult.length===0)throw new Q;let It;this.extendedMode?It=De.decodeExtended(this.decodeRowResult):It=this.decodeRowResult;let Qt=(H[1]+H[0])/2,St=Te+Qe/2;return new me(It,null,0,[new wt(Qt,y),new wt(St,y)],xe.CODE_39,new Date().getTime())}static findAsteriskPattern(y,E){let F=y.getSize(),$=y.getNextSet(0),H=0,Y=$,le=!1,ve=E.length;for(let Te=$;Te<F;Te++)if(y.get(Te)!==le)E[H]++;else{if(H===ve-1){if(this.toNarrowWidePattern(E)===De.ASTERISK_ENCODING&&y.isRange(Math.max(0,Y-Math.floor((Te-Y)/2)),Y,!1))return[Y,Te];Y+=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 Q}static toNarrowWidePattern(y){let E=y.length,F=0,$;do{let H=2147483647;for(let ve of y)ve<H&&ve>F&&(H=ve);F=H,$=0;let Y=0,le=0;for(let ve=0;ve<E;ve++){let Te=y[ve];Te>F&&(le|=1<<E-1-ve,$++,Y+=Te)}if($===3){for(let ve=0;ve<E&&$>0;ve++){let Te=y[ve];if(Te>F&&($--,Te*2>=Y))return-1}return le}}while($>3);return-1}static patternToChar(y){for(let E=0;E<De.CHARACTER_ENCODINGS.length;E++)if(De.CHARACTER_ENCODINGS[E]===y)return De.ALPHABET_STRING.charAt(E);if(y===De.ASTERISK_ENCODING)return"*";throw new Q}static decodeExtended(y){let E=y.length,F="";for(let $=0;$<E;$++){let H=y.charAt($);if(H==="+"||H==="$"||H==="%"||H==="/"){let Y=y.charAt($+1),le="\0";switch(H){case"+":if(Y>="A"&&Y<="Z")le=String.fromCharCode(Y.charCodeAt(0)+32);else throw new L;break;case"$":if(Y>="A"&&Y<="Z")le=String.fromCharCode(Y.charCodeAt(0)-64);else throw new L;break;case"%":if(Y>="A"&&Y<="E")le=String.fromCharCode(Y.charCodeAt(0)-38);else if(Y>="F"&&Y<="J")le=String.fromCharCode(Y.charCodeAt(0)-11);else if(Y>="K"&&Y<="O")le=String.fromCharCode(Y.charCodeAt(0)+16);else if(Y>="P"&&Y<="T")le=String.fromCharCode(Y.charCodeAt(0)+43);else if(Y==="U")le="\0";else if(Y==="V")le="@";else if(Y==="W")le="`";else if(Y==="X"||Y==="Y"||Y==="Z")le="";else throw new L;break;case"/":if(Y>="A"&&Y<="O")le=String.fromCharCode(Y.charCodeAt(0)-32);else if(Y==="Z")le=":";else throw new L;break}F+=le,$++}else F+=H}return F}}De.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",De.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],De.ASTERISK_ENCODING=148;class _t extends Bt{constructor(){super(...arguments),this.narrowLineWidth=-1}decodeRow(y,E,F){let $=this.decodeStart(E),H=this.decodeEnd(E),Y=new re;_t.decodeMiddle(E,$[1],H[0],Y);let le=Y.toString(),ve=null;F!=null&&(ve=F.get(U.ALLOWED_LENGTHS)),ve==null&&(ve=_t.DEFAULT_ALLOWED_LENGTHS);let Te=le.length,Qe=!1,xt=0;for(let St of ve){if(Te===St){Qe=!0;break}St>xt&&(xt=St)}if(!Qe&&Te>xt&&(Qe=!0),!Qe)throw new L;const It=[new wt($[1],y),new wt(H[0],y)];return new me(le,null,0,It,xe.ITF,new Date().getTime())}static decodeMiddle(y,E,F,$){let H=new Int32Array(10),Y=new Int32Array(5),le=new Int32Array(5);for(H.fill(0),Y.fill(0),le.fill(0);E<F;){Bt.recordPattern(y,E,H);for(let Te=0;Te<5;Te++){let Qe=2*Te;Y[Te]=H[Qe],le[Te]=H[Qe+1]}let ve=_t.decodeDigit(Y);$.append(ve.toString()),ve=this.decodeDigit(le),$.append(ve.toString()),H.forEach(function(Te){E+=Te})}}decodeStart(y){let E=_t.skipWhiteSpace(y),F=_t.findGuardPattern(y,E,_t.START_PATTERN);return this.narrowLineWidth=(F[1]-F[0])/4,this.validateQuietZone(y,F[0]),F}validateQuietZone(y,E){let F=this.narrowLineWidth*10;F=F<E?F:E;for(let $=E-1;F>0&&$>=0&&!y.get($);$--)F--;if(F!==0)throw new Q}static skipWhiteSpace(y){const E=y.getSize(),F=y.getNextSet(0);if(F===E)throw new Q;return F}decodeEnd(y){y.reverse();try{let E=_t.skipWhiteSpace(y),F;try{F=_t.findGuardPattern(y,E,_t.END_PATTERN_REVERSED[0])}catch(H){H instanceof Q&&(F=_t.findGuardPattern(y,E,_t.END_PATTERN_REVERSED[1]))}this.validateQuietZone(y,F[0]);let $=F[0];return F[0]=y.getSize()-F[1],F[1]=y.getSize()-$,F}finally{y.reverse()}}static findGuardPattern(y,E,F){let $=F.length,H=new Int32Array($),Y=y.getSize(),le=!1,ve=0,Te=E;H.fill(0);for(let Qe=E;Qe<Y;Qe++)if(y.get(Qe)!==le)H[ve]++;else{if(ve===$-1){if(Bt.patternMatchVariance(H,F,_t.MAX_INDIVIDUAL_VARIANCE)<_t.MAX_AVG_VARIANCE)return[Te,Qe];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 Q}static decodeDigit(y){let E=_t.MAX_AVG_VARIANCE,F=-1,$=_t.PATTERNS.length;for(let H=0;H<$;H++){let Y=_t.PATTERNS[H],le=Bt.patternMatchVariance(y,Y,_t.MAX_INDIVIDUAL_VARIANCE);le<E?(E=le,F=H):le===E&&(F=-1)}if(F>=0)return F%10;throw new Q}}_t.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])],_t.MAX_AVG_VARIANCE=.38,_t.MAX_INDIVIDUAL_VARIANCE=.5,_t.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],_t.START_PATTERN=Int32Array.from([1,1,1,1]),_t.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])];class ze extends Bt{constructor(){super(...arguments),this.decodeRowStringBuffer=""}static findStartGuardPattern(y){let E=!1,F,$=0,H=Int32Array.from([0,0,0]);for(;!E;){H=Int32Array.from([0,0,0]),F=ze.findGuardPattern(y,$,!1,this.START_END_PATTERN,H);let Y=F[0];$=F[1];let le=Y-($-Y);le>=0&&(E=y.isRange(le,Y,!1))}return F}static checkChecksum(y){return ze.checkStandardUPCEANChecksum(y)}static checkStandardUPCEANChecksum(y){let E=y.length;if(E===0)return!1;let F=parseInt(y.charAt(E-1),10);return ze.getStandardUPCEANChecksum(y.substring(0,E-1))===F}static getStandardUPCEANChecksum(y){let E=y.length,F=0;for(let $=E-1;$>=0;$-=2){let H=y.charAt($).charCodeAt(0)-48;if(H<0||H>9)throw new L;F+=H}F*=3;for(let $=E-2;$>=0;$-=2){let H=y.charAt($).charCodeAt(0)-48;if(H<0||H>9)throw new L;F+=H}return(1e3-F)%10}static decodeEnd(y,E){return ze.findGuardPattern(y,E,!1,ze.START_END_PATTERN,new Int32Array(ze.START_END_PATTERN.length).fill(0))}static findGuardPatternWithoutCounters(y,E,F,$){return this.findGuardPattern(y,E,F,$,new Int32Array($.length))}static findGuardPattern(y,E,F,$,H){let Y=y.getSize();E=F?y.getNextUnset(E):y.getNextSet(E);let le=0,ve=E,Te=$.length,Qe=F;for(let xt=E;xt<Y;xt++)if(y.get(xt)!==Qe)H[le]++;else{if(le===Te-1){if(Bt.patternMatchVariance(H,$,ze.MAX_INDIVIDUAL_VARIANCE)<ze.MAX_AVG_VARIANCE)return Int32Array.from([ve,xt]);ve+=H[0]+H[1];let It=H.slice(2,H.length-1);for(let Qt=0;Qt<le-1;Qt++)H[Qt]=It[Qt];H[le-1]=0,H[le]=0,le--}else le++;H[le]=1,Qe=!Qe}throw new Q}static decodeDigit(y,E,F,$){this.recordPattern(y,F,E);let H=this.MAX_AVG_VARIANCE,Y=-1,le=$.length;for(let ve=0;ve<le;ve++){let Te=$[ve],Qe=Bt.patternMatchVariance(E,Te,ze.MAX_INDIVIDUAL_VARIANCE);Qe<H&&(H=Qe,Y=ve)}if(Y>=0)return Y;throw new Q}}ze.MAX_AVG_VARIANCE=.48,ze.MAX_INDIVIDUAL_VARIANCE=.7,ze.START_END_PATTERN=Int32Array.from([1,1,1]),ze.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),ze.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),ze.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 nt{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,F){let $=this.decodeRowStringBuffer,H=this.decodeMiddle(E,F,$),Y=$.toString(),le=nt.parseExtensionString(Y),ve=[new wt((F[0]+F[1])/2,y),new wt(H,y)],Te=new me(Y,null,0,ve,xe.UPC_EAN_EXTENSION,new Date().getTime());return le!=null&&Te.putAllMetadata(le),Te}decodeMiddle(y,E,F){let $=this.decodeMiddleCounters;$[0]=0,$[1]=0,$[2]=0,$[3]=0;let H=y.getSize(),Y=E[1],le=0;for(let Te=0;Te<5&&Y<H;Te++){let Qe=ze.decodeDigit(y,$,Y,ze.L_AND_G_PATTERNS);F+=String.fromCharCode(48+Qe%10);for(let xt of $)Y+=xt;Qe>=10&&(le|=1<<4-Te),Te!==4&&(Y=y.getNextSet(Y),Y=y.getNextUnset(Y))}if(F.length!==5)throw new Q;let ve=this.determineCheckDigit(le);if(nt.extensionChecksum(F.toString())!==ve)throw new Q;return Y}static extensionChecksum(y){let E=y.length,F=0;for(let $=E-2;$>=0;$-=2)F+=y.charAt($).charCodeAt(0)-48;F*=3;for(let $=E-1;$>=0;$-=2)F+=y.charAt($).charCodeAt(0)-48;return F*=3,F%10}determineCheckDigit(y){for(let E=0;E<10;E++)if(y===this.CHECK_DIGIT_ENCODINGS[E])return E;throw new Q}static parseExtensionString(y){if(y.length!==5)return null;let E=nt.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 F=parseInt(y.substring(1)),$=(F/100).toString(),H=F%100,Y=H<10?"0"+H:H.toString();return E+$+"."+Y}}class mt{constructor(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}decodeRow(y,E,F){let $=this.decodeRowStringBuffer,H=this.decodeMiddle(E,F,$),Y=$.toString(),le=mt.parseExtensionString(Y),ve=[new wt((F[0]+F[1])/2,y),new wt(H,y)],Te=new me(Y,null,0,ve,xe.UPC_EAN_EXTENSION,new Date().getTime());return le!=null&&Te.putAllMetadata(le),Te}decodeMiddle(y,E,F){let $=this.decodeMiddleCounters;$[0]=0,$[1]=0,$[2]=0,$[3]=0;let H=y.getSize(),Y=E[1],le=0;for(let ve=0;ve<2&&Y<H;ve++){let Te=ze.decodeDigit(y,$,Y,ze.L_AND_G_PATTERNS);F+=String.fromCharCode(48+Te%10);for(let Qe of $)Y+=Qe;Te>=10&&(le|=1<<1-ve),ve!==1&&(Y=y.getNextSet(Y),Y=y.getNextUnset(Y))}if(F.length!==2)throw new Q;if(parseInt(F.toString())%4!==le)throw new Q;return Y}static parseExtensionString(y){return y.length!==2?null:new Map([[je.ISSUE_NUMBER,parseInt(y)]])}}class $t{static decodeRow(y,E,F){let $=ze.findGuardPattern(E,F,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return new nt().decodeRow(y,E,$)}catch{return new mt().decodeRow(y,E,$)}}}$t.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]);class Pt extends ze{constructor(){super(),this.decodeRowStringBuffer="",Pt.L_AND_G_PATTERNS=Pt.L_PATTERNS.map(y=>Int32Array.from(y));for(let y=10;y<20;y++){let E=Pt.L_PATTERNS[y-10],F=new Int32Array(E.length);for(let $=0;$<E.length;$++)F[$]=E[E.length-$-1];Pt.L_AND_G_PATTERNS[y]=F}}decodeRow(y,E,F){let $=Pt.findStartGuardPattern(E),H=F==null?null:F.get(U.NEED_RESULT_POINT_CALLBACK);if(H!=null){const Ar=new wt(($[0]+$[1])/2,y);H.foundPossibleResultPoint(Ar)}let Y=this.decodeMiddle(E,$,this.decodeRowStringBuffer),le=Y.rowOffset,ve=Y.resultString;if(H!=null){const Ar=new wt(le,y);H.foundPossibleResultPoint(Ar)}let Te=this.decodeEnd(E,le);if(H!=null){const Ar=new wt((Te[0]+Te[1])/2,y);H.foundPossibleResultPoint(Ar)}let Qe=Te[1],xt=Qe+(Qe-Te[0]);if(xt>=E.getSize()||!E.isRange(Qe,xt,!1))throw new Q;let It=ve.toString();if(It.length<8)throw new L;if(!Pt.checkChecksum(It))throw new g;let Qt=($[1]+$[0])/2,St=(Te[1]+Te[0])/2,zt=this.getBarcodeFormat(),Wt=[new wt(Qt,y),new wt(St,y)],jn=new me(It,null,0,Wt,zt,new Date().getTime()),mr=0;try{let Ar=$t.decodeRow(y,E,Te[1]);jn.putMetadata(je.UPC_EAN_EXTENSION,Ar.getText()),jn.putAllMetadata(Ar.getResultMetadata()),jn.addResultPoints(Ar.getResultPoints()),mr=Ar.getText().length}catch{}let Sr=F==null?null:F.get(U.ALLOWED_EAN_EXTENSIONS);if(Sr!=null){let Ar=!1;for(let Ss in Sr)if(mr.toString()===Ss){Ar=!0;break}if(!Ar)throw new Q}return jn}decodeEnd(y,E){return Pt.findGuardPattern(y,E,!1,Pt.START_END_PATTERN,new Int32Array(Pt.START_END_PATTERN.length).fill(0))}static checkChecksum(y){return Pt.checkStandardUPCEANChecksum(y)}static checkStandardUPCEANChecksum(y){let E=y.length;if(E===0)return!1;let F=parseInt(y.charAt(E-1),10);return Pt.getStandardUPCEANChecksum(y.substring(0,E-1))===F}static getStandardUPCEANChecksum(y){let E=y.length,F=0;for(let $=E-1;$>=0;$-=2){let H=y.charAt($).charCodeAt(0)-48;if(H<0||H>9)throw new L;F+=H}F*=3;for(let $=E-2;$>=0;$-=2){let H=y.charAt($).charCodeAt(0)-48;if(H<0||H>9)throw new L;F+=H}return(1e3-F)%10}}class un extends Pt{constructor(){super(),this.decodeMiddleCounters=Int32Array.from([0,0,0,0])}decodeMiddle(y,E,F){let $=this.decodeMiddleCounters;$[0]=0,$[1]=0,$[2]=0,$[3]=0;let H=y.getSize(),Y=E[1],le=0;for(let Te=0;Te<6&&Y<H;Te++){let Qe=Pt.decodeDigit(y,$,Y,Pt.L_AND_G_PATTERNS);F+=String.fromCharCode(48+Qe%10);for(let xt of $)Y+=xt;Qe>=10&&(le|=1<<5-Te)}F=un.determineFirstDigit(F,le),Y=Pt.findGuardPattern(y,Y,!0,Pt.MIDDLE_PATTERN,new Int32Array(Pt.MIDDLE_PATTERN.length).fill(0))[1];for(let Te=0;Te<6&&Y<H;Te++){let Qe=Pt.decodeDigit(y,$,Y,Pt.L_PATTERNS);F+=String.fromCharCode(48+Qe);for(let xt of $)Y+=xt}return{rowOffset:Y,resultString:F}}getBarcodeFormat(){return xe.EAN_13}static determineFirstDigit(y,E){for(let F=0;F<10;F++)if(E===this.FIRST_DIGIT_ENCODINGS[F])return y=String.fromCharCode(48+F)+y,y;throw new Q}}un.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26];class an extends Pt{constructor(){super(),this.decodeMiddleCounters=Int32Array.from([0,0,0,0])}decodeMiddle(y,E,F){const $=this.decodeMiddleCounters;$[0]=0,$[1]=0,$[2]=0,$[3]=0;let H=y.getSize(),Y=E[1];for(let ve=0;ve<4&&Y<H;ve++){let Te=Pt.decodeDigit(y,$,Y,Pt.L_PATTERNS);F+=String.fromCharCode(48+Te);for(let Qe of $)Y+=Qe}Y=Pt.findGuardPattern(y,Y,!0,Pt.MIDDLE_PATTERN,new Int32Array(Pt.MIDDLE_PATTERN.length).fill(0))[1];for(let ve=0;ve<4&&Y<H;ve++){let Te=Pt.decodeDigit(y,$,Y,Pt.L_PATTERNS);F+=String.fromCharCode(48+Te);for(let Qe of $)Y+=Qe}return{rowOffset:Y,resultString:F}}getBarcodeFormat(){return xe.EAN_8}}class xn extends Pt{constructor(){super(...arguments),this.ean13Reader=new un}getBarcodeFormat(){return xe.UPC_A}decode(y,E){return this.maybeReturnResult(this.ean13Reader.decode(y))}decodeRow(y,E,F){return this.maybeReturnResult(this.ean13Reader.decodeRow(y,E,F))}decodeMiddle(y,E,F){return this.ean13Reader.decodeMiddle(y,E,F)}maybeReturnResult(y){let E=y.getText();if(E.charAt(0)==="0"){let F=new me(E.substring(1),null,null,y.getResultPoints(),xe.UPC_A);return y.getResultMetadata()!=null&&F.putAllMetadata(y.getResultMetadata()),F}else throw new Q}reset(){this.ean13Reader.reset()}}class An extends Pt{constructor(){super(),this.decodeMiddleCounters=new Int32Array(4)}decodeMiddle(y,E,F){const $=this.decodeMiddleCounters.map(Te=>Te);$[0]=0,$[1]=0,$[2]=0,$[3]=0;const H=y.getSize();let Y=E[1],le=0;for(let Te=0;Te<6&&Y<H;Te++){const Qe=An.decodeDigit(y,$,Y,An.L_AND_G_PATTERNS);F+=String.fromCharCode(48+Qe%10);for(let xt of $)Y+=xt;Qe>=10&&(le|=1<<5-Te)}let ve=An.determineNumSysAndCheckDigit(F,le);return{rowOffset:Y,resultString:ve}}decodeEnd(y,E){return An.findGuardPatternWithoutCounters(y,E,!0,An.MIDDLE_END_PATTERN)}checkChecksum(y){return Pt.checkChecksum(An.convertUPCEtoUPCA(y))}static determineNumSysAndCheckDigit(y,E){for(let F=0;F<=1;F++)for(let $=0;$<10;$++)if(E===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[F][$]){let H=String.fromCharCode(48+F),Y=String.fromCharCode(48+$);return H+y+Y}throw Q.getNotFoundInstance()}getBarcodeFormat(){return xe.UPC_E}static convertUPCEtoUPCA(y){const E=y.slice(1,7).split("").map(H=>H.charCodeAt(0)),F=new re;F.append(y.charAt(0));let $=E[5];switch($){case 0:case 1:case 2:F.appendChars(E,0,2),F.append($),F.append("0000"),F.appendChars(E,2,3);break;case 3:F.appendChars(E,0,3),F.append("00000"),F.appendChars(E,3,2);break;case 4:F.appendChars(E,0,4),F.append("00000"),F.append(E[4]);break;default:F.appendChars(E,0,5),F.append("0000"),F.append($);break}return y.length>=8&&F.append(y.charAt(7)),F.toString()}}An.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),An.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 Bt{constructor(y){super();let E=y==null?null:y.get(U.POSSIBLE_FORMATS),F=[];r(E)?(F.push(new un),F.push(new xn),F.push(new an),F.push(new An)):(E.indexOf(xe.EAN_13)>-1&&F.push(new un),E.indexOf(xe.UPC_A)>-1&&F.push(new xn),E.indexOf(xe.EAN_8)>-1&&F.push(new an),E.indexOf(xe.UPC_E)>-1&&F.push(new An)),this.readers=F}decodeRow(y,E,F){for(let $ of this.readers)try{const H=$.decodeRow(y,E,F),Y=H.getBarcodeFormat()===xe.EAN_13&&H.getText().charAt(0)==="0",le=F==null?null:F.get(U.POSSIBLE_FORMATS),ve=le==null||le.includes(xe.UPC_A);if(Y&&ve){const Te=H.getRawBytes(),Qe=new me(H.getText().substring(1),Te,Te?Te.length:null,H.getResultPoints(),xe.UPC_A);return Qe.putAllMetadata(H.getResultMetadata()),Qe}return H}catch{}throw new Q}reset(){for(let y of this.readers)y.reset()}}class yn extends Bt{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 F=0;F<E.length;F++)if(Bt.patternMatchVariance(y,E[F],yn.MAX_INDIVIDUAL_VARIANCE)<yn.MAX_AVG_VARIANCE)return F;throw new Q}static count(y){return pt.sum(new Int32Array(y))}static increment(y,E){let F=0,$=E[0];for(let H=1;H<y.length;H++)E[H]>$&&($=E[H],F=H);y[F]++}static decrement(y,E){let F=0,$=E[0];for(let H=1;H<y.length;H++)E[H]<$&&($=E[H],F=H);y[F]--}static isFinderPattern(y){let E=y[0]+y[1],F=E+y[2]+y[3],$=E/F;if($>=yn.MIN_FINDER_PATTERN_RATIO&&$<=yn.MAX_FINDER_PATTERN_RATIO){let H=Number.MAX_SAFE_INTEGER,Y=Number.MIN_SAFE_INTEGER;for(let le of y)le>Y&&(Y=le),le<H&&(H=le);return Y<10*H}return!1}}yn.MAX_AVG_VARIANCE=.2,yn.MAX_INDIVIDUAL_VARIANCE=.45,yn.MIN_FINDER_PATTERN_RATIO=9.5/12,yn.MAX_FINDER_PATTERN_RATIO=12.5/14;class Vn{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 Vn))return!1;const E=y;return this.value===E.value&&this.checksumPortion===E.checksumPortion}hashCode(){return this.value^this.checksumPortion}}class Gn{constructor(y,E,F,$,H){this.value=y,this.startEnd=E,this.value=y,this.startEnd=E,this.resultPoints=new Array,this.resultPoints.push(new wt(F,H)),this.resultPoints.push(new wt($,H))}getValue(){return this.value}getStartEnd(){return this.startEnd}getResultPoints(){return this.resultPoints}equals(y){if(!(y instanceof Gn))return!1;const E=y;return this.value===E.value}hashCode(){return this.value}}class Rn{constructor(){}static getRSSvalue(y,E,F){let $=0;for(let ve of y)$+=ve;let H=0,Y=0,le=y.length;for(let ve=0;ve<le-1;ve++){let Te;for(Te=1,Y|=1<<ve;Te<y[ve];Te++,Y&=~(1<<ve)){let Qe=Rn.combins($-Te-1,le-ve-2);if(F&&Y===0&&$-Te-(le-ve-1)>=le-ve-1&&(Qe-=Rn.combins($-Te-(le-ve),le-ve-2)),le-ve-1>1){let xt=0;for(let It=$-Te-(le-ve-2);It>E;It--)xt+=Rn.combins($-Te-It-1,le-ve-3);Qe-=xt*(le-1-ve)}else $-Te>E&&Qe--;H+=Qe}$-=Te}return H}static combins(y,E){let F,$;y-E>E?($=E,F=y-E):($=y-E,F=E);let H=1,Y=1;for(let le=y;le>F;le--)H*=le,Y<=$&&(H/=Y,Y++);for(;Y<=$;)H/=Y,Y++;return H}}class Yn{static buildBitArray(y){let E=y.length*2-1;y[y.length-1].getRightChar()==null&&(E-=1);let F=12*E,$=new R(F),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],Qe=Te.getLeftChar().getValue();for(let xt=11;xt>=0;--xt)Qe&1<<xt&&$.set(H),H++;if(Te.getRightChar()!=null){let xt=Te.getRightChar().getValue();for(let It=11;It>=0;--It)xt&1<<It&&$.set(H),H++}}return $}}class Cn{constructor(y,E){E?this.decodedInformation=null:(this.finished=y,this.decodedInformation=E)}getDecodedInformation(){return this.decodedInformation}isFinished(){return this.finished}}class rn{constructor(y){this.newPosition=y}getNewPosition(){return this.newPosition}}class Oe extends rn{constructor(y,E){super(y),this.value=E}getValue(){return this.value}isFNC1(){return this.value===Oe.FNC1}}Oe.FNC1="$";class Jt extends rn{constructor(y,E,F){super(y),F?(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 sn extends rn{constructor(y,E,F){if(super(y),E<0||E>10||F<0||F>10)throw new L;this.firstDigit=E,this.secondDigit=F}getFirstDigit(){return this.firstDigit}getSecondDigit(){return this.secondDigit}getValue(){return this.firstDigit*10+this.secondDigit}isFirstDigitFNC1(){return this.firstDigit===sn.FNC1}isSecondDigitFNC1(){return this.secondDigit===sn.FNC1}isAnyFNC1(){return this.firstDigit===sn.FNC1||this.secondDigit===sn.FNC1}}sn.FNC1=10;class Et{constructor(){}static parseFieldsInGeneralPurpose(y){if(!y)return null;if(y.length<2)throw new Q;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 Q;let F=y.substring(0,3);for(let H of Et.THREE_DIGIT_DATA_LENGTH)if(H[0]===F)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]===F)return H[1]===Et.VARIABLE_LENGTH?Et.processVariableAI(4,H[2],y):Et.processFixedAI(4,H[1],y);if(y.length<4)throw new Q;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 Q}static processFixedAI(y,E,F){if(F.length<y)throw new Q;let $=F.substring(0,y);if(F.length<y+E)throw new Q;let H=F.substring(y,y+E),Y=F.substring(y+E),le="("+$+")"+H,ve=Et.parseFieldsInGeneralPurpose(Y);return ve==null?le:le+ve}static processVariableAI(y,E,F){let $=F.substring(0,y),H;F.length<y+E?H=F.length:H=y+E;let Y=F.substring(y,H),le=F.substring(H),ve="("+$+")"+Y,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 Xn{constructor(y){this.buffer=new re,this.information=y}decodeAllCodes(y,E){let F=E,$=null;do{let H=this.decodeGeneralPurposeField(F,$),Y=Et.parseFieldsInGeneralPurpose(H.getNewString());if(Y!=null&&y.append(Y),H.isRemaining()?$=""+H.getRemainingValue():$=null,F===H.getNewPosition())break;F=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 sn(this.information.getSize(),sn.FNC1,sn.FNC1):new sn(this.information.getSize(),H-1,sn.FNC1)}let E=this.extractNumericValueFromBitArray(y,7),F=(E-8)/11,$=(E-8)%11;return new sn(y+7,F,$)}extractNumericValueFromBitArray(y,E){return Xn.extractNumericValueFromBitArray(this.information,y,E)}static extractNumericValueFromBitArray(y,E,F){let $=0;for(let H=0;H<F;++H)y.get(E+H)&&($|=1<<F-H-1);return $}decodeGeneralPurposeField(y,E){this.buffer.setLengthToZero(),E!=null&&this.buffer.append(E),this.current.setPosition(y);let F=this.parseBlocks();return F!=null&&F.isRemaining()?new Jt(this.current.getPosition(),this.buffer.toString(),F.getRemainingValue()):new Jt(this.current.getPosition(),this.buffer.toString())}parseBlocks(){let y,E;do{let F=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()),!(F!==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 Jt(this.current.getPosition(),this.buffer.toString()):E=new Jt(this.current.getPosition(),this.buffer.toString(),y.getSecondDigit()),new Cn(!0,E)}if(this.buffer.append(y.getFirstDigit()),y.isSecondDigitFNC1()){let E=new Jt(this.current.getPosition(),this.buffer.toString());return new Cn(!0,E)}this.buffer.append(y.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new Cn(!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 Jt(this.current.getPosition(),this.buffer.toString());return new Cn(!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 Cn(!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 Jt(this.current.getPosition(),this.buffer.toString());return new Cn(!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 Cn(!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 F=this.extractNumericValueFromBitArray(y,7);if(F>=64&&F<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 F=this.extractNumericValueFromBitArray(y,7);if(F>=64&&F<90)return new Oe(y+7,""+(F+1));if(F>=90&&F<116)return new Oe(y+7,""+(F+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 F=this.extractNumericValueFromBitArray(y,6);return F>=16&&F<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 F=this.extractNumericValueFromBitArray(y,6);if(F>=32&&F<58)return new Oe(y+6,""+(F+33));let $;switch(F){case 58:$="*";break;case 59:$=",";break;case 60:$="-";break;case 61:$=".";break;case 62:$="/";break;default:throw new tt("Decoding invalid alphanumeric value: "+F)}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 gn{constructor(y){this.information=y,this.generalDecoder=new Xn(y)}getInformation(){return this.information}getGeneralDecoder(){return this.generalDecoder}}class Dt extends gn{constructor(y){super(y)}encodeCompressedGtin(y,E){y.append("(01)");let F=y.length();y.append("9"),this.encodeCompressedGtinWithoutAI(y,E,F)}encodeCompressedGtinWithoutAI(y,E,F){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)}Dt.appendCheckDigit(y,F)}static appendCheckDigit(y,E){let F=0;for(let $=0;$<13;$++){let H=y.charAt($+E).charCodeAt(0)-48;F+=$&1?H:3*H}F=10-F%10,F===10&&(F=0),y.append(F)}}Dt.GTIN_SIZE=40;class en extends Dt{constructor(y){super(y)}parseInformation(){let y=new re;y.append("(01)");let E=y.length(),F=this.getGeneralDecoder().extractNumericValueFromBitArray(en.HEADER_SIZE,4);return y.append(F),this.encodeCompressedGtinWithoutAI(y,en.HEADER_SIZE+4,E),this.getGeneralDecoder().decodeAllCodes(y,en.HEADER_SIZE+44)}}en.HEADER_SIZE=4;class In extends gn{constructor(y){super(y)}parseInformation(){let y=new re;return this.getGeneralDecoder().decodeAllCodes(y,In.HEADER_SIZE)}}In.HEADER_SIZE=5;class Qn extends Dt{constructor(y){super(y)}encodeCompressedWeight(y,E,F){let $=this.getGeneralDecoder().extractNumericValueFromBitArray(E,F);this.addWeightCode(y,$);let H=this.checkWeight($),Y=1e5;for(let le=0;le<5;++le)H/Y===0&&y.append("0"),Y/=10;y.append(H)}}class ar extends Qn{constructor(y){super(y)}parseInformation(){if(this.getInformation().getSize()!=ar.HEADER_SIZE+Qn.GTIN_SIZE+ar.WEIGHT_SIZE)throw new Q;let y=new re;return this.encodeCompressedGtin(y,ar.HEADER_SIZE),this.encodeCompressedWeight(y,ar.HEADER_SIZE+Qn.GTIN_SIZE,ar.WEIGHT_SIZE),y.toString()}}ar.HEADER_SIZE=5,ar.WEIGHT_SIZE=15;class hr extends ar{constructor(y){super(y)}addWeightCode(y,E){y.append("(3103)")}checkWeight(y){return y}}class Gt extends ar{constructor(y){super(y)}addWeightCode(y,E){E<1e4?y.append("(3202)"):y.append("(3203)")}checkWeight(y){return y<1e4?y:y-1e4}}class $n extends Dt{constructor(y){super(y)}parseInformation(){if(this.getInformation().getSize()<$n.HEADER_SIZE+Dt.GTIN_SIZE)throw new Q;let y=new re;this.encodeCompressedGtin(y,$n.HEADER_SIZE);let E=this.getGeneralDecoder().extractNumericValueFromBitArray($n.HEADER_SIZE+Dt.GTIN_SIZE,$n.LAST_DIGIT_SIZE);y.append("(392"),y.append(E),y.append(")");let F=this.getGeneralDecoder().decodeGeneralPurposeField($n.HEADER_SIZE+Dt.GTIN_SIZE+$n.LAST_DIGIT_SIZE,null);return y.append(F.getNewString()),y.toString()}}$n.HEADER_SIZE=8,$n.LAST_DIGIT_SIZE=2;class nr extends Dt{constructor(y){super(y)}parseInformation(){if(this.getInformation().getSize()<nr.HEADER_SIZE+Dt.GTIN_SIZE)throw new Q;let y=new re;this.encodeCompressedGtin(y,nr.HEADER_SIZE);let E=this.getGeneralDecoder().extractNumericValueFromBitArray(nr.HEADER_SIZE+Dt.GTIN_SIZE,nr.LAST_DIGIT_SIZE);y.append("(393"),y.append(E),y.append(")");let F=this.getGeneralDecoder().extractNumericValueFromBitArray(nr.HEADER_SIZE+Dt.GTIN_SIZE+nr.LAST_DIGIT_SIZE,nr.FIRST_THREE_DIGITS_SIZE);F/100==0&&y.append("0"),F/10==0&&y.append("0"),y.append(F);let $=this.getGeneralDecoder().decodeGeneralPurposeField(nr.HEADER_SIZE+Dt.GTIN_SIZE+nr.LAST_DIGIT_SIZE+nr.FIRST_THREE_DIGITS_SIZE,null);return y.append($.getNewString()),y.toString()}}nr.HEADER_SIZE=8,nr.LAST_DIGIT_SIZE=2,nr.FIRST_THREE_DIGITS_SIZE=10;class Rt extends Qn{constructor(y,E,F){super(y),this.dateCode=F,this.firstAIdigits=E}parseInformation(){if(this.getInformation().getSize()!=Rt.HEADER_SIZE+Rt.GTIN_SIZE+Rt.WEIGHT_SIZE+Rt.DATE_SIZE)throw new Q;let y=new re;return this.encodeCompressedGtin(y,Rt.HEADER_SIZE),this.encodeCompressedWeight(y,Rt.HEADER_SIZE+Rt.GTIN_SIZE,Rt.WEIGHT_SIZE),this.encodeCompressedDate(y,Rt.HEADER_SIZE+Rt.GTIN_SIZE+Rt.WEIGHT_SIZE),y.toString()}encodeCompressedDate(y,E){let F=this.getGeneralDecoder().extractNumericValueFromBitArray(E,Rt.DATE_SIZE);if(F==38400)return;y.append("("),y.append(this.dateCode),y.append(")");let $=F%32;F/=32;let H=F%12+1;F/=12;let Y=F;Y/10==0&&y.append("0"),y.append(Y),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}}Rt.HEADER_SIZE=8,Rt.WEIGHT_SIZE=20,Rt.DATE_SIZE=16;function En(dt){try{if(dt.get(1))return new en(dt);if(!dt.get(2))return new In(dt);switch(Xn.extractNumericValueFromBitArray(dt,1,4)){case 4:return new hr(dt);case 5:return new Gt(dt)}switch(Xn.extractNumericValueFromBitArray(dt,1,5)){case 12:return new $n(dt);case 13:return new nr(dt)}switch(Xn.extractNumericValueFromBitArray(dt,1,7)){case 56:return new Rt(dt,"310","11");case 57:return new Rt(dt,"320","11");case 58:return new Rt(dt,"310","13");case 59:return new Rt(dt,"320","13");case 60:return new Rt(dt,"310","15");case 61:return new Rt(dt,"320","15");case 62:return new Rt(dt,"310","17");case 63:return new Rt(dt,"320","17")}}catch(y){throw console.log(y),new tt("unknown decoder: "+dt)}}class Ee{constructor(y,E,F,$){this.leftchar=y,this.rightchar=E,this.finderpattern=F,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 h{constructor(y,E,F){this.pairs=y,this.rowNumber=E,this.wasReversed=F}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 h?this.checkEqualitity(y,E)&&y.wasReversed===E.wasReversed:!1}checkEqualitity(y,E){if(!y||!E)return;let F;return y.forEach(($,H)=>{E.forEach(Y=>{$.getLeftChar().getValue()===Y.getLeftChar().getValue()&&$.getRightChar().getValue()===Y.getRightChar().getValue()&&$.getFinderPatter().getValue()===Y.getFinderPatter().getValue()&&(F=!0)})}),F}}class p extends yn{constructor(y){super(...arguments),this.pairs=new Array(p.MAX_PAIRS),this.rows=new Array,this.startEnd=[2],this.verbose=y===!0}decodeRow(y,E,F){this.pairs.length=0,this.startFromEven=!1;try{return p.constructResult(this.decodeRow2pairs(y,E))}catch($){this.verbose&&console.log($)}return this.pairs.length=0,this.startFromEven=!0,p.constructResult(this.decodeRow2pairs(y,E))}reset(){this.pairs.length=0,this.rows.length=0}decodeRow2pairs(y,E){let F=!1;for(;!F;)try{this.pairs.push(this.retrieveNextPair(E,this.pairs,y))}catch(H){if(H instanceof Q){if(!this.pairs.length)throw new Q;F=!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 Q}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(F){this.verbose&&console.log(F)}return y&&(this.rows=this.rows.reverse()),E}checkRows(y,E){for(let F=E;F<this.rows.length;F++){let $=this.rows[F];this.pairs.length=0;for(let Y of y)this.pairs.push(Y.getPairs());if(this.pairs.push($.getPairs()),!p.isValidSequence(this.pairs))continue;if(this.checkChecksum())return this.pairs;let H=new Array(y);H.push($);try{return this.checkRows(H,F+1)}catch(Y){this.verbose&&console.log(Y)}}throw new Q}static isValidSequence(y){for(let E of p.FINDER_PATTERN_SEQUENCES){if(y.length>E.length)continue;let F=!0;for(let $=0;$<y.length;$++)if(y[$].getFinderPattern().getValue()!=E[$]){F=!1;break}if(F)return!0}return!1}storeRow(y,E){let F=0,$=!1,H=!1;for(;F<this.rows.length;){let Y=this.rows[F];if(Y.getRowNumber()>y){H=Y.isEquivalent(this.pairs);break}$=Y.isEquivalent(this.pairs),F++}H||$||p.isPartialRow(this.pairs,this.rows)||(this.rows.push(F,new h(this.pairs,y,E)),this.removePartialRows(this.pairs,this.rows))}removePartialRows(y,E){for(let F of E)if(F.getPairs().length!==y.length){for(let $ of F.getPairs())for(let H of y)if(Ee.equals($,H))break}}static isPartialRow(y,E){for(let F of E){let $=!0;for(let H of y){let Y=!1;for(let le of F.getPairs())if(H.equals(le)){Y=!0;break}if(!Y){$=!1;break}}if($)return!0}return!1}getRows(){return this.rows}static constructResult(y){let E=Yn.buildBitArray(y),$=En(E).parseInformation(),H=y[0].getFinderPattern().getResultPoints(),Y=y[y.length-1].getFinderPattern().getResultPoints(),le=[H[0],H[1],Y[0],Y[1]];return new me($,null,null,le,xe.RSS_EXPANDED,null)}checkChecksum(){let y=this.pairs.get(0),E=y.getLeftChar(),F=y.getRightChar();if(F==null)return!1;let $=F.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 F;return y.get(E)?(F=y.getNextUnset(E),F=y.getNextSet(F)):(F=y.getNextSet(E),F=y.getNextUnset(F)),F}retrieveNextPair(y,E,F){let $=E.length%2==0;this.startFromEven&&($=!$);let H,Y=!0,le=-1;do this.findNextPair(y,E,le),H=this.parseFoundFinderPattern(y,F,$),H==null?le=p.getNextSecondBar(y,this.startEnd[0]):Y=!1;while(Y);let ve=this.decodeDataCharacter(y,H,$,!0);if(!this.isEmptyPair(E)&&E[E.length-1].mustBeLast())throw new Q;let Te;try{Te=this.decodeDataCharacter(y,H,$,!1)}catch(Qe){Te=null,this.verbose&&console.log(Qe)}return new Ee(ve,Te,H,!0)}isEmptyPair(y){return y.length===0}findNextPair(y,E,F){let $=this.getDecodeFinderCounters();$[0]=0,$[1]=0,$[2]=0,$[3]=0;let H=y.getSize(),Y;F>=0?Y=F:this.isEmptyPair(E)?Y=0:Y=E[E.length-1].getFinderPattern().getStartEnd()[1];let le=E.length%2!=0;this.startFromEven&&(le=!le);let ve=!1;for(;Y<H&&(ve=!y.get(Y),!!ve);)Y++;let Te=0,Qe=Y;for(let xt=Y;xt<H;xt++)if(y.get(xt)!=ve)$[Te]++;else{if(Te==3){if(le&&p.reverseCounters($),p.isFinderPattern($)){this.startEnd[0]=Qe,this.startEnd[1]=xt;return}le&&p.reverseCounters($),Qe+=$[0]+$[1],$[0]=$[2],$[1]=$[3],$[2]=0,$[3]=0,Te--}else Te++;$[Te]=1,ve=!ve}throw new Q}static reverseCounters(y){let E=y.length;for(let F=0;F<E/2;++F){let $=y[F];y[F]=y[E-F-1],y[E-F-1]=$}}parseFoundFinderPattern(y,E,F){let $,H,Y;if(F){let Te=this.startEnd[0]-1;for(;Te>=0&&!y.get(Te);)Te--;Te++,$=this.startEnd[0]-Te,H=Te,Y=this.startEnd[1]}else H=this.startEnd[0],Y=y.getNextUnset(this.startEnd[1]+1),$=Y-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,p.FINDER_PATTERNS)}catch{return null}return new Gn(ve,[H,Y],H,Y,E)}decodeDataCharacter(y,E,F,$){let H=this.getDataCharacterCounters();for(let fa=0;fa<H.length;fa++)H[fa]=0;if($)p.recordPatternInReverse(y,E.getStartEnd()[0],H);else{p.recordPattern(y,E.getStartEnd()[1],H);for(let fa=0,ka=H.length-1;fa<ka;fa++,ka--){let Go=H[fa];H[fa]=H[ka],H[ka]=Go}}let Y=17,le=pt.sum(new Int32Array(H))/Y,ve=(E.getStartEnd()[1]-E.getStartEnd()[0])/15;if(Math.abs(le-ve)/ve>.3)throw new Q;let Te=this.getOddCounts(),Qe=this.getEvenCounts(),xt=this.getOddRoundingErrors(),It=this.getEvenRoundingErrors();for(let fa=0;fa<H.length;fa++){let ka=1*H[fa]/le,Go=ka+.5;if(Go<1){if(ka<.3)throw new Q;Go=1}else if(Go>8){if(ka>8.7)throw new Q;Go=8}let Cd=fa/2;fa&1?(Qe[Cd]=Go,It[Cd]=ka-Go):(Te[Cd]=Go,xt[Cd]=ka-Go)}this.adjustOddEvenCounts(Y);let Qt=4*E.getValue()+(F?0:2)+($?0:1)-1,St=0,zt=0;for(let fa=Te.length-1;fa>=0;fa--){if(p.isNotA1left(E,F,$)){let ka=p.WEIGHTS[Qt][2*fa];zt+=Te[fa]*ka}St+=Te[fa]}let Wt=0;for(let fa=Qe.length-1;fa>=0;fa--)if(p.isNotA1left(E,F,$)){let ka=p.WEIGHTS[Qt][2*fa+1];Wt+=Qe[fa]*ka}let jn=zt+Wt;if(St&1||St>13||St<4)throw new Q;let mr=(13-St)/2,Sr=p.SYMBOL_WIDEST[mr],Ar=9-Sr,Ss=Rn.getRSSvalue(Te,Sr,!0),Zs=Rn.getRSSvalue(Qe,Ar,!1),fc=p.EVEN_TOTAL_SUBSET[mr],Ja=p.GSUM[mr],eo=Ss*fc+Zs+Ja;return new Vn(eo,jn)}static isNotA1left(y,E,F){return!(y.getValue()==0&&E&&F)}adjustOddEvenCounts(y){let E=pt.sum(new Int32Array(this.getOddCounts())),F=pt.sum(new Int32Array(this.getEvenCounts())),$=!1,H=!1;E>13?H=!0:E<4&&($=!0);let Y=!1,le=!1;F>13?le=!0:F<4&&(Y=!0);let ve=E+F-y,Te=(E&1)==1,Qe=(F&1)==0;if(ve==1)if(Te){if(Qe)throw new Q;H=!0}else{if(!Qe)throw new Q;le=!0}else if(ve==-1)if(Te){if(Qe)throw new Q;$=!0}else{if(!Qe)throw new Q;Y=!0}else if(ve==0){if(Te){if(!Qe)throw new Q;E<F?($=!0,le=!0):(H=!0,Y=!0)}else if(Qe)throw new Q}else throw new Q;if($){if(H)throw new Q;p.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(H&&p.decrement(this.getOddCounts(),this.getOddRoundingErrors()),Y){if(le)throw new Q;p.increment(this.getEvenCounts(),this.getOddRoundingErrors())}le&&p.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())}}p.SYMBOL_WIDEST=[7,5,4,3,1],p.EVEN_TOTAL_SUBSET=[4,20,52,104,204],p.GSUM=[0,348,1388,2948,3988],p.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])],p.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]],p.FINDER_PAT_A=0,p.FINDER_PAT_B=1,p.FINDER_PAT_C=2,p.FINDER_PAT_D=3,p.FINDER_PAT_E=4,p.FINDER_PAT_F=5,p.FINDER_PATTERN_SEQUENCES=[[p.FINDER_PAT_A,p.FINDER_PAT_A],[p.FINDER_PAT_A,p.FINDER_PAT_B,p.FINDER_PAT_B],[p.FINDER_PAT_A,p.FINDER_PAT_C,p.FINDER_PAT_B,p.FINDER_PAT_D],[p.FINDER_PAT_A,p.FINDER_PAT_E,p.FINDER_PAT_B,p.FINDER_PAT_D,p.FINDER_PAT_C],[p.FINDER_PAT_A,p.FINDER_PAT_E,p.FINDER_PAT_B,p.FINDER_PAT_D,p.FINDER_PAT_D,p.FINDER_PAT_F],[p.FINDER_PAT_A,p.FINDER_PAT_E,p.FINDER_PAT_B,p.FINDER_PAT_D,p.FINDER_PAT_E,p.FINDER_PAT_F,p.FINDER_PAT_F],[p.FINDER_PAT_A,p.FINDER_PAT_A,p.FINDER_PAT_B,p.FINDER_PAT_B,p.FINDER_PAT_C,p.FINDER_PAT_C,p.FINDER_PAT_D,p.FINDER_PAT_D],[p.FINDER_PAT_A,p.FINDER_PAT_A,p.FINDER_PAT_B,p.FINDER_PAT_B,p.FINDER_PAT_C,p.FINDER_PAT_C,p.FINDER_PAT_D,p.FINDER_PAT_E,p.FINDER_PAT_E],[p.FINDER_PAT_A,p.FINDER_PAT_A,p.FINDER_PAT_B,p.FINDER_PAT_B,p.FINDER_PAT_C,p.FINDER_PAT_C,p.FINDER_PAT_D,p.FINDER_PAT_E,p.FINDER_PAT_F,p.FINDER_PAT_F],[p.FINDER_PAT_A,p.FINDER_PAT_A,p.FINDER_PAT_B,p.FINDER_PAT_B,p.FINDER_PAT_C,p.FINDER_PAT_D,p.FINDER_PAT_D,p.FINDER_PAT_E,p.FINDER_PAT_E,p.FINDER_PAT_F,p.FINDER_PAT_F]],p.MAX_PAIRS=11;class S extends Vn{constructor(y,E,F){super(y,E),this.count=0,this.finderPattern=F}getFinderPattern(){return this.finderPattern}getCount(){return this.count}incrementCount(){this.count++}}class _ extends yn{constructor(){super(...arguments),this.possibleLeftPairs=[],this.possibleRightPairs=[]}decodeRow(y,E,F){const $=this.decodePair(E,!1,y,F);_.addOrTally(this.possibleLeftPairs,$),E.reverse();let H=this.decodePair(E,!0,y,F);_.addOrTally(this.possibleRightPairs,H),E.reverse();for(let Y of this.possibleLeftPairs)if(Y.getCount()>1){for(let le of this.possibleRightPairs)if(le.getCount()>1&&_.checkChecksum(Y,le))return _.constructResult(Y,le)}throw new Q}static addOrTally(y,E){if(E==null)return;let F=!1;for(let $ of y)if($.getValue()===E.getValue()){$.incrementCount(),F=!0;break}F||y.push(E)}reset(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0}static constructResult(y,E){let F=4537077*y.getValue()+E.getValue(),$=new String(F).toString(),H=new re;for(let Te=13-$.length;Te>0;Te--)H.append("0");H.append($);let Y=0;for(let Te=0;Te<13;Te++){let Qe=H.charAt(Te).charCodeAt(0)-48;Y+=Te&1?Qe:3*Qe}Y=10-Y%10,Y===10&&(Y=0),H.append(Y.toString());let le=y.getFinderPattern().getResultPoints(),ve=E.getFinderPattern().getResultPoints();return new me(H.toString(),null,0,[le[0],le[1],ve[0],ve[1]],xe.RSS_14,new Date().getTime())}static checkChecksum(y,E){let F=(y.getChecksumPortion()+16*E.getChecksumPortion())%79,$=9*y.getFinderPattern().getValue()+E.getFinderPattern().getValue();return $>72&&$--,$>8&&$--,F===$}decodePair(y,E,F,$){try{let H=this.findFinderPattern(y,E),Y=this.parseFoundFinderPattern(y,F,E,H),le=$==null?null:$.get(U.NEED_RESULT_POINT_CALLBACK);if(le!=null){let Qe=(H[0]+H[1])/2;E&&(Qe=y.getSize()-1-Qe),le.foundPossibleResultPoint(new wt(Qe,F))}let ve=this.decodeDataCharacter(y,Y,!0),Te=this.decodeDataCharacter(y,Y,!1);return new S(1597*ve.getValue()+Te.getValue(),ve.getChecksumPortion()+4*Te.getChecksumPortion(),Y)}catch{return null}}decodeDataCharacter(y,E,F){let $=this.getDataCharacterCounters();for(let Wt=0;Wt<$.length;Wt++)$[Wt]=0;if(F)Bt.recordPatternInReverse(y,E.getStartEnd()[0],$);else{Bt.recordPattern(y,E.getStartEnd()[1]+1,$);for(let Wt=0,jn=$.length-1;Wt<jn;Wt++,jn--){let mr=$[Wt];$[Wt]=$[jn],$[jn]=mr}}let H=F?16:15,Y=pt.sum(new Int32Array($))/H,le=this.getOddCounts(),ve=this.getEvenCounts(),Te=this.getOddRoundingErrors(),Qe=this.getEvenRoundingErrors();for(let Wt=0;Wt<$.length;Wt++){let jn=$[Wt]/Y,mr=Math.floor(jn+.5);mr<1?mr=1:mr>8&&(mr=8);let Sr=Math.floor(Wt/2);Wt&1?(ve[Sr]=mr,Qe[Sr]=jn-mr):(le[Sr]=mr,Te[Sr]=jn-mr)}this.adjustOddEvenCounts(F,H);let xt=0,It=0;for(let Wt=le.length-1;Wt>=0;Wt--)It*=9,It+=le[Wt],xt+=le[Wt];let Qt=0,St=0;for(let Wt=ve.length-1;Wt>=0;Wt--)Qt*=9,Qt+=ve[Wt],St+=ve[Wt];let zt=It+3*Qt;if(F){if(xt&1||xt>12||xt<4)throw new Q;let Wt=(12-xt)/2,jn=_.OUTSIDE_ODD_WIDEST[Wt],mr=9-jn,Sr=Rn.getRSSvalue(le,jn,!1),Ar=Rn.getRSSvalue(ve,mr,!0),Ss=_.OUTSIDE_EVEN_TOTAL_SUBSET[Wt],Zs=_.OUTSIDE_GSUM[Wt];return new Vn(Sr*Ss+Ar+Zs,zt)}else{if(St&1||St>10||St<4)throw new Q;let Wt=(10-St)/2,jn=_.INSIDE_ODD_WIDEST[Wt],mr=9-jn,Sr=Rn.getRSSvalue(le,jn,!0),Ar=Rn.getRSSvalue(ve,mr,!1),Ss=_.INSIDE_ODD_TOTAL_SUBSET[Wt],Zs=_.INSIDE_GSUM[Wt];return new Vn(Ar*Ss+Sr+Zs,zt)}}findFinderPattern(y,E){let F=this.getDecodeFinderCounters();F[0]=0,F[1]=0,F[2]=0,F[3]=0;let $=y.getSize(),H=!1,Y=0;for(;Y<$&&(H=!y.get(Y),E!==H);)Y++;let le=0,ve=Y;for(let Te=Y;Te<$;Te++)if(y.get(Te)!==H)F[le]++;else{if(le===3){if(yn.isFinderPattern(F))return[ve,Te];ve+=F[0]+F[1],F[0]=F[2],F[1]=F[3],F[2]=0,F[3]=0,le--}else le++;F[le]=1,H=!H}throw new Q}parseFoundFinderPattern(y,E,F,$){let H=y.get($[0]),Y=$[0]-1;for(;Y>=0&&H!==y.get(Y);)Y--;Y++;const le=$[0]-Y,ve=this.getDecodeFinderCounters(),Te=new Int32Array(ve.length);w.arraycopy(ve,0,Te,1,ve.length-1),Te[0]=le;const Qe=this.parseFinderValue(Te,_.FINDER_PATTERNS);let xt=Y,It=$[1];return F&&(xt=y.getSize()-1-xt,It=y.getSize()-1-It),new Gn(Qe,[Y,$[1]],xt,It,E)}adjustOddEvenCounts(y,E){let F=pt.sum(new Int32Array(this.getOddCounts())),$=pt.sum(new Int32Array(this.getEvenCounts())),H=!1,Y=!1,le=!1,ve=!1;y?(F>12?Y=!0:F<4&&(H=!0),$>12?ve=!0:$<4&&(le=!0)):(F>11?Y=!0:F<5&&(H=!0),$>10?ve=!0:$<4&&(le=!0));let Te=F+$-E,Qe=(F&1)===(y?1:0),xt=($&1)===1;if(Te===1)if(Qe){if(xt)throw new Q;Y=!0}else{if(!xt)throw new Q;ve=!0}else if(Te===-1)if(Qe){if(xt)throw new Q;H=!0}else{if(!xt)throw new Q;le=!0}else if(Te===0){if(Qe){if(!xt)throw new Q;F<$?(H=!0,ve=!0):(Y=!0,le=!0)}else if(xt)throw new Q}else throw new Q;if(H){if(Y)throw new Q;yn.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(Y&&yn.decrement(this.getOddCounts(),this.getOddRoundingErrors()),le){if(ve)throw new Q;yn.increment(this.getEvenCounts(),this.getOddRoundingErrors())}ve&&yn.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 Bt{constructor(y,E){super(),this.readers=[],this.verbose=E===!0;const F=y?y.get(U.POSSIBLE_FORMATS):null,$=y&&y.get(U.ASSUME_CODE_39_CHECK_DIGIT)!==void 0;F?((F.includes(xe.EAN_13)||F.includes(xe.UPC_A)||F.includes(xe.EAN_8)||F.includes(xe.UPC_E))&&this.readers.push(new kn(y)),F.includes(xe.CODE_39)&&this.readers.push(new De($)),F.includes(xe.CODE_128)&&this.readers.push(new ot),F.includes(xe.ITF)&&this.readers.push(new _t),F.includes(xe.RSS_14)&&this.readers.push(new _),F.includes(xe.RSS_EXPANDED)&&this.readers.push(new p(this.verbose))):(this.readers.push(new kn(y)),this.readers.push(new De),this.readers.push(new kn(y)),this.readers.push(new ot),this.readers.push(new _t),this.readers.push(new _),this.readers.push(new p(this.verbose)))}decodeRow(y,E,F){for(let $=0;$<this.readers.length;$++)try{return this.readers[$].decodeRow(y,E,F)}catch{}throw new Q}reset(){this.readers.forEach(y=>y.reset())}}class T extends Ne{constructor(y=500,E){super(new k(E),y,E)}}class B{constructor(y,E,F){this.ecCodewords=y,this.ecBlocks=[E],F&&this.ecBlocks.push(F)}getECCodewords(){return this.ecCodewords}getECBlocks(){return this.ecBlocks}}class W{constructor(y,E){this.count=y,this.dataCodewords=E}getCount(){return this.count}getDataCodewords(){return this.dataCodewords}}class ee{constructor(y,E,F,$,H,Y){this.versionNumber=y,this.symbolSizeRows=E,this.symbolSizeColumns=F,this.dataRegionSizeRows=$,this.dataRegionSizeColumns=H,this.ecBlocks=Y;let le=0;const ve=Y.getECCodewords(),Te=Y.getECBlocks();for(let Qe of Te)le+=Qe.getCount()*(Qe.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 F of ee.VERSIONS)if(F.symbolSizeRows===y&&F.symbolSizeColumns===E)return F;throw new L}toString(){return""+this.versionNumber}static buildVersions(){return[new ee(1,10,10,8,8,new B(5,new W(1,3))),new ee(2,12,12,10,10,new B(7,new W(1,5))),new ee(3,14,14,12,12,new B(10,new W(1,8))),new ee(4,16,16,14,14,new B(12,new W(1,12))),new ee(5,18,18,16,16,new B(14,new W(1,18))),new ee(6,20,20,18,18,new B(18,new W(1,22))),new ee(7,22,22,20,20,new B(20,new W(1,30))),new ee(8,24,24,22,22,new B(24,new W(1,36))),new ee(9,26,26,24,24,new B(28,new W(1,44))),new ee(10,32,32,14,14,new B(36,new W(1,62))),new ee(11,36,36,16,16,new B(42,new W(1,86))),new ee(12,40,40,18,18,new B(48,new W(1,114))),new ee(13,44,44,20,20,new B(56,new W(1,144))),new ee(14,48,48,22,22,new B(68,new W(1,174))),new ee(15,52,52,24,24,new B(42,new W(2,102))),new ee(16,64,64,14,14,new B(56,new W(2,140))),new ee(17,72,72,16,16,new B(36,new W(4,92))),new ee(18,80,80,18,18,new B(48,new W(4,114))),new ee(19,88,88,20,20,new B(56,new W(4,144))),new ee(20,96,96,22,22,new B(68,new W(4,174))),new ee(21,104,104,24,24,new B(56,new W(6,136))),new ee(22,120,120,18,18,new B(68,new W(6,175))),new ee(23,132,132,20,20,new B(62,new W(8,163))),new ee(24,144,144,22,22,new B(62,new W(8,156),new W(2,155))),new ee(25,8,18,6,16,new B(7,new W(1,5))),new ee(26,8,32,6,14,new B(11,new W(1,10))),new ee(27,12,26,10,24,new B(14,new W(1,16))),new ee(28,12,36,10,16,new B(18,new W(1,22))),new ee(29,16,36,14,16,new B(24,new W(1,32))),new ee(30,16,48,14,22,new B(28,new W(1,49)))]}}ee.VERSIONS=ee.buildVersions();class ce{constructor(y){const E=y.getHeight();if(E<8||E>144||E&1)throw new L;this.version=ce.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(),F=y.getWidth();return ee.getVersionForDimensions(E,F)}readCodewords(){const y=new Int8Array(this.version.getTotalCodewords());let E=0,F=4,$=0;const H=this.mappingBitMatrix.getHeight(),Y=this.mappingBitMatrix.getWidth();let le=!1,ve=!1,Te=!1,Qe=!1;do if(F===H&&$===0&&!le)y[E++]=this.readCorner1(H,Y)&255,F-=2,$+=2,le=!0;else if(F===H-2&&$===0&&Y&3&&!ve)y[E++]=this.readCorner2(H,Y)&255,F-=2,$+=2,ve=!0;else if(F===H+4&&$===2&&!(Y&7)&&!Te)y[E++]=this.readCorner3(H,Y)&255,F-=2,$+=2,Te=!0;else if(F===H-2&&$===0&&(Y&7)===4&&!Qe)y[E++]=this.readCorner4(H,Y)&255,F-=2,$+=2,Qe=!0;else{do F<H&&$>=0&&!this.readMappingMatrix.get($,F)&&(y[E++]=this.readUtah(F,$,H,Y)&255),F-=2,$+=2;while(F>=0&&$<Y);F+=1,$+=3;do F>=0&&$<Y&&!this.readMappingMatrix.get($,F)&&(y[E++]=this.readUtah(F,$,H,Y)&255),F+=2,$-=2;while(F<H&&$>=0);F+=3,$+=1}while(F<H||$<Y);if(E!==this.version.getTotalCodewords())throw new L;return y}readModule(y,E,F,$){return y<0&&(y+=F,E+=4-(F+4&7)),E<0&&(E+=$,y+=4-($+4&7)),this.readMappingMatrix.set(E,y),this.mappingBitMatrix.get(E,y)}readUtah(y,E,F,$){let H=0;return this.readModule(y-2,E-2,F,$)&&(H|=1),H<<=1,this.readModule(y-2,E-1,F,$)&&(H|=1),H<<=1,this.readModule(y-1,E-2,F,$)&&(H|=1),H<<=1,this.readModule(y-1,E-1,F,$)&&(H|=1),H<<=1,this.readModule(y-1,E,F,$)&&(H|=1),H<<=1,this.readModule(y,E-2,F,$)&&(H|=1),H<<=1,this.readModule(y,E-1,F,$)&&(H|=1),H<<=1,this.readModule(y,E,F,$)&&(H|=1),H}readCorner1(y,E){let F=0;return this.readModule(y-1,0,y,E)&&(F|=1),F<<=1,this.readModule(y-1,1,y,E)&&(F|=1),F<<=1,this.readModule(y-1,2,y,E)&&(F|=1),F<<=1,this.readModule(0,E-2,y,E)&&(F|=1),F<<=1,this.readModule(0,E-1,y,E)&&(F|=1),F<<=1,this.readModule(1,E-1,y,E)&&(F|=1),F<<=1,this.readModule(2,E-1,y,E)&&(F|=1),F<<=1,this.readModule(3,E-1,y,E)&&(F|=1),F}readCorner2(y,E){let F=0;return this.readModule(y-3,0,y,E)&&(F|=1),F<<=1,this.readModule(y-2,0,y,E)&&(F|=1),F<<=1,this.readModule(y-1,0,y,E)&&(F|=1),F<<=1,this.readModule(0,E-4,y,E)&&(F|=1),F<<=1,this.readModule(0,E-3,y,E)&&(F|=1),F<<=1,this.readModule(0,E-2,y,E)&&(F|=1),F<<=1,this.readModule(0,E-1,y,E)&&(F|=1),F<<=1,this.readModule(1,E-1,y,E)&&(F|=1),F}readCorner3(y,E){let F=0;return this.readModule(y-1,0,y,E)&&(F|=1),F<<=1,this.readModule(y-1,E-1,y,E)&&(F|=1),F<<=1,this.readModule(0,E-3,y,E)&&(F|=1),F<<=1,this.readModule(0,E-2,y,E)&&(F|=1),F<<=1,this.readModule(0,E-1,y,E)&&(F|=1),F<<=1,this.readModule(1,E-3,y,E)&&(F|=1),F<<=1,this.readModule(1,E-2,y,E)&&(F|=1),F<<=1,this.readModule(1,E-1,y,E)&&(F|=1),F}readCorner4(y,E){let F=0;return this.readModule(y-3,0,y,E)&&(F|=1),F<<=1,this.readModule(y-2,0,y,E)&&(F|=1),F<<=1,this.readModule(y-1,0,y,E)&&(F|=1),F<<=1,this.readModule(0,E-2,y,E)&&(F|=1),F<<=1,this.readModule(0,E-1,y,E)&&(F|=1),F<<=1,this.readModule(1,E-1,y,E)&&(F|=1),F<<=1,this.readModule(2,E-1,y,E)&&(F|=1),F<<=1,this.readModule(3,E-1,y,E)&&(F|=1),F}extractDataRegion(y){const E=this.version.getSymbolSizeRows(),F=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(),Y=E/$|0,le=F/H|0,ve=Y*$,Te=le*H,Qe=new he(Te,ve);for(let xt=0;xt<Y;++xt){const It=xt*$;for(let Qt=0;Qt<le;++Qt){const St=Qt*H;for(let zt=0;zt<$;++zt){const Wt=xt*($+2)+1+zt,jn=It+zt;for(let mr=0;mr<H;++mr){const Sr=Qt*(H+2)+1+mr;if(y.get(Sr,Wt)){const Ar=St+mr;Qe.set(Ar,jn)}}}}}return Qe}}class ue{constructor(y,E){this.numDataCodewords=y,this.codewords=E}static getDataBlocks(y,E){const F=E.getECBlocks();let $=0;const H=F.getECBlocks();for(let zt of H)$+=zt.getCount();const Y=new Array($);let le=0;for(let zt of H)for(let Wt=0;Wt<zt.getCount();Wt++){const jn=zt.getDataCodewords(),mr=F.getECCodewords()+jn;Y[le++]=new ue(jn,new Uint8Array(mr))}const Te=Y[0].codewords.length-F.getECCodewords(),Qe=Te-1;let xt=0;for(let zt=0;zt<Qe;zt++)for(let Wt=0;Wt<le;Wt++)Y[Wt].codewords[zt]=y[xt++];const It=E.getVersionNumber()===24,Qt=It?8:le;for(let zt=0;zt<Qt;zt++)Y[zt].codewords[Te-1]=y[xt++];const St=Y[0].codewords.length;for(let zt=Te;zt<St;zt++)for(let Wt=0;Wt<le;Wt++){const jn=It?(Wt+8)%le:Wt,mr=It&&jn>7?zt-1:zt;Y[jn].codewords[mr]=y[xt++]}if(xt!==y.length)throw new f;return Y}getNumDataCodewords(){return this.numDataCodewords}getCodewords(){return this.codewords}}class ge{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,F=this.bitOffset,$=this.byteOffset;const H=this.bytes;if(F>0){const Y=8-F,le=y<Y?y:Y,ve=Y-le,Te=255>>8-le<<ve;E=(H[$]&Te)>>ve,y-=le,F+=le,F===8&&(F=0,$++)}if(y>0){for(;y>=8;)E=E<<8|H[$]&255,$++,y-=8;if(y>0){const Y=8-y,le=255>>Y<<Y;E=E<<y|(H[$]&le)>>Y,F+=y}}return this.bitOffset=F,this.byteOffset=$,E}available(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset}}var Se;(function(dt){dt[dt.PAD_ENCODE=0]="PAD_ENCODE",dt[dt.ASCII_ENCODE=1]="ASCII_ENCODE",dt[dt.C40_ENCODE=2]="C40_ENCODE",dt[dt.TEXT_ENCODE=3]="TEXT_ENCODE",dt[dt.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",dt[dt.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",dt[dt.BASE256_ENCODE=6]="BASE256_ENCODE"})(Se||(Se={}));class ke{static decode(y){const E=new ge(y),F=new re,$=new re,H=new Array;let Y=Se.ASCII_ENCODE;do if(Y===Se.ASCII_ENCODE)Y=this.decodeAsciiSegment(E,F,$);else{switch(Y){case Se.C40_ENCODE:this.decodeC40Segment(E,F);break;case Se.TEXT_ENCODE:this.decodeTextSegment(E,F);break;case Se.ANSIX12_ENCODE:this.decodeAnsiX12Segment(E,F);break;case Se.EDIFACT_ENCODE:this.decodeEdifactSegment(E,F);break;case Se.BASE256_ENCODE:this.decodeBase256Segment(E,F,H);break;default:throw new L}Y=Se.ASCII_ENCODE}while(Y!==Se.PAD_ENCODE&&E.available()>0);return $.length()>0&&F.append($.toString()),new Pe(y,F.toString(),H.length===0?null:H,null)}static decodeAsciiSegment(y,E,F){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)),Se.ASCII_ENCODE;if(H===129)return Se.PAD_ENCODE;if(H<=229){const Y=H-130;Y<10&&E.append("0"),E.append(""+Y)}else switch(H){case 230:return Se.C40_ENCODE;case 231:return Se.BASE256_ENCODE;case 232:E.append("");break;case 233:case 234:break;case 235:$=!0;break;case 236:E.append("[)>05"),F.insert(0,"");break;case 237:E.append("[)>06"),F.insert(0,"");break;case 238:return Se.ANSIX12_ENCODE;case 239:return Se.TEXT_ENCODE;case 240:return Se.EDIFACT_ENCODE;case 241:break;default:if(H!==254||y.available()!==0)throw new L;break}}while(y.available()>0);return Se.ASCII_ENCODE}static decodeC40Segment(y,E){let F=!1;const $=[];let H=0;do{if(y.available()===8)return;const Y=y.readBits(8);if(Y===254)return;this.parseTwoBytes(Y,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];F?(E.append(String.fromCharCode(Te.charCodeAt(0)+128)),F=!1):E.append(Te)}else throw new L;break;case 1:F?(E.append(String.fromCharCode(ve+128)),F=!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];F?(E.append(String.fromCharCode(Te.charCodeAt(0)+128)),F=!1):E.append(Te)}else switch(ve){case 27:E.append("");break;case 30:F=!0;break;default:throw new L}H=0;break;case 3:F?(E.append(String.fromCharCode(ve+224)),F=!1):E.append(String.fromCharCode(ve+96)),H=0;break;default:throw new L}}}while(y.available()>0)}static decodeTextSegment(y,E){let F=!1,$=[],H=0;do{if(y.available()===8)return;const Y=y.readBits(8);if(Y===254)return;this.parseTwoBytes(Y,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];F?(E.append(String.fromCharCode(Te.charCodeAt(0)+128)),F=!1):E.append(Te)}else throw new L;break;case 1:F?(E.append(String.fromCharCode(ve+128)),F=!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];F?(E.append(String.fromCharCode(Te.charCodeAt(0)+128)),F=!1):E.append(Te)}else switch(ve){case 27:E.append("");break;case 30:F=!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];F?(E.append(String.fromCharCode(Te.charCodeAt(0)+128)),F=!1):E.append(Te),H=0}else throw new L;break;default:throw new L}}}while(y.available()>0)}static decodeAnsiX12Segment(y,E){const F=[];do{if(y.available()===8)return;const $=y.readBits(8);if($===254)return;this.parseTwoBytes($,y.readBits(8),F);for(let H=0;H<3;H++){const Y=F[H];switch(Y){case 0:E.append("\r");break;case 1:E.append("*");break;case 2:E.append(">");break;case 3:E.append(" ");break;default:if(Y<14)E.append(String.fromCharCode(Y+44));else if(Y<40)E.append(String.fromCharCode(Y+51));else throw new L;break}}}while(y.available()>0)}static parseTwoBytes(y,E,F){let $=(y<<8)+E-1,H=Math.floor($/1600);F[0]=H,$-=H*1600,H=Math.floor($/40),F[1]=H,F[2]=$-H*40}static decodeEdifactSegment(y,E){do{if(y.available()<=16)return;for(let F=0;F<4;F++){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,F){let $=1+y.getByteOffset();const H=this.unrandomize255State(y.readBits(8),$++);let Y;if(H===0?Y=y.available()/8|0:H<250?Y=H:Y=250*(H-249)+this.unrandomize255State(y.readBits(8),$++),Y<0)throw new L;const le=new Uint8Array(Y);for(let ve=0;ve<Y;ve++){if(y.available()<8)throw new L;le[ve]=this.unrandomize255State(y.readBits(8),$++)}F.push(le);try{E.append(J.decode(le,K.ISO88591))}catch(ve){throw new tt("Platform does not support required encoding: "+ve.message)}}static unrandomize255State(y,E){const F=149*E%255+1,$=y-F;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 Le(ut.DATA_MATRIX_FIELD_256)}decode(y){const E=new ce(y),F=E.getVersion(),$=E.readCodewords(),H=ue.getDataBlocks($,F);let Y=0;for(let Te of H)Y+=Te.getNumDataCodewords();const le=new Uint8Array(Y),ve=H.length;for(let Te=0;Te<ve;Te++){const Qe=H[Te],xt=Qe.getCodewords(),It=Qe.getNumDataCodewords();this.correctErrors(xt,It);for(let Qt=0;Qt<It;Qt++)le[Qt*ve+Te]=xt[Qt]}return ke.decode(le)}correctErrors(y,E){const F=new Int32Array(y);try{this.rsDecoder.decode(F,y.length-E)}catch{throw new g}for(let $=0;$<E;$++)y[$]=F[$]}}class qe{constructor(y){this.image=y,this.rectangleDetector=new zn(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 Q;E=this.shiftToModuleCenter(E);const F=E[0],$=E[1],H=E[2],Y=E[3];let le=this.transitionsBetween(F,Y)+1,ve=this.transitionsBetween(H,Y)+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=qe.sampleGrid(this.image,F,$,H,Y,le,ve);return new nn(Te,[F,$,H,Y])}static shiftPoint(y,E,F){let $=(E.getX()-y.getX())/(F+1),H=(E.getY()-y.getY())/(F+1);return new wt(y.getX()+$,y.getY()+H)}static moveAway(y,E,F){let $=y.getX(),H=y.getY();return $<E?$-=1:$+=1,H<F?H-=1:H+=1,new wt($,H)}detectSolid1(y){let E=y[0],F=y[1],$=y[3],H=y[2],Y=this.transitionsBetween(E,F),le=this.transitionsBetween(F,$),ve=this.transitionsBetween($,H),Te=this.transitionsBetween(H,E),Qe=Y,xt=[H,E,F,$];return Qe>le&&(Qe=le,xt[0]=E,xt[1]=F,xt[2]=$,xt[3]=H),Qe>ve&&(Qe=ve,xt[0]=F,xt[1]=$,xt[2]=H,xt[3]=E),Qe>Te&&(xt[0]=$,xt[1]=H,xt[2]=E,xt[3]=F),xt}detectSolid2(y){let E=y[0],F=y[1],$=y[2],H=y[3],Y=this.transitionsBetween(E,H),le=qe.shiftPoint(F,$,(Y+1)*4),ve=qe.shiftPoint($,F,(Y+1)*4),Te=this.transitionsBetween(le,E),Qe=this.transitionsBetween(ve,H);return Te<Qe?(y[0]=E,y[1]=F,y[2]=$,y[3]=H):(y[0]=F,y[1]=$,y[2]=H,y[3]=E),y}correctTopRight(y){let E=y[0],F=y[1],$=y[2],H=y[3],Y=this.transitionsBetween(E,H),le=this.transitionsBetween(F,H),ve=qe.shiftPoint(E,F,(le+1)*4),Te=qe.shiftPoint($,F,(Y+1)*4);Y=this.transitionsBetween(ve,H),le=this.transitionsBetween(Te,H);let Qe=new wt(H.getX()+($.getX()-F.getX())/(Y+1),H.getY()+($.getY()-F.getY())/(Y+1)),xt=new wt(H.getX()+(E.getX()-F.getX())/(le+1),H.getY()+(E.getY()-F.getY())/(le+1));if(!this.isValid(Qe))return this.isValid(xt)?xt:null;if(!this.isValid(xt))return Qe;let It=this.transitionsBetween(ve,Qe)+this.transitionsBetween(Te,Qe),Qt=this.transitionsBetween(ve,xt)+this.transitionsBetween(Te,xt);return It>Qt?Qe:xt}shiftToModuleCenter(y){let E=y[0],F=y[1],$=y[2],H=y[3],Y=this.transitionsBetween(E,H)+1,le=this.transitionsBetween($,H)+1,ve=qe.shiftPoint(E,F,le*4),Te=qe.shiftPoint($,F,Y*4);Y=this.transitionsBetween(ve,H)+1,le=this.transitionsBetween(Te,H)+1,(Y&1)===1&&(Y+=1),(le&1)===1&&(le+=1);let Qe=(E.getX()+F.getX()+$.getX()+H.getX())/4,xt=(E.getY()+F.getY()+$.getY()+H.getY())/4;E=qe.moveAway(E,Qe,xt),F=qe.moveAway(F,Qe,xt),$=qe.moveAway($,Qe,xt),H=qe.moveAway(H,Qe,xt);let It,Qt;return ve=qe.shiftPoint(E,F,le*4),ve=qe.shiftPoint(ve,H,Y*4),It=qe.shiftPoint(F,E,le*4),It=qe.shiftPoint(It,$,Y*4),Te=qe.shiftPoint($,H,le*4),Te=qe.shiftPoint(Te,F,Y*4),Qt=qe.shiftPoint(H,$,le*4),Qt=qe.shiftPoint(Qt,E,Y*4),[ve,It,Te,Qt]}isValid(y){return y.getX()>=0&&y.getX()<this.image.getWidth()&&y.getY()>0&&y.getY()<this.image.getHeight()}static sampleGrid(y,E,F,$,H,Y,le){return Ye.getInstance().sampleGrid(y,Y,le,.5,.5,Y-.5,.5,Y-.5,le-.5,.5,le-.5,E.getX(),E.getY(),H.getX(),H.getY(),$.getX(),$.getY(),F.getX(),F.getY())}transitionsBetween(y,E){let F=Math.trunc(y.getX()),$=Math.trunc(y.getY()),H=Math.trunc(E.getX()),Y=Math.trunc(E.getY()),le=Math.abs(Y-$)>Math.abs(H-F);if(le){let zt=F;F=$,$=zt,zt=H,H=Y,Y=zt}let ve=Math.abs(H-F),Te=Math.abs(Y-$),Qe=-ve/2,xt=$<Y?1:-1,It=F<H?1:-1,Qt=0,St=this.image.get(le?$:F,le?F:$);for(let zt=F,Wt=$;zt!==H;zt+=It){let jn=this.image.get(le?Wt:zt,le?zt:Wt);if(jn!==St&&(Qt++,St=jn),Qe+=Te,Qe>0){if(Wt===Y)break;Wt+=xt,Qe-=ve}}return Qt}}class Fe{constructor(){this.decoder=new Me}decode(y,E=null){let F,$;if(E!=null&&E.has(U.PURE_BARCODE)){const Te=Fe.extractPureBits(y.getBlackMatrix());F=this.decoder.decode(Te),$=Fe.NO_POINTS}else{const Te=new qe(y.getBlackMatrix()).detect();F=this.decoder.decode(Te.getBits()),$=Te.getPoints()}const H=F.getRawBytes(),Y=new me(F.getText(),H,8*H.length,$,xe.DATA_MATRIX,w.currentTimeMillis()),le=F.getByteSegments();le!=null&&Y.putMetadata(je.BYTE_SEGMENTS,le);const ve=F.getECLevel();return ve!=null&&Y.putMetadata(je.ERROR_CORRECTION_LEVEL,ve),Y}reset(){}static extractPureBits(y){const E=y.getTopLeftOnBit(),F=y.getBottomRightOnBit();if(E==null||F==null)throw new Q;const $=this.moduleSize(E,y);let H=E[1];const Y=F[1];let le=E[0];const Te=(F[0]-le+1)/$,Qe=(Y-H+1)/$;if(Te<=0||Qe<=0)throw new Q;const xt=$/2;H+=xt,le+=xt;const It=new he(Te,Qe);for(let Qt=0;Qt<Qe;Qt++){const St=H+Qt*$;for(let zt=0;zt<Te;zt++)y.get(le+zt*$,St)&&It.set(zt,Qt)}return It}static moduleSize(y,E){const F=E.getWidth();let $=y[0];const H=y[1];for(;$<F&&E.get($,H);)$++;if($===F)throw new Q;const Y=$-y[0];if(Y===0)throw new Q;return Y}}Fe.NO_POINTS=[];class at extends Ne{constructor(y=500){super(new Fe,y)}}var se;(function(dt){dt[dt.L=0]="L",dt[dt.M=1]="M",dt[dt.Q=2]="Q",dt[dt.H=3]="H"})(se||(se={}));class Ce{constructor(y,E,F){this.value=y,this.stringValue=E,this.bits=F,Ce.FOR_BITS.set(F,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 Ue{constructor(y){this.errorCorrectionLevel=Ce.forBits(y>>3&3),this.dataMask=y&7}static numBitsDiffering(y,E){return I.bitCount(y^E)}static decodeFormatInformation(y,E){const F=Ue.doDecodeFormatInformation(y,E);return F!==null?F:Ue.doDecodeFormatInformation(y^Ue.FORMAT_INFO_MASK_QR,E^Ue.FORMAT_INFO_MASK_QR)}static doDecodeFormatInformation(y,E){let F=Number.MAX_SAFE_INTEGER,$=0;for(const H of Ue.FORMAT_INFO_DECODE_LOOKUP){const Y=H[0];if(Y===y||Y===E)return new Ue(H[1]);let le=Ue.numBitsDiffering(y,Y);le<F&&($=H[1],F=le),y!==E&&(le=Ue.numBitsDiffering(E,Y),le<F&&($=H[1],F=le))}return F<=3?new Ue($):null}getErrorCorrectionLevel(){return this.errorCorrectionLevel}getDataMask(){return this.dataMask}hashCode(){return this.errorCorrectionLevel.getBits()<<3|this.dataMask}equals(y){if(!(y instanceof Ue))return!1;const E=y;return this.errorCorrectionLevel===E.errorCorrectionLevel&&this.dataMask===E.dataMask}}Ue.FORMAT_INFO_MASK_QR=21522,Ue.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 Be{constructor(y,...E){this.ecCodewordsPerBlock=y,this.ecBlocks=E}getECCodewordsPerBlock(){return this.ecCodewordsPerBlock}getNumBlocks(){let y=0;const E=this.ecBlocks;for(const F of E)y+=F.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 rt{constructor(y,E,...F){this.versionNumber=y,this.alignmentPatternCenters=E,this.ecBlocks=F;let $=0;const H=F[0].getECCodewordsPerBlock(),Y=F[0].getECBlocks();for(const le of Y)$+=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 rt.VERSIONS[y-1]}static decodeVersionInformation(y){let E=Number.MAX_SAFE_INTEGER,F=0;for(let $=0;$<rt.VERSION_DECODE_INFO.length;$++){const H=rt.VERSION_DECODE_INFO[$];if(H===y)return rt.getVersionForNumber($+7);const Y=Ue.numBitsDiffering(y,H);Y<E&&(F=$+7,E=Y)}return E<=3?rt.getVersionForNumber(F):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 F=this.alignmentPatternCenters.length;for(let $=0;$<F;$++){const H=this.alignmentPatternCenters[$]-2;for(let Y=0;Y<F;Y++)$===0&&(Y===0||Y===F-1)||$===F-1&&Y===0||E.setRegion(this.alignmentPatternCenters[Y]-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}}rt.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]),rt.VERSIONS=[new rt(1,new Int32Array(0),new Be(7,new _e(1,19)),new Be(10,new _e(1,16)),new Be(13,new _e(1,13)),new Be(17,new _e(1,9))),new rt(2,Int32Array.from([6,18]),new Be(10,new _e(1,34)),new Be(16,new _e(1,28)),new Be(22,new _e(1,22)),new Be(28,new _e(1,16))),new rt(3,Int32Array.from([6,22]),new Be(15,new _e(1,55)),new Be(26,new _e(1,44)),new Be(18,new _e(2,17)),new Be(22,new _e(2,13))),new rt(4,Int32Array.from([6,26]),new Be(20,new _e(1,80)),new Be(18,new _e(2,32)),new Be(26,new _e(2,24)),new Be(16,new _e(4,9))),new rt(5,Int32Array.from([6,30]),new Be(26,new _e(1,108)),new Be(24,new _e(2,43)),new Be(18,new _e(2,15),new _e(2,16)),new Be(22,new _e(2,11),new _e(2,12))),new rt(6,Int32Array.from([6,34]),new Be(18,new _e(2,68)),new Be(16,new _e(4,27)),new Be(24,new _e(4,19)),new Be(28,new _e(4,15))),new rt(7,Int32Array.from([6,22,38]),new Be(20,new _e(2,78)),new Be(18,new _e(4,31)),new Be(18,new _e(2,14),new _e(4,15)),new Be(26,new _e(4,13),new _e(1,14))),new rt(8,Int32Array.from([6,24,42]),new Be(24,new _e(2,97)),new Be(22,new _e(2,38),new _e(2,39)),new Be(22,new _e(4,18),new _e(2,19)),new Be(26,new _e(4,14),new _e(2,15))),new rt(9,Int32Array.from([6,26,46]),new Be(30,new _e(2,116)),new Be(22,new _e(3,36),new _e(2,37)),new Be(20,new _e(4,16),new _e(4,17)),new Be(24,new _e(4,12),new _e(4,13))),new rt(10,Int32Array.from([6,28,50]),new Be(18,new _e(2,68),new _e(2,69)),new Be(26,new _e(4,43),new _e(1,44)),new Be(24,new _e(6,19),new _e(2,20)),new Be(28,new _e(6,15),new _e(2,16))),new rt(11,Int32Array.from([6,30,54]),new Be(20,new _e(4,81)),new Be(30,new _e(1,50),new _e(4,51)),new Be(28,new _e(4,22),new _e(4,23)),new Be(24,new _e(3,12),new _e(8,13))),new rt(12,Int32Array.from([6,32,58]),new Be(24,new _e(2,92),new _e(2,93)),new Be(22,new _e(6,36),new _e(2,37)),new Be(26,new _e(4,20),new _e(6,21)),new Be(28,new _e(7,14),new _e(4,15))),new rt(13,Int32Array.from([6,34,62]),new Be(26,new _e(4,107)),new Be(22,new _e(8,37),new _e(1,38)),new Be(24,new _e(8,20),new _e(4,21)),new Be(22,new _e(12,11),new _e(4,12))),new rt(14,Int32Array.from([6,26,46,66]),new Be(30,new _e(3,115),new _e(1,116)),new Be(24,new _e(4,40),new _e(5,41)),new Be(20,new _e(11,16),new _e(5,17)),new Be(24,new _e(11,12),new _e(5,13))),new rt(15,Int32Array.from([6,26,48,70]),new Be(22,new _e(5,87),new _e(1,88)),new Be(24,new _e(5,41),new _e(5,42)),new Be(30,new _e(5,24),new _e(7,25)),new Be(24,new _e(11,12),new _e(7,13))),new rt(16,Int32Array.from([6,26,50,74]),new Be(24,new _e(5,98),new _e(1,99)),new Be(28,new _e(7,45),new _e(3,46)),new Be(24,new _e(15,19),new _e(2,20)),new Be(30,new _e(3,15),new _e(13,16))),new rt(17,Int32Array.from([6,30,54,78]),new Be(28,new _e(1,107),new _e(5,108)),new Be(28,new _e(10,46),new _e(1,47)),new Be(28,new _e(1,22),new _e(15,23)),new Be(28,new _e(2,14),new _e(17,15))),new rt(18,Int32Array.from([6,30,56,82]),new Be(30,new _e(5,120),new _e(1,121)),new Be(26,new _e(9,43),new _e(4,44)),new Be(28,new _e(17,22),new _e(1,23)),new Be(28,new _e(2,14),new _e(19,15))),new rt(19,Int32Array.from([6,30,58,86]),new Be(28,new _e(3,113),new _e(4,114)),new Be(26,new _e(3,44),new _e(11,45)),new Be(26,new _e(17,21),new _e(4,22)),new Be(26,new _e(9,13),new _e(16,14))),new rt(20,Int32Array.from([6,34,62,90]),new Be(28,new _e(3,107),new _e(5,108)),new Be(26,new _e(3,41),new _e(13,42)),new Be(30,new _e(15,24),new _e(5,25)),new Be(28,new _e(15,15),new _e(10,16))),new rt(21,Int32Array.from([6,28,50,72,94]),new Be(28,new _e(4,116),new _e(4,117)),new Be(26,new _e(17,42)),new Be(28,new _e(17,22),new _e(6,23)),new Be(30,new _e(19,16),new _e(6,17))),new rt(22,Int32Array.from([6,26,50,74,98]),new Be(28,new _e(2,111),new _e(7,112)),new Be(28,new _e(17,46)),new Be(30,new _e(7,24),new _e(16,25)),new Be(24,new _e(34,13))),new rt(23,Int32Array.from([6,30,54,78,102]),new Be(30,new _e(4,121),new _e(5,122)),new Be(28,new _e(4,47),new _e(14,48)),new Be(30,new _e(11,24),new _e(14,25)),new Be(30,new _e(16,15),new _e(14,16))),new rt(24,Int32Array.from([6,28,54,80,106]),new Be(30,new _e(6,117),new _e(4,118)),new Be(28,new _e(6,45),new _e(14,46)),new Be(30,new _e(11,24),new _e(16,25)),new Be(30,new _e(30,16),new _e(2,17))),new rt(25,Int32Array.from([6,32,58,84,110]),new Be(26,new _e(8,106),new _e(4,107)),new Be(28,new _e(8,47),new _e(13,48)),new Be(30,new _e(7,24),new _e(22,25)),new Be(30,new _e(22,15),new _e(13,16))),new rt(26,Int32Array.from([6,30,58,86,114]),new Be(28,new _e(10,114),new _e(2,115)),new Be(28,new _e(19,46),new _e(4,47)),new Be(28,new _e(28,22),new _e(6,23)),new Be(30,new _e(33,16),new _e(4,17))),new rt(27,Int32Array.from([6,34,62,90,118]),new Be(30,new _e(8,122),new _e(4,123)),new Be(28,new _e(22,45),new _e(3,46)),new Be(30,new _e(8,23),new _e(26,24)),new Be(30,new _e(12,15),new _e(28,16))),new rt(28,Int32Array.from([6,26,50,74,98,122]),new Be(30,new _e(3,117),new _e(10,118)),new Be(28,new _e(3,45),new _e(23,46)),new Be(30,new _e(4,24),new _e(31,25)),new Be(30,new _e(11,15),new _e(31,16))),new rt(29,Int32Array.from([6,30,54,78,102,126]),new Be(30,new _e(7,116),new _e(7,117)),new Be(28,new _e(21,45),new _e(7,46)),new Be(30,new _e(1,23),new _e(37,24)),new Be(30,new _e(19,15),new _e(26,16))),new rt(30,Int32Array.from([6,26,52,78,104,130]),new Be(30,new _e(5,115),new _e(10,116)),new Be(28,new _e(19,47),new _e(10,48)),new Be(30,new _e(15,24),new _e(25,25)),new Be(30,new _e(23,15),new _e(25,16))),new rt(31,Int32Array.from([6,30,56,82,108,134]),new Be(30,new _e(13,115),new _e(3,116)),new Be(28,new _e(2,46),new _e(29,47)),new Be(30,new _e(42,24),new _e(1,25)),new Be(30,new _e(23,15),new _e(28,16))),new rt(32,Int32Array.from([6,34,60,86,112,138]),new Be(30,new _e(17,115)),new Be(28,new _e(10,46),new _e(23,47)),new Be(30,new _e(10,24),new _e(35,25)),new Be(30,new _e(19,15),new _e(35,16))),new rt(33,Int32Array.from([6,30,58,86,114,142]),new Be(30,new _e(17,115),new _e(1,116)),new Be(28,new _e(14,46),new _e(21,47)),new Be(30,new _e(29,24),new _e(19,25)),new Be(30,new _e(11,15),new _e(46,16))),new rt(34,Int32Array.from([6,34,62,90,118,146]),new Be(30,new _e(13,115),new _e(6,116)),new Be(28,new _e(14,46),new _e(23,47)),new Be(30,new _e(44,24),new _e(7,25)),new Be(30,new _e(59,16),new _e(1,17))),new rt(35,Int32Array.from([6,30,54,78,102,126,150]),new Be(30,new _e(12,121),new _e(7,122)),new Be(28,new _e(12,47),new _e(26,48)),new Be(30,new _e(39,24),new _e(14,25)),new Be(30,new _e(22,15),new _e(41,16))),new rt(36,Int32Array.from([6,24,50,76,102,128,154]),new Be(30,new _e(6,121),new _e(14,122)),new Be(28,new _e(6,47),new _e(34,48)),new Be(30,new _e(46,24),new _e(10,25)),new Be(30,new _e(2,15),new _e(64,16))),new rt(37,Int32Array.from([6,28,54,80,106,132,158]),new Be(30,new _e(17,122),new _e(4,123)),new Be(28,new _e(29,46),new _e(14,47)),new Be(30,new _e(49,24),new _e(10,25)),new Be(30,new _e(24,15),new _e(46,16))),new rt(38,Int32Array.from([6,32,58,84,110,136,162]),new Be(30,new _e(4,122),new _e(18,123)),new Be(28,new _e(13,46),new _e(32,47)),new Be(30,new _e(48,24),new _e(14,25)),new Be(30,new _e(42,15),new _e(32,16))),new rt(39,Int32Array.from([6,26,54,82,110,138,166]),new Be(30,new _e(20,117),new _e(4,118)),new Be(28,new _e(40,47),new _e(7,48)),new Be(30,new _e(43,24),new _e(22,25)),new Be(30,new _e(10,15),new _e(67,16))),new rt(40,Int32Array.from([6,30,58,86,114,142,170]),new Be(30,new _e(19,118),new _e(6,119)),new Be(28,new _e(18,47),new _e(31,48)),new Be(30,new _e(34,24),new _e(34,25)),new Be(30,new _e(20,15),new _e(61,16)))];var ct;(function(dt){dt[dt.DATA_MASK_000=0]="DATA_MASK_000",dt[dt.DATA_MASK_001=1]="DATA_MASK_001",dt[dt.DATA_MASK_010=2]="DATA_MASK_010",dt[dt.DATA_MASK_011=3]="DATA_MASK_011",dt[dt.DATA_MASK_100=4]="DATA_MASK_100",dt[dt.DATA_MASK_101=5]="DATA_MASK_101",dt[dt.DATA_MASK_110=6]="DATA_MASK_110",dt[dt.DATA_MASK_111=7]="DATA_MASK_111"})(ct||(ct={}));class yt{constructor(y,E){this.value=y,this.isMasked=E}unmaskBitMatrix(y,E){for(let F=0;F<E;F++)for(let $=0;$<E;$++)this.isMasked(F,$)&&y.flip($,F)}}yt.values=new Map([[ct.DATA_MASK_000,new yt(ct.DATA_MASK_000,(dt,y)=>(dt+y&1)===0)],[ct.DATA_MASK_001,new yt(ct.DATA_MASK_001,(dt,y)=>(dt&1)===0)],[ct.DATA_MASK_010,new yt(ct.DATA_MASK_010,(dt,y)=>y%3===0)],[ct.DATA_MASK_011,new yt(ct.DATA_MASK_011,(dt,y)=>(dt+y)%3===0)],[ct.DATA_MASK_100,new yt(ct.DATA_MASK_100,(dt,y)=>(Math.floor(dt/2)+Math.floor(y/3)&1)===0)],[ct.DATA_MASK_101,new yt(ct.DATA_MASK_101,(dt,y)=>dt*y%6===0)],[ct.DATA_MASK_110,new yt(ct.DATA_MASK_110,(dt,y)=>dt*y%6<3)],[ct.DATA_MASK_111,new yt(ct.DATA_MASK_111,(dt,y)=>(dt+y+dt*y%3&1)===0)]]);class Lt{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 F=0;const $=E-7;for(let H=E-1;H>=$;H--)F=this.copyBit(8,H,F);for(let H=E-8;H<E;H++)F=this.copyBit(H,8,F);if(this.parsedFormatInfo=Ue.decodeFormatInformation(y,F),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 rt.getVersionForNumber(E);let F=0;const $=y-11;for(let Y=5;Y>=0;Y--)for(let le=y-9;le>=$;le--)F=this.copyBit(le,Y,F);let H=rt.decodeVersionInformation(F);if(H!==null&&H.getDimensionForVersion()===y)return this.parsedVersion=H,H;F=0;for(let Y=5;Y>=0;Y--)for(let le=y-9;le>=$;le--)F=this.copyBit(Y,le,F);if(H=rt.decodeVersionInformation(F),H!==null&&H.getDimensionForVersion()===y)return this.parsedVersion=H,H;throw new L}copyBit(y,E,F){return(this.isMirror?this.bitMatrix.get(E,y):this.bitMatrix.get(y,E))?F<<1|1:F<<1}readCodewords(){const y=this.readFormatInformation(),E=this.readVersion(),F=yt.values.get(y.getDataMask()),$=this.bitMatrix.getHeight();F.unmaskBitMatrix(this.bitMatrix,$);const H=E.buildFunctionPattern();let Y=!0;const le=new Uint8Array(E.getTotalCodewords());let ve=0,Te=0,Qe=0;for(let xt=$-1;xt>0;xt-=2){xt===6&&xt--;for(let It=0;It<$;It++){const Qt=Y?$-1-It:It;for(let St=0;St<2;St++)H.get(xt-St,Qt)||(Qe++,Te<<=1,this.bitMatrix.get(xt-St,Qt)&&(Te|=1),Qe===8&&(le[ve++]=Te,Qe=0,Te=0))}Y=!Y}if(ve!==E.getTotalCodewords())throw new L;return le}remask(){if(this.parsedFormatInfo===null)return;const y=yt.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,F=y.getWidth();E<F;E++)for(let $=E+1,H=y.getHeight();$<H;$++)y.get(E,$)!==y.get($,E)&&(y.flip($,E),y.flip(E,$))}}class ft{constructor(y,E){this.numDataCodewords=y,this.codewords=E}static getDataBlocks(y,E,F){if(y.length!==E.getTotalCodewords())throw new f;const $=E.getECBlocksForLevel(F);let H=0;const Y=$.getECBlocks();for(const St of Y)H+=St.getCount();const le=new Array(H);let ve=0;for(const St of Y)for(let zt=0;zt<St.getCount();zt++){const Wt=St.getDataCodewords(),jn=$.getECCodewordsPerBlock()+Wt;le[ve++]=new ft(Wt,new Uint8Array(jn))}const Te=le[0].codewords.length;let Qe=le.length-1;for(;Qe>=0&&le[Qe].codewords.length!==Te;)Qe--;Qe++;const xt=Te-$.getECCodewordsPerBlock();let It=0;for(let St=0;St<xt;St++)for(let zt=0;zt<ve;zt++)le[zt].codewords[St]=y[It++];for(let St=Qe;St<ve;St++)le[St].codewords[xt]=y[It++];const Qt=le[0].codewords.length;for(let St=xt;St<Qt;St++)for(let zt=0;zt<ve;zt++){const Wt=zt<Qe?St:St+1;le[zt].codewords[Wt]=y[It++]}return le}getNumDataCodewords(){return this.numDataCodewords}getCodewords(){return this.codewords}}var Tt;(function(dt){dt[dt.TERMINATOR=0]="TERMINATOR",dt[dt.NUMERIC=1]="NUMERIC",dt[dt.ALPHANUMERIC=2]="ALPHANUMERIC",dt[dt.STRUCTURED_APPEND=3]="STRUCTURED_APPEND",dt[dt.BYTE=4]="BYTE",dt[dt.ECI=5]="ECI",dt[dt.KANJI=6]="KANJI",dt[dt.FNC1_FIRST_POSITION=7]="FNC1_FIRST_POSITION",dt[dt.FNC1_SECOND_POSITION=8]="FNC1_SECOND_POSITION",dt[dt.HANZI=9]="HANZI"})(Tt||(Tt={}));class Ge{constructor(y,E,F,$){this.value=y,this.stringValue=E,this.characterCountBitsForVersions=F,this.bits=$,Ge.FOR_BITS.set($,this),Ge.FOR_VALUE.set(y,this)}static forBits(y){const E=Ge.FOR_BITS.get(y);if(E===void 0)throw new f;return E}getCharacterCountBits(y){const E=y.getVersionNumber();let F;return E<=9?F=0:E<=26?F=1:F=2,this.characterCountBitsForVersions[F]}getValue(){return this.value}getBits(){return this.bits}equals(y){if(!(y instanceof Ge))return!1;const E=y;return this.value===E.value}toString(){return this.stringValue}}Ge.FOR_BITS=new Map,Ge.FOR_VALUE=new Map,Ge.TERMINATOR=new Ge(Tt.TERMINATOR,"TERMINATOR",Int32Array.from([0,0,0]),0),Ge.NUMERIC=new Ge(Tt.NUMERIC,"NUMERIC",Int32Array.from([10,12,14]),1),Ge.ALPHANUMERIC=new Ge(Tt.ALPHANUMERIC,"ALPHANUMERIC",Int32Array.from([9,11,13]),2),Ge.STRUCTURED_APPEND=new Ge(Tt.STRUCTURED_APPEND,"STRUCTURED_APPEND",Int32Array.from([0,0,0]),3),Ge.BYTE=new Ge(Tt.BYTE,"BYTE",Int32Array.from([8,16,16]),4),Ge.ECI=new Ge(Tt.ECI,"ECI",Int32Array.from([0,0,0]),7),Ge.KANJI=new Ge(Tt.KANJI,"KANJI",Int32Array.from([8,10,12]),8),Ge.FNC1_FIRST_POSITION=new Ge(Tt.FNC1_FIRST_POSITION,"FNC1_FIRST_POSITION",Int32Array.from([0,0,0]),5),Ge.FNC1_SECOND_POSITION=new Ge(Tt.FNC1_SECOND_POSITION,"FNC1_SECOND_POSITION",Int32Array.from([0,0,0]),9),Ge.HANZI=new Ge(Tt.HANZI,"HANZI",Int32Array.from([8,10,12]),13);class At{static decode(y,E,F,$){const H=new ge(y);let Y=new re;const le=new Array;let ve=-1,Te=-1;try{let Qe=null,xt=!1,It;do{if(H.available()<4)It=Ge.TERMINATOR;else{const Qt=H.readBits(4);It=Ge.forBits(Qt)}switch(It){case Ge.TERMINATOR:break;case Ge.FNC1_FIRST_POSITION:case Ge.FNC1_SECOND_POSITION:xt=!0;break;case Ge.STRUCTURED_APPEND:if(H.available()<16)throw new L;ve=H.readBits(8),Te=H.readBits(8);break;case Ge.ECI:const Qt=At.parseECIValue(H);if(Qe=X.getCharacterSetECIByValue(Qt),Qe===null)throw new L;break;case Ge.HANZI:const St=H.readBits(4),zt=H.readBits(It.getCharacterCountBits(E));St===At.GB2312_SUBSET&&At.decodeHanziSegment(H,Y,zt);break;default:const Wt=H.readBits(It.getCharacterCountBits(E));switch(It){case Ge.NUMERIC:At.decodeNumericSegment(H,Y,Wt);break;case Ge.ALPHANUMERIC:At.decodeAlphanumericSegment(H,Y,Wt,xt);break;case Ge.BYTE:At.decodeByteSegment(H,Y,Wt,Qe,le,$);break;case Ge.KANJI:At.decodeKanjiSegment(H,Y,Wt);break;default:throw new L}break}}while(It!==Ge.TERMINATOR)}catch{throw new L}return new Pe(y,Y.toString(),le.length===0?null:le,F===null?null:F.toString(),ve,Te)}static decodeHanziSegment(y,E,F){if(F*13>y.available())throw new L;const $=new Uint8Array(2*F);let H=0;for(;F>0;){const Y=y.readBits(13);let le=Y/96<<8&4294967295|Y%96;le<959?le+=41377:le+=42657,$[H]=le>>8&255,$[H+1]=le&255,H+=2,F--}try{E.append(J.decode($,K.GB2312))}catch(Y){throw new L(Y)}}static decodeKanjiSegment(y,E,F){if(F*13>y.available())throw new L;const $=new Uint8Array(2*F);let H=0;for(;F>0;){const Y=y.readBits(13);let le=Y/192<<8&4294967295|Y%192;le<7936?le+=33088:le+=49472,$[H]=le>>8,$[H+1]=le,H+=2,F--}try{E.append(J.decode($,K.SHIFT_JIS))}catch(Y){throw new L(Y)}}static decodeByteSegment(y,E,F,$,H,Y){if(8*F>y.available())throw new L;const le=new Uint8Array(F);for(let Te=0;Te<F;Te++)le[Te]=y.readBits(8);let ve;$===null?ve=K.guessEncoding(le,Y):ve=$.getName();try{E.append(J.decode(le,ve))}catch(Te){throw new L(Te)}H.push(le)}static toAlphaNumericChar(y){if(y>=At.ALPHANUMERIC_CHARS.length)throw new L;return At.ALPHANUMERIC_CHARS[y]}static decodeAlphanumericSegment(y,E,F,$){const H=E.length();for(;F>1;){if(y.available()<11)throw new L;const Y=y.readBits(11);E.append(At.toAlphaNumericChar(Math.floor(Y/45))),E.append(At.toAlphaNumericChar(Y%45)),F-=2}if(F===1){if(y.available()<6)throw new L;E.append(At.toAlphaNumericChar(y.readBits(6)))}if($)for(let Y=H;Y<E.length();Y++)E.charAt(Y)==="%"&&(Y<E.length()-1&&E.charAt(Y+1)==="%"?E.deleteCharAt(Y+1):E.setCharAt(Y,""))}static decodeNumericSegment(y,E,F){for(;F>=3;){if(y.available()<10)throw new L;const $=y.readBits(10);if($>=1e3)throw new L;E.append(At.toAlphaNumericChar(Math.floor($/100))),E.append(At.toAlphaNumericChar(Math.floor($/10)%10)),E.append(At.toAlphaNumericChar($%10)),F-=3}if(F===2){if(y.available()<7)throw new L;const $=y.readBits(7);if($>=100)throw new L;E.append(At.toAlphaNumericChar(Math.floor($/10))),E.append(At.toAlphaNumericChar($%10))}else if(F===1){if(y.available()<4)throw new L;const $=y.readBits(4);if($>=10)throw new L;E.append(At.toAlphaNumericChar($))}}static parseECIValue(y){const E=y.readBits(8);if(!(E&128))return E&127;if((E&192)===128){const F=y.readBits(8);return(E&63)<<8&4294967295|F}if((E&224)===192){const F=y.readBits(16);return(E&31)<<16&4294967295|F}throw new L}}At.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",At.GB2312_SUBSET=1;class Ot{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 it{constructor(){this.rsDecoder=new Le(ut.QR_CODE_FIELD_256)}decodeBooleanArray(y,E){return this.decodeBitMatrix(he.parseFromBooleanArray(y),E)}decodeBitMatrix(y,E){const F=new Lt(y);let $=null;try{return this.decodeBitMatrixParser(F,E)}catch(H){$=H}try{F.remask(),F.setMirror(!0),F.readVersion(),F.readFormatInformation(),F.mirror();const H=this.decodeBitMatrixParser(F,E);return H.setOther(new Ot(!0)),H}catch(H){throw $!==null?$:H}}decodeBitMatrixParser(y,E){const F=y.readVersion(),$=y.readFormatInformation().getErrorCorrectionLevel(),H=y.readCodewords(),Y=ft.getDataBlocks(H,F,$);let le=0;for(const Qe of Y)le+=Qe.getNumDataCodewords();const ve=new Uint8Array(le);let Te=0;for(const Qe of Y){const xt=Qe.getCodewords(),It=Qe.getNumDataCodewords();this.correctErrors(xt,It);for(let Qt=0;Qt<It;Qt++)ve[Te++]=xt[Qt]}return At.decode(ve,F,$,E)}correctErrors(y,E){const F=new Int32Array(y);try{this.rsDecoder.decode(F,y.length-E)}catch{throw new g}for(let $=0;$<E;$++)y[$]=F[$]}}class jt extends wt{constructor(y,E,F){super(y,E),this.estimatedModuleSize=F}aboutEquals(y,E,F){if(Math.abs(E-this.getY())<=y&&Math.abs(F-this.getX())<=y){const $=Math.abs(y-this.estimatedModuleSize);return $<=1||$<=this.estimatedModuleSize}return!1}combineEstimate(y,E,F){const $=(this.getX()+E)/2,H=(this.getY()+y)/2,Y=(this.estimatedModuleSize+F)/2;return new jt($,H,Y)}}class Nn{constructor(y,E,F,$,H,Y,le){this.image=y,this.startX=E,this.startY=F,this.width=$,this.height=H,this.moduleSize=Y,this.resultPointCallback=le,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}find(){const y=this.startX,E=this.height,F=this.width,$=y+F,H=this.startY+E/2,Y=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));Y[0]=0,Y[1]=0,Y[2]=0;let Qe=y;for(;Qe<$&&!le.get(Qe,Te);)Qe++;let xt=0;for(;Qe<$;){if(le.get(Qe,Te))if(xt===1)Y[1]++;else if(xt===2){if(this.foundPatternCross(Y)){const It=this.handlePossibleCenter(Y,Te,Qe);if(It!==null)return It}Y[0]=Y[2],Y[1]=1,Y[2]=0,xt=1}else Y[++xt]++;else xt===1&&xt++,Y[xt]++;Qe++}if(this.foundPatternCross(Y)){const It=this.handlePossibleCenter(Y,Te,$);if(It!==null)return It}}if(this.possibleCenters.length!==0)return this.possibleCenters[0];throw new Q}static centerFromEnd(y,E){return E-y[2]-y[1]/2}foundPatternCross(y){const E=this.moduleSize,F=E/2;for(let $=0;$<3;$++)if(Math.abs(E-y[$])>=F)return!1;return!0}crossCheckVertical(y,E,F,$){const H=this.image,Y=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]<=F;)le[1]++,ve--;if(ve<0||le[1]>F)return NaN;for(;ve>=0&&!H.get(E,ve)&&le[0]<=F;)le[0]++,ve--;if(le[0]>F)return NaN;for(ve=y+1;ve<Y&&H.get(E,ve)&&le[1]<=F;)le[1]++,ve++;if(ve===Y||le[1]>F)return NaN;for(;ve<Y&&!H.get(E,ve)&&le[2]<=F;)le[2]++,ve++;if(le[2]>F)return NaN;const Te=le[0]+le[1]+le[2];return 5*Math.abs(Te-$)>=2*$?NaN:this.foundPatternCross(le)?Nn.centerFromEnd(le,ve):NaN}handlePossibleCenter(y,E,F){const $=y[0]+y[1]+y[2],H=Nn.centerFromEnd(y,F),Y=this.crossCheckVertical(E,H,2*y[1],$);if(!isNaN(Y)){const le=(y[0]+y[1]+y[2])/3;for(const Te of this.possibleCenters)if(Te.aboutEquals(le,Y,H))return Te.combineEstimate(Y,H,le);const ve=new jt(H,Y,le);this.possibleCenters.push(ve),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(ve)}return null}}class mn extends wt{constructor(y,E,F,$){super(y,E),this.estimatedModuleSize=F,this.count=$,$===void 0&&(this.count=1)}getEstimatedModuleSize(){return this.estimatedModuleSize}getCount(){return this.count}aboutEquals(y,E,F){if(Math.abs(E-this.getY())<=y&&Math.abs(F-this.getX())<=y){const $=Math.abs(y-this.estimatedModuleSize);return $<=1||$<=this.estimatedModuleSize}return!1}combineEstimate(y,E,F){const $=this.count+1,H=(this.count*this.getX()+E)/$,Y=(this.count*this.getY()+y)/$,le=(this.count*this.estimatedModuleSize+F)/$;return new mn(H,Y,le,$)}}class ir{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 Sn{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,F=y!=null&&y.get(U.PURE_BARCODE)!==void 0,$=this.image,H=$.getHeight(),Y=$.getWidth();let le=Math.floor(3*H/(4*Sn.MAX_MODULES));(le<Sn.MIN_SKIP||E)&&(le=Sn.MIN_SKIP);let ve=!1;const Te=new Int32Array(5);for(let xt=le-1;xt<H&&!ve;xt+=le){Te[0]=0,Te[1]=0,Te[2]=0,Te[3]=0,Te[4]=0;let It=0;for(let Qt=0;Qt<Y;Qt++)if($.get(Qt,xt))(It&1)===1&&It++,Te[It]++;else if(It&1)Te[It]++;else if(It===4)if(Sn.foundPatternCross(Te)){if(this.handlePossibleCenter(Te,xt,Qt,F)===!0)if(le=2,this.hasSkipped===!0)ve=this.haveMultiplyConfirmedCenters();else{const zt=this.findRowSkip();zt>Te[2]&&(xt+=zt-Te[2]-le,Qt=Y-1)}else{Te[0]=Te[2],Te[1]=Te[3],Te[2]=Te[4],Te[3]=1,Te[4]=0,It=3;continue}It=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,It=3;else Te[++It]++;Sn.foundPatternCross(Te)&&this.handlePossibleCenter(Te,xt,Y,F)===!0&&(le=Te[0],this.hasSkipped&&(ve=this.haveMultiplyConfirmedCenters()))}const Qe=this.selectBestPatterns();return wt.orderBestPatterns(Qe),new ir(Qe)}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 Y=y[H];if(Y===0)return!1;E+=Y}if(E<7)return!1;const F=E/7,$=F/2;return Math.abs(F-y[0])<$&&Math.abs(F-y[1])<$&&Math.abs(3*F-y[2])<3*$&&Math.abs(F-y[3])<$&&Math.abs(F-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,F,$){const H=this.getCrossCheckStateCount();let Y=0;const le=this.image;for(;y>=Y&&E>=Y&&le.get(E-Y,y-Y);)H[2]++,Y++;if(y<Y||E<Y)return!1;for(;y>=Y&&E>=Y&&!le.get(E-Y,y-Y)&&H[1]<=F;)H[1]++,Y++;if(y<Y||E<Y||H[1]>F)return!1;for(;y>=Y&&E>=Y&&le.get(E-Y,y-Y)&&H[0]<=F;)H[0]++,Y++;if(H[0]>F)return!1;const ve=le.getHeight(),Te=le.getWidth();for(Y=1;y+Y<ve&&E+Y<Te&&le.get(E+Y,y+Y);)H[2]++,Y++;if(y+Y>=ve||E+Y>=Te)return!1;for(;y+Y<ve&&E+Y<Te&&!le.get(E+Y,y+Y)&&H[3]<F;)H[3]++,Y++;if(y+Y>=ve||E+Y>=Te||H[3]>=F)return!1;for(;y+Y<ve&&E+Y<Te&&le.get(E+Y,y+Y)&&H[4]<F;)H[4]++,Y++;if(H[4]>=F)return!1;const Qe=H[0]+H[1]+H[2]+H[3]+H[4];return Math.abs(Qe-$)<2*$&&Sn.foundPatternCross(H)}crossCheckVertical(y,E,F,$){const H=this.image,Y=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]<=F;)le[1]++,ve--;if(ve<0||le[1]>F)return NaN;for(;ve>=0&&H.get(E,ve)&&le[0]<=F;)le[0]++,ve--;if(le[0]>F)return NaN;for(ve=y+1;ve<Y&&H.get(E,ve);)le[2]++,ve++;if(ve===Y)return NaN;for(;ve<Y&&!H.get(E,ve)&&le[3]<F;)le[3]++,ve++;if(ve===Y||le[3]>=F)return NaN;for(;ve<Y&&H.get(E,ve)&&le[4]<F;)le[4]++,ve++;if(le[4]>=F)return NaN;const Te=le[0]+le[1]+le[2]+le[3]+le[4];return 5*Math.abs(Te-$)>=2*$?NaN:Sn.foundPatternCross(le)?Sn.centerFromEnd(le,ve):NaN}crossCheckHorizontal(y,E,F,$){const H=this.image,Y=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]<=F;)le[1]++,ve--;if(ve<0||le[1]>F)return NaN;for(;ve>=0&&H.get(ve,E)&&le[0]<=F;)le[0]++,ve--;if(le[0]>F)return NaN;for(ve=y+1;ve<Y&&H.get(ve,E);)le[2]++,ve++;if(ve===Y)return NaN;for(;ve<Y&&!H.get(ve,E)&&le[3]<F;)le[3]++,ve++;if(ve===Y||le[3]>=F)return NaN;for(;ve<Y&&H.get(ve,E)&&le[4]<F;)le[4]++,ve++;if(le[4]>=F)return NaN;const Te=le[0]+le[1]+le[2]+le[3]+le[4];return 5*Math.abs(Te-$)>=$?NaN:Sn.foundPatternCross(le)?Sn.centerFromEnd(le,ve):NaN}handlePossibleCenter(y,E,F,$){const H=y[0]+y[1]+y[2]+y[3]+y[4];let Y=Sn.centerFromEnd(y,F),le=this.crossCheckVertical(E,Math.floor(Y),y[2],H);if(!isNaN(le)&&(Y=this.crossCheckHorizontal(Math.floor(Y),Math.floor(le),y[2],H),!isNaN(Y)&&(!$||this.crossCheckDiagonal(Math.floor(le),Math.floor(Y),y[2],H)))){const ve=H/7;let Te=!1;const Qe=this.possibleCenters;for(let xt=0,It=Qe.length;xt<It;xt++){const Qt=Qe[xt];if(Qt.aboutEquals(ve,le,Y)){Qe[xt]=Qt.combineEstimate(le,Y,ve),Te=!0;break}}if(!Te){const xt=new mn(Y,le,ve);Qe.push(xt),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(xt)}return!0}return!1}findRowSkip(){if(this.possibleCenters.length<=1)return 0;let E=null;for(const F of this.possibleCenters)if(F.getCount()>=Sn.CENTER_QUORUM)if(E==null)E=F;else return this.hasSkipped=!0,Math.floor((Math.abs(E.getX()-F.getX())-Math.abs(E.getY()-F.getY()))/2);return 0}haveMultiplyConfirmedCenters(){let y=0,E=0;const F=this.possibleCenters.length;for(const Y of this.possibleCenters)Y.getCount()>=Sn.CENTER_QUORUM&&(y++,E+=Y.getEstimatedModuleSize());if(y<3)return!1;const $=E/F;let H=0;for(const Y of this.possibleCenters)H+=Math.abs(Y.getEstimatedModuleSize()-$);return H<=.05*E}selectBestPatterns(){const y=this.possibleCenters.length;if(y<3)throw new Q;const E=this.possibleCenters;let F;if(y>3){let $=0,H=0;for(const ve of this.possibleCenters){const Te=ve.getEstimatedModuleSize();$+=Te,H+=Te*Te}F=$/y;let Y=Math.sqrt(H/y-F*F);E.sort((ve,Te)=>{const Qe=Math.abs(Te.getEstimatedModuleSize()-F),xt=Math.abs(ve.getEstimatedModuleSize()-F);return Qe<xt?-1:Qe>xt?1:0});const le=Math.max(.2*F,Y);for(let ve=0;ve<E.length&&E.length>3;ve++){const Te=E[ve];Math.abs(Te.getEstimatedModuleSize()-F)>le&&(E.splice(ve,1),ve--)}}if(E.length>3){let $=0;for(const H of E)$+=H.getEstimatedModuleSize();F=$/E.length,E.sort((H,Y)=>{if(Y.getCount()===H.getCount()){const le=Math.abs(Y.getEstimatedModuleSize()-F),ve=Math.abs(H.getEstimatedModuleSize()-F);return le<ve?1:le>ve?-1:0}else return Y.getCount()-H.getCount()}),E.splice(3)}return[E[0],E[1],E[2]]}}Sn.CENTER_QUORUM=2,Sn.MIN_SKIP=3,Sn.MAX_MODULES=57;class Bn{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 F=new Sn(this.image,this.resultPointCallback).find(y);return this.processFinderPatternInfo(F)}processFinderPatternInfo(y){const E=y.getTopLeft(),F=y.getTopRight(),$=y.getBottomLeft(),H=this.calculateModuleSize(E,F,$);if(H<1)throw new Q("No pattern found in proccess finder.");const Y=Bn.computeDimension(E,F,$,H),le=rt.getProvisionalVersionForDimension(Y),ve=le.getDimensionForVersion()-7;let Te=null;if(le.getAlignmentPatternCenters().length>0){const Qt=F.getX()-E.getX()+$.getX(),St=F.getY()-E.getY()+$.getY(),zt=1-3/ve,Wt=Math.floor(E.getX()+zt*(Qt-E.getX())),jn=Math.floor(E.getY()+zt*(St-E.getY()));for(let mr=4;mr<=16;mr<<=1)try{Te=this.findAlignmentInRegion(H,Wt,jn,mr);break}catch(Sr){if(!(Sr instanceof Q))throw Sr}}const Qe=Bn.createTransform(E,F,$,Te,Y),xt=Bn.sampleGrid(this.image,Qe,Y);let It;return Te===null?It=[$,E,F]:It=[$,E,F,Te],new nn(xt,It)}static createTransform(y,E,F,$,H){const Y=H-3.5;let le,ve,Te,Qe;return $!==null?(le=$.getX(),ve=$.getY(),Te=Y-3,Qe=Te):(le=E.getX()-y.getX()+F.getX(),ve=E.getY()-y.getY()+F.getY(),Te=Y,Qe=Y),on.quadrilateralToQuadrilateral(3.5,3.5,Y,3.5,Te,Qe,3.5,Y,y.getX(),y.getY(),E.getX(),E.getY(),le,ve,F.getX(),F.getY())}static sampleGrid(y,E,F){return Ye.getInstance().sampleGridWithTransform(y,F,F,E)}static computeDimension(y,E,F,$){const H=pt.round(wt.distance(y,E)/$),Y=pt.round(wt.distance(y,F)/$);let le=Math.floor((H+Y)/2)+7;switch(le&3){case 0:le++;break;case 2:le--;break;case 3:throw new Q("Dimensions could be not found.")}return le}calculateModuleSize(y,E,F){return(this.calculateModuleSizeOneWay(y,E)+this.calculateModuleSizeOneWay(y,F))/2}calculateModuleSizeOneWay(y,E){const F=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(F)?$/7:isNaN($)?F/7:(F+$)/14}sizeOfBlackWhiteBlackRunBothWays(y,E,F,$){let H=this.sizeOfBlackWhiteBlackRun(y,E,F,$),Y=1,le=y-(F-y);le<0?(Y=y/(y-le),le=0):le>=this.image.getWidth()&&(Y=(this.image.getWidth()-1-y)/(le-y),le=this.image.getWidth()-1);let ve=Math.floor(E-($-E)*Y);return Y=1,ve<0?(Y=E/(E-ve),ve=0):ve>=this.image.getHeight()&&(Y=(this.image.getHeight()-1-E)/(ve-E),ve=this.image.getHeight()-1),le=Math.floor(y+(le-y)*Y),H+=this.sizeOfBlackWhiteBlackRun(y,E,le,ve),H-1}sizeOfBlackWhiteBlackRun(y,E,F,$){const H=Math.abs($-E)>Math.abs(F-y);if(H){let Qt=y;y=E,E=Qt,Qt=F,F=$,$=Qt}const Y=Math.abs(F-y),le=Math.abs($-E);let ve=-Y/2;const Te=y<F?1:-1,Qe=E<$?1:-1;let xt=0;const It=F+Te;for(let Qt=y,St=E;Qt!==It;Qt+=Te){const zt=H?St:Qt,Wt=H?Qt:St;if(xt===1===this.image.get(zt,Wt)){if(xt===2)return pt.distance(Qt,St,y,E);xt++}if(ve+=le,ve>0){if(St===$)break;St+=Qe,ve-=Y}}return xt===2?pt.distance(F+Te,$,y,E):NaN}findAlignmentInRegion(y,E,F,$){const H=Math.floor($*y),Y=Math.max(0,E-H),le=Math.min(this.image.getWidth()-1,E+H);if(le-Y<y*3)throw new Q("Alignment top exceeds estimated module size.");const ve=Math.max(0,F-H),Te=Math.min(this.image.getHeight()-1,F+H);if(Te-ve<y*3)throw new Q("Alignment bottom exceeds estimated module size.");return new Nn(this.image,Y,ve,le-Y,Te-ve,y,this.resultPointCallback).find()}}class rr{constructor(){this.decoder=new it}getDecoder(){return this.decoder}decode(y,E){let F,$;if(E!=null&&E.get(U.PURE_BARCODE)!==void 0){const ve=rr.extractPureBits(y.getBlackMatrix());F=this.decoder.decodeBitMatrix(ve,E),$=rr.NO_POINTS}else{const ve=new Bn(y.getBlackMatrix()).detect(E);F=this.decoder.decodeBitMatrix(ve.getBits(),E),$=ve.getPoints()}F.getOther()instanceof Ot&&F.getOther().applyMirroredCorrection($);const H=new me(F.getText(),F.getRawBytes(),void 0,$,xe.QR_CODE,void 0),Y=F.getByteSegments();Y!==null&&H.putMetadata(je.BYTE_SEGMENTS,Y);const le=F.getECLevel();return le!==null&&H.putMetadata(je.ERROR_CORRECTION_LEVEL,le),F.hasStructuredAppend()&&(H.putMetadata(je.STRUCTURED_APPEND_SEQUENCE,F.getStructuredAppendSequenceNumber()),H.putMetadata(je.STRUCTURED_APPEND_PARITY,F.getStructuredAppendParity())),H}reset(){}static extractPureBits(y){const E=y.getTopLeftOnBit(),F=y.getBottomRightOnBit();if(E===null||F===null)throw new Q;const $=this.moduleSize(E,y);let H=E[1],Y=F[1],le=E[0],ve=F[0];if(le>=ve||H>=Y)throw new Q;if(Y-H!==ve-le&&(ve=le+(Y-H),ve>=y.getWidth()))throw new Q;const Te=Math.round((ve-le+1)/$),Qe=Math.round((Y-H+1)/$);if(Te<=0||Qe<=0)throw new Q;if(Qe!==Te)throw new Q;const xt=Math.floor($/2);H+=xt,le+=xt;const It=le+Math.floor((Te-1)*$)-ve;if(It>0){if(It>xt)throw new Q;le-=It}const Qt=H+Math.floor((Qe-1)*$)-Y;if(Qt>0){if(Qt>xt)throw new Q;H-=Qt}const St=new he(Te,Qe);for(let zt=0;zt<Qe;zt++){const Wt=H+Math.floor(zt*$);for(let jn=0;jn<Te;jn++)y.get(le+Math.floor(jn*$),Wt)&&St.set(jn,zt)}return St}static moduleSize(y,E){const F=E.getHeight(),$=E.getWidth();let H=y[0],Y=y[1],le=!0,ve=0;for(;H<$&&Y<F;){if(le!==E.get(H,Y)){if(++ve===5)break;le=!le}H++,Y++}if(H===$||Y===F)throw new Q;return(H-y[0])/7}}rr.NO_POINTS=new Array;class ur{PDF417Common(){}static getBitCountSum(y){return pt.sum(y)}static toIntArray(y){if(y==null||!y.length)return ur.EMPTY_INT_ARRAY;const E=new Int32Array(y.length);let F=0;for(const $ of y)E[F++]=$;return E}static getCodeword(y){const E=P.binarySearch(ur.SYMBOL_TABLE,y&262143);return E<0?-1:(ur.CODEWORD_TABLE[E]-1)%ur.NUMBER_OF_CODEWORDS}}ur.NUMBER_OF_CODEWORDS=929,ur.MAX_CODEWORDS_IN_BARCODE=ur.NUMBER_OF_CODEWORDS-1,ur.MIN_ROWS_IN_BARCODE=3,ur.MAX_ROWS_IN_BARCODE=90,ur.MODULES_IN_CODEWORD=17,ur.MODULES_IN_STOP_PATTERN=18,ur.BARS_IN_MODULE=8,ur.EMPTY_INT_ARRAY=new Int32Array([]),ur.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]),ur.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 _r{constructor(y,E){this.bits=y,this.points=E}getBits(){return this.bits}getPoints(){return this.points}}class Un{static detectMultiple(y,E,F){let $=y.getBlackMatrix(),H=Un.detect(F,$);return H.length||($=$.clone(),$.rotate180(),H=Un.detect(F,$)),new _r($,H)}static detect(y,E){const F=new Array;let $=0,H=0,Y=!1;for(;$<E.getHeight();){const le=Un.findVertices(E,$,H);if(le[0]==null&&le[3]==null){if(!Y)break;Y=!1,H=0;for(const ve of F)ve[1]!=null&&($=Math.trunc(Math.max($,ve[1].getY()))),ve[3]!=null&&($=Math.max($,Math.trunc(ve[3].getY())));$+=Un.ROW_STEP;continue}if(Y=!0,F.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 F}static findVertices(y,E,F){const $=y.getHeight(),H=y.getWidth(),Y=new Array(8);return Un.copyToResult(Y,Un.findRowsWithPattern(y,$,H,E,F,Un.START_PATTERN),Un.INDEXES_START_PATTERN),Y[4]!=null&&(F=Math.trunc(Y[4].getX()),E=Math.trunc(Y[4].getY())),Un.copyToResult(Y,Un.findRowsWithPattern(y,$,H,E,F,Un.STOP_PATTERN),Un.INDEXES_STOP_PATTERN),Y}static copyToResult(y,E,F){for(let $=0;$<F.length;$++)y[F[$]]=E[$]}static findRowsWithPattern(y,E,F,$,H,Y){const le=new Array(4);let ve=!1;const Te=new Int32Array(Y.length);for(;$<E;$+=Un.ROW_STEP){let xt=Un.findGuardPattern(y,H,$,F,!1,Y,Te);if(xt!=null){for(;$>0;){const It=Un.findGuardPattern(y,H,--$,F,!1,Y,Te);if(It!=null)xt=It;else{$++;break}}le[0]=new wt(xt[0],$),le[1]=new wt(xt[1],$),ve=!0;break}}let Qe=$+1;if(ve){let xt=0,It=Int32Array.from([Math.trunc(le[0].getX()),Math.trunc(le[1].getX())]);for(;Qe<E;Qe++){const Qt=Un.findGuardPattern(y,It[0],Qe,F,!1,Y,Te);if(Qt!=null&&Math.abs(It[0]-Qt[0])<Un.MAX_PATTERN_DRIFT&&Math.abs(It[1]-Qt[1])<Un.MAX_PATTERN_DRIFT)It=Qt,xt=0;else{if(xt>Un.SKIPPED_ROW_COUNT_MAX)break;xt++}}Qe-=xt+1,le[2]=new wt(It[0],Qe),le[3]=new wt(It[1],Qe)}return Qe-$<Un.BARCODE_MIN_HEIGHT&&P.fill(le,null),le}static findGuardPattern(y,E,F,$,H,Y,le){P.fillWithin(le,0,le.length,0);let ve=E,Te=0;for(;y.get(ve,F)&&ve>0&&Te++<Un.MAX_PIXEL_DRIFT;)ve--;let Qe=ve,xt=0,It=Y.length;for(let Qt=H;Qe<$;Qe++)if(y.get(Qe,F)!==Qt)le[xt]++;else{if(xt===It-1){if(Un.patternMatchVariance(le,Y,Un.MAX_INDIVIDUAL_VARIANCE)<Un.MAX_AVG_VARIANCE)return new Int32Array([ve,Qe]);ve+=le[0]+le[1],w.arraycopy(le,2,le,0,xt-1),le[xt-1]=0,le[xt]=0,xt--}else xt++;le[xt]=1,Qt=!Qt}return xt===It-1&&Un.patternMatchVariance(le,Y,Un.MAX_INDIVIDUAL_VARIANCE)<Un.MAX_AVG_VARIANCE?new Int32Array([ve,Qe-1]):null}static patternMatchVariance(y,E,F){let $=y.length,H=0,Y=0;for(let Te=0;Te<$;Te++)H+=y[Te],Y+=E[Te];if(H<Y)return 1/0;let le=H/Y;F*=le;let ve=0;for(let Te=0;Te<$;Te++){let Qe=y[Te],xt=E[Te]*le,It=Qe>xt?Qe-xt:xt-Qe;if(It>F)return 1/0;ve+=It}return ve/H}}Un.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),Un.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),Un.MAX_AVG_VARIANCE=.42,Un.MAX_INDIVIDUAL_VARIANCE=.8,Un.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),Un.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),Un.MAX_PIXEL_DRIFT=3,Un.MAX_PATTERN_DRIFT=5,Un.SKIPPED_ROW_COUNT_MAX=25,Un.ROW_STEP=5,Un.BARCODE_MIN_HEIGHT=10;class Ln{constructor(y,E){if(E.length===0)throw new f;this.field=y;let F=E.length;if(F>1&&E[0]===0){let $=1;for(;$<F&&E[$]===0;)$++;$===F?this.coefficients=new Int32Array([0]):(this.coefficients=new Int32Array(F-$),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],F=this.coefficients.length;for(let $=1;$<F;$++)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,F=y.coefficients;if(E.length>F.length){let Y=E;E=F,F=Y}let $=new Int32Array(F.length),H=F.length-E.length;w.arraycopy(F,0,$,0,H);for(let Y=H;Y<F.length;Y++)$[Y]=this.field.add(E[Y-H],F[Y]);return new Ln(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 Ln?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 Ln(this.field,new Int32Array([0]));let E=this.coefficients,F=E.length,$=y.coefficients,H=$.length,Y=new Int32Array(F+H-1);for(let le=0;le<F;le++){let ve=E[le];for(let Te=0;Te<H;Te++)Y[le+Te]=this.field.add(Y[le+Te],this.field.multiply(ve,$[Te]))}return new Ln(this.field,Y)}negative(){let y=this.coefficients.length,E=new Int32Array(y);for(let F=0;F<y;F++)E[F]=this.field.subtract(0,this.coefficients[F]);return new Ln(this.field,E)}multiplyScalar(y){if(y===0)return new Ln(this.field,new Int32Array([0]));if(y===1)return this;let E=this.coefficients.length,F=new Int32Array(E);for(let $=0;$<E;$++)F[$]=this.field.multiply(this.coefficients[$],y);return new Ln(this.field,F)}multiplyByMonomial(y,E){if(y<0)throw new f;if(E===0)return new Ln(this.field,new Int32Array([0]));let F=this.coefficients.length,$=new Int32Array(F+y);for(let H=0;H<F;H++)$[H]=this.field.multiply(this.coefficients[H],E);return new Ln(this.field,$)}toString(){let y=new re;for(let E=this.getDegree();E>=0;E--){let F=this.getCoefficient(E);F!==0&&(F<0?(y.append(" - "),F=-F):y.length()>0&&y.append(" + "),(E===0||F!==1)&&y.append(F),E!==0&&(E===1?y.append("x"):(y.append("x^"),y.append(E))))}return y.toString()}}class Kn{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 Ke;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 Yr extends Kn{constructor(y,E){super(),this.modulus=y,this.expTable=new Int32Array(y),this.logTable=new Int32Array(y);let F=1;for(let $=0;$<y;$++)this.expTable[$]=F,F=F*E%y;for(let $=0;$<y-1;$++)this.logTable[this.expTable[$]]=$;this.zero=new Ln(this,new Int32Array([0])),this.one=new Ln(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 F=new Int32Array(y+1);return F[0]=E,new Ln(this,F)}}Yr.PDF417_GF=new Yr(ur.NUMBER_OF_CODEWORDS,3);class os{constructor(){this.field=Yr.PDF417_GF}decode(y,E,F){let $=new Ln(this.field,y),H=new Int32Array(E),Y=!1;for(let St=E;St>0;St--){let zt=$.evaluateAt(this.field.exp(St));H[E-St]=zt,zt!==0&&(Y=!0)}if(!Y)return 0;let le=this.field.getOne();if(F!=null)for(const St of F){let zt=this.field.exp(y.length-1-St),Wt=new Ln(this.field,new Int32Array([this.field.subtract(0,zt),1]));le=le.multiply(Wt)}let ve=new Ln(this.field,H),Te=this.runEuclideanAlgorithm(this.field.buildMonomial(E,1),ve,E),Qe=Te[0],xt=Te[1],It=this.findErrorLocations(Qe),Qt=this.findErrorMagnitudes(xt,Qe,It);for(let St=0;St<It.length;St++){let zt=y.length-1-this.field.log(It[St]);if(zt<0)throw g.getChecksumInstance();y[zt]=this.field.subtract(y[zt],Qt[St])}return It.length}runEuclideanAlgorithm(y,E,F){if(y.getDegree()<E.getDegree()){let It=y;y=E,E=It}let $=y,H=E,Y=this.field.getZero(),le=this.field.getOne();for(;H.getDegree()>=Math.round(F/2);){let It=$,Qt=Y;if($=H,Y=le,$.isZero())throw g.getChecksumInstance();H=It;let St=this.field.getZero(),zt=$.getCoefficient($.getDegree()),Wt=this.field.inverse(zt);for(;H.getDegree()>=$.getDegree()&&!H.isZero();){let jn=H.getDegree()-$.getDegree(),mr=this.field.multiply(H.getCoefficient(H.getDegree()),Wt);St=St.add(this.field.buildMonomial(jn,mr)),H=H.subtract($.multiplyByMonomial(jn,mr))}le=St.multiply(Y).subtract(Qt).negative()}let ve=le.getCoefficient(0);if(ve===0)throw g.getChecksumInstance();let Te=this.field.inverse(ve),Qe=le.multiply(Te),xt=H.multiply(Te);return[Qe,xt]}findErrorLocations(y){let E=y.getDegree(),F=new Int32Array(E),$=0;for(let H=1;H<this.field.getSize()&&$<E;H++)y.evaluateAt(H)===0&&(F[$]=this.field.inverse(H),$++);if($!==E)throw g.getChecksumInstance();return F}findErrorMagnitudes(y,E,F){let $=E.getDegree(),H=new Int32Array($);for(let Te=1;Te<=$;Te++)H[$-Te]=this.field.multiply(Te,E.getCoefficient(Te));let Y=new Ln(this.field,H),le=F.length,ve=new Int32Array(le);for(let Te=0;Te<le;Te++){let Qe=this.field.inverse(F[Te]),xt=this.field.subtract(0,y.evaluateAt(Qe)),It=this.field.inverse(Y.evaluateAt(Qe));ve[Te]=this.field.multiply(xt,It)}return ve}}class ds{constructor(y,E,F,$,H){y instanceof ds?this.constructor_2(y):this.constructor_1(y,E,F,$,H)}constructor_1(y,E,F,$,H){const Y=E==null||F==null,le=$==null||H==null;if(Y&&le)throw new Q;Y?(E=new wt(0,$.getY()),F=new wt(0,H.getY())):le&&($=new wt(y.getWidth()-1,E.getY()),H=new wt(y.getWidth()-1,F.getY())),this.image=y,this.topLeft=E,this.bottomLeft=F,this.topRight=$,this.bottomRight=H,this.minX=Math.trunc(Math.min(E.getX(),F.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(F.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 ds(y.image,y.topLeft,y.bottomLeft,E.topRight,E.bottomRight)}addMissingRows(y,E,F){let $=this.topLeft,H=this.bottomLeft,Y=this.topRight,le=this.bottomRight;if(y>0){let ve=F?this.topLeft:this.topRight,Te=Math.trunc(ve.getY()-y);Te<0&&(Te=0);let Qe=new wt(ve.getX(),Te);F?$=Qe:Y=Qe}if(E>0){let ve=F?this.bottomLeft:this.bottomRight,Te=Math.trunc(ve.getY()+E);Te>=this.image.getHeight()&&(Te=this.image.getHeight()-1);let Qe=new wt(ve.getX(),Te);F?H=Qe:le=Qe}return new ds(this.image,$,H,Y,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 Je{constructor(y,E,F,$){this.columnCount=y,this.errorCorrectionLevel=$,this.rowCountUpperPart=E,this.rowCountLowerPart=F,this.rowCount=E+F}getColumnCount(){return this.columnCount}getErrorCorrectionLevel(){return this.errorCorrectionLevel}getRowCount(){return this.rowCount}getRowCountUpperPart(){return this.rowCountUpperPart}getRowCountLowerPart(){return this.rowCountLowerPart}}class bt{constructor(){this.buffer=""}static form(y,E){let F=-1;function $(Y,le,ve,Te,Qe,xt){if(Y==="%%")return"%";if(E[++F]===void 0)return;Y=Te?parseInt(Te.substr(1)):void 0;let It=Qe?parseInt(Qe.substr(1)):void 0,Qt;switch(xt){case"s":Qt=E[F];break;case"c":Qt=E[F][0];break;case"f":Qt=parseFloat(E[F]).toFixed(Y);break;case"p":Qt=parseFloat(E[F]).toPrecision(Y);break;case"e":Qt=parseFloat(E[F]).toExponential(Y);break;case"x":Qt=parseInt(E[F]).toString(It||16);break;case"d":Qt=parseFloat(parseInt(E[F],It||10).toPrecision(Y)).toFixed(0);break}Qt=typeof Qt=="object"?JSON.stringify(Qt):(+Qt).toString(It);let St=parseInt(ve),zt=ve&&ve[0]+""=="0"?"0":" ";for(;Qt.length<St;)Qt=le!==void 0?Qt+zt:zt+Qt;return Qt}let H=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return y.replace(H,$)}format(y,...E){this.buffer+=bt.form(y,E)}toString(){return this.buffer}}class Tn{constructor(y){this.boundingBox=new ds(y),this.codewords=new Array(y.getMaxY()-y.getMinY()+1)}getCodewordNearby(y){let E=this.getCodeword(y);if(E!=null)return E;for(let F=1;F<Tn.MAX_NEARBY_DISTANCE;F++){let $=this.imageRowToCodewordIndex(y)-F;if($>=0&&(E=this.codewords[$],E!=null)||($=this.imageRowToCodewordIndex(y)+F,$<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 bt;let E=0;for(const F of this.codewords){if(F==null){y.format("%3d:    |   %n",E++);continue}y.format("%3d: %3d|%3d%n",E++,F.getRowNumber(),F.getValue())}return y.toString()}}Tn.MAX_NEARBY_DISTANCE=5;class er{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[F,$]of this.values.entries()){const H={getKey:()=>F,getValue:()=>$};H.getValue()>y?(y=H.getValue(),E=[],E.push(H.getKey())):H.getValue()===y&&E.push(H.getKey())}return ur.toIntArray(E)}getConfidence(y){return this.values.get(y)}}class kr extends Tn{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 F=this.getBoundingBox(),$=this._isLeft?F.getTopLeft():F.getTopRight(),H=this._isLeft?F.getBottomLeft():F.getBottomRight(),Y=this.imageRowToCodewordIndex(Math.trunc($.getY())),le=this.imageRowToCodewordIndex(Math.trunc(H.getY())),ve=-1,Te=1,Qe=0;for(let xt=Y;xt<le;xt++){if(E[xt]==null)continue;let It=E[xt],Qt=It.getRowNumber()-ve;if(Qt===0)Qe++;else if(Qt===1)Te=Math.max(Te,Qe),Qe=1,ve=It.getRowNumber();else if(Qt<0||It.getRowNumber()>=y.getRowCount()||Qt>xt)E[xt]=null;else{let St;Te>2?St=(Te-2)*Qt:St=Qt;let zt=St>=xt;for(let Wt=1;Wt<=St&&!zt;Wt++)zt=E[xt-Wt]!=null;zt?E[xt]=null:(ve=It.getRowNumber(),Qe=1)}}}getRowHeights(){let y=this.getBarcodeMetadata();if(y==null)return null;this.adjustIncompleteIndicatorColumnRowNumbers(y);let E=new Int32Array(y.getRowCount());for(let F of this.getCodewords())if(F!=null){let $=F.getRowNumber();if($>=E.length)continue;E[$]++}return E}adjustIncompleteIndicatorColumnRowNumbers(y){let E=this.getBoundingBox(),F=this._isLeft?E.getTopLeft():E.getTopRight(),$=this._isLeft?E.getBottomLeft():E.getBottomRight(),H=this.imageRowToCodewordIndex(Math.trunc(F.getY())),Y=this.imageRowToCodewordIndex(Math.trunc($.getY())),le=this.getCodewords(),ve=-1;for(let Te=H;Te<Y;Te++){if(le[Te]==null)continue;let Qe=le[Te];Qe.setRowNumberAsRowIndicatorColumn();let xt=Qe.getRowNumber()-ve;xt===0||(xt===1?ve=Qe.getRowNumber():Qe.getRowNumber()>=y.getRowCount()?le[Te]=null:ve=Qe.getRowNumber())}}getBarcodeMetadata(){let y=this.getCodewords(),E=new er,F=new er,$=new er,H=new er;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:F.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||F.getValue().length===0||$.getValue().length===0||H.getValue().length===0||E.getValue()[0]<1||F.getValue()[0]+$.getValue()[0]<ur.MIN_ROWS_IN_BARCODE||F.getValue()[0]+$.getValue()[0]>ur.MAX_ROWS_IN_BARCODE)return null;let Y=new Je(E.getValue()[0],F.getValue()[0],$.getValue()[0],H.getValue()[0]);return this.removeIncorrectCodewords(y,Y),Y}removeIncorrectCodewords(y,E){for(let F=0;F<y.length;F++){let $=y[F];if(y[F]==null)continue;let H=$.getValue()%30,Y=$.getRowNumber();if(Y>E.getRowCount()){y[F]=null;continue}switch(this._isLeft||(Y+=2),Y%3){case 0:H*3+1!==E.getRowCountUpperPart()&&(y[F]=null);break;case 1:(Math.trunc(H/3)!==E.getErrorCorrectionLevel()||H%3!==E.getRowCountLowerPart())&&(y[F]=null);break;case 2:H+1!==E.getColumnCount()&&(y[F]=null);break}}}isLeft(){return this._isLeft}toString(){return"IsLeft: "+this._isLeft+`
`+super.toString()}}class Dr{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=ur.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 F=this.detectionResultColumns[E].getCodewords();for(let $=0;$<F.length;$++)F[$]!=null&&(F[$].hasValidRowNumber()||this.adjustRowNumbers(E,$,F))}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 F=0;F<y.length;F++)if(y[F]!=null&&E[F]!=null&&y[F].getRowNumber()===E[F].getRowNumber())for(let $=1;$<=this.barcodeColumnCount;$++){let H=this.detectionResultColumns[$].getCodewords()[F];H!=null&&(H.setRowNumber(y[F].getRowNumber()),H.hasValidRowNumber()||(this.detectionResultColumns[$].getCodewords()[F]=null))}}adjustRowNumbersFromRRI(){if(this.detectionResultColumns[this.barcodeColumnCount+1]==null)return 0;let y=0,E=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords();for(let F=0;F<E.length;F++){if(E[F]==null)continue;let $=E[F].getRowNumber(),H=0;for(let Y=this.barcodeColumnCount+1;Y>0&&H<this.ADJUST_ROW_NUMBER_SKIP;Y--){let le=this.detectionResultColumns[Y].getCodewords()[F];le!=null&&(H=Dr.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 F=0;F<E.length;F++){if(E[F]==null)continue;let $=E[F].getRowNumber(),H=0;for(let Y=1;Y<this.barcodeColumnCount+1&&H<this.ADJUST_ROW_NUMBER_SKIP;Y++){let le=this.detectionResultColumns[Y].getCodewords()[F];le!=null&&(H=Dr.adjustRowNumberIfValid($,H,le),le.hasValidRowNumber()||y++)}}return y}static adjustRowNumberIfValid(y,E,F){return F==null||F.hasValidRowNumber()||(F.isValidRowNumber(y)?(F.setRowNumber(y),E=0):++E),E}adjustRowNumbers(y,E,F){if(!this.detectionResultColumns[y-1])return;let $=F[E],H=this.detectionResultColumns[y-1].getCodewords(),Y=H;this.detectionResultColumns[y+1]!=null&&(Y=this.detectionResultColumns[y+1].getCodewords());let le=new Array(14);le[2]=H[E],le[3]=Y[E],E>0&&(le[0]=F[E-1],le[4]=H[E-1],le[5]=Y[E-1]),E>1&&(le[8]=F[E-2],le[10]=H[E-2],le[11]=Y[E-2]),E<F.length-1&&(le[1]=F[E+1],le[6]=H[E+1],le[7]=Y[E+1]),E<F.length-2&&(le[9]=F[E+2],le[12]=H[E+2],le[13]=Y[E+2]);for(let ve of le)if(Dr.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 bt;for(let F=0;F<y.getCodewords().length;F++){E.format("CW %3d:",F);for(let $=0;$<this.barcodeColumnCount+2;$++){if(this.detectionResultColumns[$]==null){E.format("    |   ");continue}let H=this.detectionResultColumns[$].getCodewords()[F];if(H==null){E.format("    |   ");continue}E.format(" %3d|%3d",H.getRowNumber(),H.getValue())}E.format("%n")}return E.toString()}}class Ur{constructor(y,E,F,$){this.rowNumber=Ur.BARCODE_ROW_UNKNOWN,this.startX=Math.trunc(y),this.endX=Math.trunc(E),this.bucket=Math.trunc(F),this.value=Math.trunc($)}hasValidRowNumber(){return this.isValidRowNumber(this.rowNumber)}isValidRowNumber(y){return y!==Ur.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}}Ur.BARCODE_ROW_UNKNOWN=-1;class cr{static initialize(){for(let y=0;y<ur.SYMBOL_TABLE.length;y++){let E=ur.SYMBOL_TABLE[y],F=E&1;for(let $=0;$<ur.BARS_IN_MODULE;$++){let H=0;for(;(E&1)===F;)H+=1,E>>=1;F=E&1,cr.RATIOS_TABLE[y]||(cr.RATIOS_TABLE[y]=new Array(ur.BARS_IN_MODULE)),cr.RATIOS_TABLE[y][ur.BARS_IN_MODULE-$-1]=Math.fround(H/ur.MODULES_IN_CODEWORD)}}this.bSymbolTableReady=!0}static getDecodedValue(y){let E=cr.getDecodedCodewordValue(cr.sampleBitCounts(y));return E!==-1?E:cr.getClosestDecodedValue(y)}static sampleBitCounts(y){let E=pt.sum(y),F=new Int32Array(ur.BARS_IN_MODULE),$=0,H=0;for(let Y=0;Y<ur.MODULES_IN_CODEWORD;Y++){let le=E/(2*ur.MODULES_IN_CODEWORD)+Y*E/ur.MODULES_IN_CODEWORD;H+y[$]<=le&&(H+=y[$],$++),F[$]++}return F}static getDecodedCodewordValue(y){let E=cr.getBitValue(y);return ur.getCodeword(E)===-1?-1:E}static getBitValue(y){let E=0;for(let F=0;F<y.length;F++)for(let $=0;$<y[F];$++)E=E<<1|(F%2===0?1:0);return Math.trunc(E)}static getClosestDecodedValue(y){let E=pt.sum(y),F=new Array(ur.BARS_IN_MODULE);if(E>1)for(let Y=0;Y<F.length;Y++)F[Y]=Math.fround(y[Y]/E);let $=Kt.MAX_VALUE,H=-1;this.bSymbolTableReady||cr.initialize();for(let Y=0;Y<cr.RATIOS_TABLE.length;Y++){let le=0,ve=cr.RATIOS_TABLE[Y];for(let Te=0;Te<ur.BARS_IN_MODULE;Te++){let Qe=Math.fround(ve[Te]-F[Te]);if(le+=Math.fround(Qe*Qe),le>=$)break}le<$&&($=le,H=ur.SYMBOL_TABLE[Y])}return H}}cr.bSymbolTableReady=!1,cr.RATIOS_TABLE=new Array(ur.SYMBOL_TABLE.length).map(dt=>new Array(ur.BARS_IN_MODULE));class Cr{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 ls{static parseLong(y,E=void 0){return parseInt(y,E)}}class yr extends u{}yr.kind="NullPointerException";class Jr{writeBytes(y){this.writeBytesOffset(y,0,y.length)}writeBytesOffset(y,E,F){if(y==null)throw new yr;if(E<0||E>y.length||F<0||E+F>y.length||E+F<0)throw new C;if(F===0)return;for(let $=0;$<F;$++)this.write(y[E+$])}flush(){}close(){}}class Ks extends u{}class Es extends Jr{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 F=this.buf.length<<1;if(F-y<0&&(F=y),F<0){if(y<0)throw new Ks;F=I.MAX_VALUE}this.buf=P.copyOfUint8Array(this.buf,F)}write(y){this.ensureCapacity(this.count+1),this.buf[this.count]=y,this.count+=1}writeBytesOffset(y,E,F){if(E<0||E>y.length||F<0||E+F-y.length>0)throw new C;this.ensureCapacity(this.count+F),w.arraycopy(y,E,this.buf,this.count,F),this.count+=F}writeTo(y){y.writeBytesOffset(this.buf,0,this.count)}reset(){this.count=0}toByteArray(){return P.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 gr;(function(dt){dt[dt.ALPHA=0]="ALPHA",dt[dt.LOWER=1]="LOWER",dt[dt.MIXED=2]="MIXED",dt[dt.PUNCT=3]="PUNCT",dt[dt.ALPHA_SHIFT=4]="ALPHA_SHIFT",dt[dt.PUNCT_SHIFT=5]="PUNCT_SHIFT"})(gr||(gr={}));function Vt(){if(typeof window<"u")return window.BigInt||null;if(typeof Iu<"u")return Iu.BigInt||null;if(typeof self<"u")return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}let de;function st(dt){if(typeof de>"u"&&(de=Vt()),de===null)throw new Error("BigInt is not supported!");return de(dt)}function Ct(){let dt=[];dt[0]=st(1);let y=st(900);dt[1]=y;for(let E=2;E<16;E++)dt[E]=dt[E-1]*y;return dt}class vt{static decode(y,E){let F=new re(""),$=X.ISO8859_1;F.enableDecoding($);let H=1,Y=y[H++],le=new Cr;for(;H<y[0];){switch(Y){case vt.TEXT_COMPACTION_MODE_LATCH:H=vt.textCompaction(y,H,F);break;case vt.BYTE_COMPACTION_MODE_LATCH:case vt.BYTE_COMPACTION_MODE_LATCH_6:H=vt.byteCompaction(Y,y,$,H,F);break;case vt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:F.append(y[H++]);break;case vt.NUMERIC_COMPACTION_MODE_LATCH:H=vt.numericCompaction(y,H,F);break;case vt.ECI_CHARSET:X.getCharacterSetECIByValue(y[H++]);break;case vt.ECI_GENERAL_PURPOSE:H+=2;break;case vt.ECI_USER_DEFINED:H++;break;case vt.BEGIN_MACRO_PDF417_CONTROL_BLOCK:H=vt.decodeMacroBlock(y,H,le);break;case vt.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case vt.MACRO_PDF417_TERMINATOR:throw new L;default:H--,H=vt.textCompaction(y,H,F);break}if(H<y.length)Y=y[H++];else throw L.getFormatInstance()}if(F.length()===0)throw L.getFormatInstance();let ve=new Pe(null,F.toString(),null,E);return ve.setOther(le),ve}static decodeMacroBlock(y,E,F){if(E+vt.NUMBER_OF_SEQUENCE_CODEWORDS>y[0])throw L.getFormatInstance();let $=new Int32Array(vt.NUMBER_OF_SEQUENCE_CODEWORDS);for(let le=0;le<vt.NUMBER_OF_SEQUENCE_CODEWORDS;le++,E++)$[le]=y[E];F.setSegmentIndex(I.parseInt(vt.decodeBase900toBase10($,vt.NUMBER_OF_SEQUENCE_CODEWORDS)));let H=new re;E=vt.textCompaction(y,E,H),F.setFileId(H.toString());let Y=-1;for(y[E]===vt.BEGIN_MACRO_PDF417_OPTIONAL_FIELD&&(Y=E+1);E<y[0];)switch(y[E]){case vt.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:switch(E++,y[E]){case vt.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:let le=new re;E=vt.textCompaction(y,E+1,le),F.setFileName(le.toString());break;case vt.MACRO_PDF417_OPTIONAL_FIELD_SENDER:let ve=new re;E=vt.textCompaction(y,E+1,ve),F.setSender(ve.toString());break;case vt.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:let Te=new re;E=vt.textCompaction(y,E+1,Te),F.setAddressee(Te.toString());break;case vt.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:let Qe=new re;E=vt.numericCompaction(y,E+1,Qe),F.setSegmentCount(I.parseInt(Qe.toString()));break;case vt.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:let xt=new re;E=vt.numericCompaction(y,E+1,xt),F.setTimestamp(ls.parseLong(xt.toString()));break;case vt.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:let It=new re;E=vt.numericCompaction(y,E+1,It),F.setChecksum(I.parseInt(It.toString()));break;case vt.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:let Qt=new re;E=vt.numericCompaction(y,E+1,Qt),F.setFileSize(ls.parseLong(Qt.toString()));break;default:throw L.getFormatInstance()}break;case vt.MACRO_PDF417_TERMINATOR:E++,F.setLastSegment(!0);break;default:throw L.getFormatInstance()}if(Y!==-1){let le=E-Y;F.isLastSegment()&&le--,F.setOptionalData(P.copyOfRange(y,Y,Y+le))}return E}static textCompaction(y,E,F){let $=new Int32Array((y[0]-E)*2),H=new Int32Array((y[0]-E)*2),Y=0,le=!1;for(;E<y[0]&&!le;){let ve=y[E++];if(ve<vt.TEXT_COMPACTION_MODE_LATCH)$[Y]=ve/30,$[Y+1]=ve%30,Y+=2;else switch(ve){case vt.TEXT_COMPACTION_MODE_LATCH:$[Y++]=vt.TEXT_COMPACTION_MODE_LATCH;break;case vt.BYTE_COMPACTION_MODE_LATCH:case vt.BYTE_COMPACTION_MODE_LATCH_6:case vt.NUMERIC_COMPACTION_MODE_LATCH:case vt.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case vt.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case vt.MACRO_PDF417_TERMINATOR:E--,le=!0;break;case vt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:$[Y]=vt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,ve=y[E++],H[Y]=ve,Y++;break}}return vt.decodeTextCompaction($,H,Y,F),E}static decodeTextCompaction(y,E,F,$){let H=gr.ALPHA,Y=gr.ALPHA,le=0;for(;le<F;){let ve=y[le],Te="";switch(H){case gr.ALPHA:if(ve<26)Te=String.fromCharCode(65+ve);else switch(ve){case 26:Te=" ";break;case vt.LL:H=gr.LOWER;break;case vt.ML:H=gr.MIXED;break;case vt.PS:Y=H,H=gr.PUNCT_SHIFT;break;case vt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:$.append(E[le]);break;case vt.TEXT_COMPACTION_MODE_LATCH:H=gr.ALPHA;break}break;case gr.LOWER:if(ve<26)Te=String.fromCharCode(97+ve);else switch(ve){case 26:Te=" ";break;case vt.AS:Y=H,H=gr.ALPHA_SHIFT;break;case vt.ML:H=gr.MIXED;break;case vt.PS:Y=H,H=gr.PUNCT_SHIFT;break;case vt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:$.append(E[le]);break;case vt.TEXT_COMPACTION_MODE_LATCH:H=gr.ALPHA;break}break;case gr.MIXED:if(ve<vt.PL)Te=vt.MIXED_CHARS[ve];else switch(ve){case vt.PL:H=gr.PUNCT;break;case 26:Te=" ";break;case vt.LL:H=gr.LOWER;break;case vt.AL:H=gr.ALPHA;break;case vt.PS:Y=H,H=gr.PUNCT_SHIFT;break;case vt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:$.append(E[le]);break;case vt.TEXT_COMPACTION_MODE_LATCH:H=gr.ALPHA;break}break;case gr.PUNCT:if(ve<vt.PAL)Te=vt.PUNCT_CHARS[ve];else switch(ve){case vt.PAL:H=gr.ALPHA;break;case vt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:$.append(E[le]);break;case vt.TEXT_COMPACTION_MODE_LATCH:H=gr.ALPHA;break}break;case gr.ALPHA_SHIFT:if(H=Y,ve<26)Te=String.fromCharCode(65+ve);else switch(ve){case 26:Te=" ";break;case vt.TEXT_COMPACTION_MODE_LATCH:H=gr.ALPHA;break}break;case gr.PUNCT_SHIFT:if(H=Y,ve<vt.PAL)Te=vt.PUNCT_CHARS[ve];else switch(ve){case vt.PAL:H=gr.ALPHA;break;case vt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:$.append(E[le]);break;case vt.TEXT_COMPACTION_MODE_LATCH:H=gr.ALPHA;break}break}Te!==""&&$.append(Te),le++}}static byteCompaction(y,E,F,$,H){let Y=new Es,le=0,ve=0,Te=!1;switch(y){case vt.BYTE_COMPACTION_MODE_LATCH:let Qe=new Int32Array(6),xt=E[$++];for(;$<E[0]&&!Te;)switch(Qe[le++]=xt,ve=900*ve+xt,xt=E[$++],xt){case vt.TEXT_COMPACTION_MODE_LATCH:case vt.BYTE_COMPACTION_MODE_LATCH:case vt.NUMERIC_COMPACTION_MODE_LATCH:case vt.BYTE_COMPACTION_MODE_LATCH_6:case vt.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case vt.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case vt.MACRO_PDF417_TERMINATOR:$--,Te=!0;break;default:if(le%5===0&&le>0){for(let It=0;It<6;++It)Y.write(Number(st(ve)>>st(8*(5-It))));ve=0,le=0}break}$===E[0]&&xt<vt.TEXT_COMPACTION_MODE_LATCH&&(Qe[le++]=xt);for(let It=0;It<le;It++)Y.write(Qe[It]);break;case vt.BYTE_COMPACTION_MODE_LATCH_6:for(;$<E[0]&&!Te;){let It=E[$++];if(It<vt.TEXT_COMPACTION_MODE_LATCH)le++,ve=900*ve+It;else switch(It){case vt.TEXT_COMPACTION_MODE_LATCH:case vt.BYTE_COMPACTION_MODE_LATCH:case vt.NUMERIC_COMPACTION_MODE_LATCH:case vt.BYTE_COMPACTION_MODE_LATCH_6:case vt.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case vt.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case vt.MACRO_PDF417_TERMINATOR:$--,Te=!0;break}if(le%5===0&&le>0){for(let Qt=0;Qt<6;++Qt)Y.write(Number(st(ve)>>st(8*(5-Qt))));ve=0,le=0}}break}return H.append(J.decode(Y.toByteArray(),F)),$}static numericCompaction(y,E,F){let $=0,H=!1,Y=new Int32Array(vt.MAX_NUMERIC_CODEWORDS);for(;E<y[0]&&!H;){let le=y[E++];if(E===y[0]&&(H=!0),le<vt.TEXT_COMPACTION_MODE_LATCH)Y[$]=le,$++;else switch(le){case vt.TEXT_COMPACTION_MODE_LATCH:case vt.BYTE_COMPACTION_MODE_LATCH:case vt.BYTE_COMPACTION_MODE_LATCH_6:case vt.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case vt.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case vt.MACRO_PDF417_TERMINATOR:E--,H=!0;break}($%vt.MAX_NUMERIC_CODEWORDS===0||le===vt.NUMERIC_COMPACTION_MODE_LATCH||H)&&$>0&&(F.append(vt.decodeBase900toBase10(Y,$)),$=0)}return E}static decodeBase900toBase10(y,E){let F=st(0);for(let H=0;H<E;H++)F+=vt.EXP900[E-H-1]*st(y[H]);let $=F.toString();if($.charAt(0)!=="1")throw new L;return $.substring(1)}}vt.TEXT_COMPACTION_MODE_LATCH=900,vt.BYTE_COMPACTION_MODE_LATCH=901,vt.NUMERIC_COMPACTION_MODE_LATCH=902,vt.BYTE_COMPACTION_MODE_LATCH_6=924,vt.ECI_USER_DEFINED=925,vt.ECI_GENERAL_PURPOSE=926,vt.ECI_CHARSET=927,vt.BEGIN_MACRO_PDF417_CONTROL_BLOCK=928,vt.BEGIN_MACRO_PDF417_OPTIONAL_FIELD=923,vt.MACRO_PDF417_TERMINATOR=922,vt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE=913,vt.MAX_NUMERIC_CODEWORDS=15,vt.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME=0,vt.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT=1,vt.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP=2,vt.MACRO_PDF417_OPTIONAL_FIELD_SENDER=3,vt.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE=4,vt.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE=5,vt.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM=6,vt.PL=25,vt.LL=27,vt.AS=27,vt.ML=28,vt.AL=28,vt.PS=29,vt.PAL=29,vt.PUNCT_CHARS=`;<>@[\\]_\`~!\r	,:
-.$/"|*()?{}'`,vt.MIXED_CHARS="0123456789&\r	,:#-.$/+%*=^",vt.EXP900=Vt()?Ct():[],vt.NUMBER_OF_SEQUENCE_CODEWORDS=2;class ln{constructor(){}static decode(y,E,F,$,H,Y,le){let ve=new ds(y,E,F,$,H),Te=null,Qe=null,xt;for(let St=!0;;St=!1){if(E!=null&&(Te=ln.getRowIndicatorColumn(y,ve,E,!0,Y,le)),$!=null&&(Qe=ln.getRowIndicatorColumn(y,ve,$,!1,Y,le)),xt=ln.merge(Te,Qe),xt==null)throw Q.getNotFoundInstance();let zt=xt.getBoundingBox();if(St&&zt!=null&&(zt.getMinY()<ve.getMinY()||zt.getMaxY()>ve.getMaxY()))ve=zt;else break}xt.setBoundingBox(ve);let It=xt.getBarcodeColumnCount()+1;xt.setDetectionResultColumn(0,Te),xt.setDetectionResultColumn(It,Qe);let Qt=Te!=null;for(let St=1;St<=It;St++){let zt=Qt?St:It-St;if(xt.getDetectionResultColumn(zt)!==void 0)continue;let Wt;zt===0||zt===It?Wt=new kr(ve,zt===0):Wt=new Tn(ve),xt.setDetectionResultColumn(zt,Wt);let jn=-1,mr=jn;for(let Sr=ve.getMinY();Sr<=ve.getMaxY();Sr++){if(jn=ln.getStartColumn(xt,zt,Sr,Qt),jn<0||jn>ve.getMaxX()){if(mr===-1)continue;jn=mr}let Ar=ln.detectCodeword(y,ve.getMinX(),ve.getMaxX(),Qt,jn,Sr,Y,le);Ar!=null&&(Wt.setCodeword(Sr,Ar),mr=jn,Y=Math.min(Y,Ar.getWidth()),le=Math.max(le,Ar.getWidth()))}}return ln.createDecoderResult(xt)}static merge(y,E){if(y==null&&E==null)return null;let F=ln.getBarcodeMetadata(y,E);if(F==null)return null;let $=ds.merge(ln.adjustBoundingBox(y),ln.adjustBoundingBox(E));return new Dr(F,$)}static adjustBoundingBox(y){if(y==null)return null;let E=y.getRowHeights();if(E==null)return null;let F=ln.getMax(E),$=0;for(let le of E)if($+=F-le,le>0)break;let H=y.getCodewords();for(let le=0;$>0&&H[le]==null;le++)$--;let Y=0;for(let le=E.length-1;le>=0&&(Y+=F-E[le],!(E[le]>0));le--);for(let le=H.length-1;Y>0&&H[le]==null;le--)Y--;return y.getBoundingBox().addMissingRows($,Y,y.isLeft())}static getMax(y){let E=-1;for(let F of y)E=Math.max(E,F);return E}static getBarcodeMetadata(y,E){let F;if(y==null||(F=y.getBarcodeMetadata())==null)return E==null?null:E.getBarcodeMetadata();let $;return E==null||($=E.getBarcodeMetadata())==null?F:F.getColumnCount()!==$.getColumnCount()&&F.getErrorCorrectionLevel()!==$.getErrorCorrectionLevel()&&F.getRowCount()!==$.getRowCount()?null:F}static getRowIndicatorColumn(y,E,F,$,H,Y){let le=new kr(E,$);for(let ve=0;ve<2;ve++){let Te=ve===0?1:-1,Qe=Math.trunc(Math.trunc(F.getX()));for(let xt=Math.trunc(Math.trunc(F.getY()));xt<=E.getMaxY()&&xt>=E.getMinY();xt+=Te){let It=ln.detectCodeword(y,0,y.getWidth(),$,Qe,xt,H,Y);It!=null&&(le.setCodeword(xt,It),$?Qe=It.getStartX():Qe=It.getEndX())}}return le}static adjustCodewordCount(y,E){let F=E[0][1],$=F.getValue(),H=y.getBarcodeColumnCount()*y.getBarcodeRowCount()-ln.getNumberOfECCodeWords(y.getBarcodeECLevel());if($.length===0){if(H<1||H>ur.MAX_CODEWORDS_IN_BARCODE)throw Q.getNotFoundInstance();F.setValue(H)}else $[0]!==H&&F.setValue(H)}static createDecoderResult(y){let E=ln.createBarcodeMatrix(y);ln.adjustCodewordCount(y,E);let F=new Array,$=new Int32Array(y.getBarcodeRowCount()*y.getBarcodeColumnCount()),H=[],Y=new Array;for(let ve=0;ve<y.getBarcodeRowCount();ve++)for(let Te=0;Te<y.getBarcodeColumnCount();Te++){let Qe=E[ve][Te+1].getValue(),xt=ve*y.getBarcodeColumnCount()+Te;Qe.length===0?F.push(xt):Qe.length===1?$[xt]=Qe[0]:(Y.push(xt),H.push(Qe))}let le=new Array(H.length);for(let ve=0;ve<le.length;ve++)le[ve]=H[ve];return ln.createDecoderResultFromAmbiguousValues(y.getBarcodeECLevel(),$,ur.toIntArray(F),ur.toIntArray(Y),le)}static createDecoderResultFromAmbiguousValues(y,E,F,$,H){let Y=new Int32Array($.length),le=100;for(;le-- >0;){for(let ve=0;ve<Y.length;ve++)E[$[ve]]=H[ve][Y[ve]];try{return ln.decodeCodewords(E,y,F)}catch(ve){if(!(ve instanceof g))throw ve}if(Y.length===0)throw g.getChecksumInstance();for(let ve=0;ve<Y.length;ve++)if(Y[ve]<H[ve].length-1){Y[ve]++;break}else if(Y[ve]=0,ve===Y.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 er;let F=0;for(let $ of y.getDetectionResultColumns()){if($!=null){for(let H of $.getCodewords())if(H!=null){let Y=H.getRowNumber();if(Y>=0){if(Y>=E.length)continue;E[Y][F].setValue(H.getValue())}}}F++}return E}static isValidBarcodeColumn(y,E){return E>=0&&E<=y.getBarcodeColumnCount()+1}static getStartColumn(y,E,F,$){let H=$?1:-1,Y=null;if(ln.isValidBarcodeColumn(y,E-H)&&(Y=y.getDetectionResultColumn(E-H).getCodeword(F)),Y!=null)return $?Y.getEndX():Y.getStartX();if(Y=y.getDetectionResultColumn(E).getCodewordNearby(F),Y!=null)return $?Y.getStartX():Y.getEndX();if(ln.isValidBarcodeColumn(y,E-H)&&(Y=y.getDetectionResultColumn(E-H).getCodewordNearby(F)),Y!=null)return $?Y.getEndX():Y.getStartX();let le=0;for(;ln.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,F,$,H,Y,le,ve){H=ln.adjustCodewordStartColumn(y,E,F,$,H,Y);let Te=ln.getModuleBitCount(y,E,F,$,H,Y);if(Te==null)return null;let Qe,xt=pt.sum(Te);if($)Qe=H+xt;else{for(let St=0;St<Te.length/2;St++){let zt=Te[St];Te[St]=Te[Te.length-1-St],Te[Te.length-1-St]=zt}Qe=H,H=Qe-xt}if(!ln.checkCodewordSkew(xt,le,ve))return null;let It=cr.getDecodedValue(Te),Qt=ur.getCodeword(It);return Qt===-1?null:new Ur(H,Qe,ln.getCodewordBucketNumber(It),Qt)}static getModuleBitCount(y,E,F,$,H,Y){let le=H,ve=new Int32Array(8),Te=0,Qe=$?1:-1,xt=$;for(;($?le<F:le>=E)&&Te<ve.length;)y.get(le,Y)===xt?(ve[Te]++,le+=Qe):(Te++,xt=!xt);return Te===ve.length||le===($?F:E)&&Te===ve.length-1?ve:null}static getNumberOfECCodeWords(y){return 2<<y}static adjustCodewordStartColumn(y,E,F,$,H,Y){let le=H,ve=$?-1:1;for(let Te=0;Te<2;Te++){for(;($?le>=E:le<F)&&$===y.get(le,Y);){if(Math.abs(H-le)>ln.CODEWORD_SKEW_SIZE)return H;le+=ve}ve=-ve,$=!$}return le}static checkCodewordSkew(y,E,F){return E-ln.CODEWORD_SKEW_SIZE<=y&&y<=F+ln.CODEWORD_SKEW_SIZE}static decodeCodewords(y,E,F){if(y.length===0)throw L.getFormatInstance();let $=1<<E+1,H=ln.correctErrors(y,F,$);ln.verifyCodewordCount(y,$);let Y=vt.decode(y,""+E);return Y.setErrorsCorrected(H),Y.setErasures(F.length),Y}static correctErrors(y,E,F){if(E!=null&&E.length>F/2+ln.MAX_ERRORS||F<0||F>ln.MAX_EC_CODEWORDS)throw g.getChecksumInstance();return ln.errorCorrection.decode(y,F,E)}static verifyCodewordCount(y,E){if(y.length<4)throw L.getFormatInstance();let F=y[0];if(F>y.length)throw L.getFormatInstance();if(F===0)if(E<y.length)y[0]=y.length-E;else throw L.getFormatInstance()}static getBitCountForCodeword(y){let E=new Int32Array(8),F=0,$=E.length-1;for(;!((y&1)!==F&&(F=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 ln.getCodewordBucketNumber(ln.getBitCountForCodeword(y))}static getCodewordBucketNumber_Int32Array(y){return(y[0]-y[2]+y[4]-y[6]+9)%9}static toString(y){let E=new bt;for(let F=0;F<y.length;F++){E.format("Row %2d: ",F);for(let $=0;$<y[F].length;$++){let H=y[F][$];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()}}ln.CODEWORD_SKEW_SIZE=2,ln.MAX_ERRORS=3,ln.MAX_EC_CODEWORDS=512,ln.errorCorrection=new os;class pn{decode(y,E=null){let F=pn.decode(y,E,!1);if(F==null||F.length===0||F[0]==null)throw Q.getNotFoundInstance();return F[0]}decodeMultiple(y,E=null){try{return pn.decode(y,E,!0)}catch(F){throw F instanceof L||F instanceof g?Q.getNotFoundInstance():F}}static decode(y,E,F){const $=new Array,H=Un.detectMultiple(y,E,F);for(const Y of H.getPoints()){const le=ln.decode(H.getBits(),Y[4],Y[5],Y[6],Y[7],pn.getMinCodewordWidth(Y),pn.getMaxCodewordWidth(Y)),ve=new me(le.getText(),le.getRawBytes(),void 0,Y,xe.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(Y=>Y)}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?I.MAX_VALUE:Math.trunc(Math.abs(y.getX()-E.getX()))}static getMaxCodewordWidth(y){return Math.floor(Math.max(Math.max(pn.getMaxWidth(y[0],y[4]),pn.getMaxWidth(y[6],y[2])*ur.MODULES_IN_CODEWORD/ur.MODULES_IN_STOP_PATTERN),Math.max(pn.getMaxWidth(y[1],y[5]),pn.getMaxWidth(y[7],y[3])*ur.MODULES_IN_CODEWORD/ur.MODULES_IN_STOP_PATTERN)))}static getMinCodewordWidth(y){return Math.floor(Math.min(Math.min(pn.getMinWidth(y[0],y[4]),pn.getMinWidth(y[6],y[2])*ur.MODULES_IN_CODEWORD/ur.MODULES_IN_STOP_PATTERN),Math.min(pn.getMinWidth(y[1],y[5]),pn.getMinWidth(y[7],y[3])*ur.MODULES_IN_CODEWORD/ur.MODULES_IN_STOP_PATTERN)))}reset(){}}class dr extends u{}dr.kind="ReaderException";class jr{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,F=r(y)?null:y.get(U.POSSIBLE_FORMATS),$=new Array;if(!r(F)){const H=F.some(Y=>Y===xe.UPC_A||Y===xe.UPC_E||Y===xe.EAN_13||Y===xe.EAN_8||Y===xe.CODABAR||Y===xe.CODE_39||Y===xe.CODE_93||Y===xe.CODE_128||Y===xe.ITF||Y===xe.RSS_14||Y===xe.RSS_EXPANDED);H&&!E&&$.push(new k(y,this.verbose)),F.includes(xe.QR_CODE)&&$.push(new rr),F.includes(xe.DATA_MATRIX)&&$.push(new Fe),F.includes(xe.AZTEC)&&$.push(new dn),F.includes(xe.PDF_417)&&$.push(new pn),H&&E&&$.push(new k(y,this.verbose))}$.length===0&&(E||$.push(new k(y,this.verbose)),$.push(new rr),$.push(new Fe),$.push(new dn),$.push(new pn),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 dr("No readers where selected, nothing can be read.");for(const E of this.readers)try{return E.decode(y,this.hints)}catch(F){if(F instanceof dr)continue}throw new Q("No MultiFormat Readers were able to detect the code.")}}class pr extends Ne{constructor(y=null,E=500){const F=new jr;F.setHints(y),super(F,E)}decodeBitmap(y){return this.reader.decodeWithState(y)}}class fr extends Ne{constructor(y=500){super(new pn,y)}}class Kr extends Ne{constructor(y=500){super(new rr,y)}}var rs;(function(dt){dt[dt.ERROR_CORRECTION=0]="ERROR_CORRECTION",dt[dt.CHARACTER_SET=1]="CHARACTER_SET",dt[dt.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",dt[dt.MIN_SIZE=3]="MIN_SIZE",dt[dt.MAX_SIZE=4]="MAX_SIZE",dt[dt.MARGIN=5]="MARGIN",dt[dt.PDF417_COMPACT=6]="PDF417_COMPACT",dt[dt.PDF417_COMPACTION=7]="PDF417_COMPACTION",dt[dt.PDF417_DIMENSIONS=8]="PDF417_DIMENSIONS",dt[dt.AZTEC_LAYERS=9]="AZTEC_LAYERS",dt[dt.QR_VERSION=10]="QR_VERSION"})(rs||(rs={}));var Ir=rs;class br{constructor(y){this.field=y,this.cachedGenerators=[],this.cachedGenerators.push(new Xe(y,Int32Array.from([1])))}buildGenerator(y){const E=this.cachedGenerators;if(y>=E.length){let F=E[E.length-1];const $=this.field;for(let H=E.length;H<=y;H++){const Y=F.multiply(new Xe($,Int32Array.from([1,$.exp(H-1+$.getGeneratorBase())])));E.push(Y),F=Y}}return E[y]}encode(y,E){if(E===0)throw new f("No error correction bytes");const F=y.length-E;if(F<=0)throw new f("No data bytes provided");const $=this.buildGenerator(E),H=new Int32Array(F);w.arraycopy(y,0,H,0,F);let Y=new Xe(this.field,H);Y=Y.multiplyByMonomial(E,1);const ve=Y.divide($)[1].getCoefficients(),Te=E-ve.length;for(let Qe=0;Qe<Te;Qe++)y[F+Qe]=0;w.arraycopy(ve,0,y,F+Te,ve.length)}}class Zn{constructor(){}static applyMaskPenaltyRule1(y){return Zn.applyMaskPenaltyRule1Internal(y,!0)+Zn.applyMaskPenaltyRule1Internal(y,!1)}static applyMaskPenaltyRule2(y){let E=0;const F=y.getArray(),$=y.getWidth(),H=y.getHeight();for(let Y=0;Y<H-1;Y++){const le=F[Y];for(let ve=0;ve<$-1;ve++){const Te=le[ve];Te===le[ve+1]&&Te===F[Y+1][ve]&&Te===F[Y+1][ve+1]&&E++}}return Zn.N2*E}static applyMaskPenaltyRule3(y){let E=0;const F=y.getArray(),$=y.getWidth(),H=y.getHeight();for(let Y=0;Y<H;Y++)for(let le=0;le<$;le++){const ve=F[Y];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&&(Zn.isWhiteHorizontal(ve,le-4,le)||Zn.isWhiteHorizontal(ve,le+7,le+11))&&E++,Y+6<H&&F[Y][le]===1&&F[Y+1][le]===0&&F[Y+2][le]===1&&F[Y+3][le]===1&&F[Y+4][le]===1&&F[Y+5][le]===0&&F[Y+6][le]===1&&(Zn.isWhiteVertical(F,le,Y-4,Y)||Zn.isWhiteVertical(F,le,Y+7,Y+11))&&E++}return E*Zn.N3}static isWhiteHorizontal(y,E,F){E=Math.max(E,0),F=Math.min(F,y.length);for(let $=E;$<F;$++)if(y[$]===1)return!1;return!0}static isWhiteVertical(y,E,F,$){F=Math.max(F,0),$=Math.min($,y.length);for(let H=F;H<$;H++)if(y[H][E]===1)return!1;return!0}static applyMaskPenaltyRule4(y){let E=0;const F=y.getArray(),$=y.getWidth(),H=y.getHeight();for(let ve=0;ve<H;ve++){const Te=F[ve];for(let Qe=0;Qe<$;Qe++)Te[Qe]===1&&E++}const Y=y.getHeight()*y.getWidth();return Math.floor(Math.abs(E*2-Y)*10/Y)*Zn.N4}static getDataMaskBit(y,E,F){let $,H;switch(y){case 0:$=F+E&1;break;case 1:$=F&1;break;case 2:$=E%3;break;case 3:$=(F+E)%3;break;case 4:$=Math.floor(F/2)+Math.floor(E/3)&1;break;case 5:H=F*E,$=(H&1)+H%3;break;case 6:H=F*E,$=(H&1)+H%3&1;break;case 7:H=F*E,$=H%3+(F+E&1)&1;break;default:throw new f("Invalid mask pattern: "+y)}return $===0}static applyMaskPenaltyRule1Internal(y,E){let F=0;const $=E?y.getHeight():y.getWidth(),H=E?y.getWidth():y.getHeight(),Y=y.getArray();for(let le=0;le<$;le++){let ve=0,Te=-1;for(let Qe=0;Qe<H;Qe++){const xt=E?Y[le][Qe]:Y[Qe][le];xt===Te?ve++:(ve>=5&&(F+=Zn.N1+(ve-5)),ve=1,Te=xt)}ve>=5&&(F+=Zn.N1+(ve-5))}return F}}Zn.N1=3,Zn.N2=3,Zn.N3=40,Zn.N4=10;class xs{constructor(y,E){this.width=y,this.height=E;const F=new Array(E);for(let $=0;$!==E;$++)F[$]=new Uint8Array(y);this.bytes=F}getHeight(){return this.height}getWidth(){return this.width}get(y,E){return this.bytes[E][y]}getArray(){return this.bytes}setNumber(y,E,F){this.bytes[E][y]=F}setBoolean(y,E,F){this.bytes[E][y]=F?1:0}clear(y){for(const E of this.bytes)P.fill(E,y)}equals(y){if(!(y instanceof xs))return!1;const E=y;if(this.width!==E.width||this.height!==E.height)return!1;for(let F=0,$=this.height;F<$;++F){const H=this.bytes[F],Y=E.bytes[F];for(let le=0,ve=this.width;le<ve;++le)if(H[le]!==Y[le])return!1}return!0}toString(){const y=new re;for(let E=0,F=this.height;E<F;++E){const $=this.bytes[E];for(let H=0,Y=this.width;H<Y;++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 Qs{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<Qs.NUM_MASK_PATTERNS}}Qs.NUM_MASK_PATTERNS=8;class ai extends u{}ai.kind="WriterException";class Pr{constructor(){}static clearMatrix(y){y.clear(255)}static buildMatrix(y,E,F,$,H){Pr.clearMatrix(H),Pr.embedBasicPatterns(F,H),Pr.embedTypeInfo(E,$,H),Pr.maybeEmbedVersionInfo(F,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,F){const $=new R;Pr.makeTypeInfoBits(y,E,$);for(let H=0,Y=$.getSize();H<Y;++H){const le=$.get($.getSize()-1-H),ve=Pr.TYPE_INFO_COORDINATES[H],Te=ve[0],Qe=ve[1];if(F.setBoolean(Te,Qe,le),H<8){const xt=F.getWidth()-H-1;F.setBoolean(xt,8,le)}else{const It=F.getHeight()-7+(H-8);F.setBoolean(8,It,le)}}}static maybeEmbedVersionInfo(y,E){if(y.getVersionNumber()<7)return;const F=new R;Pr.makeVersionInfoBits(y,F);let $=6*3-1;for(let H=0;H<6;++H)for(let Y=0;Y<3;++Y){const le=F.get($);$--,E.setBoolean(H,E.getHeight()-11+Y,le),E.setBoolean(E.getHeight()-11+Y,H,le)}}static embedDataBits(y,E,F){let $=0,H=-1,Y=F.getWidth()-1,le=F.getHeight()-1;for(;Y>0;){for(Y===6&&(Y-=1);le>=0&&le<F.getHeight();){for(let ve=0;ve<2;++ve){const Te=Y-ve;if(!Pr.isEmpty(F.get(Te,le)))continue;let Qe;$<y.getSize()?(Qe=y.get($),++$):Qe=!1,E!==255&&Zn.getDataMaskBit(E,Te,le)&&(Qe=!Qe),F.setBoolean(Te,le,Qe)}le+=H}H=-H,le+=H,Y-=2}if($!==y.getSize())throw new ai("Not all bits consumed: "+$+"/"+y.getSize())}static findMSBSet(y){return 32-I.numberOfLeadingZeros(y)}static calculateBCHCode(y,E){if(E===0)throw new f("0 polynomial");const F=Pr.findMSBSet(E);for(y<<=F-1;Pr.findMSBSet(y)>=F;)y^=E<<Pr.findMSBSet(y)-F;return y}static makeTypeInfoBits(y,E,F){if(!Qs.isValidMaskPattern(E))throw new ai("Invalid mask pattern");const $=y.getBits()<<3|E;F.appendBits($,5);const H=Pr.calculateBCHCode($,Pr.TYPE_INFO_POLY);F.appendBits(H,10);const Y=new R;if(Y.appendBits(Pr.TYPE_INFO_MASK_PATTERN,15),F.xor(Y),F.getSize()!==15)throw new ai("should not happen but we got: "+F.getSize())}static makeVersionInfoBits(y,E){E.appendBits(y.getVersionNumber(),6);const F=Pr.calculateBCHCode(y.getVersionNumber(),Pr.VERSION_INFO_POLY);if(E.appendBits(F,12),E.getSize()!==18)throw new ai("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 F=(E+1)%2;Pr.isEmpty(y.get(E,6))&&y.setNumber(E,6,F),Pr.isEmpty(y.get(6,E))&&y.setNumber(6,E,F)}}static embedDarkDotAtLeftBottomCorner(y){if(y.get(8,y.getHeight()-8)===0)throw new ai;y.setNumber(8,y.getHeight()-8,1)}static embedHorizontalSeparationPattern(y,E,F){for(let $=0;$<8;++$){if(!Pr.isEmpty(F.get(y+$,E)))throw new ai;F.setNumber(y+$,E,0)}}static embedVerticalSeparationPattern(y,E,F){for(let $=0;$<7;++$){if(!Pr.isEmpty(F.get(y,E+$)))throw new ai;F.setNumber(y,E+$,0)}}static embedPositionAdjustmentPattern(y,E,F){for(let $=0;$<5;++$){const H=Pr.POSITION_ADJUSTMENT_PATTERN[$];for(let Y=0;Y<5;++Y)F.setNumber(y+Y,E+$,H[Y])}}static embedPositionDetectionPattern(y,E,F){for(let $=0;$<7;++$){const H=Pr.POSITION_DETECTION_PATTERN[$];for(let Y=0;Y<7;++Y)F.setNumber(y+Y,E+$,H[Y])}}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 F=8;Pr.embedHorizontalSeparationPattern(0,F-1,y),Pr.embedHorizontalSeparationPattern(y.getWidth()-F,F-1,y),Pr.embedHorizontalSeparationPattern(0,y.getWidth()-F,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 F=y.getVersionNumber()-1,$=Pr.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[F];for(let H=0,Y=$.length;H!==Y;H++){const le=$[H];if(le>=0)for(let ve=0;ve!==Y;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 vn{constructor(y,E){this.dataBytes=y,this.errorCorrectionBytes=E}getDataBytes(){return this.dataBytes}getErrorCorrectionBytes(){return this.errorCorrectionBytes}}class Fn{constructor(){}static calculateMaskPenalty(y){return Zn.applyMaskPenaltyRule1(y)+Zn.applyMaskPenaltyRule2(y)+Zn.applyMaskPenaltyRule3(y)+Zn.applyMaskPenaltyRule4(y)}static encode(y,E,F=null){let $=Fn.DEFAULT_BYTE_MODE_ENCODING;const H=F!==null&&F.get(Ir.CHARACTER_SET)!==void 0;H&&($=F.get(Ir.CHARACTER_SET).toString());const Y=this.chooseMode(y,$),le=new R;if(Y===Ge.BYTE&&(H||Fn.DEFAULT_BYTE_MODE_ENCODING!==$)){const Sr=X.getCharacterSetECIByName($);Sr!==void 0&&this.appendECI(Sr,le)}this.appendModeInfo(Y,le);const ve=new R;this.appendBytes(y,Y,ve,$);let Te;if(F!==null&&F.get(Ir.QR_VERSION)!==void 0){const Sr=Number.parseInt(F.get(Ir.QR_VERSION).toString(),10);Te=rt.getVersionForNumber(Sr);const Ar=this.calculateBitsNeeded(Y,le,ve,Te);if(!this.willFit(Ar,Te,E))throw new ai("Data too big for requested version")}else Te=this.recommendVersion(E,Y,le,ve);const Qe=new R;Qe.appendBitArray(le);const xt=Y===Ge.BYTE?ve.getSizeInBytes():y.length;this.appendLengthInfo(xt,Te,Y,Qe),Qe.appendBitArray(ve);const It=Te.getECBlocksForLevel(E),Qt=Te.getTotalCodewords()-It.getTotalECCodewords();this.terminateBits(Qt,Qe);const St=this.interleaveWithECBytes(Qe,Te.getTotalCodewords(),Qt,It.getNumBlocks()),zt=new Qs;zt.setECLevel(E),zt.setMode(Y),zt.setVersion(Te);const Wt=Te.getDimensionForVersion(),jn=new xs(Wt,Wt),mr=this.chooseMaskPattern(St,E,Te,jn);return zt.setMaskPattern(mr),Pr.buildMatrix(St,E,Te,mr,jn),zt.setMatrix(jn),zt}static recommendVersion(y,E,F,$){const H=this.calculateBitsNeeded(E,F,$,rt.getVersionForNumber(1)),Y=this.chooseVersion(H,y),le=this.calculateBitsNeeded(E,F,$,Y);return this.chooseVersion(le,y)}static calculateBitsNeeded(y,E,F,$){return E.getSize()+y.getCharacterCountBits($)+F.getSize()}static getAlphanumericCode(y){return y<Fn.ALPHANUMERIC_TABLE.length?Fn.ALPHANUMERIC_TABLE[y]:-1}static chooseMode(y,E=null){if(X.SJIS.getName()===E&&this.isOnlyDoubleByteKanji(y))return Ge.KANJI;let F=!1,$=!1;for(let H=0,Y=y.length;H<Y;++H){const le=y.charAt(H);if(Fn.isDigit(le))F=!0;else if(this.getAlphanumericCode(le.charCodeAt(0))!==-1)$=!0;else return Ge.BYTE}return $?Ge.ALPHANUMERIC:F?Ge.NUMERIC:Ge.BYTE}static isOnlyDoubleByteKanji(y){let E;try{E=J.encode(y,X.SJIS)}catch{return!1}const F=E.length;if(F%2!==0)return!1;for(let $=0;$<F;$+=2){const H=E[$]&255;if((H<129||H>159)&&(H<224||H>235))return!1}return!0}static chooseMaskPattern(y,E,F,$){let H=Number.MAX_SAFE_INTEGER,Y=-1;for(let le=0;le<Qs.NUM_MASK_PATTERNS;le++){Pr.buildMatrix(y,E,F,le,$);let ve=this.calculateMaskPenalty($);ve<H&&(H=ve,Y=le)}return Y}static chooseVersion(y,E){for(let F=1;F<=40;F++){const $=rt.getVersionForNumber(F);if(Fn.willFit(y,$,E))return $}throw new ai("Data too big")}static willFit(y,E,F){const $=E.getTotalCodewords(),Y=E.getECBlocksForLevel(F).getTotalECCodewords(),le=$-Y,ve=(y+7)/8;return le>=ve}static terminateBits(y,E){const F=y*8;if(E.getSize()>F)throw new ai("data bits cannot fit in the QR Code"+E.getSize()+" > "+F);for(let Y=0;Y<4&&E.getSize()<F;++Y)E.appendBit(!1);const $=E.getSize()&7;if($>0)for(let Y=$;Y<8;Y++)E.appendBit(!1);const H=y-E.getSizeInBytes();for(let Y=0;Y<H;++Y)E.appendBits(Y&1?17:236,8);if(E.getSize()!==F)throw new ai("Bits size does not equal capacity")}static getNumDataBytesAndNumECBytesForBlockID(y,E,F,$,H,Y){if($>=F)throw new ai("Block ID too large");const le=y%F,ve=F-le,Te=Math.floor(y/F),Qe=Te+1,xt=Math.floor(E/F),It=xt+1,Qt=Te-xt,St=Qe-It;if(Qt!==St)throw new ai("EC bytes mismatch");if(F!==ve+le)throw new ai("RS blocks mismatch");if(y!==(xt+Qt)*ve+(It+St)*le)throw new ai("Total bytes mismatch");$<ve?(H[0]=xt,Y[0]=Qt):(H[0]=It,Y[0]=St)}static interleaveWithECBytes(y,E,F,$){if(y.getSizeInBytes()!==F)throw new ai("Number of bits and data bytes does not match");let H=0,Y=0,le=0;const ve=new Array;for(let Qe=0;Qe<$;++Qe){const xt=new Int32Array(1),It=new Int32Array(1);Fn.getNumDataBytesAndNumECBytesForBlockID(E,F,$,Qe,xt,It);const Qt=xt[0],St=new Uint8Array(Qt);y.toBytes(8*H,St,0,Qt);const zt=Fn.generateECBytes(St,It[0]);ve.push(new vn(St,zt)),Y=Math.max(Y,Qt),le=Math.max(le,zt.length),H+=xt[0]}if(F!==H)throw new ai("Data bytes does not match offset");const Te=new R;for(let Qe=0;Qe<Y;++Qe)for(const xt of ve){const It=xt.getDataBytes();Qe<It.length&&Te.appendBits(It[Qe],8)}for(let Qe=0;Qe<le;++Qe)for(const xt of ve){const It=xt.getErrorCorrectionBytes();Qe<It.length&&Te.appendBits(It[Qe],8)}if(E!==Te.getSizeInBytes())throw new ai("Interleaving error: "+E+" and "+Te.getSizeInBytes()+" differ.");return Te}static generateECBytes(y,E){const F=y.length,$=new Int32Array(F+E);for(let Y=0;Y<F;Y++)$[Y]=y[Y]&255;new br(ut.QR_CODE_FIELD_256).encode($,E);const H=new Uint8Array(E);for(let Y=0;Y<E;Y++)H[Y]=$[F+Y];return H}static appendModeInfo(y,E){E.appendBits(y.getBits(),4)}static appendLengthInfo(y,E,F,$){const H=F.getCharacterCountBits(E);if(y>=1<<H)throw new ai(y+" is bigger than "+((1<<H)-1));$.appendBits(y,H)}static appendBytes(y,E,F,$){switch(E){case Ge.NUMERIC:Fn.appendNumericBytes(y,F);break;case Ge.ALPHANUMERIC:Fn.appendAlphanumericBytes(y,F);break;case Ge.BYTE:Fn.append8BitBytes(y,F,$);break;case Ge.KANJI:Fn.appendKanjiBytes(y,F);break;default:throw new ai("Invalid mode: "+E)}}static getDigit(y){return y.charCodeAt(0)-48}static isDigit(y){const E=Fn.getDigit(y);return E>=0&&E<=9}static appendNumericBytes(y,E){const F=y.length;let $=0;for(;$<F;){const H=Fn.getDigit(y.charAt($));if($+2<F){const Y=Fn.getDigit(y.charAt($+1)),le=Fn.getDigit(y.charAt($+2));E.appendBits(H*100+Y*10+le,10),$+=3}else if($+1<F){const Y=Fn.getDigit(y.charAt($+1));E.appendBits(H*10+Y,7),$+=2}else E.appendBits(H,4),$++}}static appendAlphanumericBytes(y,E){const F=y.length;let $=0;for(;$<F;){const H=Fn.getAlphanumericCode(y.charCodeAt($));if(H===-1)throw new ai;if($+1<F){const Y=Fn.getAlphanumericCode(y.charCodeAt($+1));if(Y===-1)throw new ai;E.appendBits(H*45+Y,11),$+=2}else E.appendBits(H,6),$++}}static append8BitBytes(y,E,F){let $;try{$=J.encode(y,F)}catch(H){throw new ai(H)}for(let H=0,Y=$.length;H!==Y;H++){const le=$[H];E.appendBits(le,8)}}static appendKanjiBytes(y,E){let F;try{F=J.encode(y,X.SJIS)}catch(H){throw new ai(H)}const $=F.length;for(let H=0;H<$;H+=2){const Y=F[H]&255,le=F[H+1]&255,ve=Y<<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 ai("Invalid byte sequence");const Qe=(Te>>8)*192+(Te&255);E.appendBits(Qe,13)}}static appendECI(y,E){E.appendBits(Ge.ECI.getBits(),4),E.appendBits(y.getValue(),8)}}Fn.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]),Fn.DEFAULT_BYTE_MODE_ENCODING=X.UTF8.getName();class lt{write(y,E,F,$=null){if(y.length===0)throw new f("Found empty contents");if(E<0||F<0)throw new f("Requested dimensions are too small: "+E+"x"+F);let H=Ce.L,Y=lt.QUIET_ZONE_SIZE;$!==null&&($.get(Ir.ERROR_CORRECTION)!==void 0&&(H=Ce.fromString($.get(Ir.ERROR_CORRECTION).toString())),$.get(Ir.MARGIN)!==void 0&&(Y=Number.parseInt($.get(Ir.MARGIN).toString(),10)));const le=Fn.encode(y,H,$);return this.renderResult(le,E,F,Y)}writeToDom(y,E,F,$,H=null){typeof y=="string"&&(y=document.querySelector(y));const Y=this.write(E,F,$,H);y&&y.appendChild(Y)}renderResult(y,E,F,$){const H=y.getMatrix();if(H===null)throw new tt;const Y=H.getWidth(),le=H.getHeight(),ve=Y+$*2,Te=le+$*2,Qe=Math.max(E,ve),xt=Math.max(F,Te),It=Math.min(Math.floor(Qe/ve),Math.floor(xt/Te)),Qt=Math.floor((Qe-Y*It)/2),St=Math.floor((xt-le*It)/2),zt=this.createSVGElement(Qe,xt);for(let Wt=0,jn=St;Wt<le;Wt++,jn+=It)for(let mr=0,Sr=Qt;mr<Y;mr++,Sr+=It)if(H.get(mr,Wt)===1){const Ar=this.createSvgRectElement(Sr,jn,It,It);zt.appendChild(Ar)}return zt}createSVGElement(y,E){const F=document.createElementNS(lt.SVG_NS,"svg");return F.setAttributeNS(null,"height",y.toString()),F.setAttributeNS(null,"width",E.toString()),F}createSvgRectElement(y,E,F,$){const H=document.createElementNS(lt.SVG_NS,"rect");return H.setAttributeNS(null,"x",y.toString()),H.setAttributeNS(null,"y",E.toString()),H.setAttributeNS(null,"height",F.toString()),H.setAttributeNS(null,"width",$.toString()),H.setAttributeNS(null,"fill","#000000"),H}}lt.QUIET_ZONE_SIZE=4,lt.SVG_NS="http://www.w3.org/2000/svg";class Ut{encode(y,E,F,$,H){if(y.length===0)throw new f("Found empty contents");if(E!==xe.QR_CODE)throw new f("Can only encode QR_CODE, but got "+E);if(F<0||$<0)throw new f(`Requested dimensions are too small: ${F}x${$}`);let Y=Ce.L,le=Ut.QUIET_ZONE_SIZE;H!==null&&(H.get(Ir.ERROR_CORRECTION)!==void 0&&(Y=Ce.fromString(H.get(Ir.ERROR_CORRECTION).toString())),H.get(Ir.MARGIN)!==void 0&&(le=Number.parseInt(H.get(Ir.MARGIN).toString(),10)));const ve=Fn.encode(y,Y,H);return Ut.renderResult(ve,F,$,le)}static renderResult(y,E,F,$){const H=y.getMatrix();if(H===null)throw new tt;const Y=H.getWidth(),le=H.getHeight(),ve=Y+$*2,Te=le+$*2,Qe=Math.max(E,ve),xt=Math.max(F,Te),It=Math.min(Math.floor(Qe/ve),Math.floor(xt/Te)),Qt=Math.floor((Qe-Y*It)/2),St=Math.floor((xt-le*It)/2),zt=new he(Qe,xt);for(let Wt=0,jn=St;Wt<le;Wt++,jn+=It)for(let mr=0,Sr=Qt;mr<Y;mr++,Sr+=It)H.get(mr,Wt)===1&&zt.setRegion(Sr,jn,It,It);return zt}}Ut.QUIET_ZONE_SIZE=4;class tr{encode(y,E,F,$,H){let Y;switch(E){case xe.QR_CODE:Y=new Ut;break;default:throw new f("No encoder available for format "+E)}return Y.encode(y,E,F,$,H)}}class Wn extends G{constructor(y,E,F,$,H,Y,le,ve){if(super(Y,le),this.yuvData=y,this.dataWidth=E,this.dataHeight=F,this.left=$,this.top=H,$+Y>E||H+le>F)throw new f("Crop rectangle does not fit within image data.");ve&&this.reverseHorizontal(Y,le)}getRow(y,E){if(y<0||y>=this.getHeight())throw new f("Requested row is outside the image: "+y);const F=this.getWidth();(E==null||E.length<F)&&(E=new Uint8ClampedArray(F));const $=(y+this.top)*this.dataWidth+this.left;return w.arraycopy(this.yuvData,$,E,0,F),E}getMatrix(){const y=this.getWidth(),E=this.getHeight();if(y===this.dataWidth&&E===this.dataHeight)return this.yuvData;const F=y*E,$=new Uint8ClampedArray(F);let H=this.top*this.dataWidth+this.left;if(y===this.dataWidth)return w.arraycopy(this.yuvData,H,$,0,F),$;for(let Y=0;Y<E;Y++){const le=Y*y;w.arraycopy(this.yuvData,H,$,le,y),H+=this.dataWidth}return $}isCropSupported(){return!0}crop(y,E,F,$){return new Wn(this.yuvData,this.dataWidth,this.dataHeight,this.left+y,this.top+E,F,$,!1)}renderThumbnail(){const y=this.getWidth()/Wn.THUMBNAIL_SCALE_FACTOR,E=this.getHeight()/Wn.THUMBNAIL_SCALE_FACTOR,F=new Int32Array(y*E),$=this.yuvData;let H=this.top*this.dataWidth+this.left;for(let Y=0;Y<E;Y++){const le=Y*y;for(let ve=0;ve<y;ve++){const Te=$[H+ve*Wn.THUMBNAIL_SCALE_FACTOR]&255;F[le+ve]=4278190080|Te*65793}H+=this.dataWidth*Wn.THUMBNAIL_SCALE_FACTOR}return F}getThumbnailWidth(){return this.getWidth()/Wn.THUMBNAIL_SCALE_FACTOR}getThumbnailHeight(){return this.getHeight()/Wn.THUMBNAIL_SCALE_FACTOR}reverseHorizontal(y,E){const F=this.yuvData;for(let $=0,H=this.top*this.dataWidth+this.left;$<E;$++,H+=this.dataWidth){const Y=H+y/2;for(let le=H,ve=H+y-1;le<Y;le++,ve--){const Te=F[le];F[le]=F[ve],F[ve]=Te}}}invert(){return new V(this)}}Wn.THUMBNAIL_SCALE_FACTOR=2;class Fr extends G{constructor(y,E,F,$,H,Y,le){if(super(E,F),this.dataWidth=$,this.dataHeight=H,this.left=Y,this.top=le,y.BYTES_PER_ELEMENT===4){const ve=E*F,Te=new Uint8ClampedArray(ve);for(let Qe=0;Qe<ve;Qe++){const xt=y[Qe],It=xt>>16&255,Qt=xt>>7&510,St=xt&255;Te[Qe]=(It+Qt+St)/4&255}this.luminances=Te}else this.luminances=y;if($===void 0&&(this.dataWidth=E),H===void 0&&(this.dataHeight=F),Y===void 0&&(this.left=0),le===void 0&&(this.top=0),this.left+E>this.dataWidth||this.top+F>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 F=this.getWidth();(E==null||E.length<F)&&(E=new Uint8ClampedArray(F));const $=(y+this.top)*this.dataWidth+this.left;return w.arraycopy(this.luminances,$,E,0,F),E}getMatrix(){const y=this.getWidth(),E=this.getHeight();if(y===this.dataWidth&&E===this.dataHeight)return this.luminances;const F=y*E,$=new Uint8ClampedArray(F);let H=this.top*this.dataWidth+this.left;if(y===this.dataWidth)return w.arraycopy(this.luminances,H,$,0,F),$;for(let Y=0;Y<E;Y++){const le=Y*y;w.arraycopy(this.luminances,H,$,le,y),H+=this.dataWidth}return $}isCropSupported(){return!0}crop(y,E,F,$){return new Fr(this.luminances,F,$,this.dataWidth,this.dataHeight,this.left+y,this.top+E)}invert(){return new V(this)}}class Tr extends X{static forName(y){return this.getCharacterSetECIByName(y)}}class es{}es.ISO_8859_1=X.ISO8859_1;class Rs{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 kt{static singletonList(y){return[y]}static min(y,E){return y.sort(E)[0]}}class or{constructor(y){this.previous=y}getPrevious(){return this.previous}}class Hn extends or{constructor(y,E,F){super(y),this.value=E,this.bitCount=F}appendTo(y,E){y.appendBits(this.value,this.bitCount)}add(y,E){return new Hn(this,y,E)}addBinaryShift(y,E){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new Hn(this,y,E)}toString(){let y=this.value&(1<<this.bitCount)-1;return y|=1<<this.bitCount,"<"+I.toBinaryString(y|1<<this.bitCount).substring(1)+">"}}class Hr extends Hn{constructor(y,E,F){super(y,0,0),this.binaryShiftStart=E,this.binaryShiftByteCount=F}appendTo(y,E){for(let F=0;F<this.binaryShiftByteCount;F++)(F===0||F===31&&this.binaryShiftByteCount<=62)&&(y.appendBits(31,5),this.binaryShiftByteCount>62?y.appendBits(this.binaryShiftByteCount-31,16):F===0?y.appendBits(Math.min(this.binaryShiftByteCount,31),5):y.appendBits(this.binaryShiftByteCount-31,5)),y.appendBits(E[this.binaryShiftStart+F],8)}addBinaryShift(y,E){return new Hr(this,y,E)}toString(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}}function as(dt,y,E){return new Hr(dt,y,E)}function ss(dt,y,E){return new Hn(dt,y,E)}const ms=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],gs=0,Ui=1,$s=2,bs=3,Cs=4,dc=new Hn(null,0,0),_s=[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 _a(dt){for(let y of dt)P.fill(y,-1);return dt[gs][Cs]=0,dt[Ui][Cs]=0,dt[Ui][gs]=28,dt[bs][Cs]=0,dt[$s][Cs]=0,dt[$s][gs]=15,dt}const $u=_a(P.createInt32Array(6,6));class ba{constructor(y,E,F,$){this.token=y,this.mode=E,this.binaryShiftByteCount=F,this.bitCount=$}getMode(){return this.mode}getToken(){return this.token}getBinaryShiftByteCount(){return this.binaryShiftByteCount}getBitCount(){return this.bitCount}latchAndAppend(y,E){let F=this.bitCount,$=this.token;if(y!==this.mode){let Y=_s[this.mode][y];$=ss($,Y&65535,Y>>16),F+=Y>>16}let H=y===$s?4:5;return $=ss($,E,H),new ba($,y,0,F+H)}shiftAndAppend(y,E){let F=this.token,$=this.mode===$s?4:5;return F=ss(F,$u[this.mode][y],$),F=ss(F,E,5),new ba(F,this.mode,0,this.bitCount+$+5)}addBinaryShiftChar(y){let E=this.token,F=this.mode,$=this.bitCount;if(this.mode===Cs||this.mode===$s){let le=_s[F][gs];E=ss(E,le&65535,le>>16),$+=le>>16,F=gs}let H=this.binaryShiftByteCount===0||this.binaryShiftByteCount===31?18:this.binaryShiftByteCount===62?9:8,Y=new ba(E,F,this.binaryShiftByteCount+1,$+H);return Y.binaryShiftByteCount===2078&&(Y=Y.endBinaryShift(y+1)),Y}endBinaryShift(y){if(this.binaryShiftByteCount===0)return this;let E=this.token;return E=as(E,y-this.binaryShiftByteCount,this.binaryShiftByteCount),new ba(E,this.mode,0,this.bitCount)}isBetterThanOrEqualTo(y){let E=this.bitCount+(_s[this.mode][y.mode]>>16);return this.binaryShiftByteCount<y.binaryShiftByteCount?E+=ba.calculateBinaryShiftCost(y)-ba.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 F=new R;for(const $ of E)$.appendTo(F,y);return F}toString(){return K.format("%s bits=%d bytes=%d",ms[this.mode],this.bitCount,this.binaryShiftByteCount)}static calculateBinaryShiftCost(y){return y.binaryShiftByteCount>62?21:y.binaryShiftByteCount>31?20:y.binaryShiftByteCount>0?10:0}}ba.INITIAL_STATE=new ba(dc,gs,0,0);function qo(dt){const y=K.getCharCode(" "),E=K.getCharCode("."),F=K.getCharCode(",");dt[gs][y]=1;const $=K.getCharCode("Z"),H=K.getCharCode("A");for(let It=H;It<=$;It++)dt[gs][It]=It-H+2;dt[Ui][y]=1;const Y=K.getCharCode("z"),le=K.getCharCode("a");for(let It=le;It<=Y;It++)dt[Ui][It]=It-le+2;dt[$s][y]=1;const ve=K.getCharCode("9"),Te=K.getCharCode("0");for(let It=Te;It<=ve;It++)dt[$s][It]=It-Te+2;dt[$s][F]=12,dt[$s][E]=13;const Qe=["\0"," ","","","","","","","\x07","\b","	",`
`,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~",""];for(let It=0;It<Qe.length;It++)dt[bs][K.getCharCode(Qe[It])]=It;const xt=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(let It=0;It<xt.length;It++)K.getCharCode(xt[It])>0&&(dt[Cs][K.getCharCode(xt[It])]=It);return dt}const Uu=qo(P.createInt32Array(5,256));class Wl{constructor(y){this.text=y}encode(){const y=K.getCharCode(" "),E=K.getCharCode(`
`);let F=kt.singletonList(ba.INITIAL_STATE);for(let H=0;H<this.text.length;H++){let Y,le=H+1<this.text.length?this.text[H+1]:0;switch(this.text[H]){case K.getCharCode("\r"):Y=le===E?2:0;break;case K.getCharCode("."):Y=le===y?3:0;break;case K.getCharCode(","):Y=le===y?4:0;break;case K.getCharCode(":"):Y=le===y?5:0;break;default:Y=0}Y>0?(F=Wl.updateStateListForPair(F,H,Y),H++):F=this.updateStateListForChar(F,H)}return kt.min(F,(H,Y)=>H.getBitCount()-Y.getBitCount()).toBitArray(this.text)}updateStateListForChar(y,E){const F=[];for(let $ of y)this.updateStateForChar($,E,F);return Wl.simplifyStates(F)}updateStateForChar(y,E,F){let $=this.text[E]&255,H=Uu[y.getMode()][$]>0,Y=null;for(let le=0;le<=Cs;le++){let ve=Uu[le][$];if(ve>0){if(Y==null&&(Y=y.endBinaryShift(E)),!H||le===y.getMode()||le===$s){const Te=Y.latchAndAppend(le,ve);F.push(Te)}if(!H&&$u[y.getMode()][le]>=0){const Te=Y.shiftAndAppend(le,ve);F.push(Te)}}}if(y.getBinaryShiftByteCount()>0||Uu[y.getMode()][$]===0){let le=y.addBinaryShiftChar(E);F.push(le)}}static updateStateListForPair(y,E,F){const $=[];for(let H of y)this.updateStateForPair(H,E,F,$);return this.simplifyStates($)}static updateStateForPair(y,E,F,$){let H=y.endBinaryShift(E);if($.push(H.latchAndAppend(Cs,F)),y.getMode()!==Cs&&$.push(H.shiftAndAppend(Cs,F)),F===3||F===4){let Y=H.latchAndAppend($s,16-F).latchAndAppend($s,1);$.push(Y)}if(y.getBinaryShiftByteCount()>0){let Y=y.addBinaryShiftChar(E).addBinaryShiftChar(E+1);$.push(Y)}}static simplifyStates(y){let E=[];for(const F of y){let $=!0;for(const H of E){if(H.isBetterThanOrEqualTo(F)){$=!1;break}F.isBetterThanOrEqualTo(H)&&(E=E.filter(Y=>Y!==H))}$&&E.push(F)}return E}}class bi{constructor(){}static encodeBytes(y){return bi.encode(y,bi.DEFAULT_EC_PERCENT,bi.DEFAULT_AZTEC_LAYERS)}static encode(y,E,F){let $=new Wl(y).encode(),H=I.truncDivision($.getSize()*E,100)+11,Y=$.getSize()+H,le,ve,Te,Qe,xt;if(F!==bi.DEFAULT_AZTEC_LAYERS){if(le=F<0,ve=Math.abs(F),ve>(le?bi.MAX_NB_BITS_COMPACT:bi.MAX_NB_BITS))throw new f(K.format("Illegal value %s for layers",F));Te=bi.totalBitsInLayer(ve,le),Qe=bi.WORD_SIZE[ve];let Ar=Te-Te%Qe;if(xt=bi.stuffBits($,Qe),xt.getSize()+H>Ar)throw new f("Data to large for user specified layer");if(le&&xt.getSize()>Qe*64)throw new f("Data to large for user specified layer")}else{Qe=0,xt=null;for(let Ar=0;;Ar++){if(Ar>bi.MAX_NB_BITS)throw new f("Data too large for an Aztec code");if(le=Ar<=3,ve=le?Ar+1:Ar,Te=bi.totalBitsInLayer(ve,le),Y>Te)continue;(xt==null||Qe!==bi.WORD_SIZE[ve])&&(Qe=bi.WORD_SIZE[ve],xt=bi.stuffBits($,Qe));let Ss=Te-Te%Qe;if(!(le&&xt.getSize()>Qe*64)&&xt.getSize()+H<=Ss)break}}let It=bi.generateCheckWords(xt,Te,Qe),Qt=xt.getSize()/Qe,St=bi.generateModeMessage(le,ve,Qt),zt=(le?11:14)+ve*4,Wt=new Int32Array(zt),jn;if(le){jn=zt;for(let Ar=0;Ar<Wt.length;Ar++)Wt[Ar]=Ar}else{jn=zt+1+2*I.truncDivision(I.truncDivision(zt,2)-1,15);let Ar=I.truncDivision(zt,2),Ss=I.truncDivision(jn,2);for(let Zs=0;Zs<Ar;Zs++){let fc=Zs+I.truncDivision(Zs,15);Wt[Ar-Zs-1]=Ss-fc-1,Wt[Ar+Zs]=Ss+fc+1}}let mr=new he(jn);for(let Ar=0,Ss=0;Ar<ve;Ar++){let Zs=(ve-Ar)*4+(le?9:12);for(let fc=0;fc<Zs;fc++){let Ja=fc*2;for(let eo=0;eo<2;eo++)It.get(Ss+Ja+eo)&&mr.set(Wt[Ar*2+eo],Wt[Ar*2+fc]),It.get(Ss+Zs*2+Ja+eo)&&mr.set(Wt[Ar*2+fc],Wt[zt-1-Ar*2-eo]),It.get(Ss+Zs*4+Ja+eo)&&mr.set(Wt[zt-1-Ar*2-eo],Wt[zt-1-Ar*2-fc]),It.get(Ss+Zs*6+Ja+eo)&&mr.set(Wt[zt-1-Ar*2-fc],Wt[Ar*2+eo])}Ss+=Zs*8}if(bi.drawModeMessage(mr,le,jn,St),le)bi.drawBullsEye(mr,I.truncDivision(jn,2),5);else{bi.drawBullsEye(mr,I.truncDivision(jn,2),7);for(let Ar=0,Ss=0;Ar<I.truncDivision(zt,2)-1;Ar+=15,Ss+=16)for(let Zs=I.truncDivision(jn,2)&1;Zs<jn;Zs+=2)mr.set(I.truncDivision(jn,2)-Ss,Zs),mr.set(I.truncDivision(jn,2)+Ss,Zs),mr.set(Zs,I.truncDivision(jn,2)-Ss),mr.set(Zs,I.truncDivision(jn,2)+Ss)}let Sr=new Rs;return Sr.setCompact(le),Sr.setSize(jn),Sr.setLayers(ve),Sr.setCodeWords(Qt),Sr.setMatrix(mr),Sr}static drawBullsEye(y,E,F){for(let $=0;$<F;$+=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-F,E-F),y.set(E-F+1,E-F),y.set(E-F,E-F+1),y.set(E+F,E-F),y.set(E+F,E-F+1),y.set(E+F,E+F-1)}static generateModeMessage(y,E,F){let $=new R;return y?($.appendBits(E-1,2),$.appendBits(F-1,6),$=bi.generateCheckWords($,28,4)):($.appendBits(E-1,5),$.appendBits(F-1,11),$=bi.generateCheckWords($,40,4)),$}static drawModeMessage(y,E,F,$){let H=I.truncDivision(F,2);if(E)for(let Y=0;Y<7;Y++){let le=H-3+Y;$.get(Y)&&y.set(le,H-5),$.get(Y+7)&&y.set(H+5,le),$.get(20-Y)&&y.set(le,H+5),$.get(27-Y)&&y.set(H-5,le)}else for(let Y=0;Y<10;Y++){let le=H-5+Y+I.truncDivision(Y,5);$.get(Y)&&y.set(le,H-7),$.get(Y+10)&&y.set(H+7,le),$.get(29-Y)&&y.set(le,H+7),$.get(39-Y)&&y.set(H-7,le)}}static generateCheckWords(y,E,F){let $=y.getSize()/F,H=new br(bi.getGF(F)),Y=I.truncDivision(E,F),le=bi.bitsToWords(y,F,Y);H.encode(le,Y-$);let ve=E%F,Te=new R;Te.appendBits(0,ve);for(const Qe of Array.from(le))Te.appendBits(Qe,F);return Te}static bitsToWords(y,E,F){let $=new Int32Array(F),H,Y;for(H=0,Y=y.getSize()/E;H<Y;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 ut.AZTEC_PARAM;case 6:return ut.AZTEC_DATA_6;case 8:return ut.AZTEC_DATA_8;case 10:return ut.AZTEC_DATA_10;case 12:return ut.AZTEC_DATA_12;default:throw new f("Unsupported word size "+y)}}static stuffBits(y,E){let F=new R,$=y.getSize(),H=(1<<E)-2;for(let Y=0;Y<$;Y+=E){let le=0;for(let ve=0;ve<E;ve++)(Y+ve>=$||y.get(Y+ve))&&(le|=1<<E-1-ve);(le&H)===H?(F.appendBits(le&H,E),Y--):le&H?F.appendBits(le,E):(F.appendBits(le|1,E),Y--)}return F}static totalBitsInLayer(y,E){return((E?88:112)+16*y)*y}}bi.DEFAULT_EC_PERCENT=33,bi.DEFAULT_AZTEC_LAYERS=0,bi.MAX_NB_BITS=32,bi.MAX_NB_BITS_COMPACT=4,bi.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 wd{encode(y,E,F,$){return this.encodeWithHints(y,E,F,$,null)}encodeWithHints(y,E,F,$,H){let Y=es.ISO_8859_1,le=bi.DEFAULT_EC_PERCENT,ve=bi.DEFAULT_AZTEC_LAYERS;return H!=null&&(H.has(Ir.CHARACTER_SET)&&(Y=Tr.forName(H.get(Ir.CHARACTER_SET).toString())),H.has(Ir.ERROR_CORRECTION)&&(le=I.parseInt(H.get(Ir.ERROR_CORRECTION).toString())),H.has(Ir.AZTEC_LAYERS)&&(ve=I.parseInt(H.get(Ir.AZTEC_LAYERS).toString()))),wd.encodeLayers(y,E,F,$,Y,le,ve)}static encodeLayers(y,E,F,$,H,Y,le){if(E!==xe.AZTEC)throw new f("Can only encode AZTEC, but got "+E);let ve=bi.encode(K.getBytes(y,H),Y,le);return wd.renderResult(ve,F,$)}static renderResult(y,E,F){let $=y.getMatrix();if($==null)throw new tt;let H=$.getWidth(),Y=$.getHeight(),le=Math.max(E,H),ve=Math.max(F,Y),Te=Math.min(le/H,ve/Y),Qe=(le-H*Te)/2,xt=(ve-Y*Te)/2,It=new he(le,ve);for(let Qt=0,St=xt;Qt<Y;Qt++,St+=Te)for(let zt=0,Wt=Qe;zt<H;zt++,Wt+=Te)$.get(zt,Qt)&&It.setRegion(Wt,St,Te,Te);return It}}n.AbstractExpandedDecoder=gn,n.ArgumentException=d,n.ArithmeticException=Ke,n.AztecCode=Rs,n.AztecCodeReader=dn,n.AztecCodeWriter=wd,n.AztecDecoder=ht,n.AztecDetector=Ft,n.AztecDetectorResult=cn,n.AztecEncoder=bi,n.AztecHighLevelEncoder=Wl,n.AztecPoint=Ze,n.BarcodeFormat=xe,n.Binarizer=v,n.BinaryBitmap=x,n.BitArray=R,n.BitMatrix=he,n.BitSource=ge,n.BrowserAztecCodeReader=Yt,n.BrowserBarcodeReader=T,n.BrowserCodeReader=Ne,n.BrowserDatamatrixCodeReader=at,n.BrowserMultiFormatReader=pr,n.BrowserPDF417Reader=fr,n.BrowserQRCodeReader=Kr,n.BrowserQRCodeSvgWriter=lt,n.CharacterSetECI=X,n.ChecksumException=g,n.Code128Reader=ot,n.Code39Reader=De,n.DataMatrixDecodedBitStreamParser=ke,n.DataMatrixReader=Fe,n.DecodeHintType=U,n.DecoderResult=Pe,n.DefaultGridSampler=Zt,n.DetectorResult=nn,n.EAN13Reader=un,n.EncodeHintType=Ir,n.Exception=u,n.FormatException=L,n.GenericGF=ut,n.GenericGFPoly=Xe,n.GlobalHistogramBinarizer=ie,n.GridSampler=Xt,n.GridSamplerInstance=Ye,n.HTMLCanvasElementLuminanceSource=te,n.HybridBinarizer=oe,n.ITFReader=_t,n.IllegalArgumentException=f,n.IllegalStateException=tt,n.InvertedLuminanceSource=V,n.LuminanceSource=G,n.MathUtils=pt,n.MultiFormatOneDReader=k,n.MultiFormatReader=jr,n.MultiFormatWriter=tr,n.NotFoundException=Q,n.OneDReader=Bt,n.PDF417DecodedBitStreamParser=vt,n.PDF417DecoderErrorCorrection=os,n.PDF417Reader=pn,n.PDF417ResultMetadata=Cr,n.PerspectiveTransform=on,n.PlanarYUVLuminanceSource=Wn,n.QRCodeByteMatrix=xs,n.QRCodeDataMask=yt,n.QRCodeDecodedBitStreamParser=At,n.QRCodeDecoderErrorCorrectionLevel=Ce,n.QRCodeDecoderFormatInformation=Ue,n.QRCodeEncoder=Fn,n.QRCodeEncoderQRCode=Qs,n.QRCodeMaskUtil=Zn,n.QRCodeMatrixUtil=Pr,n.QRCodeMode=Ge,n.QRCodeReader=rr,n.QRCodeVersion=rt,n.QRCodeWriter=Ut,n.RGBLuminanceSource=Fr,n.RSS14Reader=_,n.RSSExpandedReader=p,n.ReaderException=dr,n.ReedSolomonDecoder=Le,n.ReedSolomonEncoder=br,n.ReedSolomonException=et,n.Result=me,n.ResultMetadataType=je,n.ResultPoint=wt,n.StringUtils=K,n.UnsupportedOperationException=ne,n.VideoInputDevice=ae,n.WhiteRectangleDetector=zn,n.WriterException=ai,n.ZXingArrays=P,n.ZXingCharset=Tr,n.ZXingInteger=I,n.ZXingStandardCharsets=es,n.ZXingStringBuilder=re,n.ZXingStringEncoding=J,n.ZXingSystem=w,n.createAbstractExpandedDecoder=En,Object.defineProperty(n,"__esModule",{value:!0})})}(jj,jj.exports)),jj.exports}var mo=cLt();const uLt=Ii(mo),dLt=PNe({__proto__:null,default:uLt},[mo]);var Dbe=function(){function e(t,n,r){if(this.formatMap=new Map([[As.QR_CODE,mo.BarcodeFormat.QR_CODE],[As.AZTEC,mo.BarcodeFormat.AZTEC],[As.CODABAR,mo.BarcodeFormat.CODABAR],[As.CODE_39,mo.BarcodeFormat.CODE_39],[As.CODE_93,mo.BarcodeFormat.CODE_93],[As.CODE_128,mo.BarcodeFormat.CODE_128],[As.DATA_MATRIX,mo.BarcodeFormat.DATA_MATRIX],[As.MAXICODE,mo.BarcodeFormat.MAXICODE],[As.ITF,mo.BarcodeFormat.ITF],[As.EAN_13,mo.BarcodeFormat.EAN_13],[As.EAN_8,mo.BarcodeFormat.EAN_8],[As.PDF_417,mo.BarcodeFormat.PDF_417],[As.RSS_14,mo.BarcodeFormat.RSS_14],[As.RSS_EXPANDED,mo.BarcodeFormat.RSS_EXPANDED],[As.UPC_A,mo.BarcodeFormat.UPC_A],[As.UPC_E,mo.BarcodeFormat.UPC_E],[As.UPC_EAN_EXTENSION,mo.BarcodeFormat.UPC_EAN_EXTENSION]]),this.reverseFormatMap=this.createReverseFormatMap(),!dLt)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(mo.DecodeHintType.POSSIBLE_FORMATS,s),a.set(mo.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 mo.MultiFormatReader(this.verbose,this.hints),r=new mo.HTMLCanvasElementLuminanceSource(t),s=new mo.BinaryBitmap(new mo.HybridBinarizer(r)),a=n.decode(s);return{text:a.text,format:NLe.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}(),fLt=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())})},hLt=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([[As.QR_CODE,"qr_code"],[As.AZTEC,"aztec"],[As.CODABAR,"codabar"],[As.CODE_39,"code_39"],[As.CODE_93,"code_93"],[As.CODE_128,"code_128"],[As.DATA_MATRIX,"data_matrix"],[As.ITF,"itf"],[As.EAN_13,"ean_13"],[As.EAN_8,"ean_8"],[As.PDF_417,"pdf417"],[As.UPC_A,"upc_a"],[As.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 fLt(this,void 0,void 0,function(){var n,r;return hLt(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:NLe.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}}},pLt=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)}}(),BR=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())})},$R=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}}},jLe=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}(),mLt=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}(jLe),xLt=function(e){mle(t,e);function t(n){return e.call(this,"zoom",n)||this}return t}(mLt),gLt=function(e){mle(t,e);function t(n){return e.call(this,"torch",n)||this}return t}(jLe),bLt=function(){function e(t){this.track=t}return e.prototype.zoomFeature=function(){return new xLt(this.track)},e.prototype.torchFeature=function(){return new gLt(this.track)},e}(),yLt=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 BR(this,void 0,void 0,function(){var a,o;return $R(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 BR(this,void 0,void 0,function(){return $R(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 bLt(this.getFirstTrackOrFail())},e}(),vLt=function(){function e(t){this.mediaStream=t}return e.prototype.render=function(t,n,r){return BR(this,void 0,void 0,function(){return $R(this,function(s){return[2,yLt.create(t,this.mediaStream,n,r)]})})},e.create=function(t){return BR(this,void 0,void 0,function(){var n,r;return $R(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}}},wLt=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,vLt.create(t)]})})},e}(),CLt=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())})},SLt=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}}},NLt=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=DC.unableToQuerySupportedDevices();return e.isHttpsOrLocalhost()||(t=DC.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 CLt(this,void 0,void 0,function(){var t,n,r,s,a,o,l;return SLt(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}(),el;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.NOT_STARTED=1]="NOT_STARTED",e[e.SCANNING=2]="SCANNING",e[e.PAUSED=3]="PAUSED"})(el||(el={}));var ALt=function(){function e(){this.state=el.NOT_STARTED,this.onGoingTransactionNewState=el.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===el.UNKNOWN)throw"Transaction is already cancelled, cannot execute().";var t=this.onGoingTransactionNewState;this.onGoingTransactionNewState=el.UNKNOWN,this.directTransition(t)},e.prototype.cancel=function(){if(this.onGoingTransactionNewState===el.UNKNOWN)throw"Transaction is already cancelled, cannot cancel().";this.onGoingTransactionNewState=el.UNKNOWN},e.prototype.getState=function(){return this.state},e.prototype.failIfTransitionOngoing=function(){if(this.onGoingTransactionNewState!==el.UNKNOWN)throw"Cannot transition to a new state, already under transition"},e.prototype.validateTransition=function(t){switch(this.state){case el.UNKNOWN:throw"Transition from unknown is not allowed";case el.NOT_STARTED:this.failIfNewStateIs(t,[el.PAUSED]);break;case el.SCANNING:break;case el.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}(),jLt=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()===el.NOT_STARTED},e.prototype.isScanning=function(){return this.stateManager.getState()!==el.NOT_STARTED},e.prototype.isStrictlyScanning=function(){return this.stateManager.getState()===el.SCANNING},e.prototype.isPaused=function(){return this.stateManager.getState()===el.PAUSED},e}(),ELt=function(){function e(){}return e.create=function(){return new jLt(new ALt)},e}(),_Lt=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)}}(),Tf=function(e){_Lt(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}(iLt),kLt=function(){function e(t,n){this.logger=n,this.fps=Tf.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=Tf.DEFAULT_DISABLE_FLIP}return e.prototype.isMediaStreamConstraintsValid=function(){return this.videoConstraints?ALe.isMediaStreamConstraintsValid(this.videoConstraints,this.logger):(this.logger.logError("Empty videoConstraints",!0),!1)},e.prototype.isShadedBoxEnabled=function(){return!ig(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 oLt(this.verbose),this.qrcode=new pLt(this.getSupportedFormats(n),this.getUseBarCodeDetectorIfSupported(r),this.verbose,this.logger),this.foreverScanTimeout,this.shouldScan=!0,this.stateManagerProxy=ELt.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=kLt.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:Tf.DEFAULT_WIDTH,d.style.position="relative",this.shouldScan=!0,this.element=d;var f=this,x=this.stateManagerProxy.startTransition(el.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(P,I){f.setupUi(P,I,l),f.isScanning=!0,f.foreverScan(l,r,o)}};wLt.failIfNotSupported().then(function(P){P.create(w).then(function(I){return I.render(a.element,C,N).then(function(R){f.renderedCamera=R,x.execute(),g(null)}).catch(function(R){x.cancel(),v(R)})}).catch(function(I){x.cancel(),v(DC.errorGettingUserMedia(I))})}).catch(function(P){x.cancel(),v(DC.cameraStreamingNotSupported())})})},e.prototype.pause=function(t){if(!this.stateManagerProxy.isStrictlyScanning())throw"Cannot pause, scanner is not scanning.";this.stateManagerProxy.directTransition(el.PAUSED),this.showPausedState(),(ig(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(el.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(el.NOT_STARTED);this.shouldScan=!1,this.foreverScanTimeout&&clearTimeout(this.foreverScanTimeout);var r=function(){if(t.element){var a=document.getElementById(Tf.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(ig(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:Tf.DEFAULT_WIDTH,f=Math.max(u.clientHeight?u.clientHeight:c,Tf.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=Tf.FILE_SCAN_HIDDEN_CANVAS_PADDING,C=Math.max(o.width,x.width),N=Math.max(o.height,x.height),P=C+2*w,I=N+2*w,R=r.createCanvasElement(P,I);u.appendChild(R);var O=R.getContext("2d");if(!O)throw"Unable to get 2d context from canvas";O.canvas.width=P,O.canvas.height=I,O.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 NLt.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(!ALe.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=[As.QR_CODE,As.AZTEC,As.CODABAR,As.CODE_39,As.CODE_93,As.CODE_128,As.DATA_MATRIX,As.MAXICODE,As.ITF,As.EAN_13,As.EAN_8,As.PDF_417,As.RSS_14,As.RSS_EXPANDED,As.UPC_A,As.UPC_E,As.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];sLt(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(ig(t))return!0;if(!ig(t.useBarCodeDetectorIfSupported))return t.useBarCodeDetectorIfSupported!==!1;if(ig(t.experimentalFeatures))return!0;var n=t.experimentalFeatures;return ig(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<Tf.MIN_QR_BOX_SIZE)throw"minimum size of 'config.qrbox' dimension value is"+" ".concat(Tf.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=ig(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=DC.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=DC.codeParseError(s);return n(a,aLt.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?Tf.BORDER_SHADER_MATCH_COLOR:Tf.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=ig(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(Tf.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=Tf.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 t_(){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 TLt=()=>{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),P=()=>{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(ml,{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:Ki,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:S1,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(rd,{className:"text-white w-3 h-3"})})]}),i.jsx("div",{onClick:P,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:P,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(t_,{}),i.jsx(ml,{to:"/terminal/BTC",onClick:()=>t(!1),children:"Terminal"}),i.jsx(ml,{to:"/discover-wallets",onClick:()=>t(!1),children:"Discover Wallets"}),i.jsx(ml,{to:"/hyperliquid-vaults",onClick:()=>t(!1),children:"Discover Vaults"}),i.jsx(ml,{to:"/copy-trade",onClick:()=>t(!1),children:"My Copy Trading"}),i.jsx(ml,{to:"/wallet-management",onClick:()=>t(!1),children:"Wallet Management"}),i.jsx(ml,{to:"/ticker",onClick:()=>t(!1),children:"Ticker"}),i.jsx(ml,{to:"/leaderboard",onClick:()=>t(!1),children:"Leaderboard"}),i.jsx(ml,{to:"/referral",onClick:()=>t(!1),children:"Referral"}),i.jsx(ml,{to:"/tracked-wallets",onClick:()=>t(!1),children:"Tracked Wallets"}),i.jsx(ml,{to:"/tracker",onClick:()=>t(!1),children:"My Activities"}),i.jsx(ml,{to:"/hyperliquid-whale-trades",onClick:()=>t(!1),children:"Whale trades"}),i.jsx(ml,{to:"/back-testing",onClick:()=>t(!1),children:"Backtest"}),i.jsx(ml,{to:"/hyperliquid-fee-calculator ",onClick:()=>t(!1),children:"HL Fee Calculator"}),i.jsxs(ml,{to:"/terminal/extended/BTC#gridbot",onClick:()=>t(!1),children:["Extended Grid Bot ",i.jsx(w0,{})]}),i.jsxs(ml,{to:"/dca-bot",onClick:()=>t(!1),children:["Extended DCA Bot ",i.jsx(w0,{})]}),i.jsxs("div",{onClick:()=>g(!0),className:"text-white font-bold cursor-pointer inline-flex items-center",children:["Extended Farming ",i.jsx(w0,{tone:"emerald",label:"SMART"})]}),i.jsxs(ml,{to:"/terminal/lighter/BTC#gridbot",onClick:()=>t(!1),children:["Lighter Grid Bot ",i.jsx(w0,{})]}),i.jsxs(ml,{to:"/terminal/hyperliquid/BTC#gridbot",onClick:()=>t(!1),children:["HL Grid Bot ",i.jsx(w0,{})]}),i.jsx(ml,{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(w$,{open:x,setOpen:g}),i.jsx(Woe,{open:v,setOpen:w}),i.jsx(qoe,{open:C,setOpen:N})]})},ELe=({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"})]}),ILt=()=>{var he,Q,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 te=localStorage.getItem("isToasterMinimized");return te===null?!1:te==="true"});m.useEffect(()=>{localStorage.setItem("isToasterMinimized",f)},[f]);const[g,v]=m.useState([]),C=localStorage.getItem("isDateToasterFormat")||"date",[N,P]=m.useState(C);m.useEffect(()=>{localStorage.setItem("isDateToasterFormat",N)},[N]);const[I,R]=m.useState(0),O=m.useRef(null),[U,L]=m.useState(null),[z,X]=m.useState(0),ne=1e4;m.useEffect(()=>{if(l||r.length===0||t){clearInterval(O.current);return}const te=Date.now();return L(te),O.current=setTimeout(()=>{R(ae=>(ae+1)%r.length),X(0)},ne-z),()=>clearTimeout(O.current)},[l,r.length,t,I,z]),m.useEffect(()=>{I>=(r==null?void 0:r.length)&&R(0)},[r]);async function J(){try{d(!0);const te=await fetch("https://dextrabothypev2.nftinit.io/api/hyper/analysis/getallmetrics/");if(!te.ok)throw new Error(`Server responded with status ${te.status}`);const ae=await te.json();ae&&s(ae.refcodes)}catch(te){return console.error("Error fetching metrics:",te.message),null}finally{d(!1)}}m.useEffect(()=>{let te;return f||(J(),te=setInterval(()=>{J()},6e4)),()=>{te&&clearInterval(te)}},[f]),m.useEffect(()=>{var te;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)},(xe,ye)=>ye+((a==null?void 0:a.length)??0)),Ne=fe==null?void 0:fe.sort(()=>Math.random()-.5),me=[...ae,...Ne??[]];o(me);const we=me==null?void 0:me.map(xe=>r==null?void 0:r[xe]);v(we)}else{const ae=(te=a==null?void 0:a.map(fe=>r==null?void 0:r[fe]))==null?void 0:te.filter(Boolean);v(ae)}},[r]);const[K,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(te=>{const ae=!te;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:ike,alt:"Toggle",className:"w-8 h-8 opacity-90 group-hover:opacity-100"})}),(!f||K)&&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:`${K?"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:te=>{te.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(ELe,{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(te=>te+(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[I])==null?void 0:he.result,createdAt:(Q=g[I])==null?void 0:Q.created_at,category:(ie=g[I])==null?void 0:ie.category,metric:(oe=g[I])==null?void 0:oe.metric,metricId:(G=g[I])==null?void 0:G.metric_definition_id,isDeleted:(V=g[I])==null?void 0:V.is_deleted,isDateToasterFormat:N,setIsDateToasterFormat:P,isDropdownOpen:l,activeIndex:I,progressRef:e})},`toast-${I}`)}):g==null?void 0:g.map((te,ae)=>i.jsx(qbe,{content:te==null?void 0:te.result,createdAt:te==null?void 0:te.created_at,category:te==null?void 0:te.category,metric:te==null?void 0:te.metric,metricId:te==null?void 0:te.metric_definition_id,isDeleted:te==null?void 0:te.is_deleted,isDateToasterFormat:N,setIsDateToasterFormat:P,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 P,I;function f({date:R}){const[O,U]=m.useState(Ro(R));return m.useEffect(()=>{const L=setInterval(()=>{U(Ro(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 ",O==null?void 0:O.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?ike:g?rke:v?Ayt:""}`,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=>hm(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?((P=(e==null?void 0:e.dextraaddress)||(e==null?void 0:e.sourceaddress))==null?void 0:P.slice(0,5))+".."+((I=(e==null?void 0:e.dextraaddress)||(e==null?void 0:e.sourceaddress))==null?void 0:I.slice(-4)):"--"}),i.jsx("img",{onClick:R=>{R.stopPropagation(),navigator.clipboard.writeText((e==null?void 0:e.dextraaddress)||(e==null?void 0:e.sourceaddress)),tn.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:Co,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:tae,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:jyt,alt:"",className:"w-[14px] h-[14px]"}),g&&i.jsx("img",{src:Eyt,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}):iu(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}`)})]})]})]})},PLt=()=>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:Syt,alt:"",className:"w-[14px] h-[14px]"})}),FLt=()=>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:ske,alt:"",className:"w-[14px] h-[14px]"})}),OLt=()=>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:Nyt,alt:"",className:"w-[14px] h-[14px]"})}),MLt=()=>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:l5,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"})]}),RLt=({open:e,setOpen:t,favoriteName:n,setFavoriteName:r,likeError:s,like:a,setLikeError:o})=>i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{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(ga,{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:$a})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Qbt,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 v5({walletAddress:e,children:t}){const{isConnected:n,address:r}=ts(),{trackedWatchList:s,getTrackedWatchList:a,setSignModalOpen:o}=m.useContext(Qr),[l,c]=m.useState(""),[u,d]=m.useState(!1),[f,x]=m.useState(""),g=async C=>{try{const N=window.localStorage.getItem("hyperToken"),P="https://dextrabothypev2.nftinit.io/api/hyper/tracker/save/",I=window.localStorage.getItem("hyperAddress");if(N||o(!0),!C){x("Please enter a wallet label.");return}const R=await fetch(P,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:r?r.toLowerCase():I,token:N,track_address:e,tag:C})});R.ok;const O=await R.json();O.success?(a(),c(""),d(!1),x(""),tn.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(O.error_message),tn.error(O.error_message),x(O.error_message))}catch(N){console.error("Error in like function:",N),tn.error(N.message||"Something went wrong!"),x(N.message)}},v=async()=>{try{const C=window.localStorage.getItem("hyperToken"),N=window.localStorage.getItem("hyperAddress"),P="https://dextrabothypev2.nftinit.io/api/hyper/tracker/unfollow/";C||o(!0);const I=await fetch(P,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:r?r.toLowerCase():N,token:C,track_address:e})});if(!I.ok)throw new Error(`Failed to unlike: ${I.status} ${I.statusText}`);const R=await I.json();R.success?(a(),tn.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),tn.error(R.error_message))}catch(C){console.error("Error in unlike function:",C),tn.error(C.message||"Something went wrong!")}},w=()=>{window.localStorage.getItem("hyperToken")?d(!0):o(!0)};return i.jsxs(i.Fragment,{children:[i.jsx(RLt,{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 LLt({open:e,setOpen:t,copyTradeSave:n}){return i.jsxs(Ea,{open:e,onClose:t,className:"relative z-50 font-manrope",children:[i.jsx(ja,{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(ga,{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:$a})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Ki,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 sa=(e,t=null)=>{t&&e.target.src===t?e.target.src=Wa:t&&e.target.src!==t?e.target.src=t:e.target.src!==Wa&&(e.target.src=Wa)};function DLt({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(Ba,{})}):!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:ac,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(P3,{}):i.jsx(I3,{}):i.jsx(F3,{})]})}),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(P3,{}):i.jsx(I3,{}):i.jsx(F3,{})]})})]})}),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=>sa(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(Fs,{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:BLt,max:$Lt}=Math,s3=(e,t=0,n=1)=>BLt($Lt(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]=s3(e[t],0,255)):t===3&&(e[t]=s3(e[t],0,1));return e},_Le={};for(let e of["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])_Le[`[object ${e}]`]=e.toLowerCase();function Wi(e){return _Le[Object.prototype.toString.call(e)]||"object"}const Pi=(e,t=null)=>e.length>=3?Array.prototype.slice.call(e):Wi(e[0])=="object"&&t?t.split("").filter(n=>e[0][n]!==void 0).map(n=>e[0][n]):e[0].slice(0),HA=e=>{if(e.length<2)return null;const t=e.length-1;return Wi(e[t])=="string"?e[t].toLowerCase():null},{PI:k$,min:kLe,max:TLe}=Math,tp=e=>Math.round(e*100)/100,ete=e=>Math.round(e*100)/100,hg=k$*2,jW=k$/3,ULt=k$/180,zLt=180/k$;function ILe(e){return[...e.slice(0,3).reverse(),...e.slice(3)]}const Ei={format:{},autodetect:[]};let Zr=class{constructor(...t){const n=this;if(Wi(t[0])==="object"&&t[0].constructor&&t[0].constructor===this.constructor)return t[0];let r=HA(t),s=!1;if(!r){s=!0,Ei.sorted||(Ei.autodetect=Ei.autodetect.sort((a,o)=>o.p-a.p),Ei.sorted=!0);for(let a of Ei.autodetect)if(r=a.test(...t),r)break}if(Ei.format[r]){const a=Ei.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 Wi(this.hex)=="function"?this.hex():`[${this._rgb.join(",")}]`}};const HLt="3.1.2",gi=(...e)=>new Zr(...e);gi.version=HLt;const yN={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"},VLt=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,WLt=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,PLe=e=>{if(e.match(VLt)){(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(WLt)){(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:vP}=Math,FLe=(...e)=>{let[t,n,r,s]=Pi(e,"rgba"),a=HA(e)||"auto";s===void 0&&(s=1),a==="auto"&&(a=s<1?"rgba":"rgb"),t=vP(t),n=vP(n),r=vP(r);let l="000000"+(t<<16|n<<8|r).toString(16);l=l.substr(l.length-6);let c="0"+vP(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}`}};Zr.prototype.name=function(){const e=FLe(this._rgb,"rgb");for(let t of Object.keys(yN))if(yN[t]===e)return t.toLowerCase();return e};Ei.format.named=e=>{if(e=e.toLowerCase(),yN[e])return PLe(yN[e]);throw new Error("unknown color name: "+e)};Ei.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&Wi(e)==="string"&&yN[e.toLowerCase()])return"named"}});Zr.prototype.alpha=function(e,t=!1){return e!==void 0&&Wi(e)==="number"?t?(this._rgb[3]=e,this):new Zr([this._rgb[0],this._rgb[1],this._rgb[2],e],"rgb"):this._rgb[3]};Zr.prototype.clipped=function(){return this._rgb._clipped||!1};const U0={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}},qLt=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 Rg(e){const t=qLt.get(String(e).toLowerCase());if(!t)throw new Error("unknown Lab illuminant "+e);U0.labWhitePoint=e,U0.Xn=t[0],U0.Zn=t[1]}function n_(){return U0.labWhitePoint}const gle=(...e)=>{e=Pi(e,"lab");const[t,n,r]=e,[s,a,o]=GLt(t,n,r),[l,c,u]=OLe(s,a,o);return[l,c,u,e.length>3?e[3]:1]},GLt=(e,t,n)=>{const{kE:r,kK:s,kKE:a,Xn:o,Yn:l,Zn:c}=U0,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,P=w*l,I=C*c;return[N,P,I]},EW=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},OLe=(e,t,n)=>{const{MtxAdaptMa:r,MtxAdaptMaI:s,MtxXYZ2RGB:a,RefWhiteRGB:o,Xn:l,Yn:c,Zn:u}=U0,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),P=(e*r.m02+t*r.m12+n*r.m22)*(w/x),I=C*s.m00+N*s.m10+P*s.m20,R=C*s.m01+N*s.m11+P*s.m21,O=C*s.m02+N*s.m12+P*s.m22,U=EW(I*a.m00+R*a.m10+O*a.m20),L=EW(I*a.m01+R*a.m11+O*a.m21),z=EW(I*a.m02+R*a.m12+O*a.m22);return[U*255,L*255,z*255]},ble=(...e)=>{const[t,n,r,...s]=Pi(e,"rgb"),[a,o,l]=MLe(t,n,r),[c,u,d]=KLt(a,o,l);return[c,u,d,...s.length>0&&s[0]<1?[s[0]]:[]]};function KLt(e,t,n){const{Xn:r,Yn:s,Zn:a,kE:o,kK:l}=U0,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 _W(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 MLe=(e,t,n)=>{e=_W(e/255),t=_W(t/255),n=_W(n/255);const{MtxRGB2XYZ:r,MtxAdaptMa:s,MtxAdaptMaI:a,Xn:o,Yn:l,Zn:c,As:u,Bs:d,Cs:f}=U0;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 P=x*s.m00+g*s.m10+v*s.m20,I=x*s.m01+g*s.m11+v*s.m21,R=x*s.m02+g*s.m12+v*s.m22;return P*=w/u,I*=C/d,R*=N/f,x=P*a.m00+I*a.m10+R*a.m20,g=P*a.m01+I*a.m11+R*a.m21,v=P*a.m02+I*a.m12+R*a.m22,[x,g,v]};Zr.prototype.lab=function(){return ble(this._rgb)};const YLt=(...e)=>new Zr(...e,"lab");Object.assign(gi,{lab:YLt,getLabWhitePoint:n_,setLabWhitePoint:Rg});Ei.format.lab=gle;Ei.autodetect.push({p:2,test:(...e)=>{if(e=Pi(e,"lab"),Wi(e)==="array"&&e.length===3)return"lab"}});Zr.prototype.darken=function(e=1){const t=this,n=t.lab();return n[0]-=U0.Kn*e,new Zr(n,"lab").alpha(t.alpha(),!0)};Zr.prototype.brighten=function(e=1){return this.darken(-e)};Zr.prototype.darker=Zr.prototype.darken;Zr.prototype.brighter=Zr.prototype.brighten;Zr.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:XLt}=Math,QLt=1e-7,ZLt=20;Zr.prototype.luminance=function(e,t="rgb"){if(e!==void 0&&Wi(e)==="number"){if(e===0)return new Zr([0,0,0,this._rgb[3]],"rgb");if(e===1)return new Zr([255,255,255,this._rgb[3]],"rgb");let n=this.luminance(),r=ZLt;const s=(o,l)=>{const c=o.interpolate(l,.5,t),u=c.luminance();return Math.abs(e-u)<QLt||!r--?c:u>e?s(o,c):s(c,l)},a=(n>e?s(new Zr([0,0,0]),this):s(this,new Zr([255,255,255]))).rgb();return new Zr([...a,this._rgb[3]])}return JLt(...this._rgb.slice(0,3))};const JLt=(e,t,n)=>(e=kW(e),t=kW(t),n=kW(n),.2126*e+.7152*t+.0722*n),kW=e=>(e/=255,e<=.03928?e/12.92:XLt((e+.055)/1.055,2.4)),Ou={},vN=(e,t,n=.5,...r)=>{let s=r[0]||"lrgb";if(!Ou[s]&&!r.length&&(s=Object.keys(Ou)[0]),!Ou[s])throw new Error(`interpolation mode ${s} is not defined`);return Wi(e)!=="object"&&(e=new Zr(e)),Wi(t)!=="object"&&(t=new Zr(t)),Ou[s](e,t,n).alpha(e.alpha()+n*(t.alpha()-e.alpha()))};Zr.prototype.mix=Zr.prototype.interpolate=function(e,t=.5,...n){return vN(this,e,t,...n)};Zr.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 Zr([t[0]*n,t[1]*n,t[2]*n,n],"rgb")};const{sin:eDt,cos:tDt}=Math,RLe=(...e)=>{let[t,n,r]=Pi(e,"lch");return isNaN(r)&&(r=0),r=r*ULt,[t,tDt(r)*n,eDt(r)*n]},yle=(...e)=>{e=Pi(e,"lch");const[t,n,r]=e,[s,a,o]=RLe(t,n,r),[l,c,u]=gle(s,a,o);return[l,c,u,e.length>3?e[3]:1]},nDt=(...e)=>{const t=ILe(Pi(e,"hcl"));return yle(...t)},{sqrt:rDt,atan2:sDt,round:iDt}=Math,LLe=(...e)=>{const[t,n,r]=Pi(e,"lab"),s=rDt(n*n+r*r);let a=(sDt(r,n)*zLt+360)%360;return iDt(s*1e4)===0&&(a=Number.NaN),[t,s,a]},vle=(...e)=>{const[t,n,r,...s]=Pi(e,"rgb"),[a,o,l]=ble(t,n,r),[c,u,d]=LLe(a,o,l);return[c,u,d,...s.length>0&&s[0]<1?[s[0]]:[]]};Zr.prototype.lch=function(){return vle(this._rgb)};Zr.prototype.hcl=function(){return ILe(vle(this._rgb))};const aDt=(...e)=>new Zr(...e,"lch"),oDt=(...e)=>new Zr(...e,"hcl");Object.assign(gi,{lch:aDt,hcl:oDt});Ei.format.lch=yle;Ei.format.hcl=nDt;["lch","hcl"].forEach(e=>Ei.autodetect.push({p:2,test:(...t)=>{if(t=Pi(t,e),Wi(t)==="array"&&t.length===3)return e}}));Zr.prototype.saturate=function(e=1){const t=this,n=t.lch();return n[1]+=U0.Kn*e,n[1]<0&&(n[1]=0),new Zr(n,"lch").alpha(t.alpha(),!0)};Zr.prototype.desaturate=function(e=1){return this.saturate(-e)};Zr.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(Wi(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(Wi(t)==="number")a[o]=t;else throw new Error("unsupported value for Color.set");const l=new Zr(a,r);return n?(this._rgb=l._rgb,this):l}throw new Error(`unknown channel ${s} in mode ${r}`)}else return a};Zr.prototype.tint=function(e=.5,...t){return vN(this,"white",e,...t)};Zr.prototype.shade=function(e=.5,...t){return vN(this,"black",e,...t)};const lDt=(e,t,n)=>{const r=e._rgb,s=t._rgb;return new Zr(r[0]+n*(s[0]-r[0]),r[1]+n*(s[1]-r[1]),r[2]+n*(s[2]-r[2]),"rgb")};Ou.rgb=lDt;const{sqrt:TW,pow:Q6}=Math,cDt=(e,t,n)=>{const[r,s,a]=e._rgb,[o,l,c]=t._rgb;return new Zr(TW(Q6(r,2)*(1-n)+Q6(o,2)*n),TW(Q6(s,2)*(1-n)+Q6(l,2)*n),TW(Q6(a,2)*(1-n)+Q6(c,2)*n),"rgb")};Ou.lrgb=cDt;const uDt=(e,t,n)=>{const r=e.lab(),s=t.lab();return new Zr(r[0]+n*(s[0]-r[0]),r[1]+n*(s[1]-r[1]),r[2]+n*(s[2]-r[2]),"lab")};Ou.lab=uDt;const VA=(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 Zr([v,x,g],r):new Zr([g,x,v],r)},DLe=(e,t,n)=>VA(e,t,n,"lch");Ou.lch=DLe;Ou.hcl=DLe;const dDt=e=>{if(Wi(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)},fDt=(...e)=>{const[t,n,r]=Pi(e,"rgb");return(t<<16)+(n<<8)+r};Zr.prototype.num=function(){return fDt(this._rgb)};const hDt=(...e)=>new Zr(...e,"num");Object.assign(gi,{num:hDt});Ei.format.num=dDt;Ei.autodetect.push({p:5,test:(...e)=>{if(e.length===1&&Wi(e[0])==="number"&&e[0]>=0&&e[0]<=16777215)return"num"}});const pDt=(e,t,n)=>{const r=e.num(),s=t.num();return new Zr(r+n*(s-r),"num")};Ou.num=pDt;const{floor:mDt}=Math,xDt=(...e)=>{e=Pi(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=mDt(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]},gDt=(...e)=>{const[t,n,r]=Pi(e,"rgb"),s=kLe(t,n,r),a=TLe(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]};Zr.prototype.hcg=function(){return gDt(this._rgb)};const bDt=(...e)=>new Zr(...e,"hcg");gi.hcg=bDt;Ei.format.hcg=xDt;Ei.autodetect.push({p:1,test:(...e)=>{if(e=Pi(e,"hcg"),Wi(e)==="array"&&e.length===3)return"hcg"}});const yDt=(e,t,n)=>VA(e,t,n,"hcg");Ou.hcg=yDt;const{cos:Z6}=Math,vDt=(...e)=>{e=Pi(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*Z6(hg*t)/Z6(jW-hg*t))/3,a=1-(o+s)):t<2/3?(t-=1/3,s=(1-n)/3,a=(1+n*Z6(hg*t)/Z6(jW-hg*t))/3,o=1-(s+a)):(t-=2/3,a=(1-n)/3,o=(1+n*Z6(hg*t)/Z6(jW-hg*t))/3,s=1-(a+o)),s=s3(r*s*3),a=s3(r*a*3),o=s3(r*o*3),[s*255,a*255,o*255,e.length>3?e[3]:1]},{min:wDt,sqrt:CDt,acos:SDt}=Math,NDt=(...e)=>{let[t,n,r]=Pi(e,"rgb");t/=255,n/=255,r/=255;let s;const a=wDt(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/=CDt((t-n)*(t-n)+(t-r)*(n-r)),s=SDt(s),r>n&&(s=hg-s),s/=hg),[s*360,l,o]};Zr.prototype.hsi=function(){return NDt(this._rgb)};const ADt=(...e)=>new Zr(...e,"hsi");gi.hsi=ADt;Ei.format.hsi=vDt;Ei.autodetect.push({p:2,test:(...e)=>{if(e=Pi(e,"hsi"),Wi(e)==="array"&&e.length===3)return"hsi"}});const jDt=(e,t,n)=>VA(e,t,n,"hsi");Ou.hsi=jDt;const tte=(...e)=>{e=Pi(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]},BLe=(...e)=>{e=Pi(e,"rgba");let[t,n,r]=e;t/=255,n/=255,r/=255;const s=kLe(t,n,r),a=TLe(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]};Zr.prototype.hsl=function(){return BLe(this._rgb)};const EDt=(...e)=>new Zr(...e,"hsl");gi.hsl=EDt;Ei.format.hsl=tte;Ei.autodetect.push({p:2,test:(...e)=>{if(e=Pi(e,"hsl"),Wi(e)==="array"&&e.length===3)return"hsl"}});const _Dt=(e,t,n)=>VA(e,t,n,"hsl");Ou.hsl=_Dt;const{floor:kDt}=Math,TDt=(...e)=>{e=Pi(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=kDt(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:IDt,max:PDt}=Math,FDt=(...e)=>{e=Pi(e,"rgb");let[t,n,r]=e;const s=IDt(t,n,r),a=PDt(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]};Zr.prototype.hsv=function(){return FDt(this._rgb)};const ODt=(...e)=>new Zr(...e,"hsv");gi.hsv=ODt;Ei.format.hsv=TDt;Ei.autodetect.push({p:2,test:(...e)=>{if(e=Pi(e,"hsv"),Wi(e)==="array"&&e.length===3)return"hsv"}});const MDt=(e,t,n)=>VA(e,t,n,"hsv");Ou.hsv=MDt;function UR(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=Pi(e,"lab");const[t,n,r,...s]=e,[a,o,l]=RDt([t,n,r]),[c,u,d]=OLe(a,o,l);return[c,u,d,...s.length>0&&s[0]<1?[s[0]]:[]]};function RDt(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=UR(n,e);return UR(t,r.map(s=>s**3))}const Cle=(...e)=>{const[t,n,r,...s]=Pi(e,"rgb"),a=MLe(t,n,r);return[...LDt(a),...s.length>0&&s[0]<1?[s[0]]:[]]};function LDt(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=UR(t,e);return UR(n,r.map(s=>Math.cbrt(s)))}Zr.prototype.oklab=function(){return Cle(this._rgb)};const DDt=(...e)=>new Zr(...e,"oklab");Object.assign(gi,{oklab:DDt});Ei.format.oklab=wle;Ei.autodetect.push({p:2,test:(...e)=>{if(e=Pi(e,"oklab"),Wi(e)==="array"&&e.length===3)return"oklab"}});const BDt=(e,t,n)=>{const r=e.oklab(),s=t.oklab();return new Zr(r[0]+n*(s[0]-r[0]),r[1]+n*(s[1]-r[1]),r[2]+n*(s[2]-r[2]),"oklab")};Ou.oklab=BDt;const $Dt=(e,t,n)=>VA(e,t,n,"oklch");Ou.oklch=$Dt;const{pow:IW,sqrt:PW,PI:FW,cos:Gbe,sin:Kbe,atan2:UDt}=Math,zDt=(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 Zr(f)),t==="lrgb")return HDt(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*FW;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*FW;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=UDt(u/l[f],c/l[f])/FW*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 Zr(o,t).alpha(d>.99999?1:d,!0)},HDt=(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]+=IW(l[0],2)*o,r[1]+=IW(l[1],2)*o,r[2]+=IW(l[2],2)*o,r[3]+=l[3]*o}return r[0]=PW(r[0]),r[1]=PW(r[1]),r[2]=PW(r[2]),r[3]>.9999999&&(r[3]=1),new Zr(xle(r))},{pow:VDt}=Math;function zR(e){let t="rgb",n=gi("#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&&Wi(L)==="string"&&gi.brewer&&gi.brewer[L.toLowerCase()]&&(L=gi.brewer[L.toLowerCase()]),Wi(L)==="array"){L.length===1&&(L=[L[0],L[0]]),L=L.slice(0);for(let z=0;z<L.length;z++)L[z]=gi(L[z]);a.length=0;for(let z=0;z<L.length;z++)a.push(z/(L.length-1))}return O(),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 P=L=>L,I=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=I(ne),z||(ne=P(ne)),w!==1&&(ne=VDt(ne,w)),ne=o[0]+ne*(1-o[0]-o[1]),ne=s3(ne,0,1);const J=Math.floor(ne*1e4);if(v&&g[J])X=g[J];else{if(Wi(c)==="array")for(let K=0;K<a.length;K++){const re=a[K];if(ne<=re){X=c[K];break}if(ne>=re&&K===a.length-1){X=c[K];break}if(ne>re&&ne<a[K+1]){ne=(ne-re)/(a[K+1]-re),X=gi.interpolate(c[K],c[K+1],ne,t);break}}else Wi(c)==="function"&&(X=c(ne));v&&(g[J]=X)}return X};var O=()=>g={};C(e);const U=function(L){const z=gi(R(L));return u&&z[u]?z[u]():z};return U.classes=function(L){if(L!=null){if(Wi(L)==="array")l=L,s=[L[0],L[L.length-1]];else{const z=gi.analyze(s);L===0?l=[z.min,z.max]:l=gi.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,K)=>K/(L.length-1)),ne=L.map(J=>(J-d)/(f-d));ne.every((J,K)=>X[K]===J)||(I=J=>{if(J<=0||J>=1)return J;let K=0;for(;J>=ne[K+1];)K++;const re=(J-ne[K])/(ne[K+1]-ne[K]);return X[K]+re*(X[K+1]-X[K])})}}return s=[d,f],U},U.mode=function(L){return arguments.length?(t=L,O(),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,O(),x?P=function(z){const X=R(0,!0).lab()[0],ne=R(1,!0).lab()[0],J=X>ne;let K=R(z,!0).lab()[0];const re=X+(ne-X)*z;let he=K-re,Q=0,ie=1,oe=20;for(;Math.abs(he)>.01&&oe-- >0;)(function(){return J&&(he*=-1),he<0?(Q=z,z+=(ie-z)*.5):(ie=z,z+=(Q-z)*.5),K=R(z,!0).lab()[0],he=K-re})();return z}:P=z=>z,U},U.padding=function(L){return L!=null?(Wi(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=WDt(0,L).map(K=>U(ne+K/(L-1)*J))}else{e=[];let ne=[];if(l&&l.length>2)for(let J=1,K=l.length,re=1<=K;re?J<K:J>K;re?J++:J--)ne.push((l[J-1]+l[J])*.5);else ne=s;X=ne.map(J=>U(J))}return gi[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=gi(L),U):n},U}function WDt(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 qDt=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},GDt=function(e){let t,n,r,s;if(e=e.map(a=>new Zr(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 Zr(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 Zr(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 Zr(l,"lab")}}else if(e.length>=5){let a,o,l;a=e.map(c=>c.lab()),l=e.length-1,o=qDt(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 Zr(d,"lab")}}else throw new RangeError("No point in running bezier with only one color.");return t},KDt=e=>{const t=GDt(e);return t.scale=()=>zR(t),t},{round:$Le}=Math;Zr.prototype.rgb=function(e=!0){return e===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map($Le)};Zr.prototype.rgba=function(e=!0){return this._rgb.slice(0,4).map((t,n)=>n<3?e===!1?t:$Le(t):t)};const YDt=(...e)=>new Zr(...e,"rgb");Object.assign(gi,{rgb:YDt});Ei.format.rgb=(...e)=>{const t=Pi(e,"rgba");return t[3]===void 0&&(t[3]=1),t};Ei.autodetect.push({p:3,test:(...e)=>{if(e=Pi(e,"rgba"),Wi(e)==="array"&&(e.length===3||e.length===4&&Wi(e[3])=="number"&&e[3]>=0&&e[3]<=1))return"rgb"}});const Cm=(e,t,n)=>{if(!Cm[n])throw new Error("unknown blend mode "+n);return Cm[n](e,t)},h2=e=>(t,n)=>{const r=gi(n).rgb(),s=gi(t).rgb();return gi.rgb(e(r,s))},p2=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},XDt=e=>e,QDt=(e,t)=>e*t/255,ZDt=(e,t)=>e>t?t:e,JDt=(e,t)=>e>t?e:t,eBt=(e,t)=>255*(1-(1-e/255)*(1-t/255)),tBt=(e,t)=>t<128?2*e*t/255:255*(1-2*(1-e/255)*(1-t/255)),nBt=(e,t)=>255*(1-(1-t/255)/(e/255)),rBt=(e,t)=>e===255?255:(e=255*(t/255)/(1-e/255),e>255?255:e);Cm.normal=h2(p2(XDt));Cm.multiply=h2(p2(QDt));Cm.screen=h2(p2(eBt));Cm.overlay=h2(p2(tBt));Cm.darken=h2(p2(ZDt));Cm.lighten=h2(p2(JDt));Cm.dodge=h2(p2(rBt));Cm.burn=h2(p2(nBt));const{pow:sBt,sin:iBt,cos:aBt}=Math;function oBt(e=300,t=-1.5,n=1,r=1,s=[0,1]){let a=0,o;Wi(s)==="array"?o=s[1]-s[0]:(o=0,s=[s,s]);const l=function(c){const u=hg*((e+120)/360+t*c),d=sBt(s[0]+o*c,r),x=(a!==0?n[0]+c*a:n)*d*(1-d)/2,g=aBt(u),v=iBt(u),w=d+x*(-.14861*g+1.78277*v),C=d+x*(-.29227*g-.90649*v),N=d+x*(1.97294*g);return gi(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,Wi(n)==="array"?(a=n[1]-n[0],a===0&&(n=n[1])):a=0,l)},l.lightness=function(c){return c==null?s:(Wi(c)==="array"?(s=c,o=c[1]-c[0]):(s=[c,c],o=0),l)},l.scale=()=>gi.scale(l),l.hue(n),l}const lBt="0123456789abcdef",{floor:cBt,random:uBt}=Math,dBt=()=>{let e="#";for(let t=0;t<6;t++)e+=lBt.charAt(cBt(uBt()*16));return new Zr(e,"hex")},{log:Ybe,pow:fBt,floor:hBt,abs:pBt}=Math;function ULe(e,t=null){const n={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return Wi(e)==="object"&&(e=Object.values(e)),e.forEach(r=>{t&&Wi(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)=>zLe(n,r,s),n}function zLe(e,t="equal",n=7){Wi(e)=="array"&&(e=ULe(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(fBt(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=hBt(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 P=a[N];let I=Number.MAX_VALUE,R;for(let O=0;O<n;O++){const U=pBt(g[O]-P);U<I&&(I=U,R=O),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 mBt=(e,t)=>{e=new Zr(e),t=new Zr(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,xBt=5e-4,gBt=.1,Qbe=1.14,wP=.022,Zbe=1.414,bBt=(e,t)=>{e=new Zr(e),t=new Zr(t),e.alpha()<1&&(e=vN(t,e,e.alpha(),"rgb"));const n=Jbe(...e.rgb()),r=Jbe(...t.rgb()),s=n>=wP?n:n+Math.pow(wP-n,Zbe),a=r>=wP?r:r+Math.pow(wP-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)<xBt?0:s<a?o*Qbe:l*Qbe;return(Math.abs(c)<gBt?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:Wx,pow:Il,min:yBt,max:vBt,atan2:eye,abs:tye,cos:CP,sin:nye,exp:wBt,PI:rye}=Math;function CBt(e,t,n=1,r=1,s=1){var a=function(Ne){return 360*Ne/(2*rye)},o=function(Ne){return 2*rye*Ne/360};e=new Zr(e),t=new Zr(t);const[l,c,u]=Array.from(e.lab()),[d,f,x]=Array.from(t.lab()),g=(l+d)/2,v=Wx(Il(c,2)+Il(u,2)),w=Wx(Il(f,2)+Il(x,2)),C=(v+w)/2,N=.5*(1-Wx(Il(C,7)/(Il(C,7)+Il(25,7)))),P=c*(1+N),I=f*(1+N),R=Wx(Il(P,2)+Il(u,2)),O=Wx(Il(I,2)+Il(x,2)),U=(R+O)/2,L=a(eye(u,P)),z=a(eye(x,I)),X=L>=0?L:L+360,ne=z>=0?z:z+360,J=tye(X-ne)>180?(X+ne+360)/2:(X+ne)/2,K=1-.17*CP(o(J-30))+.24*CP(o(2*J))+.32*CP(o(3*J+6))-.2*CP(o(4*J-63));let re=ne-X;re=tye(re)<=180?re:ne<=X?re+360:re-360,re=2*Wx(R*O)*nye(o(re)/2);const he=d-l,Q=O-R,ie=1+.015*Il(g-50,2)/Wx(20+Il(g-50,2)),oe=1+.045*U,G=1+.015*U*K,V=30*wBt(-Il((J-275)/25,2)),ae=-(2*Wx(Il(U,7)/(Il(U,7)+Il(25,7))))*nye(2*o(V)),fe=Wx(Il(he/(n*ie),2)+Il(Q/(r*oe),2)+Il(re/(s*G),2)+ae*(Q/(r*oe))*(re/(s*G)));return vBt(0,yBt(100,fe))}function SBt(e,t,n="lab"){e=new Zr(e),t=new Zr(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 NBt=(...e)=>{try{return new Zr(...e),!0}catch{return!1}},ABt={cool(){return zR([gi.hsl(180,1,.9),gi.hsl(250,.7,.4)])},hot(){return zR(["#000","#f00","#ff0","#fff"]).mode("rgb")}},nte={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"]},HLe=Object.keys(nte),sye=new Map(HLe.map(e=>[e.toLowerCase(),e])),jBt=typeof Proxy=="function"?new Proxy(nte,{get(e,t){const n=t.toLowerCase();if(sye.has(n))return e[sye.get(n)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(HLe)}}):nte,EBt=(...e)=>{e=Pi(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,_Bt=(...e)=>{let[t,n,r]=Pi(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]};Zr.prototype.cmyk=function(){return _Bt(this._rgb)};const kBt=(...e)=>new Zr(...e,"cmyk");Object.assign(gi,{cmyk:kBt});Ei.format.cmyk=EBt;Ei.autodetect.push({p:2,test:(...e)=>{if(e=Pi(e,"cmyk"),Wi(e)==="array"&&e.length===4)return"cmyk"}});const TBt=(...e)=>{const t=Pi(e,"hsla");let n=HA(e)||"lsa";return t[0]=tp(t[0]||0)+"deg",t[1]=tp(t[1]*100)+"%",t[2]=tp(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(" ")})`},IBt=(...e)=>{const t=Pi(e,"lab");let n=HA(e)||"lab";return t[0]=tp(t[0])+"%",t[1]=tp(t[1]),t[2]=tp(t[2]),n==="laba"||t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`lab(${t.join(" ")})`},PBt=(...e)=>{const t=Pi(e,"lch");let n=HA(e)||"lab";return t[0]=tp(t[0])+"%",t[1]=tp(t[1]),t[2]=isNaN(t[2])?"none":tp(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(" ")})`},FBt=(...e)=>{const t=Pi(e,"lab");return t[0]=tp(t[0]*100)+"%",t[1]=ete(t[1]),t[2]=ete(t[2]),t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`oklab(${t.join(" ")})`},VLe=(...e)=>{const[t,n,r,...s]=Pi(e,"rgb"),[a,o,l]=Cle(t,n,r),[c,u,d]=LLe(a,o,l);return[c,u,d,...s.length>0&&s[0]<1?[s[0]]:[]]},OBt=(...e)=>{const t=Pi(e,"lch");return t[0]=tp(t[0]*100)+"%",t[1]=ete(t[1]),t[2]=isNaN(t[2])?"none":tp(t[2])+"deg",t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`oklch(${t.join(" ")})`},{round:OW}=Math,MBt=(...e)=>{const t=Pi(e,"rgba");let n=HA(e)||"rgb";if(n.substr(0,3)==="hsl")return TBt(BLe(t),n);if(n.substr(0,3)==="lab"){const r=n_();Rg("d50");const s=IBt(ble(t),n);return Rg(r),s}if(n.substr(0,3)==="lch"){const r=n_();Rg("d50");const s=PBt(vle(t),n);return Rg(r),s}return n.substr(0,5)==="oklab"?FBt(Cle(t)):n.substr(0,5)==="oklch"?OBt(VLe(t)):(t[0]=OW(t[0]),t[1]=OW(t[1]),t[2]=OW(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(" ")})`)},WLe=(...e)=>{e=Pi(e,"lch");const[t,n,r,...s]=e,[a,o,l]=RLe(t,n,r),[c,u,d]=wle(a,o,l);return[c,u,d,...s.length>0&&s[0]<1?[s[0]]:[]]},Kg=/((?:-?\d+)|(?:-?\d+(?:\.\d+)?)%|none)/.source,pm=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%?)|none)/.source,HR=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%)|none)/.source,fp=/\s*/.source,WA=/\s+/.source,Sle=/\s*,\s*/.source,T$=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?)|none)/.source,qA=/\s*(?:\/\s*((?:[01]|[01]?\.\d+)|\d+(?:\.\d+)?%))?/.source,qLe=new RegExp("^rgba?\\("+fp+[Kg,Kg,Kg].join(WA)+qA+"\\)$"),GLe=new RegExp("^rgb\\("+fp+[Kg,Kg,Kg].join(Sle)+fp+"\\)$"),KLe=new RegExp("^rgba\\("+fp+[Kg,Kg,Kg,pm].join(Sle)+fp+"\\)$"),YLe=new RegExp("^hsla?\\("+fp+[T$,HR,HR].join(WA)+qA+"\\)$"),XLe=new RegExp("^hsl?\\("+fp+[T$,HR,HR].join(Sle)+fp+"\\)$"),QLe=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,ZLe=new RegExp("^lab\\("+fp+[pm,pm,pm].join(WA)+qA+"\\)$"),JLe=new RegExp("^lch\\("+fp+[pm,pm,T$].join(WA)+qA+"\\)$"),eDe=new RegExp("^oklab\\("+fp+[pm,pm,pm].join(WA)+qA+"\\)$"),tDe=new RegExp("^oklch\\("+fp+[pm,pm,T$].join(WA)+qA+"\\)$"),{round:nDe}=Math,J6=e=>e.map((t,n)=>n<=2?s3(nDe(t),0,255):t),Pl=(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),Ku=(e,t)=>e==="none"?t:e,Nle=e=>{if(e=e.toLowerCase().trim(),e==="transparent")return[0,0,0,0];let t;if(Ei.format.named)try{return Ei.format.named(e)}catch{}if((t=e.match(qLe))||(t=e.match(GLe))){let n=t.slice(1,4);for(let s=0;s<3;s++)n[s]=+Pl(Ku(n[s],0),0,255);n=J6(n);const r=t[4]!==void 0?+Pl(t[4],0,1):1;return n[3]=r,n}if(t=e.match(KLe)){const n=t.slice(1,5);for(let r=0;r<4;r++)n[r]=+Pl(n[r],0,255);return n}if((t=e.match(YLe))||(t=e.match(XLe))){const n=t.slice(1,4);n[0]=+Ku(n[0].replace("deg",""),0),n[1]=+Pl(Ku(n[1],0),0,100)*.01,n[2]=+Pl(Ku(n[2],0),0,100)*.01;const r=J6(tte(n)),s=t[4]!==void 0?+Pl(t[4],0,1):1;return r[3]=s,r}if(t=e.match(QLe)){const n=t.slice(1,4);n[1]*=.01,n[2]*=.01;const r=tte(n);for(let s=0;s<3;s++)r[s]=nDe(r[s]);return r[3]=+t[4],r}if(t=e.match(ZLe)){const n=t.slice(1,4);n[0]=Pl(Ku(n[0],0),0,100),n[1]=Pl(Ku(n[1],0),-125,125,!0),n[2]=Pl(Ku(n[2],0),-125,125,!0);const r=n_();Rg("d50");const s=J6(gle(n));Rg(r);const a=t[4]!==void 0?+Pl(t[4],0,1):1;return s[3]=a,s}if(t=e.match(JLe)){const n=t.slice(1,4);n[0]=Pl(n[0],0,100),n[1]=Pl(Ku(n[1],0),0,150,!1),n[2]=+Ku(n[2].replace("deg",""),0);const r=n_();Rg("d50");const s=J6(yle(n));Rg(r);const a=t[4]!==void 0?+Pl(t[4],0,1):1;return s[3]=a,s}if(t=e.match(eDe)){const n=t.slice(1,4);n[0]=Pl(Ku(n[0],0),0,1),n[1]=Pl(Ku(n[1],0),-.4,.4,!0),n[2]=Pl(Ku(n[2],0),-.4,.4,!0);const r=J6(wle(n)),s=t[4]!==void 0?+Pl(t[4],0,1):1;return r[3]=s,r}if(t=e.match(tDe)){const n=t.slice(1,4);n[0]=Pl(Ku(n[0],0),0,1),n[1]=Pl(Ku(n[1],0),0,.4,!1),n[2]=+Ku(n[2].replace("deg",""),0);const r=J6(WLe(n)),s=t[4]!==void 0?+Pl(t[4],0,1):1;return r[3]=s,r}};Nle.test=e=>qLe.test(e)||YLe.test(e)||ZLe.test(e)||JLe.test(e)||eDe.test(e)||tDe.test(e)||GLe.test(e)||KLe.test(e)||XLe.test(e)||QLe.test(e)||e==="transparent";Zr.prototype.css=function(e){return MBt(this._rgb,e)};const RBt=(...e)=>new Zr(...e,"css");gi.css=RBt;Ei.format.css=Nle;Ei.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&Wi(e)==="string"&&Nle.test(e))return"css"}});Ei.format.gl=(...e)=>{const t=Pi(e,"rgba");return t[0]*=255,t[1]*=255,t[2]*=255,t};const LBt=(...e)=>new Zr(...e,"gl");gi.gl=LBt;Zr.prototype.gl=function(){const e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]};Zr.prototype.hex=function(e){return FLe(this._rgb,e)};const DBt=(...e)=>new Zr(...e,"hex");gi.hex=DBt;Ei.format.hex=PLe;Ei.autodetect.push({p:4,test:(e,...t)=>{if(!t.length&&Wi(e)==="string"&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return"hex"}});const{log:SP}=Math,rDe=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*SP(r),s=t<20?0:-254.76935184120902+.8274096064007395*(s=t-10)+115.67994401066147*SP(s)):(n=351.97690566805693+.114206453784165*(n=t-55)-40.25366309332127*SP(n),r=325.4494125711974+.07943456536662342*(r=t-50)-28.0852963507957*SP(r),s=255),[n,r,s,1]},{round:BBt}=Math,$Bt=(...e)=>{const t=Pi(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=rDe(l);c[2]/c[0]>=r/n?a=l:s=l}return BBt(l)};Zr.prototype.temp=Zr.prototype.kelvin=Zr.prototype.temperature=function(){return $Bt(this._rgb)};const MW=(...e)=>new Zr(...e,"temp");Object.assign(gi,{temp:MW,kelvin:MW,temperature:MW});Ei.format.temp=Ei.format.kelvin=Ei.format.temperature=rDe;Zr.prototype.oklch=function(){return VLe(this._rgb)};const UBt=(...e)=>new Zr(...e,"oklch");Object.assign(gi,{oklch:UBt});Ei.format.oklch=WLe;Ei.autodetect.push({p:2,test:(...e)=>{if(e=Pi(e,"oklch"),Wi(e)==="array"&&e.length===3)return"oklch"}});Object.assign(gi,{analyze:ULe,average:zDt,bezier:KDt,blend:Cm,brewer:jBt,Color:Zr,colors:yN,contrast:mBt,contrastAPCA:bBt,cubehelix:oBt,deltaE:CBt,distance:SBt,input:Ei,interpolate:vN,limits:zLe,mix:vN,random:dBt,scale:zR,scales:ABt,valid:NBt});const zBt=({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"})}),nw=({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"})]}),RW=({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(Ai,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(so,{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(rd,{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(_y,{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(nw,{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(zBt,{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:P=>hm(P)}),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))})]})]})]})},LW=new Map,HBt=e=>{if(!e)return Math.floor(Math.random()*1240);const t=e.toLowerCase().replace(/^0x/,"");return parseInt(t.slice(0,8),16)%1240};function sDe({wallet:e,className:t=""}){const[n,r]=m.useState(()=>LW.get(e)||null),[s,a]=m.useState(!1);return m.useEffect(()=>{if(LW.has(e))return;const o=HBt(e);hs.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)}`),LW.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 VBt=({open:e,setOpen:t,setCopyTradeModal:n,onClose:r,setIsUnderstand:s})=>i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{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(ga,{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:Ki,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"})})]})]})})})})})]}),WBt=({open:e,setOpen:t,setCopyTradeModal:n,onClose:r,setIsLighterUnderstand:s})=>i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{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(ga,{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:Ki,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:bm,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"})})]})]})})})})})]}),qBt=({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:P}=m.useContext(Qr),{address:I}=ts(),[R,O]=m.useState(!1),[U,L]=m.useState(!1),[z,X]=m.useState(""),[ne,J]=m.useState(""),[K,re]=m.useState(""),[he,Q]=m.useState(!1),ie=async()=>{var fe,Ne,me,we,xe,ye;const te=window.localStorage.getItem("hyperToken"),ae=window.localStorage.getItem("hyperAddress");if(!(!te||!ae))try{Q(!0);const je=await _i(ae.toLowerCase(),te);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((Ne=je==null?void 0:je.mushboomer_counts)==null?void 0:Ne.sol),v(je==null?void 0:je.referral_code),w(je==null?void 0:je.refcode),C(je==null?void 0:je.whitelist),N(te),P(ae),re(je==null?void 0:je.farming_tools),t(je==null?void 0:je.farming_tools),Q(!1),je!=null&&je.farming_tools&&n(!1),r((me=je==null?void 0:je.copy_trade_slots_info)==null?void 0:me.extra_slot_count),s((we=je==null?void 0:je.copy_trade_slots_info)==null?void 0:we.subs_slot_count),a((xe=je==null?void 0:je.copy_trade_slots_info)==null?void 0:xe.using_slot_count),o((ye=je==null?void 0:je.copy_trade_slots_info)==null?void 0:ye.total_slot_count),l(je==null?void 0:je.copy_trade_slots_wallets)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),N(""),P(""),Q(!1))}catch(je){console.error("Token verification error:",je),console.error(je.message||"An unknown error occurred."),Q(!1)}},oe=async()=>new Al(window.ethereum).eth.getAccounts(ae=>ae),G=async(te="farming",ae=24,fe=5e3)=>{ae<=0||(await new Promise(Ne=>setTimeout(Ne,fe)),await ie(),te==="farming"&&!K?G(te,ae-1,fe):e())},V=async()=>{J("");const te=window.localStorage.getItem("hyperToken"),ae=window.localStorage.getItem("hyperAddress");if(!te||!I){c(!0);return}L(!0),O(!0);try{await window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0x1"}]})}catch(me){console.error("Failed to switch network",me),O(!1);return}const fe=new Al(window.ethereum);var Ne=await oe();if(Ne.length>0?Ne=Ne[0]:Ne=void 0,Ne){const we={from:Ne,to:"0xdEAe8586eD227A5096EBae47342fFc1ED99f13F9",value:"120000000000000000"};await fe.eth.sendTransaction(we).then(xe=>{console.log("txHash :>> ",xe),O(!1),X(xe.transactionHash),fetch("https://dextrabothypev2.nftinit.io/api/hyper/payment/save/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:I?I.toLowerCase():ae,token:te,payment_tx:xe.transactionHash,payment_role:"farming_tools"})}),ie(),G("farming")}).catch(xe=>{console.log(xe),xe.code===-32003||xe.message.includes("insufficient funds")?J("Insufficient funds."):xe.message==="MetaMask Tx Signature: User denied transaction signature."&&L(!1)})}else await fe.eth.requestAccounts()};return i.jsxs(i.Fragment,{children:[i.jsx(vd,{open:U,setOpen:L,transactionHash:z,transactionLoading:R,paymentPresaleRole:K,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}=ts(),{setSignModalOpen:o,setTelegramChatId:l,setSubscriberRole:c,setSubsExpireDay:u,setMushboomerETH:d,setMushboomerSOL:f,setIsReferralCode:x,setIsReferralCodeName:g,setIsWhitelist:v,setHyperToken:w,setHyperAddress:C}=m.useContext(Qr),[N,P]=m.useState(1),[I,R]=m.useState(!1),[O,U]=m.useState(!1),[L,z]=m.useState(""),[X,ne]=m.useState(""),[J,K]=m.useState(""),re=ae=>/^\d*$/.test(ae),he=ae=>{["e","E","+","-"].includes(ae.key)&&ae.preventDefault()};m.useEffect(()=>{e||P(1)},[e]);const Q=m.useRef(J);m.useEffect(()=>{Q.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 Ne,me,we;const ae=window.localStorage.getItem("hyperToken"),fe=window.localStorage.getItem("hyperAddress");if(!(!ae||!fe))try{const xe=await _i(fe.toLowerCase(),ae);xe!=null&&xe.success?(l(xe==null?void 0:xe.telegram_chat_id),c(xe==null?void 0:xe.subscriber_role),u(xe==null?void 0:xe.subs_expire_day),d((Ne=xe==null?void 0:xe.mushboomer_counts)==null?void 0:Ne.eth),f((me=xe==null?void 0:xe.mushboomer_counts)==null?void 0:me.sol),x(xe==null?void 0:xe.referral_code),g(xe==null?void 0:xe.refcode),v(xe==null?void 0:xe.whitelist),w(ae),C(fe),K((we=xe==null?void 0:xe.copy_trade_slots_info)==null?void 0:we.extra_slot_count)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),w(""),C(""))}catch(xe){console.error("Token verification error:",xe),console.error(xe.message||"An unknown error occurred.")}},G=async()=>new Al(window.ethereum).eth.getAccounts(fe=>fe),V=async(ae="slot",fe=24,Ne=5e3)=>{fe<=0||(await new Promise(me=>setTimeout(me,Ne)),await oe(),ae==="slot"&&Q.current<=n?V(ae,fe-1,Ne):r())},te=async ae=>{ne("");const fe=window.localStorage.getItem("hyperToken"),Ne=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(xe){console.error("Failed to switch network",xe),R(!1);return}const me=new Al(window.ethereum);var we=await G();if(we.length>0?we=we[0]:we=void 0,we){const ye=ae*.012,je=me.utils.toWei(ye.toString(),"ether"),Pe={from:we,to:"0xdEAe8586eD227A5096EBae47342fFc1ED99f13F9",value:je};await me.eth.sendTransaction(Pe).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():Ne,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 me.eth.requestAccounts()};return e?i.jsxs(i.Fragment,{children:[i.jsx(vd,{open:O,setOpen:U,transactionHash:L,transactionLoading:I,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:()=>P(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 P("");re(fe)&&P(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:()=>P(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&&te(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},GBt=({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(Og,{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(xi,{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:ac,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 w5({open:e,setOpen:t,copyTradeData:n,copyTradeWallet:r,setCopyTradeWallet:s,isScalper:a,setCopyTradeData:o,sourcePage:l="default"}){var Wn,Fr,Tr,es,Rs;const{getCopyTradeWatchList:c,copyTradeWatchList:u,mushboomerETH:d,mushboomerSOL:f,trackedWatchList:x,isWhitelist:g,setTelegramChatId:v,setSubscriberRole:w,setSubsExpireDay:C,setMushboomerETH:N,setMushboomerSOL:P,setIsReferralCode:I,setIsReferralCodeName:R,setIsWhitelist:O,setHyperToken:U,setHyperAddress:L}=m.useContext(Qr),{address:z}=ts(),[X,ne]=m.useState(!1),[J,K]=m.useState(!1),[re,he]=m.useState("method_two"),[Q,ie]=m.useState("All"),[oe,G]=m.useState([]),[V,te]=m.useState(!1),[ae,fe]=m.useState(null),[Ne,me]=m.useState(!1),[we,xe]=m.useState(!1),[ye,je]=m.useState(!1),[Pe,Re]=m.useState(!1),[Xe,Ke]=m.useState(!1),[ut,et]=m.useState(!1),[tt,Le]=m.useState(!1),[$e,ht]=m.useState(!1),[pt,Kt]=m.useState(""),[wt,nn]=m.useState(""),[cn,zn]=m.useState(""),[Xt,on]=m.useState(""),[Zt,Ye]=m.useState(""),[Ze,Ft]=m.useState(""),[dn,Yt]=m.useState(""),[Bt,ot]=m.useState(""),[De,_t]=m.useState(100),[ze,nt]=m.useState(!0),[mt,$t]=m.useState(!0),[Pt,un]=m.useState(!1),[an,xn]=m.useState(!0),[An,kn]=m.useState(!0),[yn,Vn]=m.useState(null),[Gn,Rn]=m.useState(null),[Yn,Cn]=m.useState(""),[rn,Oe]=m.useState(""),[Jt,sn]=m.useState({inputValue:"",selectValue:"%"}),[Et,Xn]=m.useState({inputValue:"",selectValue:"%"}),[gn,Dt]=m.useState([]),[en,In]=m.useState(!0),[Qn,ar]=m.useState([]),[hr,Gt]=m.useState([]);m.useState(!1),m.useState(!1);const[$n,nr]=m.useState(!1),[Rt,En]=m.useState(null),[Ee,h]=m.useState(null),[p,S]=m.useState(null),[_,k]=m.useState(null),[T,B]=m.useState(!1),[W,ee]=m.useState(!1),[ce,ue]=m.useState(!1),[ge,Se]=m.useState(!1),[ke,Me]=m.useState(!1),qe=m.useRef(null),[Fe,at]=m.useState(null),[se,Ce]=m.useState(!1),Ue=m.useRef(null),[Be,_e]=m.useState(!1),[rt,ct]=m.useState(!1),[yt,Lt]=m.useState(!1),[ft,Tt]=m.useState([]),[Ge,At]=m.useState([]),[Ot,it]=m.useState(!1),[jt,Nn]=m.useState(!1),[mn,ir]=m.useState(!1),[Sn,Bn]=m.useState(0),[rr,ur]=m.useState(0),[_r,Un]=m.useState(0),[Ln,Kn]=m.useState(0),[Yr,os]=m.useState(null),[ds,Je]=m.useState(!1),[bt,Tn]=m.useState(!1),[er,kr]=m.useState([]),[Dr,Ur]=m.useState(null),[cr,Cr]=m.useState(!1),ls=async kt=>{var as,ss,ms,gs,Ui,$s;if(!e)return;const or=kt||Fe,Hn=window.localStorage.getItem("hyperToken"),Hr=window.localStorage.getItem("hyperAddress");if(!(!Hn||!Hr))try{ir(!0);const bs=await _i(Hr.toLowerCase(),Hn);bs!=null&&bs.success?(v(bs==null?void 0:bs.telegram_chat_id),w(bs==null?void 0:bs.subscriber_role),C(bs==null?void 0:bs.subs_expire_day),N((as=bs==null?void 0:bs.mushboomer_counts)==null?void 0:as.eth),P((ss=bs==null?void 0:bs.mushboomer_counts)==null?void 0:ss.sol),I(bs==null?void 0:bs.referral_code),R(bs==null?void 0:bs.refcode),O(bs==null?void 0:bs.whitelist),U(Hn),L(Hr),Bn((ms=bs==null?void 0:bs.copy_trade_slots_info)==null?void 0:ms.extra_slot_count),ur((gs=bs==null?void 0:bs.copy_trade_slots_info)==null?void 0:gs.subs_slot_count),Un((Ui=bs==null?void 0:bs.copy_trade_slots_info)==null?void 0:Ui.using_slot_count),Kn(($s=bs==null?void 0:bs.copy_trade_slots_info)==null?void 0:$s.total_slot_count),kr(bs==null?void 0:bs.copy_trade_slots_wallets),it(bs==null?void 0:bs.farming_tools),or==="lighter"?bs!=null&&bs.farming_tools?Nn(!1):Nn(!0):Nn(!1),ir(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),U(""),L(""),ir(!1))}catch(bs){console.error("Token verification error:",bs),console.error(bs.message||"An unknown error occurred."),ir(!1)}};m.useEffect(()=>{if(e)if(Ot&&Ln==0&&Fe==="lighter"&&yn){const kt=er==null?void 0:er.includes(yn);Tn(!kt)}else Tn(!1)},[yn,Fe,Ln,Ot,e]);const yr=m.useMemo(()=>n?Array.isArray(n)?n:[]:[],[n]);m.useEffect(()=>{if(l==="default"||!l||!yr.length)return;const kt=yr.findIndex(or=>(or==null?void 0:or.wallet_id)===l);kt!==-1&&Ur(kt)},[l,yr]),m.useEffect(()=>{l!=="default"||!yr.length||Dr===null&&Ur(0)},[yr,l]);const Jr=yr[Dr]||null,Ks=m.useMemo(()=>!cr||!yn?!1:yr.some(kt=>(kt==null?void 0:kt.wallet_id)===yn),[cr,yn,yr,Fe]);function Es(kt){return String(kt).trim().toUpperCase()}const gr=kt=>{kt&&(Kt(kt==null?void 0:kt.margin_used_rate),nn(kt==null?void 0:kt.min_usd_per_order),zn(kt==null?void 0:kt.max_usd_per_order),on(kt==null?void 0:kt.max_usd_per_positions),Ye(kt==null?void 0:kt.initial_order_max_usd),Ft(kt==null?void 0:kt.margin_used_amount),Yt(kt==null?void 0:kt.increase_limit),ot(kt==null?void 0:kt.copy_current_percentage),_t((kt==null?void 0:kt.scaling)==null?100:kt==null?void 0:kt.scaling),ie((kt==null?void 0:kt.position_type)===0?"All":(kt==null?void 0:kt.position_type)===1?"LONG":(kt==null?void 0:kt.position_type)===2?"SHORT":"All"),at(kt!=null&&kt.target_platform?(kt==null?void 0:kt.target_platform)==="hyper"?"hyper":kt==null?void 0:kt.target_platform:"hyper"),he((kt==null?void 0:kt.method_type)===1?"method_one":(kt==null?void 0:kt.method_type)===2?"method_two":(kt==null?void 0:kt.method_type)===2e3?"method_twothousand":"method_two"),nt((kt==null?void 0:kt.copy_trait_mode)==null?!0:kt==null?void 0:kt.copy_trait_mode),$t((kt==null?void 0:kt.open_with_increase)!==null?kt==null?void 0:kt.open_with_increase:!0),un((kt==null?void 0:kt.included_twaps)!==null?kt==null?void 0:kt.included_twaps:!1),xn((kt==null?void 0:kt.future_listed_tokens)!==null?kt==null?void 0:kt.future_listed_tokens:!0),kn((kt==null?void 0:kt.copy_current)!==null?kt==null?void 0:kt.copy_current:!0),Vn(kt==null?void 0:kt.wallet_id),Rn(kt==null?void 0:kt.wallet_id),Cn(kt==null?void 0:kt.tag),Oe(kt==null?void 0:kt.comments),sn({inputValue:kt==null?void 0:kt.stop_loss_amount,selectValue:(kt==null?void 0:kt.stop_loss_type)??"%"}),Xn({inputValue:kt==null?void 0:kt.target_price_amount,selectValue:kt==null?void 0:kt.target_price_type}),ar((kt==null?void 0:kt.include_coins)||[]),Gt((kt==null?void 0:kt.exclude_coins)||[]),xs(kt!=null&&kt.target_platform?(kt==null?void 0:kt.target_platform)==="hyper"?"hyper":kt==null?void 0:kt.target_platform:"hyper"))};m.useEffect(()=>{Jr===null&&n!==null?cr||gr(Array.isArray(n)?n[0]:n):gr(Jr)},[Jr,n]),m.useEffect(()=>{e&&n===null&&(async()=>{try{const kt=window.localStorage.getItem("hyperToken"),or=window.localStorage.getItem("hyperAddress");if(!kt)return;const[Hn,Hr]=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():or,token:kt})}),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():or,token:kt})})]),[as,ss]=await Promise.all([Hn.json(),Hr.json()]),ms=as!=null&&as.success?as.data:[],gs=ss!=null&&ss.success?ss.data:[];ms.length>0?at("hyper"):gs.length>0?at("lighter"):at("hyper")}catch(kt){console.error("Wallet auto-select error:",kt)}})()},[e,n]);const Vt=u==null?void 0:u.some(kt=>(kt==null?void 0:kt.wallet_address)===r),de=async()=>{try{const kt=window.localStorage.getItem("hyperToken"),or=window.localStorage.getItem("hyperAddress");if(!kt){setSignModalOpen(!0);return}const Hn="https://dextrabothypev2.nftinit.io/api/hyper/following/get_setting/",Hr={address:z?z.toLowerCase():or,token:kt},as=await fetch(Hn,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(Hr)});if(!as.ok)throw new Error(`Server responded with status ${as.status}`);const ss=await as.json();if(ss.success){Cr(!0);const ms=ss==null?void 0:ss.data;gr(ms),Ur(null)}else console.log(ss.error_message),tn.error(ss.error_message)}catch(kt){console.error("Error in like function:",kt),tn.error(kt.message||"Something went wrong!")}},st=kt=>{let or=kt.target.value;if(or===""){sn(Hn=>({...Hn,inputValue:""}));return}/^\d*\.?\d{0,2}$/.test(or)&&sn(Hn=>({...Hn,inputValue:or}))},Ct=kt=>{let or=kt.target.value;if(or===""){Xn(Hn=>({...Hn,inputValue:""}));return}/^\d*\.?\d{0,2}$/.test(or)&&Xn(Hn=>({...Hn,inputValue:or}))},vt=kt=>{let or=kt.target.value.trim();if(or===""){Kt(null);return}/^\d*\.?\d{0,2}$/.test(or)&&Kt(or)},ln=kt=>{let or=kt.target.value.trim();if(or===""){nn(null);return}if(/^\d*\.?\d{0,2}$/.test(or)){nn(or);const Hn=parseFloat(or),Hr=re==="method_twothousand"&&(cn!=null&&!isNaN(cn)&&cn&&Hn>Number(cn)||Xt!=null&&!isNaN(Xt)&&Xt&&Hn>Number(Xt));et(Hr);const as=re==="method_twothousand"&&cn!=null&&!isNaN(cn)&&cn&&Hn!=null&&!isNaN(Hn)&&Hn&&Hn>Number(cn);Ke(as);const ss=re==="method_twothousand"&&Xt!=null&&!isNaN(Xt)&&Xt&&Hn>Number(Xt);ht(ss)}},pn=kt=>{let or=kt.target.value.trim();if(or===""){zn(null);return}if(/^\d*\.?\d{0,2}$/.test(or)){zn(or);const Hn=parseFloat(or),Hr=re==="method_twothousand"&&(Hn==null||isNaN(Hn)||!Hn||wt!=null&&!isNaN(wt)&&wt&&Hn<Number(wt)||Hn!=null&&!isNaN(Hn)&&Hn&&Xt!=null&&!isNaN(Xt)&&Xt&&Hn>Number(Xt));Ke(Hr);const as=re==="method_twothousand"&&wt!=null&&!isNaN(wt)&&wt&&Hn<Number(wt);et(as);const ss=re==="method_twothousand"&&Hn!=null&&!isNaN(Hn)&&Hn&&Xt!=null&&!isNaN(Xt)&&Xt&&Hn>Number(Xt);ht(ss)}},dr=kt=>{let or=kt.target.value.trim();if(or===""){Ye(null);return}if(/^\d*\.?\d{0,2}$/.test(or)){Ye(or);const Hn=parseFloat(or),Hr=re==="method_twothousand"&&Xt!=null&&!isNaN(Xt)&&Xt&&Hn&&Hn>Number(Xt);Le(Hr),ht(Hr)}},jr=kt=>{let or=kt.target.value.trim();if(or===""){on(null);return}if(/^\d*\.?\d{0,2}$/.test(or)){on(or);const Hn=parseFloat(or),Hr=re==="method_twothousand"&&(cn!=null&&!isNaN(cn)&&cn&&Hn<Number(cn)||wt!=null&&!isNaN(wt)&&wt&&Hn<Number(wt)||Zt!=null&&!isNaN(Zt)&&Zt&&Hn<Number(Zt));ht(Hr);const as=re==="method_twothousand"&&cn!=null&&!isNaN(cn)&&cn&&Hn!=null&&!isNaN(Hn)&&Hn&&Hn<Number(cn);Ke(as);const ss=re==="method_twothousand"&&wt!=null&&!isNaN(wt)&&wt&&Hn<Number(wt);et(ss);const ms=re==="method_twothousand"&&Zt!=null&&!isNaN(Zt)&&Zt&&Hn<Number(Zt);Le(ms)}},pr=kt=>{Cn(kt.target.value),je(!1)},fr=kt=>{let or=kt.target.value;if(or===""){Ft("");return}/^\d*\.?\d{0,2}$/.test(or)&&Ft(or),xe(!1)},Kr=kt=>{let or=kt.target.value;if(or===""){Yt("");return}/^\d*\.?\d{0,2}$/.test(or)&&Yt(or)},rs=kt=>{let or=kt.target.value;if(or===""){_t("");return}/^\d*\.?\d{0,2}$/.test(or)&&_t(or)},Ir=kt=>{["-","+","e"].includes(kt.key)&&kt.preventDefault()};async function br(){try{K(!0);const kt=yn,or=window.localStorage.getItem("hyperToken"),Hn="https://dextrabothypev2.nftinit.io/",Hr=window.localStorage.getItem("hyperAddress");if(!or||!r)throw new Error("Authentication token is missing. Please log in again.");const ss=await(await fetch(Hn+"api/test_app/following/save/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:z?z.toLowerCase():Hr,token:or,follow_address:r.toLowerCase(),copy_trait_mode:ze??!1,open_with_increase:mt??!1,included_twaps:Pt??!1,future_listed_tokens:an??!1,copy_current:An??!1,margin_used_rate:pt??null,min_usd_per_order:wt??null,max_usd_per_order:cn??null,max_usd_per_positions:Xt??null,initial_order_max_usd:Zt||null,margin_used_amount:Ze||null,increase_limit:dn||null,copy_current_percentage:Bt||null,scaling:De||null,method_type:re=="method_two"?2:re=="method_twothousand"?2e3:re=="method_one"?1:null,position_type:Q=="All"?0:Q=="LONG"?1:Q=="SHORT"?2:null,tag:Yn??null,comments:rn??null,stop_loss_amount:Jt.inputValue?Jt.inputValue:null,stop_loss_type:Jt.selectValue??"%",target_price_amount:Et.inputValue?Et.inputValue:null,target_price_type:Et.selectValue??"%",wallet_id:yn??null,include_coins:Array.isArray(Qn)&&(Qn==null?void 0:Qn.length)>0?Qn:null,exclude_coins:Array.isArray(hr)&&(hr==null?void 0:hr.length)>0?hr:null,target_platform:Fe??"hyper"})})).json();if(ss.success){K(!1),c();const ms=Array.isArray(ss.data)?ss.data.filter($s=>{var bs;return((bs=$s==null?void 0:$s.wallet_address)==null?void 0:bs.toLowerCase())===(r==null?void 0:r.toLowerCase())}):[],gs=ms==null?void 0:ms.sort(($s,bs)=>new Date(bs.created_at)-new Date($s.created_at));o(gs);const Ui=gs==null?void 0:gs.findIndex($s=>($s==null?void 0:$s.wallet_id)===kt);Ur(Ui!==-1?Ui:0),ls(Fe),nr(!1),tn.success(`${(r==null?void 0:r.slice(0,5))+"..."+(r==null?void 0:r.slice(-3))} ${Vt?"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"}}),Cr(!1)}else K(!1),tn.error(ss.error_message||"Registration failed.")}catch(kt){console.error("Error in copyTradeSave:",kt),tn.error(kt.message||"An unexpected error occurred."),K(!1)}}const Zn=async()=>{try{ne(!0);const kt=window.localStorage.getItem("hyperToken"),or="https://dextrabothypev2.nftinit.io/api/test_app/following/unfollow/",Hn=window.localStorage.getItem("hyperAddress");if(!kt||!r)throw new Error("Required information is missing. Please log in or connect your wallet.");const Hr=await fetch(or,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:z?z.toLowerCase():Hn,token:kt,follow_address:r,target_platform:Fe??"hyper",wallet_id:yn??null})});if(!Hr.ok)throw new Error(`Failed to unlike: ${Hr.status} ${Hr.statusText}`);const as=await Hr.json();if(as.success){ne(!1),c();const ss=Array.isArray(as.data)?as.data.filter(gs=>{var Ui;return((Ui=gs==null?void 0:gs.wallet_address)==null?void 0:Ui.toLowerCase())===(r==null?void 0:r.toLowerCase())}):[],ms=Array.isArray(ss)?[...ss].sort((gs,Ui)=>new Date(Ui.created_at)-new Date(gs.created_at)):[];o(ms),ms.length>0?Ur(0):Ur(null),ls(Fe),ss&&ss.length===0&&de(),tn.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),tn.error(as.error_message),ne(!1)}catch(kt){console.error("Error in unlike function:",kt),tn.error(kt.message||"Something went wrong!"),ne(!1)}},xs=async kt=>{if(!e)return;const or=kt||Fe;try{te(!0);const Hn=window.localStorage.getItem("hyperToken"),Hr=window.localStorage.getItem("hyperAddress"),as=or==="hyper"?"https://dextrabothypev2.nftinit.io/api/wallet/confirmed-list":"https://dextrabothypev2.nftinit.io/api/wallet/list-lighter";if(!Hn)return;const ms=await(await fetch(as,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:z?z.toLowerCase():Hr,token:Hn})})).json();ms.success?(G(ms==null?void 0:ms.data),te(!1)):(console.log(ms.error_message),te(!1),fe(ms.error_message))}catch(Hn){console.error("Error generate wallet list:",Hn),te(!1),fe(Hn.message)}},Qs=async()=>{try{const kt=window.localStorage.getItem("hyperToken"),or=window.localStorage.getItem("hyperAddress");if(!kt)return;const[Hn,Hr]=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():or,token:kt})}),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():or,token:kt})})]),[as,ss]=await Promise.all([Hn.json(),Hr.json()]);as.success&&Tt(as.data),ss!=null&&ss.success&&At(ss.data)}catch(kt){console.error("Error fetching wallet lists:",kt)}},ai=kt=>kt!=null&&kt.assetPositions?kt.assetPositions.filter(or=>{if(!or.position||!or.position.szi)return!1;const Hn=parseFloat(or.position.szi);return!isNaN(Hn)&&Hn!==0}).map(or=>{const Hn=or.position,Hr=parseFloat(Hn.szi),as=parseFloat(Hn.entryPx),ss=parseFloat(Hn.positionValue),ms=parseFloat(Hn.unrealizedPnl),gs=parseFloat(Hn.returnOnEquity)*100,Ui=parseFloat(Hn.marginUsed),$s=Hn.leverage.value,bs=parseFloat(Hn.cumFunding.sinceOpen),Cs=Hr>0?"Long":"Short";return{asset:Hn.coin,type:Cs,size:Math.abs(Hr),entryPrice:as.toFixed(2),currentPrice:(ss/Math.abs(Hr)).toFixed(2),leverage:$s,positionValue:ss.toFixed(2),marginUsed:Ui.toFixed(2),unrealizedPnl:ms.toFixed(2),roe:gs.toFixed(2),funding:bs.toFixed(4),liquidationPrice:Hn.liquidationPx?parseFloat(Hn.liquidationPx).toFixed(2):"N/A"}}):[];m.useEffect(()=>{const kt=async()=>{const Hr=await hs.post("https://api-ui.hyperliquid.xyz/info",{type:"clearinghouseState",user:r});if(Hr.data){En(Hr.data);const as=ai(Hr.data);h(as)}},or=async()=>{var as,ss,ms;const Hr=await hs.post("https://api-ui.hyperliquid.xyz/info",{type:"portfolio",user:r});if(Hr.data){const gs=((ss=(as=Hr.data.find($s=>$s[0]==="perpMonth"))==null?void 0:as[1])==null?void 0:ss.pnlHistory)||[],Ui=((ms=gs[gs.length-1])==null?void 0:ms[1])??0;S(Ui)}},Hn=async()=>{var ss;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(((ss=as==null?void 0:as.results[0])==null?void 0:ss.win_complated_rate)||"-")};r&&(kt(),or(),Hn())},[r]),m.useEffect(()=>{if(!e)return;let kt=!1;async function or(){var Hn,Hr;try{In(!0);const ss=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_coins/")).json(),ms=()=>gi.random().hex(),gs={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"},Ui=(Hr=(Hn=ss.coins)==null?void 0:Hn.filter($s=>!$s.startsWith("@")&&!$s.endsWith("/USDC")))==null?void 0:Hr.map($s=>({value:$s,label:$s.endsWith("/USDC")?$s+" (Spot)":$s,color:ms(),icon:`https://app.hyperliquid.xyz/coins/${gs[$s]||$s.split("/")[0]}.svg`}));kt||(Dt(Ui),In(!1))}catch(as){kt||(console.error("Data retrieval error:",as),In(!1))}}return or(),()=>{kt=!0}},[e]),m.useEffect(()=>{e&&(xs(Fe),ls(Fe))},[Fe,e]),m.useEffect(()=>{e&&Qs()},[e]),m.useEffect(()=>{if(!e||!Vt||!Jr||!Array.isArray(gn)||gn.length===0)return;const kt=gn.map(ms=>typeof ms=="string"?ms:ms.value).filter(Boolean),or=new Map(kt.map(ms=>[Es(ms),ms])),Hn=kt.map(Es),Hr=new Set([...(Jr.include_coins||[]).map(Es),...(Jr.exclude_coins||[]).map(Es)]),as=Hn.filter(ms=>!Hr.has(ms));if(as.length===0)return;const ss=as.map(ms=>or.get(ms)||ms);Jr.future_listed_tokens?ar(ms=>Array.from(new Set([...ms||[],...ss]))):Gt(ms=>Array.from(new Set([...ms||[],...ss])))},[e,Vt,gn,Jr]),m.useEffect(()=>{e||(t(!1),Kt(null),nn(null),zn(null),on(null),Ye(null),Ft(null),Yt(null),ot(null),_t(100),he("method_two"),at(null),ie("All"),nt(!0),$t(!0),un(!1),xn(!0),kn(!0),Vn(null),Rn(null),Cn(null),Oe(null),sn({inputValue:null,selectValue:"%"}),Xn({inputValue:null,selectValue:"%"}),ar(null),Gt(null),me(!1),xe(!1),Ke(!1),et(!1),Le(!1),ht(!1),je(!1),Re(!1),ue(!1),Lt(!1),Me(!1),Ce(!1),it(!1),Nn(!1),Tn(!1),Cr(!1),G([]),o(null),Ur(null))},[e]),m.useEffect(()=>{const kt=oe.find(or=>(or==null?void 0:or.wallet_id)===(n==null?void 0:n.wallet_id));kt&&Vn(kt==null?void 0:kt.wallet_id)},[oe,n]),m.useEffect(()=>{Fe==="lighter"?(De!==""&&Number(De)>100?Re(!0):Re(!1),Nn(!Ot)):(Re(!1),Nn(!1))},[De,Fe]);const Pr=kt=>{Vn(kt??null),me(!1),Me(!1)},vn=kt=>{at(kt),Ce(!1),kn(!1),kt==="lighter"&&(re=="method_twothousand"||re=="method_one")&&he("method_two"),Vn(null)},Fn=()=>{xs(Fe)};m.useEffect(()=>{const kt=or=>{qe.current&&!qe.current.contains(or.target)&&Me(!1),Ue.current&&!Ue.current.contains(or.target)&&Ce(!1)};return document.addEventListener("mousedown",kt),()=>{document.removeEventListener("mousedown",kt)}},[]);const lt=[Ne,we,Xe,ut,tt,$e,ye,jt,bt].filter(Boolean).length;m.useEffect(()=>{e&&a&&!W&&(u!=null&&u.some(kt=>(kt==null?void 0:kt.wallet_address)===r)||B(!0),ee(!0)),e||ee(!1)},[e,a]),m.useEffect(()=>{e&&a&&!rt&&Fe!==null&&!T&&(u!=null&&u.some(kt=>(kt==null?void 0:kt.wallet_address)===r)||Fe==="lighter"&&_e(!0),ct(!0)),e||ct(!1)},[e,a,Fe,T]);const Ut=()=>{_e(!1),B(!1),t(!1)},tr=[{id:1,label:"Hyperliquid",value:"hyper"},{id:2,label:"Lighter",value:"lighter"}];return i.jsxs(i.Fragment,{children:[i.jsx(LLt,{open:$n,setOpen:nr,copyTradeSave:br}),i.jsx(VBt,{open:T,setOpen:B,setCopyTradeModal:t,onClose:Ut,setIsUnderstand:ue}),i.jsx(f5,{open:ge,setOpen:Se,handleListRequest:xs,handlePageChange:()=>{}}),i.jsx(WBt,{open:Be,setOpen:_e,setCopyTradeModal:t,onClose:Ut,setIsLighterUnderstand:Lt}),ds&&Na.createPortal(i.jsx(Ale,{open:ds,setOpen:Je,oldSlotCount:Yr,checkAccountTrade:ls,tradeMarket:"copyTrade"}),document.body),i.jsxs(Ea,{open:e,onClose:Ut,className:"relative z-50",children:[i.jsx(ja,{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(ga,{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&&!ce&&T&&!(u!=null&&u.some(kt=>(kt==null?void 0:kt.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(Ba,{})}):g||d>0||f>0?(oe==null?void 0:oe.length)>0||(ft==null?void 0:ft.length)>0||(Ge==null?void 0:Ge.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(zIe,{})}),i.jsx("div",{style:{backgroundImage:`url(${nyt})`,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(sDe,{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:kt=>{kt.stopPropagation(),navigator.clipboard.writeText(r),tn.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:Co,alt:"",className:"cursor-pointer"})}),i.jsx("span",{className:"ml-auto cursor-pointer",children:i.jsx(v5,{walletAddress:r,children:i.jsx("div",{className:"w-[18px] h-[18px] justify-center items-center flex cursor-pointer",children:x.some(kt=>kt.wallet_address===r)?i.jsx("img",{src:o5,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"}):i.jsx("img",{src:NA,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:["$",Rt?Er(Rt==null?void 0:Rt.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:`${Rt&&Ee&&Ee.reduce((kt,or)=>kt+parseFloat(or.unrealizedPnl),0)>=0?"text-[#67FFBD]":"text-[#FF7173]"} font-manrope text-[16px] font-semibold leading-[13px] tracking-[0.32px]`,children:["$",Rt&&Ee?Er(Math.abs(Ee.reduce((kt,or)=>kt+parseFloat(or.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:`${p&&p>=0?"text-[#67FFBD]":"text-[#FF7173]"} font-manrope text-[16px] font-semibold leading-[13px] tracking-[0.32px]`,children:["$",p?Er(Math.abs(p)):"-"]})]})]}),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(DLt,{positions:Ee})]}),i.jsx("div",{className:"w-full h-px bg-[#353535] mb-1"}),i.jsx("div",{className:"mt-2",children:i.jsx(GBt,{normalizedCopyTradeList:yr,selectedWmIndex:Dr,setSelectedWmIndex:Ur,getSettingList:de,setIsNewSetting:Cr})})]})]})]}),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(Ba,{})}),i.jsxs("div",{className:"flex-col justify-between items-center gap-4 w-full border-b border-[#353535] pb-3",children:[lt>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:ec,alt:"Dextrabot"}),lt]}),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(Ai,{className:"text-[#7C7C7C] w-3.5 min-w-3.5 min-h-3.5 h-3.5"}),i.jsx("span",{children:i.jsx(so,{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(w0,{})]}),i.jsxs("div",{ref:Ue,className:"relative w-full max-w-[250px]",children:[i.jsxs("div",{className:`${Vt&&!cr?"cursor-not-allowed":"cursor-pointer"} rounded-md bg-[#353535] text-white px-2 h-8 flex items-center justify-between`,onClick:kt=>{kt.preventDefault(),(!Vt&&cr||Vt&&cr||!Vt&&!cr)&&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(Og,{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:tr==null?void 0:tr.map(kt=>i.jsxs("div",{onClick:or=>{or.preventDefault(),(!Vt&&cr||Vt&&cr||!Vt&&!cr)&&(vn(kt.value),kt.value==="lighter"&&!yt&&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] ${kt.value===Fe?"bg-[#2c2c2c]":"hover:bg-[#2c2c2c]"} text-white ${Vt&&!cr?"cursor-not-allowed":"cursor-pointer"}`,children:[i.jsxs("span",{className:"text-white flex items-center gap-2",children:[kt.label==="Hyperliquid"?i.jsx("img",{src:"https://app.hyperliquid.xyz/coins/HYPE.svg",className:"w-4 h-4"}):i.jsx(Og,{className:"w-4 h-4 text-white"}),kt.label]}),kt.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"})})]},kt.id))})})]})]}),i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{onClick:()=>{Fn()},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:qe,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:yn?((Wn=oe==null?void 0:oe.find(kt=>(kt==null?void 0:kt.wallet_id)===yn))==null?void 0:Wn.wallet_name)==="Dextrabot"&&((Fr=oe==null?void 0:oe.find(kt=>(kt==null?void 0:kt.wallet_id)===yn))==null?void 0:Fr.version)===3?((Tr=oe==null?void 0:oe.find(kt=>(kt==null?void 0:kt.wallet_id)===yn))==null?void 0:Tr.wallet_name)+" (API-AGENT) Wallet":(es=oe==null?void 0:oe.find(kt=>(kt==null?void 0:kt.wallet_id)===yn))==null?void 0:es.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 kt=Fe==="hyper"?"hyperliquid":"lighter";window.open(`/wallet-management#${kt}#add-account#${kt}`,"_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&&((Rs=[...oe].sort((kt,or)=>{var as,ss;const Hn=(as=kt==null?void 0:kt.wallet_name)==null?void 0:as.includes("Dextrabot"),Hr=(ss=or==null?void 0:or.wallet_name)==null?void 0:ss.includes("Dextrabot");return Hn&&!Hr?-1:!Hn&&Hr?1:0}))==null?void 0:Rs.map((kt,or)=>i.jsxs("div",{onClick:Hn=>{Hn.preventDefault(),(!Vt&&cr||Vt&&cr||!Vt&&!cr)&&Pr(kt==null?void 0:kt.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] ${Vt&&!cr?"cursor-not-allowed":"cursor-pointer"} ${(kt==null?void 0:kt.wallet_id)===yn?"bg-[#2c2c2c]":"hover:bg-[#2c2c2c]"} text-white`,children:[i.jsx("span",{className:"text-white",children:(kt==null?void 0:kt.wallet_name)==="Dextrabot"&&(kt==null?void 0:kt.version)===3?(kt==null?void 0:kt.wallet_name)+" (API-AGENT) Wallet":kt==null?void 0:kt.wallet_name}),(kt==null?void 0:kt.wallet_id)===yn&&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"})})]},(kt==null?void 0:kt.wallet_id)??or)))})]}),Ne&&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:()=>{Fn()},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:ryt,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:`${jt||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:Hme,alt:"Dextrabot",className:"w-4 h-4 mr-2"}),"Methodology"]})})]}),jt||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:Hme,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(s5,{className:"w-3 h-3 text-[#67FFBD] fill-[#67FFBD]"}),i.jsxs("span",{className:"text-[#67FFBD] font-medium",children:[_r||0,"/",Ln+_r||0]})]})]}),i.jsx("div",{onClick:()=>{os(Sn),Je(!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:`${jt?"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")&&(!Vt||Vt&&cr)&&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")&&Vt&&!cr||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")&&(!Vt||Vt&&cr)&&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")&&Vt&&!cr||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")&&(!Vt||Vt&&cr))&&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")&&Vt&&!cr?"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:pt||"",onChange:vt,type:"text",name:"marginUsedRate",onKeyDown:Ir,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
                                          ${pt?"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:Ze||"",onChange:fr,type:"text",name:"marginUsedAmount",onKeyDown:Ir,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
                                          ${we?"border border-[#FF797C]":Ze?"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:dn||"",onChange:Kr,type:"text",name:"marginIncreaseLimit",onKeyDown:Ir,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
                                          ${dn?"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:mt?"On":"Off"}),i.jsx(_o,{checked:mt,onChange:$t,className:`${mt?"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:Jt.inputValue||"",onChange:st,onKeyDown:Ir,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
                                          ${Jt.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:Ct,onKeyDown:Ir,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:Pt?"On":"Off"}),i.jsx(_o,{checked:Pt,onChange:un,className:`${Pt?"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(Ai,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(so,{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(qx,{title:"All",set_click:()=>ie("All"),isPositionType:Q}),i.jsx(qx,{title:"LONG",set_click:()=>ie("LONG"),isPositionType:Q}),i.jsx(qx,{title:"SHORT",set_click:()=>ie("SHORT"),isPositionType:Q})]})]})]}),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(Ai,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(so,{content:Vt?"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:An?"On":"Off"}),i.jsx(_o,{checked:An,onChange:kt=>{(!Vt||Vt&&cr)&&ze&&kn(kt)},className:`${An?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9
                                          ${Vt&&!cr||!ze?"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
                                            ${An?"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(Ai,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(so,{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:an?"On":"Off"}),i.jsx(_o,{checked:an,onChange:xn,className:`${an?"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(RW,{dataCoin:gn,coinInclude:Qn,coinExclude:hr,setCoinInclude:ar,setCoinExclude:Gt,isLoadingCoin:en})})})}),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:Yn||"",onChange:pr,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
                                          ${ye?"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(Ai,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(so,{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:ze?"On":"Off"}),i.jsx(_o,{checked:ze,onChange:kt=>{nt(kt),kt||kn(!1)},className:`${ze?"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:`${$e?"-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:`${$e?"flex":"hidden"} items-center has-tooltip relative`,children:[i.jsx("img",{src:ec,alt:"Dextrabot",className:"w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(so,{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:`${$e?"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:Xt||"",onChange:jr,type:"text",name:"maxUsdPerpPositions",onKeyDown:Ir,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
                                          ${$e?"border border-[#FF797C] focus:outline-none focus:ring-0":Xt?"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:`${tt?"-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:`${tt?"flex":"hidden"} items-center has-tooltip relative`,children:[i.jsx("img",{src:ec,alt:"Dextrabot",className:"w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(so,{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:`${tt?"":"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:Zt||"",onChange:dr,type:"text",name:"initialOrderMaxUsd",onKeyDown:Ir,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
                                        
                                        ${tt?"border border-[#FF797C] focus:outline-none focus:ring-0":Zt?"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:`${ut?"-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:`${ut?"flex":"hidden"} items-center has-tooltip relative`,children:[i.jsx("img",{src:ec,alt:"Dextrabot",className:"w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(so,{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:`${ut?"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:wt||"",onChange:ln,type:"text",name:"minUsdPerOrder",onKeyDown:Ir,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
                                          
                                          ${ut?"border border-[#FF797C] focus:outline-none focus:ring-0":wt?"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:`${Xe&&(Xt||wt)?"-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:`${Xe&&(Xt||wt)?"flex":"hidden"} items-center has-tooltip relative`,children:[i.jsx("img",{src:ec,alt:"Dextrabot",className:"w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(so,{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:`${Xe&&(Xt||wt)?"":"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:pn,type:"text",name:"maxUsdPerOrder",onKeyDown:Ir,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
                                          ${Xe?"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(Ai,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(so,{content:Vt?"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:An?"On":"Off"}),i.jsx(_o,{checked:An,onChange:kt=>{(!Vt||Vt&&cr)&&ze&&kn(kt)},className:`${An?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9
                                          ${Vt&&!cr||!ze?"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
                                            ${An?"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:mt?"On":"Off"}),i.jsx(_o,{checked:mt,onChange:$t,className:`${mt?"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:Jt.inputValue||"",onChange:st,onKeyDown:Ir,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
                                            ${Jt.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:Ct,onKeyDown:Ir,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(Ai,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(so,{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(qx,{title:"All",set_click:()=>ie("All"),isPositionType:Q}),i.jsx(qx,{title:"LONG",set_click:()=>ie("LONG"),isPositionType:Q}),i.jsx(qx,{title:"SHORT",set_click:()=>ie("SHORT"),isPositionType:Q})]})]})]}),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:Pt?"On":"Off"}),i.jsx(_o,{checked:Pt,onChange:un,className:`${Pt?"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(Ai,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(so,{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:an?"On":"Off"}),i.jsx(_o,{checked:an,onChange:xn,className:`${an?"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(RW,{dataCoin:gn,coinInclude:Qn,coinExclude:hr,setCoinInclude:ar,setCoinExclude:Gt,isLoadingCoin:en})})})}),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:Yn||"",onChange:pr,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
                                          ${ye?"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(Ai,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(so,{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:ze?"On":"Off"}),i.jsx(_o,{checked:ze,onChange:kt=>{nt(kt),kt||kn(!1)},className:`${ze?"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:De||"",onChange:rs,type:"text",name:"scalingPercentage",onKeyDown:Ir,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 ${De?Pe?"border border-[#D97706]":"border border-[#C5C5C5]":""}
                                        outline-[#404040] placeholder:text-[#7F7F7F]`}),Pe&&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(IM,{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:mt?"On":"Off"}),i.jsx(_o,{checked:mt,onChange:$t,className:`${mt?"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:Jt.inputValue||"",onChange:st,onKeyDown:Ir,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
                                          ${Jt.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:Ct,onKeyDown:Ir,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:Pt?"On":"Off"}),i.jsx(_o,{checked:Pt,onChange:un,className:`${Pt?"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(Ai,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(so,{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(qx,{title:"All",set_click:()=>ie("All"),isPositionType:Q}),i.jsx(qx,{title:"LONG",set_click:()=>ie("LONG"),isPositionType:Q}),i.jsx(qx,{title:"SHORT",set_click:()=>ie("SHORT"),isPositionType:Q})]})]})]}),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(Ai,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(so,{content:Fe==="lighter"?"Coming Soon":Vt?"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:An?"On":"Off"}),i.jsx(_o,{checked:An,onChange:kt=>{(!Vt||Vt&&cr)&&ze&&Fe==="hyper"&&kn(kt)},className:`${An?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9
                                          ${Vt&&!cr||!ze||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
                                            ${An?"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(Ai,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(so,{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:an?"On":"Off"}),i.jsx(_o,{checked:an,onChange:xn,className:`${an?"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(RW,{dataCoin:gn,coinInclude:Qn,coinExclude:hr,setCoinInclude:ar,setCoinExclude:Gt,isLoadingCoin:en})})})}),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:Yn||"",onChange:pr,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
                                          ${ye?"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(Ai,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(so,{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:ze?"On":"Off"}),i.jsx(_o,{checked:ze,onChange:kt=>{nt(kt),kt||kn(!1)},className:`${ze?"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"?jt?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."}):bt?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."}):Ks?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."}):Ks&&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:[lt>0&&!jt&&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:ec,alt:"Dextrabot"}),lt]}),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:kt=>{yn!=null&&!isNaN(yn)&&(re!=="method_one"||Ze!=null&&!isNaN(Ze)&&Ze)&&(re!=="method_twothousand"||cn!=null&&!isNaN(cn)&&cn&&(!(Xt!=null&&!isNaN(Xt)&&Xt)||Number(Xt)>=Number(cn)&&(!(wt!=null&&!isNaN(wt)&&wt)||Number(Xt)>=Number(wt))&&(!(Zt!=null&&!isNaN(Zt)&&Zt)||Number(Xt)>=Number(Zt)))&&(!(wt!=null&&!isNaN(wt)&&wt)||Number(cn)>=Number(wt)))&&Yn&&(Fe!=="lighter"||Ot)&&(Fe!=="lighter"||!bt)?!Jt.inputValue||!Et.inputValue?nr(!0):br():(me(yn==null||isNaN(yn)),xe(re==="method_one"&&(Ze==null||isNaN(Ze)||!Ze)),Ke(re==="method_twothousand"&&(cn==null||isNaN(cn)||!cn||cn!=null&&!isNaN(cn)&&cn&&wt!=null&&!isNaN(wt)&&wt&&Number(wt)>Number(cn)||cn!=null&&!isNaN(cn)&&cn&&Xt!=null&&!isNaN(Xt)&&Xt&&Number(cn)>Number(Xt))),et(re==="method_twothousand"&&(cn!=null&&!isNaN(cn)&&cn&&wt!=null&&!isNaN(wt)&&wt&&Number(wt)>Number(cn)||Xt!=null&&!isNaN(Xt)&&Xt&&wt!=null&&!isNaN(wt)&&wt&&Number(wt)>Number(Xt))),Le(re==="method_twothousand"&&Xt!=null&&!isNaN(Xt)&&Xt&&Zt!=null&&!isNaN(Zt)&&Zt&&Number(Zt)>Number(Xt)),ht(re==="method_twothousand"&&Xt!=null&&!isNaN(Xt)&&Xt&&(cn!=null&&!isNaN(cn)&&cn&&Number(cn)>Number(Xt)||wt!=null&&!isNaN(wt)&&wt&&Number(wt)>Number(Xt)||Zt!=null&&!isNaN(Zt)&&Zt&&Number(Zt)>Number(Xt))),je(!Yn||Yn===""),Re(Fe==="lighter"&&De&&De>100),Nn(Fe==="lighter"&&!Ot))},type:"button",className:`${re==="method_one"||Fe==="lighter"&&jt||Fe==="lighter"&&bt||Ks?"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"}),lt>0&&Fe==="lighter"&&jt&&i.jsx(qBt,{checkAccountCopy:ls,setIsLighterSub:it,setLighterSubError:Nn,setSlotCount:Bn,setSlotSubsCount:ur,setSlotUsingCount:Un,setSlotTotalCount:Kn,setSlotCountWallets:kr}),lt>0&&!jt&&bt&&Fe==="lighter"&&i.jsx("div",{onClick:()=>{os(Sn),Je(!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:kt=>{kt.preventDefault(),u!=null&&u.some(or=>or.wallet_address===r)&&Zn()},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(kt=>kt.wallet_address===r)&&!cr?"":"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:Ki,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:Ki,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 qx=({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 iDe(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=iDe(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ia(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=iDe(e))&&(r&&(r+=" "),r+=t);return r}var DW,aye;function hf(){if(aye)return DW;aye=1;var e=Array.isArray;return DW=e,DW}var BW,oye;function aDe(){if(oye)return BW;oye=1;var e=typeof Iu=="object"&&Iu&&Iu.Object===Object&&Iu;return BW=e,BW}var $W,lye;function hx(){if(lye)return $W;lye=1;var e=aDe(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return $W=n,$W}var UW,cye;function lT(){if(cye)return UW;cye=1;var e=hx(),t=e.Symbol;return UW=t,UW}var zW,uye;function KBt(){if(uye)return zW;uye=1;var e=lT(),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 zW=a,zW}var HW,dye;function YBt(){if(dye)return HW;dye=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return HW=n,HW}var VW,fye;function k1(){if(fye)return VW;fye=1;var e=lT(),t=KBt(),n=YBt(),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 VW=o,VW}var WW,hye;function T1(){if(hye)return WW;hye=1;function e(t){return t!=null&&typeof t=="object"}return WW=e,WW}var qW,pye;function GA(){if(pye)return qW;pye=1;var e=k1(),t=T1(),n="[object Symbol]";function r(s){return typeof s=="symbol"||t(s)&&e(s)==n}return qW=r,qW}var GW,mye;function jle(){if(mye)return GW;mye=1;var e=hf(),t=GA(),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 GW=s,GW}var KW,xye;function m2(){if(xye)return KW;xye=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return KW=e,KW}var YW,gye;function Ele(){if(gye)return YW;gye=1;var e=k1(),t=m2(),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 YW=o,YW}var XW,bye;function XBt(){if(bye)return XW;bye=1;var e=hx(),t=e["__core-js_shared__"];return XW=t,XW}var QW,yye;function QBt(){if(yye)return QW;yye=1;var e=XBt(),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 QW=n,QW}var ZW,vye;function oDe(){if(vye)return ZW;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 ZW=n,ZW}var JW,wye;function ZBt(){if(wye)return JW;wye=1;var e=Ele(),t=QBt(),n=m2(),r=oDe(),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 JW=f,JW}var eq,Cye;function JBt(){if(Cye)return eq;Cye=1;function e(t,n){return t==null?void 0:t[n]}return eq=e,eq}var tq,Sye;function C5(){if(Sye)return tq;Sye=1;var e=ZBt(),t=JBt();function n(r,s){var a=t(r,s);return e(a)?a:void 0}return tq=n,tq}var nq,Nye;function I$(){if(Nye)return nq;Nye=1;var e=C5(),t=e(Object,"create");return nq=t,nq}var rq,Aye;function e$t(){if(Aye)return rq;Aye=1;var e=I$();function t(){this.__data__=e?e(null):{},this.size=0}return rq=t,rq}var sq,jye;function t$t(){if(jye)return sq;jye=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return sq=e,sq}var iq,Eye;function n$t(){if(Eye)return iq;Eye=1;var e=I$(),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 iq=s,iq}var aq,_ye;function r$t(){if(_ye)return aq;_ye=1;var e=I$(),t=Object.prototype,n=t.hasOwnProperty;function r(s){var a=this.__data__;return e?a[s]!==void 0:n.call(a,s)}return aq=r,aq}var oq,kye;function s$t(){if(kye)return oq;kye=1;var e=I$(),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 oq=n,oq}var lq,Tye;function i$t(){if(Tye)return lq;Tye=1;var e=e$t(),t=t$t(),n=n$t(),r=r$t(),s=s$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,lq=a,lq}var cq,Iye;function a$t(){if(Iye)return cq;Iye=1;function e(){this.__data__=[],this.size=0}return cq=e,cq}var uq,Pye;function _le(){if(Pye)return uq;Pye=1;function e(t,n){return t===n||t!==t&&n!==n}return uq=e,uq}var dq,Fye;function P$(){if(Fye)return dq;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 dq=t,dq}var fq,Oye;function o$t(){if(Oye)return fq;Oye=1;var e=P$(),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 fq=r,fq}var hq,Mye;function l$t(){if(Mye)return hq;Mye=1;var e=P$();function t(n){var r=this.__data__,s=e(r,n);return s<0?void 0:r[s][1]}return hq=t,hq}var pq,Rye;function c$t(){if(Rye)return pq;Rye=1;var e=P$();function t(n){return e(this.__data__,n)>-1}return pq=t,pq}var mq,Lye;function u$t(){if(Lye)return mq;Lye=1;var e=P$();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 mq=t,mq}var xq,Dye;function F$(){if(Dye)return xq;Dye=1;var e=a$t(),t=o$t(),n=l$t(),r=c$t(),s=u$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,xq=a,xq}var gq,Bye;function kle(){if(Bye)return gq;Bye=1;var e=C5(),t=hx(),n=e(t,"Map");return gq=n,gq}var bq,$ye;function d$t(){if($ye)return bq;$ye=1;var e=i$t(),t=F$(),n=kle();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return bq=r,bq}var yq,Uye;function f$t(){if(Uye)return yq;Uye=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return yq=e,yq}var vq,zye;function O$(){if(zye)return vq;zye=1;var e=f$t();function t(n,r){var s=n.__data__;return e(r)?s[typeof r=="string"?"string":"hash"]:s.map}return vq=t,vq}var wq,Hye;function h$t(){if(Hye)return wq;Hye=1;var e=O$();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return wq=t,wq}var Cq,Vye;function p$t(){if(Vye)return Cq;Vye=1;var e=O$();function t(n){return e(this,n).get(n)}return Cq=t,Cq}var Sq,Wye;function m$t(){if(Wye)return Sq;Wye=1;var e=O$();function t(n){return e(this,n).has(n)}return Sq=t,Sq}var Nq,qye;function x$t(){if(qye)return Nq;qye=1;var e=O$();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 Nq=t,Nq}var Aq,Gye;function Tle(){if(Gye)return Aq;Gye=1;var e=d$t(),t=h$t(),n=p$t(),r=m$t(),s=x$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,Aq=a,Aq}var jq,Kye;function lDe(){if(Kye)return jq;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,jq=n,jq}var Eq,Yye;function g$t(){if(Yye)return Eq;Yye=1;var e=lDe(),t=500;function n(r){var s=e(r,function(o){return a.size===t&&a.clear(),o}),a=s.cache;return s}return Eq=n,Eq}var _q,Xye;function b$t(){if(Xye)return _q;Xye=1;var e=g$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 _q=r,_q}var kq,Qye;function Ile(){if(Qye)return kq;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 kq=e,kq}var Tq,Zye;function y$t(){if(Zye)return Tq;Zye=1;var e=lT(),t=Ile(),n=hf(),r=GA(),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 Tq=o,Tq}var Iq,Jye;function cDe(){if(Jye)return Iq;Jye=1;var e=y$t();function t(n){return n==null?"":e(n)}return Iq=t,Iq}var Pq,e2e;function uDe(){if(e2e)return Pq;e2e=1;var e=hf(),t=jle(),n=b$t(),r=cDe();function s(a,o){return e(a)?a:t(a,o)?[a]:n(r(a))}return Pq=s,Pq}var Fq,t2e;function M$(){if(t2e)return Fq;t2e=1;var e=GA();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return Fq=t,Fq}var Oq,n2e;function Ple(){if(n2e)return Oq;n2e=1;var e=uDe(),t=M$();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 Oq=n,Oq}var Mq,r2e;function dDe(){if(r2e)return Mq;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 Mq=t,Mq}var v$t=dDe();const np=Ii(v$t);var Rq,s2e;function w$t(){if(s2e)return Rq;s2e=1;function e(t){return t==null}return Rq=e,Rq}var C$t=w$t();const Ci=Ii(C$t);var Lq,i2e;function S$t(){if(i2e)return Lq;i2e=1;var e=k1(),t=hf(),n=T1(),r="[object String]";function s(a){return typeof a=="string"||!t(a)&&n(a)&&e(a)==r}return Lq=s,Lq}var N$t=S$t();const q3=Ii(N$t);var A$t=Ele();const ji=Ii(A$t);var j$t=m2();const KA=Ii(j$t);var Dq={exports:{}},Pa={};/**
 * @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 E$t(){if(a2e)return Pa;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 Pa.ContextConsumer=o,Pa.ContextProvider=a,Pa.Element=e,Pa.ForwardRef=c,Pa.Fragment=n,Pa.Lazy=x,Pa.Memo=f,Pa.Portal=t,Pa.Profiler=s,Pa.StrictMode=r,Pa.Suspense=u,Pa.SuspenseList=d,Pa.isAsyncMode=function(){return!1},Pa.isConcurrentMode=function(){return!1},Pa.isContextConsumer=function(C){return w(C)===o},Pa.isContextProvider=function(C){return w(C)===a},Pa.isElement=function(C){return typeof C=="object"&&C!==null&&C.$$typeof===e},Pa.isForwardRef=function(C){return w(C)===c},Pa.isFragment=function(C){return w(C)===n},Pa.isLazy=function(C){return w(C)===x},Pa.isMemo=function(C){return w(C)===f},Pa.isPortal=function(C){return w(C)===t},Pa.isProfiler=function(C){return w(C)===s},Pa.isStrictMode=function(C){return w(C)===r},Pa.isSuspense=function(C){return w(C)===u},Pa.isSuspenseList=function(C){return w(C)===d},Pa.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)},Pa.typeOf=w,Pa}var o2e;function _$t(){return o2e||(o2e=1,Dq.exports=E$t()),Dq.exports}var k$t=_$t(),Bq,l2e;function fDe(){if(l2e)return Bq;l2e=1;var e=k1(),t=T1(),n="[object Number]";function r(s){return typeof s=="number"||t(s)&&e(s)==n}return Bq=r,Bq}var $q,c2e;function T$t(){if(c2e)return $q;c2e=1;var e=fDe();function t(n){return e(n)&&n!=+n}return $q=t,$q}var I$t=T$t();const YA=Ii(I$t);var P$t=fDe();const F$t=Ii(P$t);var cm=function(t){return t===0?0:t>0?1:-1},rw=function(t){return q3(t)&&t.indexOf("%")===t.length-1},ns=function(t){return F$t(t)&&!YA(t)},rc=function(t){return ns(t)||q3(t)},O$t=0,S5=function(t){var n=++O$t;return"".concat(t||"").concat(n)},G3=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(!ns(t)&&!q3(t))return r;var a;if(rw(t)){var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return YA(a)&&(a=r),s&&a>n&&(a=n),a},Mb=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},M$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},Sl=function(t,n){return ns(t)&&ns(n)?function(r){return t+r*(n-t)}:function(){return n}};function VR(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):np(r,t))===n})}var R$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}},L$t=function(t,n){return ns(t)&&ns(n)?t-n:q3(t)&&q3(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function h4(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 rte(e){"@babel/helpers - typeof";return rte=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},rte(e)}var D$t=["viewBox","children"],B$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"],Uq={svg:D$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"],WR=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(m.isValidElement(t)&&(r=t.props),!KA(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},$$t=function(t,n,r){return function(s){return t(n,r,s),null}},r_=function(t,n,r){if(!KA(t)||rte(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]=$$t(o,n,r))}),s},U$t=["children"],z$t=["children"];function d2e(e,t){if(e==null)return{};var n=H$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 H$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 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 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"},Yg=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},h2e=null,zq=null,Ole=function e(t){if(t===h2e&&Array.isArray(zq))return zq;var n=[];return m.Children.forEach(t,function(r){Ci(r)||(k$t.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),zq=n,h2e=t,n};function of(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(s){return Yg(s)}):r=[Yg(t)],Ole(e).forEach(function(s){var a=np(s,"type.displayName")||np(s,"type.name");r.indexOf(a)!==-1&&n.push(s)}),n}function Lf(e,t){var n=of(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!(!ns(r)||r<=0||!ns(s)||s<=0)},V$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"],W$t=function(t){return t&&t.type&&q3(t.type)&&V$t.indexOf(t.type)>=0},hDe=function(t){return t&&ste(t)==="object"&&"clipDot"in t},q$t=function(t,n,r,s){var a,o=(a=Uq==null?void 0:Uq[s])!==null&&a!==void 0?a:[];return n.startsWith("data-")||!ji(t)&&(s&&o.includes(n)||B$t.includes(n))||r&&Fle.includes(n)},wi=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var s=t;if(m.isValidElement(t)&&(s=t.props),!KA(s))return null;var a={};return Object.keys(s).forEach(function(o){var l;q$t((l=s)===null||l===void 0?void 0:l[o],o,n,r)&&(a[o]=s[o])}),a},ite=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(Ci(t)&&Ci(n))return!0;if(!Ci(t)&&!Ci(n)){var r=t.props||{},s=r.children,a=d2e(r,U$t),o=n.props||{},l=o.children,c=d2e(o,z$t);return s&&l?h4(a,c)&&ite(s,l):!s&&!l?h4(a,c):!1}return!1},x2e=function(t,n){var r=[],s={};return Ole(t).forEach(function(a,o){if(W$t(a))r.push(a);else if(a){var l=Yg(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},G$t=function(t){var n=t&&t.type;return n&&f2e[n]?f2e[n]:null},K$t=function(t,n){return Ole(n).indexOf(t)},Y$t=["children","width","height","viewBox","className","style","title","desc"];function ate(){return ate=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},ate.apply(this,arguments)}function X$t(e,t){if(e==null)return{};var n=Q$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 Q$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 ote(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=X$t(e,Y$t),d=s||{width:n,height:r,x:0,y:0},f=ia("recharts-surface",a);return Ae.createElement("svg",ate({},wi(u,!0,"svg"),{className:f,width:n,height:r,style:o,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),Ae.createElement("title",null,l),Ae.createElement("desc",null,c),t)}var Z$t=["children","className"];function lte(){return lte=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},lte.apply(this,arguments)}function J$t(e,t){if(e==null)return{};var n=eUt(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 eUt(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 Sa=Ae.forwardRef(function(e,t){var n=e.children,r=e.className,s=J$t(e,Z$t),a=ia("recharts-layer",r);return Ae.createElement("g",lte({className:a},wi(s,!0),{ref:t}),n)}),Xg=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]},Hq,g2e;function tUt(){if(g2e)return Hq;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 Hq=e,Hq}var Vq,b2e;function nUt(){if(b2e)return Vq;b2e=1;var e=tUt();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 Vq=t,Vq}var Wq,y2e;function pDe(){if(y2e)return Wq;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 Wq=c,Wq}var qq,v2e;function rUt(){if(v2e)return qq;v2e=1;function e(t){return t.split("")}return qq=e,qq}var Gq,w2e;function sUt(){if(w2e)return Gq;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,P="(?:"+[d+l+"?",l,f,x,o].join("|")+")",I=RegExp(c+"(?="+c+")|"+P+N,"g");function R(O){return O.match(I)||[]}return Gq=R,Gq}var Kq,C2e;function iUt(){if(C2e)return Kq;C2e=1;var e=rUt(),t=pDe(),n=sUt();function r(s){return t(s)?n(s):e(s)}return Kq=r,Kq}var Yq,S2e;function aUt(){if(S2e)return Yq;S2e=1;var e=nUt(),t=pDe(),n=iUt(),r=cDe();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 Yq=s,Yq}var Xq,N2e;function oUt(){if(N2e)return Xq;N2e=1;var e=aUt(),t=e("toUpperCase");return Xq=t,Xq}var lUt=oUt();const R$=Ii(lUt);function ao(e){return function(){return e}}const mDe=Math.cos,qR=Math.sin,_m=Math.sqrt,GR=Math.PI,L$=2*GR,cte=Math.PI,ute=2*cte,kv=1e-6,cUt=ute-kv;function xDe(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function uUt(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return xDe;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 dUt{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?xDe:uUt(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>kv)if(!(Math.abs(f*c-u*d)>kv)||!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),P=Math.sqrt(x),I=a*Math.tan((cte-Math.acos((w+x-C)/(2*N*P)))/2),R=I/P,O=I/N;Math.abs(R-1)>kv&&this._append`L${t+R*d},${n+R*f}`,this._append`A${a},${a},0,0,${+(f*g>d*v)},${this._x1=t+O*c},${this._y1=n+O*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)>kv||Math.abs(this._y1-d)>kv)&&this._append`L${u},${d}`,r&&(x<0&&(x=x%ute+ute),x>cUt?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>kv&&this._append`A${r},${r},0,${+(x>=cte)},${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 dUt(t)}function Rle(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function gDe(e){this._context=e}gDe.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 D$(e){return new gDe(e)}function bDe(e){return e[0]}function yDe(e){return e[1]}function vDe(e,t){var n=ao(!0),r=null,s=D$,a=null,o=Mle(l);e=typeof e=="function"?e:e===void 0?bDe:ao(e),t=typeof t=="function"?t:t===void 0?yDe:ao(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:ao(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:ao(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:ao(!!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 NP(e,t,n){var r=null,s=ao(!0),a=null,o=D$,l=null,c=Mle(u);e=typeof e=="function"?e:e===void 0?bDe:ao(+e),t=typeof t=="function"?t:ao(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?yDe:ao(+n);function u(f){var x,g,v,w=(f=Rle(f)).length,C,N=!1,P,I=new Array(w),R=new Array(w);for(a==null&&(l=o(P=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(I[v],R[v]);l.lineEnd(),l.areaEnd()}N&&(I[x]=+e(C,x,f),R[x]=+t(C,x,f),l.point(r?+r(C,x,f):I[x],n?+n(C,x,f):R[x]))}if(P)return l=null,P+""||null}function d(){return vDe().defined(s).curve(o).context(a)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:ao(+f),r=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:ao(+f),u):e},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:ao(+f),u):r},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:ao(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:ao(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:ao(+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:ao(!!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 wDe{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 fUt(e){return new wDe(e,!0)}function hUt(e){return new wDe(e,!1)}const Lle={draw(e,t){const n=_m(t/GR);e.moveTo(n,0),e.arc(0,0,n,0,L$)}},pUt={draw(e,t){const n=_m(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()}},CDe=_m(1/3),mUt=CDe*2,xUt={draw(e,t){const n=_m(t/mUt),r=n*CDe;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},gUt={draw(e,t){const n=_m(t),r=-n/2;e.rect(r,r,n,n)}},bUt=.8908130915292852,SDe=qR(GR/10)/qR(7*GR/10),yUt=qR(L$/10)*SDe,vUt=-mDe(L$/10)*SDe,wUt={draw(e,t){const n=_m(t*bUt),r=yUt*n,s=vUt*n;e.moveTo(0,-n),e.lineTo(r,s);for(let a=1;a<5;++a){const o=L$*a/5,l=mDe(o),c=qR(o);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*s,c*r+l*s)}e.closePath()}},Qq=_m(3),CUt={draw(e,t){const n=-_m(t/(Qq*3));e.moveTo(0,n*2),e.lineTo(-Qq*n,-n),e.lineTo(Qq*n,-n),e.closePath()}},Ch=-.5,Sh=_m(3)/2,dte=1/_m(12),SUt=(dte/2+1)*3,NUt={draw(e,t){const n=_m(t/SUt),r=n/2,s=n*dte,a=r,o=n*dte+n,l=-a,c=o;e.moveTo(r,s),e.lineTo(a,o),e.lineTo(l,c),e.lineTo(Ch*r-Sh*s,Sh*r+Ch*s),e.lineTo(Ch*a-Sh*o,Sh*a+Ch*o),e.lineTo(Ch*l-Sh*c,Sh*l+Ch*c),e.lineTo(Ch*r+Sh*s,Ch*s-Sh*r),e.lineTo(Ch*a+Sh*o,Ch*o-Sh*a),e.lineTo(Ch*l+Sh*c,Ch*c-Sh*l),e.closePath()}};function AUt(e,t){let n=null,r=Mle(s);e=typeof e=="function"?e:ao(e||Lle),t=typeof t=="function"?t:ao(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:ao(a),s):e},s.size=function(a){return arguments.length?(t=typeof a=="function"?a:ao(+a),s):t},s.context=function(a){return arguments.length?(n=a??null,s):n},s}function KR(){}function YR(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 NDe(e){this._context=e}NDe.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:YR(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:YR(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function jUt(e){return new NDe(e)}function ADe(e){this._context=e}ADe.prototype={areaStart:KR,areaEnd:KR,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:YR(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function EUt(e){return new ADe(e)}function jDe(e){this._context=e}jDe.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:YR(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function _Ut(e){return new jDe(e)}function EDe(e){this._context=e}EDe.prototype={areaStart:KR,areaEnd:KR,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 kUt(e){return new EDe(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 Zq(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 XR(e){this._context=e}XR.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:Zq(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,Zq(this,E2e(this,n=j2e(this,e,t)),n);break;default:Zq(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 _De(e){this._context=new kDe(e)}(_De.prototype=Object.create(XR.prototype)).point=function(e,t){XR.prototype.point.call(this,t,e)};function kDe(e){this._context=e}kDe.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 TUt(e){return new XR(e)}function IUt(e){return new _De(e)}function TDe(e){this._context=e}TDe.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 PUt(e){return new TDe(e)}function B$(e,t){this._context=e,this._t=t}B$.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 FUt(e){return new B$(e,.5)}function OUt(e){return new B$(e,0)}function MUt(e){return new B$(e,1)}function wN(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 fte(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function RUt(e,t){return e[t]}function LUt(e){const t=[];return t.key=e,t}function DUt(){var e=ao([]),t=fte,n=wN,r=RUt;function s(a){var o=Array.from(e.apply(this,arguments),LUt),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:ao(Array.from(a)),s):e},s.value=function(a){return arguments.length?(r=typeof a=="function"?a:ao(+a),s):r},s.order=function(a){return arguments.length?(t=a==null?fte:typeof a=="function"?a:ao(Array.from(a)),s):t},s.offset=function(a){return arguments.length?(n=a??wN,s):n},s}function BUt(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}wN(e,t)}}function $Ut(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}wN(e,t)}}function UUt(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,wN(e,t)}}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)}var zUt=["type","size","sizeType"];function hte(){return hte=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},hte.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){HUt(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 HUt(e,t,n){return t=VUt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VUt(e){var t=WUt(e,"string");return s_(t)=="symbol"?t:t+""}function WUt(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)}function qUt(e,t){if(e==null)return{};var n=GUt(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 GUt(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 IDe={symbolCircle:Lle,symbolCross:pUt,symbolDiamond:xUt,symbolSquare:gUt,symbolStar:wUt,symbolTriangle:CUt,symbolWye:NUt},KUt=Math.PI/180,YUt=function(t){var n="symbol".concat(R$(t));return IDe[n]||Lle},XUt=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*KUt;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}},QUt=function(t,n){IDe["symbol".concat(R$(t))]=n},$$=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=qUt(t,zUt),u=T2e(T2e({},c),{},{type:r,size:a,sizeType:l}),d=function(){var C=YUt(r),N=AUt().type(C).size(XUt(a,l,r));return N()},f=u.className,x=u.cx,g=u.cy,v=wi(u,!0);return x===+x&&g===+g&&a===+a?Ae.createElement("path",hte({},v,{className:ia("recharts-symbols",f),transform:"translate(".concat(x,", ").concat(g,")"),d:d()})):null};$$.registerSymbol=QUt;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 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 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 ZUt(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){i_(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 JUt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ezt(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,FDe(r.key),r)}}function tzt(e,t,n){return ezt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function nzt(e,t,n){return t=QR(t),rzt(e,PDe()?Reflect.construct(t,n||[],QR(e).constructor):t.apply(e,n))}function rzt(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 szt(e)}function szt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function PDe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(PDe=function(){return!!e})()}function QR(e){return QR=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},QR(e)}function izt(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&&mte(e,t)}function mte(e,t){return mte=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},mte(e,t)}function i_(e,t,n){return t=FDe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FDe(e){var t=azt(e,"string");return CN(t)=="symbol"?t:t+""}function azt(e,t){if(CN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(CN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Pp=32,Dle=function(e){function t(){return JUt(this,t),nzt(this,t,arguments)}return izt(t,e),tzt(t,[{key:"renderIcon",value:function(r){var s=this.props.inactiveColor,a=Pp/2,o=Pp/6,l=Pp/3,c=r.inactive?s:r.color;if(r.type==="plainline")return Ae.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:a,x2:Pp,y2:a,className:"recharts-legend-icon"});if(r.type==="line")return Ae.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(Pp,"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 Ae.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(Pp/8,"h").concat(Pp,"v").concat(Pp*3/4,"h").concat(-32,"z"),className:"recharts-legend-icon"});if(Ae.isValidElement(r.legendIcon)){var u=ZUt({},r);return delete u.legendIcon,Ae.cloneElement(r.legendIcon,u)}return Ae.createElement($$,{fill:c,cx:a,cy:a,size:Pp,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:Pp,height:Pp},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=ia(i_(i_({"recharts-legend-item":!0},"legend-item-".concat(v),!0),"inactive",g.inactive));if(g.type==="none")return null;var N=ji(g.value)?null:g.value;Xg(!ji(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 P=g.inactive?u:g.color;return Ae.createElement("li",pte({className:C,style:f,key:"legend-item-".concat(v)},r_(r.props,g,v)),Ae.createElement(ote,{width:o,height:o,viewBox:d,style:x},r.renderIcon(g)),Ae.createElement("span",{className:"recharts-legend-item-text",style:{color:P}},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 Ae.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(m.PureComponent);i_(Dle,"displayName","Legend");i_(Dle,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Jq,P2e;function ozt(){if(P2e)return Jq;P2e=1;var e=F$();function t(){this.__data__=new e,this.size=0}return Jq=t,Jq}var eG,F2e;function lzt(){if(F2e)return eG;F2e=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return eG=e,eG}var tG,O2e;function czt(){if(O2e)return tG;O2e=1;function e(t){return this.__data__.get(t)}return tG=e,tG}var nG,M2e;function uzt(){if(M2e)return nG;M2e=1;function e(t){return this.__data__.has(t)}return nG=e,nG}var rG,R2e;function dzt(){if(R2e)return rG;R2e=1;var e=F$(),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 rG=s,rG}var sG,L2e;function ODe(){if(L2e)return sG;L2e=1;var e=F$(),t=ozt(),n=lzt(),r=czt(),s=uzt(),a=dzt();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,sG=o,sG}var iG,D2e;function fzt(){if(D2e)return iG;D2e=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return iG=t,iG}var aG,B2e;function hzt(){if(B2e)return aG;B2e=1;function e(t){return this.__data__.has(t)}return aG=e,aG}var oG,$2e;function MDe(){if($2e)return oG;$2e=1;var e=Tle(),t=fzt(),n=hzt();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,oG=r,oG}var lG,U2e;function RDe(){if(U2e)return lG;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 lG=e,lG}var cG,z2e;function LDe(){if(z2e)return cG;z2e=1;function e(t,n){return t.has(n)}return cG=e,cG}var uG,H2e;function DDe(){if(H2e)return uG;H2e=1;var e=MDe(),t=RDe(),n=LDe(),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,P=!0,I=c&s?new e:void 0;for(f.set(o,l),f.set(l,o);++N<g;){var R=o[N],O=l[N];if(u)var U=x?u(O,R,N,l,o,f):u(R,O,N,o,l,f);if(U!==void 0){if(U)continue;P=!1;break}if(I){if(!t(l,function(L,z){if(!n(I,z)&&(R===L||d(R,L,c,u,f)))return I.push(z)})){P=!1;break}}else if(!(R===O||d(R,O,c,u,f))){P=!1;break}}return f.delete(o),f.delete(l),P}return uG=a,uG}var dG,V2e;function pzt(){if(V2e)return dG;V2e=1;var e=hx(),t=e.Uint8Array;return dG=t,dG}var fG,W2e;function mzt(){if(W2e)return fG;W2e=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(s,a){r[++n]=[a,s]}),r}return fG=e,fG}var hG,q2e;function Ble(){if(q2e)return hG;q2e=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(s){r[++n]=s}),r}return hG=e,hG}var pG,G2e;function xzt(){if(G2e)return pG;G2e=1;var e=lT(),t=pzt(),n=_le(),r=DDe(),s=mzt(),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]",P="[object DataView]",I=e?e.prototype:void 0,R=I?I.valueOf:void 0;function O(U,L,z,X,ne,J,K){switch(z){case P: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 Q=K.get(U);if(Q)return Q==L;X|=l,K.set(U,L);var ie=r(re(U),re(L),X,ne,J,K);return K.delete(U),ie;case C:if(R)return R.call(U)==R.call(L)}return!1}return pG=O,pG}var mG,K2e;function BDe(){if(K2e)return mG;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 mG=e,mG}var xG,Y2e;function gzt(){if(Y2e)return xG;Y2e=1;var e=BDe(),t=hf();function n(r,s,a){var o=s(r);return t(r)?o:e(o,a(r))}return xG=n,xG}var gG,X2e;function bzt(){if(X2e)return gG;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 gG=e,gG}var bG,Q2e;function yzt(){if(Q2e)return bG;Q2e=1;function e(){return[]}return bG=e,bG}var yG,Z2e;function vzt(){if(Z2e)return yG;Z2e=1;var e=bzt(),t=yzt(),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 yG=a,yG}var vG,J2e;function wzt(){if(J2e)return vG;J2e=1;function e(t,n){for(var r=-1,s=Array(t);++r<t;)s[r]=n(r);return s}return vG=e,vG}var wG,eve;function Czt(){if(eve)return wG;eve=1;var e=k1(),t=T1(),n="[object Arguments]";function r(s){return t(s)&&e(s)==n}return wG=r,wG}var CG,tve;function $le(){if(tve)return CG;tve=1;var e=Czt(),t=T1(),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 CG=a,CG}var Ej={exports:{}},SG,nve;function Szt(){if(nve)return SG;nve=1;function e(){return!1}return SG=e,SG}Ej.exports;var rve;function $De(){return rve||(rve=1,function(e,t){var n=hx(),r=Szt(),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}(Ej,Ej.exports)),Ej.exports}var NG,sve;function Ule(){if(sve)return NG;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 NG=n,NG}var AG,ive;function zle(){if(ive)return AG;ive=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return AG=t,AG}var jG,ave;function Nzt(){if(ave)return jG;ave=1;var e=k1(),t=zle(),n=T1(),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]",P="[object Float32Array]",I="[object Float64Array]",R="[object Int8Array]",O="[object Int16Array]",U="[object Int32Array]",L="[object Uint8Array]",z="[object Uint8ClampedArray]",X="[object Uint16Array]",ne="[object Uint32Array]",J={};J[P]=J[I]=J[R]=J[O]=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 K(re){return n(re)&&t(re.length)&&!!J[e(re)]}return jG=K,jG}var EG,ove;function UDe(){if(ove)return EG;ove=1;function e(t){return function(n){return t(n)}}return EG=e,EG}var _j={exports:{}};_j.exports;var lve;function Azt(){return lve||(lve=1,function(e,t){var n=aDe(),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}(_j,_j.exports)),_j.exports}var _G,cve;function zDe(){if(cve)return _G;cve=1;var e=Nzt(),t=UDe(),n=Azt(),r=n&&n.isTypedArray,s=r?t(r):e;return _G=s,_G}var kG,uve;function jzt(){if(uve)return kG;uve=1;var e=wzt(),t=$le(),n=hf(),r=$De(),s=Ule(),a=zDe(),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 P in u)(d||l.call(u,P))&&!(w&&(P=="length"||g&&(P=="offset"||P=="parent")||v&&(P=="buffer"||P=="byteLength"||P=="byteOffset")||s(P,N)))&&C.push(P);return C}return kG=c,kG}var TG,dve;function Ezt(){if(dve)return TG;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 TG=t,TG}var IG,fve;function HDe(){if(fve)return IG;fve=1;function e(t,n){return function(r){return t(n(r))}}return IG=e,IG}var PG,hve;function _zt(){if(hve)return PG;hve=1;var e=HDe(),t=e(Object.keys,Object);return PG=t,PG}var FG,pve;function kzt(){if(pve)return FG;pve=1;var e=Ezt(),t=_zt(),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 FG=s,FG}var OG,mve;function cT(){if(mve)return OG;mve=1;var e=Ele(),t=zle();function n(r){return r!=null&&t(r.length)&&!e(r)}return OG=n,OG}var MG,xve;function U$(){if(xve)return MG;xve=1;var e=jzt(),t=kzt(),n=cT();function r(s){return n(s)?e(s):t(s)}return MG=r,MG}var RG,gve;function Tzt(){if(gve)return RG;gve=1;var e=gzt(),t=vzt(),n=U$();function r(s){return e(s,n,t)}return RG=r,RG}var LG,bve;function Izt(){if(bve)return LG;bve=1;var e=Tzt(),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 P=d.get(a),I=d.get(o);if(P&&I)return P==o&&I==a;var R=!0;d.set(a,o),d.set(o,a);for(var O=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}O||(O=N=="constructor")}if(R&&!O){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 LG=s,LG}var DG,yve;function Pzt(){if(yve)return DG;yve=1;var e=C5(),t=hx(),n=e(t,"DataView");return DG=n,DG}var BG,vve;function Fzt(){if(vve)return BG;vve=1;var e=C5(),t=hx(),n=e(t,"Promise");return BG=n,BG}var $G,wve;function VDe(){if(wve)return $G;wve=1;var e=C5(),t=hx(),n=e(t,"Set");return $G=n,$G}var UG,Cve;function Ozt(){if(Cve)return UG;Cve=1;var e=C5(),t=hx(),n=e(t,"WeakMap");return UG=n,UG}var zG,Sve;function Mzt(){if(Sve)return zG;Sve=1;var e=Pzt(),t=kle(),n=Fzt(),r=VDe(),s=Ozt(),a=k1(),o=oDe(),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),P=a;return(e&&P(new e(new ArrayBuffer(1)))!=x||t&&P(new t)!=l||n&&P(n.resolve())!=u||r&&P(new r)!=d||s&&P(new s)!=f)&&(P=function(I){var R=a(I),O=R==c?I.constructor:void 0,U=O?o(O):"";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}),zG=P,zG}var HG,Nve;function Rzt(){if(Nve)return HG;Nve=1;var e=ODe(),t=DDe(),n=xzt(),r=Izt(),s=Mzt(),a=hf(),o=$De(),l=zDe(),c=1,u="[object Arguments]",d="[object Array]",f="[object Object]",x=Object.prototype,g=x.hasOwnProperty;function v(w,C,N,P,I,R){var O=a(w),U=a(C),L=O?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;O=!0,X=!1}if(J&&!X)return R||(R=new e),O||l(w)?t(w,C,N,P,I,R):n(w,C,L,N,P,I,R);if(!(N&c)){var K=X&&g.call(w,"__wrapped__"),re=ne&&g.call(C,"__wrapped__");if(K||re){var he=K?w.value():w,Q=re?C.value():C;return R||(R=new e),I(he,Q,N,P,R)}}return J?(R||(R=new e),r(w,C,N,P,I,R)):!1}return HG=v,HG}var VG,Ave;function Hle(){if(Ave)return VG;Ave=1;var e=Rzt(),t=T1();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 VG=n,VG}var WG,jve;function Lzt(){if(jve)return WG;jve=1;var e=ODe(),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 WG=s,WG}var qG,Eve;function WDe(){if(Eve)return qG;Eve=1;var e=m2();function t(n){return n===n&&!e(n)}return qG=t,qG}var GG,_ve;function Dzt(){if(_ve)return GG;_ve=1;var e=WDe(),t=U$();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 GG=n,GG}var KG,kve;function qDe(){if(kve)return KG;kve=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return KG=e,KG}var YG,Tve;function Bzt(){if(Tve)return YG;Tve=1;var e=Lzt(),t=Dzt(),n=qDe();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 YG=r,YG}var XG,Ive;function $zt(){if(Ive)return XG;Ive=1;function e(t,n){return t!=null&&n in Object(t)}return XG=e,XG}var QG,Pve;function Uzt(){if(Pve)return QG;Pve=1;var e=uDe(),t=$le(),n=hf(),r=Ule(),s=zle(),a=M$();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 QG=o,QG}var ZG,Fve;function zzt(){if(Fve)return ZG;Fve=1;var e=$zt(),t=Uzt();function n(r,s){return r!=null&&t(r,s,e)}return ZG=n,ZG}var JG,Ove;function Hzt(){if(Ove)return JG;Ove=1;var e=Hle(),t=dDe(),n=zzt(),r=jle(),s=WDe(),a=qDe(),o=M$(),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 JG=u,JG}var eK,Mve;function XA(){if(Mve)return eK;Mve=1;function e(t){return t}return eK=e,eK}var tK,Rve;function Vzt(){if(Rve)return tK;Rve=1;function e(t){return function(n){return n==null?void 0:n[t]}}return tK=e,tK}var nK,Lve;function Wzt(){if(Lve)return nK;Lve=1;var e=Ple();function t(n){return function(r){return e(r,n)}}return nK=t,nK}var rK,Dve;function qzt(){if(Dve)return rK;Dve=1;var e=Vzt(),t=Wzt(),n=jle(),r=M$();function s(a){return n(a)?e(r(a)):t(a)}return rK=s,rK}var sK,Bve;function x2(){if(Bve)return sK;Bve=1;var e=Bzt(),t=Hzt(),n=XA(),r=hf(),s=qzt();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 sK=a,sK}var iK,$ve;function GDe(){if($ve)return iK;$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 iK=e,iK}var aK,Uve;function Gzt(){if(Uve)return aK;Uve=1;function e(t){return t!==t}return aK=e,aK}var oK,zve;function Kzt(){if(zve)return oK;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 oK=e,oK}var lK,Hve;function Yzt(){if(Hve)return lK;Hve=1;var e=GDe(),t=Gzt(),n=Kzt();function r(s,a,o){return a===a?n(s,a,o):e(s,t,o)}return lK=r,lK}var cK,Vve;function Xzt(){if(Vve)return cK;Vve=1;var e=Yzt();function t(n,r){var s=n==null?0:n.length;return!!s&&e(n,r,0)>-1}return cK=t,cK}var uK,Wve;function Qzt(){if(Wve)return uK;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 uK=e,uK}var dK,qve;function Zzt(){if(qve)return dK;qve=1;function e(){}return dK=e,dK}var fK,Gve;function Jzt(){if(Gve)return fK;Gve=1;var e=VDe(),t=Zzt(),n=Ble(),r=1/0,s=e&&1/n(new e([,-0]))[1]==r?function(a){return new e(a)}:t;return fK=s,fK}var hK,Kve;function eHt(){if(Kve)return hK;Kve=1;var e=MDe(),t=Xzt(),n=Qzt(),r=LDe(),s=Jzt(),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 P=c[f],I=u?u(P):P;if(P=d||P!==0?P:0,v&&I===I){for(var R=C.length;R--;)if(C[R]===I)continue e;u&&C.push(I),w.push(P)}else x(C,I,d)||(C!==w&&C.push(I),w.push(P))}return w}return hK=l,hK}var pK,Yve;function tHt(){if(Yve)return pK;Yve=1;var e=x2(),t=eHt();function n(r,s){return r&&r.length?t(r,e(s,2)):[]}return pK=n,pK}var nHt=tHt();const Xve=Ii(nHt);function KDe(e,t,n){return t===!0?Xve(e,n):ji(t)?Xve(e,t):e}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)}var rHt=["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 Gx(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){z$(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 sHt(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,XDe(r.key),r)}}function iHt(e,t,n){return Zve(e.prototype,t),Zve(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function aHt(e,t,n){return t=ZR(t),oHt(e,YDe()?Reflect.construct(t,n,ZR(e).constructor):t.apply(e,n))}function oHt(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 lHt(e)}function lHt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function YDe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(YDe=function(){return!!e})()}function ZR(e){return ZR=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ZR(e)}function cHt(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 z$(e,t,n){return t=XDe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XDe(e){var t=uHt(e,"string");return SN(t)=="symbol"?t:t+""}function uHt(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 dHt(e,t){if(e==null)return{};var n=fHt(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 fHt(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 hHt(e){return e.value}function pHt(e,t){if(Ae.isValidElement(e))return Ae.cloneElement(e,t);if(typeof e=="function")return Ae.createElement(e,t);t.ref;var n=dHt(t,rHt);return Ae.createElement(Dle,n)}var Jve=1,i3=function(e){function t(){var n;sHt(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=aHt(this,t,[].concat(s)),z$(n,"lastBoundingBox",{width:-1,height:-1}),n}return cHt(t,e),iHt(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?Gx({},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 Gx(Gx({},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=Gx(Gx({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return Ae.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(g){r.wrapperNode=g}},pHt(a,Gx(Gx({},this.props),{},{payload:KDe(d,u,hHt)})))}}],[{key:"getWithHeight",value:function(r,s){var a=Gx(Gx({},this.defaultProps),r.props),o=a.layout;return o==="vertical"&&ns(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||s}:null}}])}(m.PureComponent);z$(i3,"displayName","Legend");z$(i3,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var mK,ewe;function mHt(){if(ewe)return mK;ewe=1;var e=lT(),t=$le(),n=hf(),r=e?e.isConcatSpreadable:void 0;function s(a){return n(a)||t(a)||!!(r&&a&&a[r])}return mK=s,mK}var xK,twe;function QDe(){if(twe)return xK;twe=1;var e=BDe(),t=mHt();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 xK=n,xK}var gK,nwe;function xHt(){if(nwe)return gK;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 gK=e,gK}var bK,rwe;function gHt(){if(rwe)return bK;rwe=1;var e=xHt(),t=e();return bK=t,bK}var yK,swe;function ZDe(){if(swe)return yK;swe=1;var e=gHt(),t=U$();function n(r,s){return r&&e(r,s,t)}return yK=n,yK}var vK,iwe;function bHt(){if(iwe)return vK;iwe=1;var e=cT();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 vK=t,vK}var wK,awe;function Vle(){if(awe)return wK;awe=1;var e=ZDe(),t=bHt(),n=t(e);return wK=n,wK}var CK,owe;function JDe(){if(owe)return CK;owe=1;var e=Vle(),t=cT();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 CK=n,CK}var SK,lwe;function yHt(){if(lwe)return SK;lwe=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return SK=e,SK}var NK,cwe;function vHt(){if(cwe)return NK;cwe=1;var e=GA();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 NK=t,NK}var AK,uwe;function wHt(){if(uwe)return AK;uwe=1;var e=vHt();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 AK=t,AK}var jK,dwe;function CHt(){if(dwe)return jK;dwe=1;var e=Ile(),t=Ple(),n=x2(),r=JDe(),s=yHt(),a=UDe(),o=wHt(),l=XA(),c=hf();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 P=e(f,function(I){return I(w)});return{criteria:P,index:++g,value:w}});return s(v,function(w,C){return o(w,C,x)})}return jK=u,jK}var EK,fwe;function SHt(){if(fwe)return EK;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 EK=e,EK}var _K,hwe;function NHt(){if(hwe)return _K;hwe=1;var e=SHt(),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 _K=n,_K}var kK,pwe;function AHt(){if(pwe)return kK;pwe=1;function e(t){return function(){return t}}return kK=e,kK}var TK,mwe;function eBe(){if(mwe)return TK;mwe=1;var e=C5(),t=function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}}();return TK=t,TK}var IK,xwe;function jHt(){if(xwe)return IK;xwe=1;var e=AHt(),t=eBe(),n=XA(),r=t?function(s,a){return t(s,"toString",{configurable:!0,enumerable:!1,value:e(a),writable:!0})}:n;return IK=r,IK}var PK,gwe;function EHt(){if(gwe)return PK;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 PK=r,PK}var FK,bwe;function _Ht(){if(bwe)return FK;bwe=1;var e=jHt(),t=EHt(),n=t(e);return FK=n,FK}var OK,ywe;function kHt(){if(ywe)return OK;ywe=1;var e=XA(),t=NHt(),n=_Ht();function r(s,a){return n(t(s,a,e),s+"")}return OK=r,OK}var MK,vwe;function H$(){if(vwe)return MK;vwe=1;var e=_le(),t=cT(),n=Ule(),r=m2();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 MK=s,MK}var RK,wwe;function THt(){if(wwe)return RK;wwe=1;var e=QDe(),t=CHt(),n=kHt(),r=H$(),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 RK=s,RK}var IHt=THt();const Wle=Ii(IHt);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 gte(){return gte=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},gte.apply(this,arguments)}function PHt(e,t){return RHt(e)||MHt(e,t)||OHt(e,t)||FHt()}function FHt(){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 OHt(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 MHt(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 RHt(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 LK(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){LHt(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 LHt(e,t,n){return t=DHt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DHt(e){var t=BHt(e,"string");return a_(t)=="symbol"?t:t+""}function BHt(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)}function $Ht(e){return Array.isArray(e)&&rc(e[0])&&rc(e[1])?e.join(" ~ "):e}var UHt=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,P=N===void 0?!1:N,I=function(){if(d&&d.length){var K={padding:0,margin:0},re=(x?Wle(d,x):d).map(function(he,Q){if(he.type==="none")return null;var ie=LK({display:"block",paddingTop:4,paddingBottom:4,color:he.color||"#000"},l),oe=he.formatter||f||$Ht,G=he.value,V=he.name,te=G,ae=V;if(te!=null&&ae!=null){var fe=oe(G,V,he,Q,d);if(Array.isArray(fe)){var Ne=PHt(fe,2);te=Ne[0],ae=Ne[1]}else te=fe}return Ae.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(Q),style:ie},rc(ae)?Ae.createElement("span",{className:"recharts-tooltip-item-name"},ae):null,rc(ae)?Ae.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,Ae.createElement("span",{className:"recharts-tooltip-item-value"},te),Ae.createElement("span",{className:"recharts-tooltip-item-unit"},he.unit||""))});return Ae.createElement("ul",{className:"recharts-tooltip-item-list",style:K},re)}return null},R=LK({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},a),O=LK({margin:0},u),U=!Ci(w),L=U?w:"",z=ia("recharts-default-tooltip",g),X=ia("recharts-tooltip-label",v);U&&C&&d!==void 0&&d!==null&&(L=C(w,d));var ne=P?{role:"status","aria-live":"assertive"}:{};return Ae.createElement("div",gte({className:z,style:R},ne),Ae.createElement("p",{className:X,style:O},Ae.isValidElement(L)?L:"".concat(L)),I())};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 AP(e,t,n){return t=zHt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zHt(e){var t=HHt(e,"string");return o_(t)=="symbol"?t:t+""}function HHt(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 O7="recharts-tooltip-wrapper",VHt={visibility:"hidden"};function WHt(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return ia(O7,AP(AP(AP(AP({},"".concat(O7,"-right"),ns(n)&&t&&ns(t.x)&&n>=t.x),"".concat(O7,"-left"),ns(n)&&t&&ns(t.x)&&n<t.x),"".concat(O7,"-bottom"),ns(r)&&t&&ns(t.y)&&r>=t.y),"".concat(O7,"-top"),ns(r)&&t&&ns(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&&ns(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 qHt(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 GHt(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=qHt({translateX:d,translateY:f,useTranslate3d:l})):u=VHt,{cssProperties:u,cssClasses:WHt({translateX:d,translateY:f,coordinate:n})}}function NN(e){"@babel/helpers - typeof";return NN=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},NN(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){yte(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 KHt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function YHt(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,nBe(r.key),r)}}function XHt(e,t,n){return YHt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function QHt(e,t,n){return t=JR(t),ZHt(e,tBe()?Reflect.construct(t,n,JR(e).constructor):t.apply(e,n))}function ZHt(e,t){if(t&&(NN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return JHt(e)}function JHt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tBe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(tBe=function(){return!!e})()}function JR(e){return JR=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},JR(e)}function eVt(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&&bte(e,t)}function bte(e,t){return bte=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},bte(e,t)}function yte(e,t,n){return t=nBe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nBe(e){var t=tVt(e,"string");return NN(t)=="symbol"?t:t+""}function tVt(e,t){if(NN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(NN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Ewe=1,nVt=function(e){function t(){var n;KHt(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=QHt(this,t,[].concat(s)),yte(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),yte(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 eVt(t,e),XHt(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,P=s.wrapperStyle,I=GHt({allowEscapeViewBox:o,coordinate:d,offsetTopLeft:g,position:v,reverseDirection:w,tooltipBox:this.state.lastBoundingBox,useTranslate3d:C,viewBox:N}),R=I.cssClasses,O=I.cssProperties,U=jwe(jwe({transition:x&&a?"transform ".concat(l,"ms ").concat(c):void 0},O),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&f?"visible":"hidden",position:"absolute",top:0,left:0},P);return Ae.createElement("div",{tabIndex:-1,className:R,style:U,ref:function(z){r.wrapperNode=z}},u)}}])}(m.PureComponent),rVt=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},mm={isSsr:rVt(),get:function(t){return mm[t]},set:function(t,n){if(typeof t=="string")mm[t]=n;else{var r=Object.keys(t);r&&r.length&&r.forEach(function(s){mm[s]=t[s]})}}};function AN(e){"@babel/helpers - typeof";return AN=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},AN(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 sVt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iVt(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,sBe(r.key),r)}}function aVt(e,t,n){return iVt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function oVt(e,t,n){return t=eL(t),lVt(e,rBe()?Reflect.construct(t,n||[],eL(e).constructor):t.apply(e,n))}function lVt(e,t){if(t&&(AN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cVt(e)}function cVt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rBe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(rBe=function(){return!!e})()}function eL(e){return eL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},eL(e)}function uVt(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&&vte(e,t)}function vte(e,t){return vte=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},vte(e,t)}function qle(e,t,n){return t=sBe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sBe(e){var t=dVt(e,"string");return AN(t)=="symbol"?t:t+""}function dVt(e,t){if(AN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(AN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fVt(e){return e.dataKey}function hVt(e,t){return Ae.isValidElement(e)?Ae.cloneElement(e,t):typeof e=="function"?Ae.createElement(e,t):Ae.createElement(UHt,t)}var Xp=function(e){function t(){return sVt(this,t),oVt(this,t,arguments)}return uVt(t,e),aVt(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,P=s.useTranslate3d,I=s.viewBox,R=s.wrapperStyle,O=v??[];f&&O.length&&(O=KDe(v.filter(function(L){return L.value!=null&&(L.hide!==!0||r.props.includeHidden)}),w,fVt));var U=O.length>0;return Ae.createElement(nVt,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:x,active:a,coordinate:d,hasPayload:U,offset:g,position:C,reverseDirection:N,useTranslate3d:P,viewBox:I,wrapperStyle:R},hVt(u,kwe(kwe({},this.props),{},{payload:O})))}}])}(m.PureComponent);qle(Xp,"displayName","Tooltip");qle(Xp,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!mm.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 DK,Twe;function pVt(){if(Twe)return DK;Twe=1;var e=hx(),t=function(){return e.Date.now()};return DK=t,DK}var BK,Iwe;function mVt(){if(Iwe)return BK;Iwe=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return BK=t,BK}var $K,Pwe;function xVt(){if(Pwe)return $K;Pwe=1;var e=mVt(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return $K=n,$K}var UK,Fwe;function iBe(){if(Fwe)return UK;Fwe=1;var e=xVt(),t=m2(),n=GA(),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 UK=c,UK}var zK,Owe;function aBe(){if(Owe)return zK;Owe=1;var e=m2(),t=pVt(),n=iBe(),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,P=!1,I=!0;if(typeof l!="function")throw new TypeError(r);c=n(c)||0,e(u)&&(N=!!u.leading,P="maxWait"in u,x=P?s(n(u.maxWait)||0,c):x,I="trailing"in u?!!u.trailing:I);function R(re){var he=d,Q=f;return d=f=void 0,C=re,g=l.apply(Q,he),g}function O(re){return C=re,v=setTimeout(z,c),N?R(re):g}function U(re){var he=re-w,Q=re-C,ie=c-he;return P?a(ie,x-Q):ie}function L(re){var he=re-w,Q=re-C;return w===void 0||he>=c||he<0||P&&Q>=x}function z(){var re=t();if(L(re))return X(re);v=setTimeout(z,U(re))}function X(re){return v=void 0,I&&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 K(){var re=t(),he=L(re);if(d=arguments,f=this,w=re,he){if(v===void 0)return O(w);if(P)return clearTimeout(v),v=setTimeout(z,c),R(w)}return v===void 0&&(v=setTimeout(z,c)),g}return K.cancel=ne,K.flush=J,K}return zK=o,zK}var HK,Mwe;function gVt(){if(Mwe)return HK;Mwe=1;var e=aBe(),t=m2(),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 HK=r,HK}var bVt=gVt();const oBe=Ii(bVt);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 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 jP(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){yVt(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 yVt(e,t,n){return t=vVt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vVt(e){var t=wVt(e,"string");return l_(t)=="symbol"?t:t+""}function wVt(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 CVt(e,t){return jVt(e)||AVt(e,t)||NVt(e,t)||SVt()}function SVt(){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 NVt(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 AVt(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 jVt(e){if(Array.isArray(e))return e}var lBe=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,P=e.onResize,I=e.style,R=I===void 0?{}:I,O=m.useRef(null),U=m.useRef();U.current=P,m.useImperativeHandle(t,function(){return Object.defineProperty(O.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),O.current},configurable:!0})});var L=m.useState({containerWidth:s.width,containerHeight:s.height}),z=CVt(L,2),X=z[0],ne=z[1],J=m.useCallback(function(re,he){ne(function(Q){var ie=Math.round(re),oe=Math.round(he);return Q.containerWidth===ie&&Q.containerHeight===oe?Q:{containerWidth:ie,containerHeight:oe}})},[]);m.useEffect(function(){var re=function(V){var te,ae=V[0].contentRect,fe=ae.width,Ne=ae.height;J(fe,Ne),(te=U.current)===null||te===void 0||te.call(U,fe,Ne)};w>0&&(re=oBe(re,w,{trailing:!0,leading:!1}));var he=new ResizeObserver(re),Q=O.current.getBoundingClientRect(),ie=Q.width,oe=Q.height;return J(ie,oe),he.observe(O.current),function(){he.disconnect()}},[J,w]);var K=m.useMemo(function(){var re=X.containerWidth,he=X.containerHeight;if(re<0||he<0)return null;Xg(rw(o)||rw(c),`The width(%s) and height(%s) are both fixed numbers,
       maybe you don't need to use a ResponsiveContainer.`,o,c),Xg(!n||n>0,"The aspect(%s) must be greater than zero.",n);var Q=rw(o)?re:o,ie=rw(c)?he:c;n&&n>0&&(Q?ie=Q/n:ie&&(Q=ie*n),x&&ie>x&&(ie=x)),Xg(Q>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.`,Q,ie,o,c,d,f,n);var oe=!Array.isArray(g)&&Yg(g.type).endsWith("Chart");return Ae.Children.map(g,function(G){return Ae.isValidElement(G)?m.cloneElement(G,jP({width:Q,height:ie},oe?{style:jP({height:"100%",width:"100%",maxHeight:ie,maxWidth:Q},G.props.style)}:{})):G})},[n,g,c,x,f,d,X,o]);return Ae.createElement("div",{id:C?"".concat(C):void 0,className:ia("recharts-responsive-container",N),style:jP(jP({},R),{},{width:o,height:c,minWidth:d,minHeight:f,maxHeight:x}),ref:O},K)}),Gle=function(t){return null};Gle.displayName="Cell";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 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 wte(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){EVt(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 EVt(e,t,n){return t=_Vt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _Vt(e){var t=kVt(e,"string");return c_(t)=="symbol"?t:t+""}function kVt(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)}var eC={widthCache:{},cacheCount:0},TVt=2e3,IVt={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},Bwe="recharts_measurement_span";function PVt(e){var t=wte({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var s9=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||mm.isSsr)return{width:0,height:0};var r=PVt(n),s=JSON.stringify({text:t,copyStyle:r});if(eC.widthCache[s])return eC.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=wte(wte({},IVt),r);Object.assign(a.style,o),a.textContent="".concat(t);var l=a.getBoundingClientRect(),c={width:l.width,height:l.height};return eC.widthCache[s]=c,++eC.cacheCount>TVt&&(eC.cacheCount=0,eC.widthCache={}),c}catch{return{width:0,height:0}}},FVt=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function u_(e){"@babel/helpers - typeof";return u_=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},u_(e)}function tL(e,t){return LVt(e)||RVt(e,t)||MVt(e,t)||OVt()}function OVt(){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 MVt(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 RVt(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 LVt(e){if(Array.isArray(e))return e}function DVt(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,$Vt(r.key),r)}}function BVt(e,t,n){return Uwe(e.prototype,t),Uwe(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function $Vt(e){var t=UVt(e,"string");return u_(t)=="symbol"?t:t+""}function UVt(e,t){if(u_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(u_(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%]*)/,zVt=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,HVt=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,cBe={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},VVt=Object.keys(cBe),BC="NaN";function WVt(e,t){return e*cBe[t]}var EP=function(){function e(t,n){DVt(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!zVt.test(n)&&(this.num=NaN,this.unit=""),VVt.includes(n)&&(this.num=WVt(t,n),this.unit="px")}return BVt(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=HVt.exec(n))!==null&&r!==void 0?r:[],a=tL(s,3),o=a[1],l=a[2];return new e(parseFloat(o),l??"")}}])}();function uBe(e){if(e.includes(BC))return BC;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=zwe.exec(t))!==null&&n!==void 0?n:[],s=tL(r,4),a=s[1],o=s[2],l=s[3],c=EP.parse(a??""),u=EP.parse(l??""),d=o==="*"?c.multiply(u):c.divide(u);if(d.isNaN())return BC;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=tL(x,4),v=g[1],w=g[2],C=g[3],N=EP.parse(v??""),P=EP.parse(C??""),I=w==="+"?N.add(P):N.subtract(P);if(I.isNaN())return BC;t=t.replace(Hwe,I.toString())}return t}var Vwe=/\(([^()]*)\)/;function qVt(e){for(var t=e;t.includes("(");){var n=Vwe.exec(t),r=tL(n,2),s=r[1];t=t.replace(Vwe,uBe(s))}return t}function GVt(e){var t=e.replace(/\s+/g,"");return t=qVt(t),t=uBe(t),t}function KVt(e){try{return GVt(e)}catch{return BC}}function VK(e){var t=KVt(e.slice(5,-1));return t===BC?"":t}var YVt=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],XVt=["dx","dy","angle","className","breakAll"];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 Wwe(e,t){if(e==null)return{};var n=QVt(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 QVt(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 tWt(e)||eWt(e,t)||JVt(e,t)||ZVt()}function ZVt(){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 JVt(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 eWt(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 tWt(e){if(Array.isArray(e))return e}var dBe=/[ \f\n\r\t\v\u2028\u2029]+/,fBe=function(t){var n=t.children,r=t.breakAll,s=t.style;try{var a=[];Ci(n)||(r?a=n.toString().split(""):a=n.toString().split(dBe));var o=a.map(function(c){return{word:c,width:s9(c,s).width}}),l=r?0:s9(" ",s).width;return{wordsWithComputedWidth:o,spaceWidth:l}}catch{return null}},nWt=function(t,n,r,s,a){var o=t.maxLines,l=t.children,c=t.style,u=t.breakAll,d=ns(o),f=l,x=function(){var Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Q.reduce(function(ie,oe){var G=oe.word,V=oe.width,te=ie[ie.length-1];if(te&&(s==null||a||te.width+V+r<Number(s)))te.words.push(G),te.width+=V+r;else{var ae={words:[G],width:V};ie.push(ae)}return ie},[])},g=x(n),v=function(Q){return Q.reduce(function(ie,oe){return ie.width>oe.width?ie:oe})};if(!d)return g;for(var w="…",C=function(Q){var ie=f.slice(0,Q),oe=fBe({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,P=f.length-1,I=0,R;N<=P&&I<=f.length-1;){var O=Math.floor((N+P)/2),U=O-1,L=C(U),z=qwe(L,2),X=z[0],ne=z[1],J=C(O),K=qwe(J,1),re=K[0];if(!X&&!re&&(N=O+1),X&&re&&(P=O-1),!X&&re){R=ne;break}I++}return R||g},Kwe=function(t){var n=Ci(t)?[]:t.toString().split(dBe);return[{words:n}]},rWt=function(t){var n=t.width,r=t.scaleToFit,s=t.children,a=t.style,o=t.breakAll,l=t.maxLines;if((n||r)&&!mm.isSsr){var c,u,d=fBe({breakAll:o,children:s,style:a});if(d){var f=d.wordsWithComputedWidth,x=d.spaceWidth;c=f,u=x}else return Kwe(s);return nWt({breakAll:o,children:s,maxLines:l,style:a},c,u,n,r)}return Kwe(s)},Ywe="#808080",nL=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,P=Wwe(t,YVt),I=m.useMemo(function(){return rWt({breakAll:P.breakAll,children:P.children,maxLines:P.maxLines,scaleToFit:f,style:P.style,width:P.width})},[P.breakAll,P.children,P.maxLines,f,P.style,P.width]),R=P.dx,O=P.dy,U=P.angle,L=P.className,z=P.breakAll,X=Wwe(P,XVt);if(!rc(r)||!rc(a))return null;var ne=r+(ns(R)?R:0),J=a+(ns(O)?O:0),K;switch(w){case"start":K=VK("calc(".concat(u,")"));break;case"middle":K=VK("calc(".concat((I.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:K=VK("calc(".concat(I.length-1," * -").concat(l,")"));break}var re=[];if(f){var he=I[0].width,Q=P.width;re.push("scale(".concat((ns(Q)?Q/he:1)/he,")"))}return U&&re.push("rotate(".concat(U,", ").concat(ne,", ").concat(J,")")),re.length&&(X.transform=re.join(" ")),Ae.createElement("text",Cte({},wi(X,!0),{x:ne,y:J,className:ia("recharts-text",L),textAnchor:g,fill:N.includes("url")?Ywe:N}),I.map(function(ie,oe){var G=ie.words.join(z?"":" ");return Ae.createElement("tspan",{x:ne,dy:oe===0?K:l,key:"".concat(G,"-").concat(oe)},G)}))};function ky(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function sWt(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=ky,n=(l,c)=>ky(e(l),c),r=(l,c)=>e(l)-c):(t=e===ky||e===sWt?e:iWt,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 iWt(){return 0}function hBe(e){return e===null?NaN:+e}function*aWt(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const oWt=Kle(ky),uT=oWt.right;Kle(hBe).center;class Xwe extends Map{constructor(t,n=uWt){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(lWt(this,t),n)}delete(t){return super.delete(cWt(this,t))}}function Qwe({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function lWt({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function cWt({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function uWt(e){return e!==null&&typeof e=="object"?e.valueOf():e}function dWt(e=ky){if(e===ky)return pBe;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 pBe(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const fWt=Math.sqrt(50),hWt=Math.sqrt(10),pWt=Math.sqrt(2);function rL(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>=fWt?10:a>=hWt?5:a>=pWt?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?rL(e,t,n*2):[l,c,u]}function Ste(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?rL(t,e,n):rL(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 Nte(e,t,n){return t=+t,e=+e,n=+n,rL(e,t,n)[2]}function Ate(e,t,n){t=+t,e=+e,n=+n;const r=t<e,s=r?Nte(t,e,n):Nte(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 mBe(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?pBe:dWt(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));mBe(e,t,g,v,s)}const a=e[t];let o=n,l=r;for(M7(e,n,t),s(e[r],a)>0&&M7(e,n,r);o<l;){for(M7(e,o,l),++o,--l;s(e[o],a)<0;)++o;for(;s(e[l],a)>0;)--l}s(e[n],a)===0?M7(e,n,l):(++l,M7(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function M7(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function mWt(e,t,n){if(e=Float64Array.from(aWt(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(mBe(e,a).subarray(0,a+1)),l=Jwe(e.subarray(a+1));return o+(l-o)*(s-a)}}function xWt(e,t,n=hBe){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 gWt(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 mp(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function I1(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 jte=Symbol("implicit");function Yle(){var e=new Xwe,t=[],n=[],r=jte;function s(a){let o=e.get(a);if(o===void 0){if(r!==jte)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)},mp.apply(s,arguments),s}function d_(){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=gWt(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 d_(t(),[r,s]).round(l).paddingInner(c).paddingOuter(u).align(d)},mp.apply(f(),arguments)}function xBe(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return xBe(t())},e}function i9(){return xBe(d_.apply(null,arguments).paddingInner(1))}function Xle(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function gBe(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function dT(){}var f_=.7,sL=1/f_,p4="\\s*([+-]?\\d+)\\s*",h_="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",z0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",bWt=/^#([0-9a-f]{3,8})$/,yWt=new RegExp(`^rgb\\(${p4},${p4},${p4}\\)$`),vWt=new RegExp(`^rgb\\(${z0},${z0},${z0}\\)$`),wWt=new RegExp(`^rgba\\(${p4},${p4},${p4},${h_}\\)$`),CWt=new RegExp(`^rgba\\(${z0},${z0},${z0},${h_}\\)$`),SWt=new RegExp(`^hsl\\(${h_},${z0},${z0}\\)$`),NWt=new RegExp(`^hsla\\(${h_},${z0},${z0},${h_}\\)$`),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(dT,p_,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:t3e,formatHex:t3e,formatHex8:AWt,formatHsl:jWt,formatRgb:n3e,toString:n3e});function t3e(){return this.rgb().formatHex()}function AWt(){return this.rgb().formatHex8()}function jWt(){return bBe(this).formatHsl()}function n3e(){return this.rgb().formatRgb()}function p_(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=bWt.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?r3e(t):n===3?new ef(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?_P(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?_P(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=yWt.exec(e))?new ef(t[1],t[2],t[3],1):(t=vWt.exec(e))?new ef(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=wWt.exec(e))?_P(t[1],t[2],t[3],t[4]):(t=CWt.exec(e))?_P(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=SWt.exec(e))?a3e(t[1],t[2]/100,t[3]/100,1):(t=NWt.exec(e))?a3e(t[1],t[2]/100,t[3]/100,t[4]):e3e.hasOwnProperty(e)?r3e(e3e[e]):e==="transparent"?new ef(NaN,NaN,NaN,0):null}function r3e(e){return new ef(e>>16&255,e>>8&255,e&255,1)}function _P(e,t,n,r){return r<=0&&(e=t=n=NaN),new ef(e,t,n,r)}function EWt(e){return e instanceof dT||(e=p_(e)),e?(e=e.rgb(),new ef(e.r,e.g,e.b,e.opacity)):new ef}function Ete(e,t,n,r){return arguments.length===1?EWt(e):new ef(e,t,n,r??1)}function ef(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Xle(ef,Ete,gBe(dT,{brighter(e){return e=e==null?sL:Math.pow(sL,e),new ef(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?f_:Math.pow(f_,e),new ef(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ef(a3(this.r),a3(this.g),a3(this.b),iL(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:_Wt,formatRgb:i3e,toString:i3e}));function s3e(){return`#${sw(this.r)}${sw(this.g)}${sw(this.b)}`}function _Wt(){return`#${sw(this.r)}${sw(this.g)}${sw(this.b)}${sw((isNaN(this.opacity)?1:this.opacity)*255)}`}function i3e(){const e=iL(this.opacity);return`${e===1?"rgb(":"rgba("}${a3(this.r)}, ${a3(this.g)}, ${a3(this.b)}${e===1?")":`, ${e})`}`}function iL(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function a3(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function sw(e){return e=a3(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 im(e,t,n,r)}function bBe(e){if(e instanceof im)return new im(e.h,e.s,e.l,e.opacity);if(e instanceof dT||(e=p_(e)),!e)return new im;if(e instanceof im)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 im(o,l,c,e.opacity)}function kWt(e,t,n,r){return arguments.length===1?bBe(e):new im(e,t,n,r??1)}function im(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Xle(im,kWt,gBe(dT,{brighter(e){return e=e==null?sL:Math.pow(sL,e),new im(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?f_:Math.pow(f_,e),new im(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 ef(WK(e>=240?e-240:e+120,s,r),WK(e,s,r),WK(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new im(o3e(this.h),kP(this.s),kP(this.l),iL(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=iL(this.opacity);return`${e===1?"hsl(":"hsla("}${o3e(this.h)}, ${kP(this.s)*100}%, ${kP(this.l)*100}%${e===1?")":`, ${e})`}`}}));function o3e(e){return e=(e||0)%360,e<0?e+360:e}function kP(e){return Math.max(0,Math.min(1,e||0))}function WK(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 TWt(e,t){return function(n){return e+n*t}}function IWt(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 PWt(e){return(e=+e)==1?yBe:function(t,n){return n-t?IWt(t,n,e):Qle(isNaN(t)?n:t)}}function yBe(e,t){var n=t-e;return n?TWt(e,n):Qle(isNaN(e)?t:e)}const l3e=function e(t){var n=PWt(t);function r(s,a){var o=n((s=Ete(s)).r,(a=Ete(a)).r),l=n(s.g,a.g),c=n(s.b,a.b),u=yBe(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 FWt(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 OWt(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function MWt(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]=QA(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 RWt(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function aL(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function LWt(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]=QA(e[s],t[s]):r[s]=t[s];return function(a){for(s in n)r[s]=n[s](a);return r}}var _te=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,qK=new RegExp(_te.source,"g");function DWt(e){return function(){return e}}function BWt(e){return function(t){return e(t)+""}}function $Wt(e,t){var n=_te.lastIndex=qK.lastIndex=0,r,s,a,o=-1,l=[],c=[];for(e=e+"",t=t+"";(r=_te.exec(e))&&(s=qK.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:aL(r,s)})),n=qK.lastIndex;return n<t.length&&(a=t.slice(n),l[o]?l[o]+=a:l[++o]=a),l.length<2?c[0]?BWt(c[0].x):DWt(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 QA(e,t){var n=typeof t,r;return t==null||n==="boolean"?Qle(t):(n==="number"?aL:n==="string"?(r=p_(t))?(t=r,l3e):$Wt:t instanceof p_?l3e:t instanceof Date?RWt:OWt(t)?FWt:Array.isArray(t)?MWt:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?LWt:aL)(e,t)}function Zle(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function UWt(e,t){t===void 0&&(t=e,e=QA);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 zWt(e){return function(){return e}}function oL(e){return+e}var c3e=[0,1];function ud(e){return e}function kte(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:zWt(isNaN(t)?NaN:.5)}function HWt(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function VWt(e,t,n){var r=e[0],s=e[1],a=t[0],o=t[1];return s<r?(r=kte(s,r),a=n(o,a)):(r=kte(r,s),a=n(a,o)),function(l){return a(r(l))}}function WWt(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]=kte(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(l){var c=uT(e,l,1,r)-1;return a[c](s[c](l))}}function fT(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function V$(){var e=c3e,t=c3e,n=QA,r,s,a,o=ud,l,c,u;function d(){var x=Math.min(e.length,t.length);return o!==ud&&(o=HWt(e[0],e[x-1])),l=x>2?WWt:VWt,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),aL)))(x)))},f.domain=function(x){return arguments.length?(e=Array.from(x,oL),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:ud,d()):o!==ud},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 V$()(ud,ud)}function qWt(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function lL(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 jN(e){return e=lL(Math.abs(e)),e?e[1]:NaN}function GWt(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 KWt(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var YWt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function m_(e){if(!(t=YWt.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]})}m_.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 XWt(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 vBe;function QWt(e,t){var n=lL(e,t);if(!n)return e+"";var r=n[0],s=n[1],a=s-(vBe=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")+lL(e,Math.max(0,t+a-1))[0]}function u3e(e,t){var n=lL(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:qWt,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:QWt,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 ZWt(e){var t=e.grouping===void 0||e.thousands===void 0?f3e:GWt(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:KWt(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=m_(f);var x=f.fill,g=f.align,v=f.sign,w=f.symbol,C=f.zero,N=f.width,P=f.comma,I=f.precision,R=f.trim,O=f.type;O==="n"?(P=!0,O="g"):d3e[O]||(I===void 0&&(I=12),R=!0,O="g"),(C||x==="0"&&g==="=")&&(C=!0,x="0",g="=");var U=w==="$"?n:w==="#"&&/[boxX]/.test(O)?"0"+O.toLowerCase():"",L=w==="$"?r:/[%p]/.test(O)?o:"",z=d3e[O],X=/[defgprs%]/.test(O);I=I===void 0?6:/[gprs]/.test(O)?Math.max(1,Math.min(21,I)):Math.max(0,Math.min(20,I));function ne(J){var K=U,re=L,he,Q,ie;if(O==="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),I),R&&(J=XWt(J)),oe&&+J==0&&v!=="+"&&(oe=!1),K=(oe?v==="("?v:l:v==="-"||v==="("?"":v)+K,re=(O==="s"?p3e[8+vBe/3]:"")+re+(oe&&v==="("?")":""),X){for(he=-1,Q=J.length;++he<Q;)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}}}P&&!C&&(J=t(J,1/0));var G=K.length+J.length+re.length,V=G<N?new Array(N-G+1).join(x):"";switch(P&&C&&(J=t(V+J,V.length?N-re.length:1/0),V=""),g){case"<":J=K+J+re+V;break;case"=":J=K+V+J+re;break;case"^":J=V.slice(0,G=V.length>>1)+K+J+re+V.slice(G);break;default:J=V+K+J+re;break}return a(J)}return ne.toString=function(){return f+""},ne}function d(f,x){var g=u((f=m_(f),f.type="f",f)),v=Math.max(-8,Math.min(8,Math.floor(jN(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 TP,tce,wBe;JWt({thousands:",",grouping:[3],currency:["$",""]});function JWt(e){return TP=ZWt(e),tce=TP.format,wBe=TP.formatPrefix,TP}function eqt(e){return Math.max(0,-jN(Math.abs(e)))}function tqt(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(jN(t)/3)))*3-jN(Math.abs(e)))}function nqt(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,jN(t)-jN(e))+1}function CBe(e,t,n,r){var s=Ate(e,t,n),a;switch(r=m_(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=tqt(s,o))&&(r.precision=a),wBe(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=nqt(s,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=eqt(s))&&(r.precision=a-(r.type==="%")*2);break}}return tce(r)}function g2(e){var t=e.domain;return e.ticks=function(n){var r=t();return Ste(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var s=t();return CBe(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=Nte(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 cL(){var e=Jle();return e.copy=function(){return fT(e,cL())},mp.apply(e,arguments),g2(e)}function SBe(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,oL),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return SBe(e).unknown(t)},e=arguments.length?Array.from(e,oL):[0,1],g2(n)}function NBe(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 rqt(e){return-Math.log(-e)}function sqt(e){return-Math.exp(-e)}function iqt(e){return isFinite(e)?+("1e"+e):e<0?0:e}function aqt(e){return e===10?iqt:e===Math.E?Math.exp:t=>Math.pow(e,t)}function oqt(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=oqt(r),a=aqt(r),n()[0]<0?(s=g3e(s),a=g3e(a),e(rqt,sqt)):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=Ste(u,d,C))}else N=Ste(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=m_(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(NBe(n(),{floor:l=>a(Math.floor(s(l))),ceil:l=>a(Math.ceil(s(l)))})),t}function ABe(){const e=nce(V$()).domain([1,10]);return e.copy=()=>fT(e,ABe()).base(e.base()),mp.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},g2(n)}function jBe(){var e=rce(V$());return e.copy=function(){return fT(e,jBe()).constant(e.constant())},mp.apply(e,arguments)}function v3e(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function lqt(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function cqt(e){return e<0?-e*e:e*e}function sce(e){var t=e(ud,ud),n=1;function r(){return n===1?e(ud,ud):n===.5?e(lqt,cqt):e(v3e(n),v3e(1/n))}return t.exponent=function(s){return arguments.length?(n=+s,r()):n},g2(t)}function ice(){var e=sce(V$());return e.copy=function(){return fT(e,ice()).exponent(e.exponent())},mp.apply(e,arguments),e}function uqt(){return ice.apply(null,arguments).exponent(.5)}function w3e(e){return Math.sign(e)*e*e}function dqt(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function EBe(){var e=Jle(),t=[0,1],n=!1,r;function s(a){var o=dqt(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,oL)).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 EBe(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},mp.apply(s,arguments),g2(s)}function _Be(){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]=xWt(e,o/l);return a}function a(o){return o==null||isNaN(o=+o)?r:t[uT(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(ky),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 _Be().domain(e).range(t).unknown(r)},mp.apply(a,arguments)}function kBe(){var e=0,t=1,n=1,r=[.5],s=[0,1],a;function o(c){return c!=null&&c<=c?s[uT(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 kBe().domain([e,t]).range(s).unknown(a)},mp.apply(g2(o),arguments)}function TBe(){var e=[.5],t=[0,1],n,r=1;function s(a){return a!=null&&a<=a?t[uT(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 TBe().domain(e).range(t).unknown(n)},mp.apply(s,arguments)}const GK=new Date,KK=new Date;function uc(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=>uc(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)=>(GK.setTime(+a),KK.setTime(+o),e(GK),e(KK),Math.floor(n(GK,KK))),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 uL=uc(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);uL.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?uc(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):uL);uL.range;const Lg=1e3,Zh=Lg*60,Dg=Zh*60,m1=Dg*24,ace=m1*7,C3e=m1*30,YK=m1*365,iw=uc(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Lg)},(e,t)=>(t-e)/Lg,e=>e.getUTCSeconds());iw.range;const oce=uc(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Lg)},(e,t)=>{e.setTime(+e+t*Zh)},(e,t)=>(t-e)/Zh,e=>e.getMinutes());oce.range;const lce=uc(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Zh)},(e,t)=>(t-e)/Zh,e=>e.getUTCMinutes());lce.range;const cce=uc(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Lg-e.getMinutes()*Zh)},(e,t)=>{e.setTime(+e+t*Dg)},(e,t)=>(t-e)/Dg,e=>e.getHours());cce.range;const uce=uc(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Dg)},(e,t)=>(t-e)/Dg,e=>e.getUTCHours());uce.range;const hT=uc(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Zh)/m1,e=>e.getDate()-1);hT.range;const W$=uc(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/m1,e=>e.getUTCDate()-1);W$.range;const IBe=uc(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/m1,e=>Math.floor(e/m1));IBe.range;function N5(e){return uc(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())*Zh)/ace)}const q$=N5(0),dL=N5(1),fqt=N5(2),hqt=N5(3),EN=N5(4),pqt=N5(5),mqt=N5(6);q$.range;dL.range;fqt.range;hqt.range;EN.range;pqt.range;mqt.range;function A5(e){return uc(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 G$=A5(0),fL=A5(1),xqt=A5(2),gqt=A5(3),_N=A5(4),bqt=A5(5),yqt=A5(6);G$.range;fL.range;xqt.range;gqt.range;_N.range;bqt.range;yqt.range;const dce=uc(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=uc(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 x1=uc(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());x1.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:uc(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)});x1.range;const g1=uc(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());g1.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:uc(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)});g1.range;function PBe(e,t,n,r,s,a){const o=[[iw,1,Lg],[iw,5,5*Lg],[iw,15,15*Lg],[iw,30,30*Lg],[a,1,Zh],[a,5,5*Zh],[a,15,15*Zh],[a,30,30*Zh],[s,1,Dg],[s,3,3*Dg],[s,6,6*Dg],[s,12,12*Dg],[r,1,m1],[r,2,2*m1],[n,1,ace],[t,1,C3e],[t,3,3*C3e],[e,1,YK]];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(Ate(u/YK,d/YK,f));if(g===0)return uL.every(Math.max(Ate(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[vqt,wqt]=PBe(g1,fce,G$,IBe,uce,lce),[Cqt,Sqt]=PBe(x1,dce,q$,hT,cce,oce);function XK(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 QK(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 R7(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Nqt(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=L7(s),d=D7(s),f=L7(a),x=D7(a),g=L7(o),v=D7(o),w=L7(l),C=D7(l),N=L7(c),P=D7(c),I={a:oe,A:G,b:V,B:te,c:null,d:_3e,e:_3e,f:Gqt,g:rGt,G:iGt,H:Vqt,I:Wqt,j:qqt,L:FBe,m:Kqt,M:Yqt,p:ae,q:fe,Q:I3e,s:P3e,S:Xqt,u:Qqt,U:Zqt,V:Jqt,w:eGt,W:tGt,x:null,X:null,y:nGt,Y:sGt,Z:aGt,"%":T3e},R={a:Ne,A:me,b:we,B:xe,c:null,d:k3e,e:k3e,f:uGt,g:vGt,G:CGt,H:oGt,I:lGt,j:cGt,L:MBe,m:dGt,M:fGt,p:ye,q:je,Q:I3e,s:P3e,S:hGt,u:pGt,U:mGt,V:xGt,w:gGt,W:bGt,x:null,X:null,y:yGt,Y:wGt,Z:SGt,"%":T3e},O={a:ne,A:J,b:K,B:re,c:he,d:j3e,e:j3e,f:$qt,g:A3e,G:N3e,H:E3e,I:E3e,j:Rqt,L:Bqt,m:Mqt,M:Lqt,p:X,q:Oqt,Q:zqt,s:Hqt,S:Dqt,u:kqt,U:Tqt,V:Iqt,w:_qt,W:Pqt,x:Q,X:ie,y:A3e,Y:N3e,Z:Fqt,"%":Uqt};I.x=U(n,I),I.X=U(r,I),I.c=U(t,I),R.x=U(n,R),R.X=U(r,R),R.c=U(t,R);function U(Pe,Re){return function(Xe){var Ke=[],ut=-1,et=0,tt=Pe.length,Le,$e,ht;for(Xe instanceof Date||(Xe=new Date(+Xe));++ut<tt;)Pe.charCodeAt(ut)===37&&(Ke.push(Pe.slice(et,ut)),($e=S3e[Le=Pe.charAt(++ut)])!=null?Le=Pe.charAt(++ut):$e=Le==="e"?" ":"0",(ht=Re[Le])&&(Le=ht(Xe,$e)),Ke.push(Le),et=ut+1);return Ke.push(Pe.slice(et,ut)),Ke.join("")}}function L(Pe,Re){return function(Xe){var Ke=R7(1900,void 0,1),ut=z(Ke,Pe,Xe+="",0),et,tt;if(ut!=Xe.length)return null;if("Q"in Ke)return new Date(Ke.Q);if("s"in Ke)return new Date(Ke.s*1e3+("L"in Ke?Ke.L:0));if(Re&&!("Z"in Ke)&&(Ke.Z=0),"p"in Ke&&(Ke.H=Ke.H%12+Ke.p*12),Ke.m===void 0&&(Ke.m="q"in Ke?Ke.q:0),"V"in Ke){if(Ke.V<1||Ke.V>53)return null;"w"in Ke||(Ke.w=1),"Z"in Ke?(et=QK(R7(Ke.y,0,1)),tt=et.getUTCDay(),et=tt>4||tt===0?fL.ceil(et):fL(et),et=W$.offset(et,(Ke.V-1)*7),Ke.y=et.getUTCFullYear(),Ke.m=et.getUTCMonth(),Ke.d=et.getUTCDate()+(Ke.w+6)%7):(et=XK(R7(Ke.y,0,1)),tt=et.getDay(),et=tt>4||tt===0?dL.ceil(et):dL(et),et=hT.offset(et,(Ke.V-1)*7),Ke.y=et.getFullYear(),Ke.m=et.getMonth(),Ke.d=et.getDate()+(Ke.w+6)%7)}else("W"in Ke||"U"in Ke)&&("w"in Ke||(Ke.w="u"in Ke?Ke.u%7:"W"in Ke?1:0),tt="Z"in Ke?QK(R7(Ke.y,0,1)).getUTCDay():XK(R7(Ke.y,0,1)).getDay(),Ke.m=0,Ke.d="W"in Ke?(Ke.w+6)%7+Ke.W*7-(tt+5)%7:Ke.w+Ke.U*7-(tt+6)%7);return"Z"in Ke?(Ke.H+=Ke.Z/100|0,Ke.M+=Ke.Z%100,QK(Ke)):XK(Ke)}}function z(Pe,Re,Xe,Ke){for(var ut=0,et=Re.length,tt=Xe.length,Le,$e;ut<et;){if(Ke>=tt)return-1;if(Le=Re.charCodeAt(ut++),Le===37){if(Le=Re.charAt(ut++),$e=O[Le in S3e?Re.charAt(ut++):Le],!$e||(Ke=$e(Pe,Xe,Ke))<0)return-1}else if(Le!=Xe.charCodeAt(Ke++))return-1}return Ke}function X(Pe,Re,Xe){var Ke=u.exec(Re.slice(Xe));return Ke?(Pe.p=d.get(Ke[0].toLowerCase()),Xe+Ke[0].length):-1}function ne(Pe,Re,Xe){var Ke=g.exec(Re.slice(Xe));return Ke?(Pe.w=v.get(Ke[0].toLowerCase()),Xe+Ke[0].length):-1}function J(Pe,Re,Xe){var Ke=f.exec(Re.slice(Xe));return Ke?(Pe.w=x.get(Ke[0].toLowerCase()),Xe+Ke[0].length):-1}function K(Pe,Re,Xe){var Ke=N.exec(Re.slice(Xe));return Ke?(Pe.m=P.get(Ke[0].toLowerCase()),Xe+Ke[0].length):-1}function re(Pe,Re,Xe){var Ke=w.exec(Re.slice(Xe));return Ke?(Pe.m=C.get(Ke[0].toLowerCase()),Xe+Ke[0].length):-1}function he(Pe,Re,Xe){return z(Pe,t,Re,Xe)}function Q(Pe,Re,Xe){return z(Pe,n,Re,Xe)}function ie(Pe,Re,Xe){return z(Pe,r,Re,Xe)}function oe(Pe){return o[Pe.getDay()]}function G(Pe){return a[Pe.getDay()]}function V(Pe){return c[Pe.getMonth()]}function te(Pe){return l[Pe.getMonth()]}function ae(Pe){return s[+(Pe.getHours()>=12)]}function fe(Pe){return 1+~~(Pe.getMonth()/3)}function Ne(Pe){return o[Pe.getUTCDay()]}function me(Pe){return a[Pe.getUTCDay()]}function we(Pe){return c[Pe.getUTCMonth()]}function xe(Pe){return l[Pe.getUTCMonth()]}function ye(Pe){return s[+(Pe.getUTCHours()>=12)]}function je(Pe){return 1+~~(Pe.getUTCMonth()/3)}return{format:function(Pe){var Re=U(Pe+="",I);return Re.toString=function(){return Pe},Re},parse:function(Pe){var Re=L(Pe+="",!1);return Re.toString=function(){return Pe},Re},utcFormat:function(Pe){var Re=U(Pe+="",R);return Re.toString=function(){return Pe},Re},utcParse:function(Pe){var Re=L(Pe+="",!0);return Re.toString=function(){return Pe},Re}}}var S3e={"-":"",_:" ",0:"0"},Lc=/^\s*\d+/,Aqt=/^%/,jqt=/[\\^$*+?|[\]().{}]/g;function xa(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 Eqt(e){return e.replace(jqt,"\\$&")}function L7(e){return new RegExp("^(?:"+e.map(Eqt).join("|")+")","i")}function D7(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function _qt(e,t,n){var r=Lc.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function kqt(e,t,n){var r=Lc.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Tqt(e,t,n){var r=Lc.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Iqt(e,t,n){var r=Lc.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Pqt(e,t,n){var r=Lc.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function N3e(e,t,n){var r=Lc.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function A3e(e,t,n){var r=Lc.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Fqt(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 Oqt(e,t,n){var r=Lc.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Mqt(e,t,n){var r=Lc.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=Lc.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Rqt(e,t,n){var r=Lc.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=Lc.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Lqt(e,t,n){var r=Lc.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Dqt(e,t,n){var r=Lc.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Bqt(e,t,n){var r=Lc.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function $qt(e,t,n){var r=Lc.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Uqt(e,t,n){var r=Aqt.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function zqt(e,t,n){var r=Lc.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Hqt(e,t,n){var r=Lc.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function _3e(e,t){return xa(e.getDate(),t,2)}function Vqt(e,t){return xa(e.getHours(),t,2)}function Wqt(e,t){return xa(e.getHours()%12||12,t,2)}function qqt(e,t){return xa(1+hT.count(x1(e),e),t,3)}function FBe(e,t){return xa(e.getMilliseconds(),t,3)}function Gqt(e,t){return FBe(e,t)+"000"}function Kqt(e,t){return xa(e.getMonth()+1,t,2)}function Yqt(e,t){return xa(e.getMinutes(),t,2)}function Xqt(e,t){return xa(e.getSeconds(),t,2)}function Qqt(e){var t=e.getDay();return t===0?7:t}function Zqt(e,t){return xa(q$.count(x1(e)-1,e),t,2)}function OBe(e){var t=e.getDay();return t>=4||t===0?EN(e):EN.ceil(e)}function Jqt(e,t){return e=OBe(e),xa(EN.count(x1(e),e)+(x1(e).getDay()===4),t,2)}function eGt(e){return e.getDay()}function tGt(e,t){return xa(dL.count(x1(e)-1,e),t,2)}function nGt(e,t){return xa(e.getFullYear()%100,t,2)}function rGt(e,t){return e=OBe(e),xa(e.getFullYear()%100,t,2)}function sGt(e,t){return xa(e.getFullYear()%1e4,t,4)}function iGt(e,t){var n=e.getDay();return e=n>=4||n===0?EN(e):EN.ceil(e),xa(e.getFullYear()%1e4,t,4)}function aGt(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+xa(t/60|0,"0",2)+xa(t%60,"0",2)}function k3e(e,t){return xa(e.getUTCDate(),t,2)}function oGt(e,t){return xa(e.getUTCHours(),t,2)}function lGt(e,t){return xa(e.getUTCHours()%12||12,t,2)}function cGt(e,t){return xa(1+W$.count(g1(e),e),t,3)}function MBe(e,t){return xa(e.getUTCMilliseconds(),t,3)}function uGt(e,t){return MBe(e,t)+"000"}function dGt(e,t){return xa(e.getUTCMonth()+1,t,2)}function fGt(e,t){return xa(e.getUTCMinutes(),t,2)}function hGt(e,t){return xa(e.getUTCSeconds(),t,2)}function pGt(e){var t=e.getUTCDay();return t===0?7:t}function mGt(e,t){return xa(G$.count(g1(e)-1,e),t,2)}function RBe(e){var t=e.getUTCDay();return t>=4||t===0?_N(e):_N.ceil(e)}function xGt(e,t){return e=RBe(e),xa(_N.count(g1(e),e)+(g1(e).getUTCDay()===4),t,2)}function gGt(e){return e.getUTCDay()}function bGt(e,t){return xa(fL.count(g1(e)-1,e),t,2)}function yGt(e,t){return xa(e.getUTCFullYear()%100,t,2)}function vGt(e,t){return e=RBe(e),xa(e.getUTCFullYear()%100,t,2)}function wGt(e,t){return xa(e.getUTCFullYear()%1e4,t,4)}function CGt(e,t){var n=e.getUTCDay();return e=n>=4||n===0?_N(e):_N.ceil(e),xa(e.getUTCFullYear()%1e4,t,4)}function SGt(){return"+0000"}function T3e(){return"%"}function I3e(e){return+e}function P3e(e){return Math.floor(+e/1e3)}var tC,LBe,DBe;NGt({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 NGt(e){return tC=Nqt(e),LBe=tC.format,tC.parse,DBe=tC.utcFormat,tC.utcParse,tC}function AGt(e){return new Date(e)}function jGt(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"),P=u("%b %d"),I=u("%B"),R=u("%Y");function O(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:P:n(U)<U?I:R)(U)}return d.invert=function(U){return new Date(f(U))},d.domain=function(U){return arguments.length?x(Array.from(U,jGt)):x().map(AGt)},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?O: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(NBe(L,U)):d},d.copy=function(){return fT(d,hce(e,t,n,r,s,a,o,l,c,u))},d}function EGt(){return mp.apply(hce(Cqt,Sqt,x1,dce,q$,hT,cce,oce,iw,LBe).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function _Gt(){return mp.apply(hce(vqt,wqt,g1,fce,G$,W$,uce,lce,iw,DBe).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function K$(){var e=0,t=1,n,r,s,a,o=ud,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(QA),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 b2(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function BBe(){var e=g2(K$()(ud));return e.copy=function(){return b2(e,BBe())},I1.apply(e,arguments)}function $Be(){var e=nce(K$()).domain([1,10]);return e.copy=function(){return b2(e,$Be()).base(e.base())},I1.apply(e,arguments)}function UBe(){var e=rce(K$());return e.copy=function(){return b2(e,UBe()).constant(e.constant())},I1.apply(e,arguments)}function pce(){var e=sce(K$());return e.copy=function(){return b2(e,pce()).exponent(e.exponent())},I1.apply(e,arguments)}function kGt(){return pce.apply(null,arguments).exponent(.5)}function zBe(){var e=[],t=ud;function n(r){if(r!=null&&!isNaN(r=+r))return t((uT(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(ky),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)=>mWt(e,a/r))},n.copy=function(){return zBe(t).domain(e)},I1.apply(n,arguments)}function Y$(){var e=0,t=.5,n=1,r=1,s,a,o,l,c,u=ud,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,P,I;return arguments.length?([N,P,I]=C,u=UWt(w,[N,P,I]),g):[u(0),u(.5),u(1)]}}return g.range=v(QA),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 HBe(){var e=g2(Y$()(ud));return e.copy=function(){return b2(e,HBe())},I1.apply(e,arguments)}function VBe(){var e=nce(Y$()).domain([.1,1,10]);return e.copy=function(){return b2(e,VBe()).base(e.base())},I1.apply(e,arguments)}function WBe(){var e=rce(Y$());return e.copy=function(){return b2(e,WBe()).constant(e.constant())},I1.apply(e,arguments)}function mce(){var e=sce(Y$());return e.copy=function(){return b2(e,mce()).exponent(e.exponent())},I1.apply(e,arguments)}function TGt(){return mce.apply(null,arguments).exponent(.5)}const F3e=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:d_,scaleDiverging:HBe,scaleDivergingLog:VBe,scaleDivergingPow:mce,scaleDivergingSqrt:TGt,scaleDivergingSymlog:WBe,scaleIdentity:SBe,scaleImplicit:jte,scaleLinear:cL,scaleLog:ABe,scaleOrdinal:Yle,scalePoint:i9,scalePow:ice,scaleQuantile:_Be,scaleQuantize:kBe,scaleRadial:EBe,scaleSequential:BBe,scaleSequentialLog:$Be,scaleSequentialPow:pce,scaleSequentialQuantile:zBe,scaleSequentialSqrt:kGt,scaleSequentialSymlog:UBe,scaleSqrt:uqt,scaleSymlog:jBe,scaleThreshold:TBe,scaleTime:EGt,scaleUtc:_Gt,tickFormat:CBe},Symbol.toStringTag,{value:"Module"}));var ZK,O3e;function qBe(){if(O3e)return ZK;O3e=1;var e=GA();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 ZK=t,ZK}var JK,M3e;function IGt(){if(M3e)return JK;M3e=1;function e(t,n){return t>n}return JK=e,JK}var eY,R3e;function PGt(){if(R3e)return eY;R3e=1;var e=qBe(),t=IGt(),n=XA();function r(s){return s&&s.length?e(s,n,t):void 0}return eY=r,eY}var FGt=PGt();const gy=Ii(FGt);var tY,L3e;function OGt(){if(L3e)return tY;L3e=1;function e(t,n){return t<n}return tY=e,tY}var nY,D3e;function MGt(){if(D3e)return nY;D3e=1;var e=qBe(),t=OGt(),n=XA();function r(s){return s&&s.length?e(s,n,t):void 0}return nY=r,nY}var RGt=MGt();const X$=Ii(RGt);var rY,B3e;function LGt(){if(B3e)return rY;B3e=1;var e=Ile(),t=x2(),n=JDe(),r=hf();function s(a,o){var l=r(a)?e:n;return l(a,t(o,3))}return rY=s,rY}var sY,$3e;function DGt(){if($3e)return sY;$3e=1;var e=QDe(),t=LGt();function n(r,s){return e(t(r,s),1)}return sY=n,sY}var BGt=DGt();const $Gt=Ii(BGt);var iY,U3e;function UGt(){if(U3e)return iY;U3e=1;var e=Hle();function t(n,r){return e(n,r)}return iY=t,iY}var zGt=UGt();const K3=Ii(zGt);var ZA=1e9,HGt={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},gce,Oo=!0,hp="[DecimalError] ",o3=hp+"Invalid argument: ",xce=hp+"Exponent out of range: ",JA=Math.floor,Tv=Math.pow,VGt=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,$f,Ac=1e7,vo=7,GBe=9007199254740991,hL=JA(GBe/vo),Ts={};Ts.absoluteValue=Ts.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Ts.comparedTo=Ts.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};Ts.decimalPlaces=Ts.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*vo;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Ts.dividedBy=Ts.div=function(e){return Qg(this,new this.constructor(e))};Ts.dividedToIntegerBy=Ts.idiv=function(e){var t=this,n=t.constructor;return Xa(Qg(t,new n(e),0,1),n.precision)};Ts.equals=Ts.eq=function(e){return!this.cmp(e)};Ts.exponent=function(){return Hl(this)};Ts.greaterThan=Ts.gt=function(e){return this.cmp(e)>0};Ts.greaterThanOrEqualTo=Ts.gte=function(e){return this.cmp(e)>=0};Ts.isInteger=Ts.isint=function(){return this.e>this.d.length-2};Ts.isNegative=Ts.isneg=function(){return this.s<0};Ts.isPositive=Ts.ispos=function(){return this.s>0};Ts.isZero=function(){return this.s===0};Ts.lessThan=Ts.lt=function(e){return this.cmp(e)<0};Ts.lessThanOrEqualTo=Ts.lte=function(e){return this.cmp(e)<1};Ts.logarithm=Ts.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($f))throw Error(hp+"NaN");if(n.s<1)throw Error(hp+(n.s?"NaN":"-Infinity"));return n.eq($f)?new r(0):(Oo=!1,t=Qg(x_(n,a),x_(e,a),a),Oo=!0,Xa(t,s))};Ts.minus=Ts.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?XBe(t,e):KBe(t,(e.s=-e.s,e))};Ts.modulo=Ts.mod=function(e){var t,n=this,r=n.constructor,s=r.precision;if(e=new r(e),!e.s)throw Error(hp+"NaN");return n.s?(Oo=!1,t=Qg(n,e,0,1).times(e),Oo=!0,n.minus(t)):Xa(new r(n),s)};Ts.naturalExponential=Ts.exp=function(){return YBe(this)};Ts.naturalLogarithm=Ts.ln=function(){return x_(this)};Ts.negated=Ts.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Ts.plus=Ts.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?KBe(t,e):XBe(t,(e.s=-e.s,e))};Ts.precision=Ts.sd=function(e){var t,n,r,s=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(o3+e);if(t=Hl(s)+1,r=s.d.length-1,n=r*vo+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};Ts.squareRoot=Ts.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(hp+"NaN")}for(e=Hl(l),Oo=!1,s=Math.sqrt(+l),s==0||s==1/0?(t=T0(l.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=JA((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),T0(a.d).slice(0,o)===(t=T0(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),s==o&&t=="4999"){if(Xa(a,n+1,0),a.times(a).eq(l)){r=a;break}}else if(t!="9999")break;o+=4}return Oo=!0,Xa(r,n)};Ts.times=Ts.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%Ac|0,t=l/Ac|0;a[s]=(a[s]+t)%Ac|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,Oo?Xa(e,f.precision):e};Ts.toDecimalPlaces=Ts.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(ax(e,0,ZA),t===void 0?t=r.rounding:ax(t,0,8),Xa(n,e+Hl(n)+1,t))};Ts.toExponential=function(e,t){var n,r=this,s=r.constructor;return e===void 0?n=Y3(r,!0):(ax(e,0,ZA),t===void 0?t=s.rounding:ax(t,0,8),r=Xa(new s(r),e+1,t),n=Y3(r,!0,e+1)),n};Ts.toFixed=function(e,t){var n,r,s=this,a=s.constructor;return e===void 0?Y3(s):(ax(e,0,ZA),t===void 0?t=a.rounding:ax(t,0,8),r=Xa(new a(s),e+Hl(s)+1,t),n=Y3(r.abs(),!1,e+Hl(r)+1),s.isneg()&&!s.isZero()?"-"+n:n)};Ts.toInteger=Ts.toint=function(){var e=this,t=e.constructor;return Xa(new t(e),Hl(e)+1,t.rounding)};Ts.toNumber=function(){return+this};Ts.toPower=Ts.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($f);if(l=new c(l),!l.s){if(e.s<1)throw Error(hp+"Infinity");return l}if(l.eq($f))return l;if(r=c.precision,e.eq($f))return Xa(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=l.s,o){if((n=d<0?-d:d)<=GBe){for(s=new c($f),t=Math.ceil(r/vo+4),Oo=!1;n%2&&(s=s.times(l),H3e(s.d,t)),n=JA(n/2),n!==0;)l=l.times(l),H3e(l.d,t);return Oo=!0,e.s<0?new c($f).div(s):Xa(s,r)}}else if(a<0)throw Error(hp+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,Oo=!1,s=e.times(x_(l,r+u)),Oo=!0,s=YBe(s),s.s=a,s};Ts.toPrecision=function(e,t){var n,r,s=this,a=s.constructor;return e===void 0?(n=Hl(s),r=Y3(s,n<=a.toExpNeg||n>=a.toExpPos)):(ax(e,1,ZA),t===void 0?t=a.rounding:ax(t,0,8),s=Xa(new a(s),e,t),n=Hl(s),r=Y3(s,e<=n||n<=a.toExpNeg,e)),r};Ts.toSignificantDigits=Ts.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(ax(e,1,ZA),t===void 0?t=r.rounding:ax(t,0,8)),Xa(new r(n),e,t)};Ts.toString=Ts.valueOf=Ts.val=Ts.toJSON=Ts[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Hl(e),n=e.constructor;return Y3(e,t<=n.toExpNeg||t>=n.toExpPos)};function KBe(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)),Oo?Xa(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/vo),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)/Ac|0,c[a]%=Ac;for(n&&(c.unshift(n),++s),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=s,Oo?Xa(t,f):t}function ax(e,t,n){if(e!==~~e||e<t||e>n)throw Error(o3+e)}function T0(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=vo-r.length,n&&(a+=Ib(n)),a+=r;o=e[t],r=o+"",n=vo-r.length,n&&(a+=Ib(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%Ac|0,o=a/Ac|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*Ac+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,P,I,R,O,U,L,z,X=r.constructor,ne=r.s==s.s?1:-1,J=r.d,K=s.d;if(!r.s)return new X(r);if(!s.s)throw Error(hp+"Division by zero");for(c=r.e-s.e,L=K.length,O=J.length,g=new X(ne),v=g.d=[],u=0;K[u]==(J[u]||0);)++u;if(K[u]>(J[u]||0)&&--c,a==null?P=a=X.precision:o?P=a+(Hl(r)-Hl(s))+1:P=a,P<0)return new X(0);if(P=P/vo+2|0,u=0,L==1)for(d=0,K=K[0],P++;(u<O||d)&&P--;u++)I=d*Ac+(J[u]||0),v[u]=I/K|0,d=I%K|0;else{for(d=Ac/(K[0]+1)|0,d>1&&(K=e(K,d),J=e(J,d),L=K.length,O=J.length),R=L,w=J.slice(0,L),C=w.length;C<L;)w[C++]=0;z=K.slice(),z.unshift(0),U=K[0],K[1]>=Ac/2&&++U;do d=0,l=t(K,w,L,C),l<0?(N=w[0],L!=C&&(N=N*Ac+(w[1]||0)),d=N/U|0,d>1?(d>=Ac&&(d=Ac-1),f=e(K,d),x=f.length,C=w.length,l=t(f,w,x,C),l==1&&(d--,n(f,L<x?z:K,x))):(d==0&&(l=d=1),f=K.slice()),x=f.length,x<C&&f.unshift(0),n(w,f,C),l==-1&&(C=w.length,l=t(K,w,L,C),l<1&&(d++,n(w,L<C?z:K,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++<O||w[0]!==void 0)&&P--)}return v[0]||v.shift(),g.e=c,Xa(g,o?a+Hl(g)+1:a)}}();function YBe(e,t){var n,r,s,a,o,l,c=0,u=0,d=e.constructor,f=d.precision;if(Hl(e)>16)throw Error(xce+Hl(e));if(!e.s)return new d($f);for(t==null?(Oo=!1,l=f):l=t,o=new d(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(r=Math.log(Tv(2,u))/Math.LN10*2+5|0,l+=r,n=s=a=new d($f),d.precision=l;;){if(s=Xa(s.times(e),l),n=n.times(++c),o=a.plus(Qg(s,n,l)),T0(o.d).slice(0,l)===T0(a.d).slice(0,l)){for(;u--;)a=Xa(a.times(a),l);return d.precision=f,t==null?(Oo=!0,Xa(a,f)):a}a=o}}function Hl(e){for(var t=e.e*vo,n=e.d[0];n>=10;n/=10)t++;return t}function aY(e,t,n){if(t>e.LN10.sd())throw Oo=!0,n&&(e.precision=n),Error(hp+"LN10 precision limit exceeded");return Xa(new e(e.LN10),t)}function Ib(e){for(var t="";e--;)t+="0";return t}function x_(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(hp+(g.s?"NaN":"-Infinity"));if(g.eq($f))return new w(0);if(t==null?(Oo=!1,u=C):u=t,g.eq(10))return t==null&&(Oo=!0),aY(w,u);if(u+=x,w.precision=u,n=T0(v),r=n.charAt(0),a=Hl(g),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=T0(g.d),r=n.charAt(0),f++;a=Hl(g),r>1?(g=new w("0."+n),a++):g=new w(r+"."+n.slice(1))}else return c=aY(w,u+2,C).times(a+""),g=x_(new w(r+"."+n.slice(1)),u-x).plus(c),w.precision=C,t==null?(Oo=!0,Xa(g,C)):g;for(l=o=g=Qg(g.minus($f),g.plus($f),u),d=Xa(g.times(g),u),s=3;;){if(o=Xa(o.times(d),u),c=l.plus(Qg(o,new w(s),u)),T0(c.d).slice(0,u)===T0(l.d).slice(0,u))return l=l.times(2),a!==0&&(l=l.plus(aY(w,u+2,C).times(a+""))),l=Qg(l,new w(f),u),w.precision=C,t==null?(Oo=!0,Xa(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=JA(n/vo),e.d=[],r=(n+1)%vo,n<0&&(r+=vo),r<s){for(r&&e.d.push(+t.slice(0,r)),s-=vo;r<s;)e.d.push(+t.slice(r,r+=vo));t=t.slice(r),r=vo-t.length}else r-=s;for(;r--;)t+="0";if(e.d.push(+t),Oo&&(e.e>hL||e.e<-hL))throw Error(xce+n)}else e.s=0,e.e=0,e.d=[0];return e}function Xa(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+=vo,s=t,u=f[d=0];else{if(d=Math.ceil((r+1)/vo),a=f.length,d>=a)return e;for(u=a=f[d],o=1;a>=10;a/=10)o++;r%=vo,s=r-vo+o}if(n!==void 0&&(a=Tv(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/Tv(10,o-s):0:f[d-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return c?(a=Hl(e),f.length=1,t=t-a-1,f[0]=Tv(10,(vo-t%vo)%vo),e.e=JA(-t/vo)||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=Tv(10,vo-r),f[d]=s>0?(u/Tv(10,o-s)%Tv(10,s)|0)*a:0),c)for(;;)if(d==0){(f[0]+=a)==Ac&&(f[0]=1,++e.e);break}else{if(f[d]+=a,f[d]!=Ac)break;f[d--]=0,a=1}for(r=f.length;f[--r]===0;)f.pop();if(Oo&&(e.e>hL||e.e<-hL))throw Error(xce+Hl(e));return e}function XBe(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),Oo?Xa(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/vo),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]=Ac-1;--c[a],c[s]+=Ac}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,Oo?Xa(t,g):t):new x(0)}function Y3(e,t,n){var r,s=Hl(e),a=T0(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+Ib(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(s<0?"e":"e+")+s):s<0?(a="0."+Ib(-s-1)+a,n&&(r=n-o)>0&&(a+=Ib(r))):s>=o?(a+=Ib(s+1-o),n&&(r=n-s-1)>0&&(a=a+"."+Ib(r))):((r=s+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(s+1===o&&(a+="."),a+=Ib(r))),e.s<0?"-"+a:a}function H3e(e,t){if(e.length>t)return e.length=t,!0}function QBe(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(o3+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(o3+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,VGt.test(a))z3e(o,a);else throw Error(o3+a)}if(s.prototype=Ts,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=QBe,s.config=s.set=WGt,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 WGt(e){if(!e||typeof e!="object")throw Error(hp+"Object expected");var t,n,r,s=["precision",1,ZA,"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(JA(r)===r&&r>=s[t+1]&&r<=s[t+2])this[n]=r;else throw Error(o3+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(o3+n+": "+r);return this}var gce=QBe(HGt);$f=new gce(1);const Ha=gce;function qGt(e){return XGt(e)||YGt(e)||KGt(e)||GGt()}function GGt(){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 KGt(e,t){if(e){if(typeof e=="string")return Tte(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 Tte(e,t)}}function YGt(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function XGt(e){if(Array.isArray(e))return Tte(e)}function Tte(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 QGt=function(t){return t},ZBe={"@@functional/placeholder":!0},JBe=function(t){return t===ZBe},V3e=function(t){return function n(){return arguments.length===0||arguments.length===1&&JBe(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},ZGt=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!==ZBe}).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 JBe(f)?c.shift():f});return n.apply(void 0,qGt(d).concat(c))}))})},Q$=function(t){return ZGt(t.length,t)},Ite=function(t,n){for(var r=[],s=t;s<n;++s)r[s-t]=s;return r},JGt=Q$(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),eKt=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return QGt;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))}},Pte=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},e$e=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 tKt(e){var t;return e===0?t=1:t=Math.floor(new Ha(e).abs().log(10).toNumber())+1,t}function nKt(e,t,n){for(var r=new Ha(e),s=0,a=[];r.lt(t)&&s<1e5;)a.push(r.toNumber()),r=r.add(n),s++;return a}var rKt=Q$(function(e,t,n){var r=+e,s=+t;return r+n*(s-r)}),sKt=Q$(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),iKt=Q$(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const Z$={rangeStep:nKt,getDigitCount:tKt,interpolateNumber:rKt,uninterpolateNumber:sKt,uninterpolateTruncation:iKt};function Fte(e){return lKt(e)||oKt(e)||t$e(e)||aKt()}function aKt(){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 oKt(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function lKt(e){if(Array.isArray(e))return Ote(e)}function g_(e,t){return dKt(e)||uKt(e,t)||t$e(e,t)||cKt()}function cKt(){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 t$e(e,t){if(e){if(typeof e=="string")return Ote(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 Ote(e,t)}}function Ote(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 uKt(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 dKt(e){if(Array.isArray(e))return e}function n$e(e){var t=g_(e,2),n=t[0],r=t[1],s=n,a=r;return n>r&&(s=r,a=n),[s,a]}function r$e(e,t,n){if(e.lte(0))return new Ha(0);var r=Z$.getDigitCount(e.toNumber()),s=new Ha(10).pow(r),a=e.div(s),o=r!==1?.05:.1,l=new Ha(Math.ceil(a.div(o).toNumber())).add(n).mul(o),c=l.mul(s);return t?c:new Ha(Math.ceil(c))}function fKt(e,t,n){var r=1,s=new Ha(e);if(!s.isint()&&n){var a=Math.abs(e);a<1?(r=new Ha(10).pow(Z$.getDigitCount(e)-1),s=new Ha(Math.floor(s.div(r).toNumber())).mul(r)):a>1&&(s=new Ha(Math.floor(e)))}else e===0?s=new Ha(Math.floor((t-1)/2)):n||(s=new Ha(Math.floor(e)));var o=Math.floor((t-1)/2),l=eKt(JGt(function(c){return s.add(new Ha(c-o).mul(r)).toNumber()}),Ite);return l(0,t)}function s$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 Ha(0),tickMin:new Ha(0),tickMax:new Ha(0)};var a=r$e(new Ha(t).sub(e).div(n-1),r,s),o;e<=0&&t>=0?o=new Ha(0):(o=new Ha(e).add(t).div(2),o=o.sub(new Ha(o).mod(a)));var l=Math.ceil(o.sub(e).div(a).toNumber()),c=Math.ceil(new Ha(t).sub(o).div(a).toNumber()),u=l+c+1;return u>n?s$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 Ha(l).mul(a)),tickMax:o.add(new Ha(c).mul(a))})}function hKt(e){var t=g_(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=n$e([n,r]),c=g_(l,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var f=d===1/0?[u].concat(Fte(Ite(0,s-1).map(function(){return 1/0}))):[].concat(Fte(Ite(0,s-1).map(function(){return-1/0})),[d]);return n>r?Pte(f):f}if(u===d)return fKt(u,s,a);var x=s$e(u,d,o,a),g=x.step,v=x.tickMin,w=x.tickMax,C=Z$.rangeStep(v,w.add(new Ha(.1).mul(g)),g);return n>r?Pte(C):C}function pKt(e,t){var n=g_(e,2),r=n[0],s=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=n$e([r,s]),l=g_(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=r$e(new Ha(u).sub(c).div(d-1),a,0),x=[].concat(Fte(Z$.rangeStep(new Ha(c),new Ha(u).sub(new Ha(.99).mul(f)),f)),[u]);return r>s?Pte(x):x}var mKt=e$e(hKt),xKt=e$e(pKt),gKt="Invariant failed";function X3(e,t){throw new Error(gKt)}var bKt=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];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)}function pL(){return pL=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},pL.apply(this,arguments)}function yKt(e,t){return SKt(e)||CKt(e,t)||wKt(e,t)||vKt()}function vKt(){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 wKt(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 CKt(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 SKt(e){if(Array.isArray(e))return e}function NKt(e,t){if(e==null)return{};var n=AKt(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 AKt(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 jKt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function EKt(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,o$e(r.key),r)}}function _Kt(e,t,n){return EKt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function kKt(e,t,n){return t=mL(t),TKt(e,i$e()?Reflect.construct(t,n||[],mL(e).constructor):t.apply(e,n))}function TKt(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 IKt(e)}function IKt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i$e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(i$e=function(){return!!e})()}function mL(e){return mL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},mL(e)}function PKt(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&&Mte(e,t)}function Mte(e,t){return Mte=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},Mte(e,t)}function a$e(e,t,n){return t=o$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o$e(e){var t=FKt(e,"string");return kN(t)=="symbol"?t:t+""}function FKt(e,t){if(kN(e)!="object"||!e)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)}var e8=function(e){function t(){return jKt(this,t),kKt(this,t,arguments)}return PKt(t,e),_Kt(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=NKt(r,bKt),g=wi(x,!1);this.props.direction==="x"&&d.type!=="number"&&X3();var v=c.map(function(w){var C=u(w,l),N=C.x,P=C.y,I=C.value,R=C.errorVal;if(!R)return null;var O=[],U,L;if(Array.isArray(R)){var z=yKt(R,2);U=z[0],L=z[1]}else U=L=R;if(a==="vertical"){var X=d.scale,ne=P+s,J=ne+o,K=ne-o,re=X(I-U),he=X(I+L);O.push({x1:he,y1:J,x2:he,y2:K}),O.push({x1:re,y1:ne,x2:he,y2:ne}),O.push({x1:re,y1:J,x2:re,y2:K})}else if(a==="horizontal"){var Q=f.scale,ie=N+s,oe=ie-o,G=ie+o,V=Q(I-U),te=Q(I+L);O.push({x1:oe,y1:te,x2:G,y2:te}),O.push({x1:ie,y1:V,x2:ie,y2:te}),O.push({x1:oe,y1:V,x2:G,y2:V})}return Ae.createElement(Sa,pL({className:"recharts-errorBar",key:"bar-".concat(O.map(function(ae){return"".concat(ae.x1,"-").concat(ae.x2,"-").concat(ae.y1,"-").concat(ae.y2)}))},g),O.map(function(ae){return Ae.createElement("line",pL({},ae,{key:"line-".concat(ae.x1,"-").concat(ae.x2,"-").concat(ae.y1,"-").concat(ae.y2)}))}))});return Ae.createElement(Sa,{className:"recharts-errorBars"},v)}}])}(Ae.Component);a$e(e8,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});a$e(e8,"displayName","ErrorBar");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 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 dv(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){OKt(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 OKt(e,t,n){return t=MKt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MKt(e){var t=RKt(e,"string");return b_(t)=="symbol"?t:t+""}function RKt(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)}var l$e=function(t){var n=t.children,r=t.formattedGraphicalItems,s=t.legendWidth,a=t.legendContent,o=Lf(n,i3);if(!o)return null;var l=i3.defaultProps,c=l!==void 0?dv(dv({},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?dv(dv({},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}}),dv(dv(dv({},c),i3.getWithHeight(o,s)),{},{payload:u,item:o})};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 G3e(e){return $Kt(e)||BKt(e)||DKt(e)||LKt()}function LKt(){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 DKt(e,t){if(e){if(typeof e=="string")return Rte(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 Rte(e,t)}}function BKt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function $Kt(e){if(Array.isArray(e))return Rte(e)}function Rte(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 rl(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){m4(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 m4(e,t,n){return t=UKt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UKt(e){var t=zKt(e,"string");return y_(t)=="symbol"?t:t+""}function zKt(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)}function sc(e,t,n){return Ci(e)||Ci(t)?n:rc(t)?np(e,t,n):ji(t)?t(e):n}function a9(e,t,n,r){var s=$Gt(e,function(l){return sc(l,t)});if(n==="number"){var a=s.filter(function(l){return ns(l)||parseFloat(l)});return a.length?[X$(a),gy(a)]:[1/0,-1/0]}var o=r?s.filter(function(l){return!Ci(l)}):s;return o.map(function(l){return rc(l)||l instanceof Date?l:""})}var HKt=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(cm(f-d)!==cm(x-f)){var v=[];if(cm(x-f)===cm(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 P=Math.min(d,x),I=Math.max(d,x);if(t>(P+f)/2&&t<=(I+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?rl(rl({},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},VKt=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 Yg(L.type).indexOf("Bar")>=0});if(N&&N.length){var P=N[0].type.defaultProps,I=P!==void 0?rl(rl({},P),N[0].props):N[0].props,R=I.barSize,O=I[C];o[O]||(o[O]=[]);var U=Ci(R)?n:R;o[O].push({item:N[0],stackList:N.slice(1),barSize:Ci(U)?void 0:G3(U,r,0)})}}return o},WKt=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=G3(n,s,0,!0),d,f=[];if(o[0].barSize===+o[0].barSize){var x=!1,g=s/c,v=o.reduce(function(R,O){return R+O.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,O){var U={item:O.item,position:{offset:C.offset+C.size+u,size:x?g:O.barSize}},L=[].concat(G3e(R),[U]);return C=L[L.length-1].position,O.stackList&&O.stackList.length&&O.stackList.forEach(function(z){L.push({item:z,position:C})}),L},f)}else{var N=G3(r,s,0,!0);s-2*N-(c-1)*u<=0&&(u=0);var P=(s-2*N-(c-1)*u)/c;P>1&&(P>>=0);var I=l===+l?Math.min(P,l):P;d=o.reduce(function(R,O,U){var L=[].concat(G3e(R),[{item:O.item,position:{offset:N+(P+u)*U+(P-I)/2,size:I}}]);return O.stackList&&O.stackList.length&&O.stackList.forEach(function(z){L.push({item:z,position:L[L.length-1].position})}),L},f)}return d},qKt=function(t,n,r,s){var a=r.children,o=r.width,l=r.margin,c=o-(l.left||0)-(l.right||0),u=l$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"&&ns(t[g]))return rl(rl({},t),{},m4({},g,t[g]+(f||0)));if((w==="horizontal"||w==="vertical"&&g==="center")&&v!=="middle"&&ns(t[v]))return rl(rl({},t),{},m4({},v,t[v]+(x||0)))}return t},GKt=function(t,n,r){return Ci(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},c$e=function(t,n,r,s,a){var o=n.props.children,l=of(o,e8).filter(function(u){return GKt(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=sc(d,r);if(Ci(f))return u;var x=Array.isArray(f)?[X$(f),gy(f)]:[f,f],g=c.reduce(function(v,w){var C=sc(d,w,0),N=x[0]-Math.abs(Array.isArray(C)?C[0]:C),P=x[1]+Math.abs(Array.isArray(C)?C[1]:C);return[Math.min(N,v[0]),Math.max(P,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},KKt=function(t,n,r,s,a){var o=n.map(function(l){return c$e(t,l,r,a,s)}).filter(function(l){return!Ci(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},u$e=function(t,n,r,s,a){var o=n.map(function(c){var u=c.props.dataKey;return r==="number"&&u&&c$e(t,c,u,s)||a9(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},[])},d$e=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},f$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},Bg=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?cm(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!YA(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}})},oY=new WeakMap,IP=function(t,n){if(typeof n!="function")return t;oY.has(t)||oY.set(t,new WeakMap);var r=oY.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},YKt=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:d_(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:cL(),realScaleType:"linear"}:a==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:i9(),realScaleType:"point"}:a==="category"?{scale:d_(),realScaleType:"band"}:{scale:cL(),realScaleType:"linear"};if(q3(s)){var c="scale".concat(R$(s));return{scale:(F3e[c]||i9)(),realScaleType:F3e[c]?c:"point"}}return ji(s)?{scale:s}:{scale:i9(),realScaleType:"point"}},Y3e=1e-4,XKt=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]])}},QKt=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},ZKt=function(t,n){if(!n||n.length!==2||!ns(n[0])||!ns(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(!ns(t[0])||t[0]<r)&&(a[0]=r),(!ns(t[1])||t[1]>s)&&(a[1]=s),a[0]>s&&(a[0]=s),a[1]<r&&(a[1]=r),a},JKt=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=YA(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])}},eYt=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=YA(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)}},tYt={sign:JKt,expand:BUt,none:wN,silhouette:$Ut,wiggle:UUt,positive:eYt},nYt=function(t,n,r){var s=n.map(function(l){return l.props.dataKey}),a=tYt[r],o=DUt().keys(s).value(function(l,c){return+sc(l,c,0)}).order(fte).offset(a);return o(t)},rYt=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?rl(rl({},x.type.defaultProps),x.props):x.props,w=v.stackId,C=v.hide;if(C)return f;var N=v[r],P=f[N]||{hasStack:!1,stackGroups:{}};if(rc(w)){var I=P.stackGroups[w]||{numericAxisId:r,cateAxisId:s,items:[]};I.items.push(x),P.hasStack=!0,P.stackGroups[w]=I}else P.stackGroups[S5("_stackId_")]={numericAxisId:r,cateAxisId:s,items:[x]};return rl(rl({},f),{},m4({},N,P))},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 rl(rl({},w),{},m4({},C,{numericAxisId:r,cateAxisId:s,items:N.items,stackedData:nYt(t,N.items,a)}))},v)}return rl(rl({},f),{},m4({},x,g))},d)},sYt=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=mKt(u,a,l);return t.domain([X$(d),gy(d)]),{niceTicks:d}}if(a&&s==="number"){var f=t.domain(),x=xKt(f,a,l);return{niceTicks:x}}return null};function TN(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&&!Ci(s[t.dataKey])){var l=VR(n,"value",s[t.dataKey]);if(l)return l.coordinate+r/2}return n[a]?n[a].coordinate+r/2:null}var c=sc(s,Ci(o)?t.dataKey:o);return Ci(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=sc(o,n.dataKey,n.domain[l]);return Ci(c)?null:n.scale(c)-a/2+s},iYt=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]},aYt=function(t,n){var r,s=(r=t.type)!==null&&r!==void 0&&r.defaultProps?rl(rl({},t.type.defaultProps),t.props):t.props,a=s.stackId;if(rc(a)){var o=n[a];if(o){var l=o.items.indexOf(t);return l>=0?o.stackedData[l]:null}}return null},oYt=function(t){return t.reduce(function(n,r){return[X$(r.concat([n[0]]).filter(ns)),gy(r.concat([n[1]]).filter(ns))]},[1/0,-1/0])},h$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=oYt(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})$/,Lte=function(t,n,r){if(ji(t))return t(n,r);if(!Array.isArray(t))return n;var s=[];if(ns(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 ji(t[0])?s[0]=t[0](n[0]):s[0]=n[0];if(ns(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 ji(t[1])?s[1]=t[1](n[1]):s[1]=n[1];return s},xL=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||K3(t,np(r,"type.defaultProps.domain"))?n:t},p$e=function(t,n){var r=t.type.defaultProps?rl(rl({},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 rl(rl({},wi(t,!1)),{},{dataKey:s,unit:o,formatter:l,name:a||s,color:bce(t),value:sc(n,s),type:c,payload:n,chartType:u,hide:d})};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)}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){lYt(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 lYt(e,t,n){return t=cYt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cYt(e){var t=uYt(e,"string");return v_(t)=="symbol"?t:t+""}function uYt(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)}var gL=Math.PI/180,dYt=function(t){return t*180/Math.PI},nu=function(t,n,r,s){return{x:t+Math.cos(-gL*s)*r,y:n+Math.sin(-gL*s)*r}},fYt=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))},hYt=function(t,n){var r=t.x,s=t.y,a=n.cx,o=n.cy,l=fYt({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:dYt(u),angleInRadian:u}},pYt=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}},mYt=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=hYt({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=pYt(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:mYt(g,n)}):null};function w_(e){"@babel/helpers - typeof";return w_=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},w_(e)}var xYt=["offset"];function gYt(e){return wYt(e)||vYt(e)||yYt(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 yYt(e,t){if(e){if(typeof e=="string")return Dte(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 Dte(e,t)}}function vYt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function wYt(e){if(Array.isArray(e))return Dte(e)}function Dte(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 CYt(e,t){if(e==null)return{};var n=SYt(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 SYt(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 Ql(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){NYt(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 NYt(e,t,n){return t=AYt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AYt(e){var t=jYt(e,"string");return w_(t)=="symbol"?t:t+""}function jYt(e,t){if(w_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(w_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function C_(){return C_=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},C_.apply(this,arguments)}var EYt=function(t){var n=t.value,r=t.formatter,s=Ci(t.children)?n:t.children;return ji(r)?r(s):s},_Yt=function(t,n){var r=cm(n-t),s=Math.min(Math.abs(n-t),360);return r*s},kYt=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=_Yt(g,v),P=N>=0?1:-1,I,R;s==="insideStart"?(I=g+P*o,R=w):s==="insideEnd"?(I=v-P*o,R=!w):s==="end"&&(I=v+P*o,R=w),R=N<=0?R:!R;var O=nu(u,d,C,I),U=nu(u,d,C,I+(R?1:-1)*359),L="M".concat(O.x,",").concat(O.y,`
    A`).concat(C,",").concat(C,",0,1,").concat(R?0:1,`,
    `).concat(U.x,",").concat(U.y),z=Ci(t.id)?S5("recharts-radial-line-"):t.id;return Ae.createElement("text",C_({},r,{dominantBaseline:"central",className:ia("recharts-radial-bar-label",l)}),Ae.createElement("defs",null,Ae.createElement("path",{id:z,d:L})),Ae.createElement("textPath",{xlinkHref:"#".concat(z)},n))},TYt=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=nu(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=nu(o,l,C,x),P=N.x,I=N.y;return{x:P,y:I,textAnchor:"middle",verticalAnchor:"middle"}},IYt=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",P=w>0?"start":"end";if(a==="top"){var I={x:l+u/2,y:c-f*s,textAnchor:"middle",verticalAnchor:g};return Ql(Ql({},I),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 Ql(Ql({},R),r?{height:Math.max(r.y+r.height-(c+d),0),width:u}:{})}if(a==="left"){var O={x:l-C,y:c+d/2,textAnchor:N,verticalAnchor:"middle"};return Ql(Ql({},O),r?{width:Math.max(O.x-r.x,0),height:d}:{})}if(a==="right"){var U={x:l+u+C,y:c+d/2,textAnchor:P,verticalAnchor:"middle"};return Ql(Ql({},U),r?{width:Math.max(r.x+r.width-U.x,0),height:d}:{})}var L=r?{width:u,height:d}:{};return a==="insideLeft"?Ql({x:l+C,y:c+d/2,textAnchor:P,verticalAnchor:"middle"},L):a==="insideRight"?Ql({x:l+u-C,y:c+d/2,textAnchor:N,verticalAnchor:"middle"},L):a==="insideTop"?Ql({x:l+u/2,y:c+x,textAnchor:"middle",verticalAnchor:v},L):a==="insideBottom"?Ql({x:l+u/2,y:c+d-x,textAnchor:"middle",verticalAnchor:g},L):a==="insideTopLeft"?Ql({x:l+C,y:c+x,textAnchor:P,verticalAnchor:v},L):a==="insideTopRight"?Ql({x:l+u-C,y:c+x,textAnchor:N,verticalAnchor:v},L):a==="insideBottomLeft"?Ql({x:l+C,y:c+d-x,textAnchor:P,verticalAnchor:g},L):a==="insideBottomRight"?Ql({x:l+u-C,y:c+d-x,textAnchor:N,verticalAnchor:g},L):KA(a)&&(ns(a.x)||rw(a.x))&&(ns(a.y)||rw(a.y))?Ql({x:l+G3(a.x,u),y:c+G3(a.y,d),textAnchor:"end",verticalAnchor:"end"},L):Ql({x:l+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},L)},PYt=function(t){return"cx"in t&&ns(t.cx)};function Eu(e){var t=e.offset,n=t===void 0?5:t,r=CYt(e,xYt),s=Ql({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||Ci(l)&&Ci(c)&&!m.isValidElement(u)&&!ji(u))return null;if(m.isValidElement(u))return m.cloneElement(u,s);var g;if(ji(u)){if(g=m.createElement(u,s),m.isValidElement(g))return g}else g=EYt(s);var v=PYt(a),w=wi(s,!0);if(v&&(o==="insideStart"||o==="insideEnd"||o==="end"))return kYt(s,g,w);var C=v?TYt(s):IYt(s);return Ae.createElement(nL,C_({className:ia("recharts-label",f)},w,C,{breakAll:x}),g)}Eu.displayName="Label";var m$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,P=t.labelViewBox;if(P)return P;if(ns(w)&&ns(C)){if(ns(f)&&ns(x))return{x:f,y:x,width:w,height:C};if(ns(g)&&ns(v))return{x:g,y:v,width:w,height:C}}return ns(f)&&ns(x)?{x:f,y:x,width:0,height:0}:ns(n)&&ns(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:{}},FYt=function(t,n){return t?t===!0?Ae.createElement(Eu,{key:"label-implicit",viewBox:n}):rc(t)?Ae.createElement(Eu,{key:"label-implicit",viewBox:n,value:t}):m.isValidElement(t)?t.type===Eu?m.cloneElement(t,{key:"label-implicit",viewBox:n}):Ae.createElement(Eu,{key:"label-implicit",content:t,viewBox:n}):ji(t)?Ae.createElement(Eu,{key:"label-implicit",content:t,viewBox:n}):KA(t)?Ae.createElement(Eu,C_({viewBox:n},t,{key:"label-implicit"})):null:null},OYt=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=m$e(t),o=of(s,Eu).map(function(c,u){return m.cloneElement(c,{viewBox:n||a,key:"label-".concat(u)})});if(!r)return o;var l=FYt(t.label,n||a);return[l].concat(gYt(o))};Eu.parseViewBox=m$e;Eu.renderCallByParent=OYt;var lY,s5e;function MYt(){if(s5e)return lY;s5e=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return lY=e,lY}var RYt=MYt();const LYt=Ii(RYt);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)}var DYt=["valueAccessor"],BYt=["data","dataKey","clockWise","id","textBreakAll"];function $Yt(e){return VYt(e)||HYt(e)||zYt(e)||UYt()}function UYt(){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 zYt(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 HYt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function VYt(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 bL(){return bL=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},bL.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){WYt(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 WYt(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=GYt(e,"string");return S_(t)=="symbol"?t:t+""}function GYt(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)}function o5e(e,t){if(e==null)return{};var n=KYt(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 KYt(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 YYt=function(t){return Array.isArray(t.value)?LYt(t.value):t.value};function H0(e){var t=e.valueAccessor,n=t===void 0?YYt:t,r=o5e(e,DYt),s=r.data,a=r.dataKey,o=r.clockWise,l=r.id,c=r.textBreakAll,u=o5e(r,BYt);return!s||!s.length?null:Ae.createElement(Sa,{className:"recharts-label-list"},s.map(function(d,f){var x=Ci(a)?n(d,f):sc(d&&d.payload,a),g=Ci(l)?{}:{id:"".concat(l,"-").concat(f)};return Ae.createElement(Eu,bL({},wi(d,!0),u,g,{parentViewBox:d.parentViewBox,value:x,textBreakAll:c,viewBox:Eu.parseViewBox(Ci(o)?d:a5e(a5e({},d),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}H0.displayName="LabelList";function XYt(e,t){return e?e===!0?Ae.createElement(H0,{key:"labelList-implicit",data:t}):Ae.isValidElement(e)||ji(e)?Ae.createElement(H0,{key:"labelList-implicit",data:t,content:e}):KA(e)?Ae.createElement(H0,bL({data:t},e,{key:"labelList-implicit"})):null:null}function QYt(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=of(r,H0).map(function(o,l){return m.cloneElement(o,{data:t,key:"labelList-".concat(l)})});if(!n)return s;var a=XYt(e.label,t);return[a].concat($Yt(s))}H0.renderCallByParent=QYt;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 $te(){return $te=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},$te.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){ZYt(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 ZYt(e,t,n){return t=JYt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JYt(e){var t=eXt(e,"string");return N_(t)=="symbol"?t:t+""}function eXt(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 tXt=function(t,n){var r=cm(n-t),s=Math.min(Math.abs(n-t),359.999);return r*s},PP=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)/gL,x=u?a:a+o*f,g=nu(n,r,d,x),v=nu(n,r,s,x),w=u?a-o*f:a,C=nu(n,r,d*Math.cos(f*gL),w);return{center:g,circleTangency:v,lineTangency:C,theta:f}},x$e=function(t){var n=t.cx,r=t.cy,s=t.innerRadius,a=t.outerRadius,o=t.startAngle,l=t.endAngle,c=tXt(o,l),u=o+c,d=nu(n,r,a,o),f=nu(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=nu(n,r,s,o),v=nu(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},nXt=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=cm(d-u),x=PP({cx:n,cy:r,radius:a,angle:u,sign:f,cornerRadius:o,cornerIsExternal:c}),g=x.circleTangency,v=x.lineTangency,w=x.theta,C=PP({cx:n,cy:r,radius:a,angle:d,sign:-f,cornerRadius:o,cornerIsExternal:c}),N=C.circleTangency,P=C.lineTangency,I=C.theta,R=c?Math.abs(u-d):Math.abs(u-d)-w-I;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
      `):x$e({cx:n,cy:r,innerRadius:s,outerRadius:a,startAngle:u,endAngle:d});var O="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(P.x,",").concat(P.y,`
  `);if(s>0){var U=PP({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=PP({cx:n,cy:r,radius:s,angle:d,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),J=ne.circleTangency,K=ne.lineTangency,re=ne.theta,he=c?Math.abs(u-d):Math.abs(u-d)-X-re;if(he<0&&o===0)return"".concat(O,"L").concat(n,",").concat(r,"Z");O+="L".concat(K.x,",").concat(K.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 O+="L".concat(n,",").concat(r,"Z");return O},rXt={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},g$e=function(t){var n=c5e(c5e({},rXt),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=ia("recharts-sector",x),v=o-a,w=G3(l,v,0,!0),C;return w>0&&Math.abs(d-f)<360?C=nXt({cx:r,cy:s,innerRadius:a,outerRadius:o,cornerRadius:Math.min(w,v/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:f}):C=x$e({cx:r,cy:s,innerRadius:a,outerRadius:o,startAngle:d,endAngle:f}),Ae.createElement("path",$te({},wi(n,!0),{className:g,d:C,role:"img"}))};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 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 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){sXt(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 sXt(e,t,n){return t=iXt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iXt(e){var t=aXt(e,"string");return A_(t)=="symbol"?t:t+""}function aXt(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 f5e={curveBasisClosed:EUt,curveBasisOpen:_Ut,curveBasis:jUt,curveBumpX:fUt,curveBumpY:hUt,curveLinearClosed:kUt,curveLinear:D$,curveMonotoneX:TUt,curveMonotoneY:IUt,curveNatural:PUt,curveStep:FUt,curveStepAfter:MUt,curveStepBefore:OUt},FP=function(t){return t.x===+t.x&&t.y===+t.y},B7=function(t){return t.x},$7=function(t){return t.y},oXt=function(t,n){if(ji(t))return t;var r="curve".concat(R$(t));return(r==="curveMonotone"||r==="curveBump")&&n?f5e["".concat(r).concat(n==="vertical"?"Y":"X")]:f5e[r]||D$},lXt=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=oXt(r,l),f=u?a.filter(function(w){return FP(w)}):a,x;if(Array.isArray(o)){var g=u?o.filter(function(w){return FP(w)}):o,v=f.map(function(w,C){return d5e(d5e({},w),{},{base:g[C]})});return l==="vertical"?x=NP().y($7).x1(B7).x0(function(w){return w.base.x}):x=NP().x(B7).y1($7).y0(function(w){return w.base.y}),x.defined(FP).curve(d),x(v)}return l==="vertical"&&ns(o)?x=NP().y($7).x1(B7).x0(o):ns(o)?x=NP().x(B7).y1($7).y0(o):x=vDe().x(B7).y($7),x.defined(FP).curve(d),x(f)},l3=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?lXt(t):s;return Ae.createElement("path",Ute({},wi(t,!1),WR(t),{className:ia("recharts-curve",n),d:o,ref:a}))},cXt=_$();const Fa=Ii(cXt);var uXt=Object.getOwnPropertyNames,dXt=Object.getOwnPropertySymbols,fXt=Object.prototype.hasOwnProperty;function h5e(e,t){return function(r,s,a){return e(r,s,a)&&t(r,s,a)}}function OP(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 uXt(e).concat(dXt(e))}var hXt=Object.hasOwn||function(e,t){return fXt.call(e,t)};function j5(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var pXt="__v",mXt="__o",xXt="_owner",m5e=Object.getOwnPropertyDescriptor,x5e=Object.keys;function gXt(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 bXt(e,t){return j5(e.getTime(),t.getTime())}function yXt(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function vXt(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 wXt=j5;function CXt(e,t,n){var r=x5e(e),s=r.length;if(x5e(t).length!==s)return!1;for(;s-- >0;)if(!b$e(e,t,n,r[s]))return!1;return!0}function U7(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],!b$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 SXt(e,t){return j5(e.valueOf(),t.valueOf())}function NXt(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 AXt(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 jXt(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 b$e(e,t,n,r){return(r===xXt||r===mXt||r===pXt)&&(e.$$typeof||t.$$typeof)?!0:hXt(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var EXt="[object Arguments]",_Xt="[object Boolean]",kXt="[object Date]",TXt="[object Error]",IXt="[object Map]",PXt="[object Number]",FXt="[object Object]",OXt="[object RegExp]",MXt="[object Set]",RXt="[object String]",LXt="[object URL]",DXt=Array.isArray,y5e=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,v5e=Object.assign,BXt=Object.prototype.toString.call.bind(Object.prototype.toString);function $Xt(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 P=v.constructor;if(P!==w.constructor)return!1;if(P===Object)return l(v,w,C);if(DXt(v))return t(v,w,C);if(y5e!=null&&y5e(v))return f(v,w,C);if(P===Date)return n(v,w,C);if(P===RegExp)return u(v,w,C);if(P===Map)return a(v,w,C);if(P===Set)return d(v,w,C);var I=BXt(v);return I===kXt?n(v,w,C):I===OXt?u(v,w,C):I===IXt?a(v,w,C):I===MXt?d(v,w,C):I===FXt?typeof v.then!="function"&&typeof w.then!="function"&&l(v,w,C):I===LXt?x(v,w,C):I===TXt?r(v,w,C):I===EXt?l(v,w,C):I===_Xt||I===PXt||I===RXt?c(v,w,C):!1}}function UXt(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,s={areArraysEqual:r?U7:gXt,areDatesEqual:bXt,areErrorsEqual:yXt,areFunctionsEqual:vXt,areMapsEqual:r?h5e(g5e,U7):g5e,areNumbersEqual:wXt,areObjectsEqual:r?U7:CXt,arePrimitiveWrappersEqual:SXt,areRegExpsEqual:NXt,areSetsEqual:r?h5e(b5e,U7):b5e,areTypedArraysEqual:r?U7:AXt,areUrlsEqual:jXt};if(n&&(s=v5e({},s,n(s))),t){var a=OP(s.areArraysEqual),o=OP(s.areMapsEqual),l=OP(s.areObjectsEqual),c=OP(s.areSetsEqual);s=v5e({},s,{areArraysEqual:a,areMapsEqual:o,areObjectsEqual:l,areSetsEqual:c})}return s}function zXt(e){return function(t,n,r,s,a,o,l){return e(t,n,l)}}function HXt(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 VXt=y2();y2({strict:!0});y2({circular:!0});y2({circular:!0,strict:!0});y2({createInternalComparator:function(){return j5}});y2({strict:!0,createInternalComparator:function(){return j5}});y2({circular:!0,createInternalComparator:function(){return j5}});y2({circular:!0,createInternalComparator:function(){return j5},strict:!0});function y2(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=UXt(e),c=$Xt(l),u=r?r(c):zXt(c);return HXt({circular:n,comparator:c,createState:s,equals:u,strict:o})}function WXt(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):WXt(s)};requestAnimationFrame(r)}function zte(e){"@babel/helpers - typeof";return zte=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},zte(e)}function qXt(e){return XXt(e)||YXt(e)||KXt(e)||GXt()}function GXt(){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 KXt(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 YXt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function XXt(e){if(Array.isArray(e))return e}function QXt(){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=qXt(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}zte(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 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 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){y$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 y$e(e,t,n){return t=ZXt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZXt(e){var t=JXt(e,"string");return j_(t)==="symbol"?t:String(t)}function JXt(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)}var eQt=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,s){return r.filter(function(a){return s.includes(a)})})},tQt=function(t){return t},nQt=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},o9=function(t,n){return Object.keys(n).reduce(function(r,s){return N5e(N5e({},r),{},y$e({},s,t(s,n[s])))},{})},A5e=function(t,n,r){return t.map(function(s){return"".concat(nQt(s)," ").concat(n,"ms ").concat(r)}).join(",")};function rQt(e,t){return aQt(e)||iQt(e,t)||v$e(e,t)||sQt()}function sQt(){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 iQt(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 aQt(e){if(Array.isArray(e))return e}function oQt(e){return uQt(e)||cQt(e)||v$e(e)||lQt()}function lQt(){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 v$e(e,t){if(e){if(typeof e=="string")return Hte(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 Hte(e,t)}}function cQt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function uQt(e){if(Array.isArray(e))return Hte(e)}function Hte(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 yL=1e-4,w$e=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},C$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=w$e(t,n);return C$e(s,r)}},dQt=function(t,n){return function(r){var s=w$e(t,n),a=[].concat(oQt(s.map(function(o,l){return o*l}).slice(1)),[0]);return C$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=rQt(u,4);s=d[0],a=d[1],o=d[2],l=d[3]}}}var f=j5e(s,o),x=j5e(a,l),g=dQt(s,o),v=function(N){return N>1?1:N<0?0:N},w=function(N){for(var P=N>1?1:N,I=P,R=0;R<8;++R){var O=f(I)-P,U=g(I);if(Math.abs(O-P)<yL||U<yL)return x(I);I=v(I-O/U)}return x(I)};return w.isStepper=!1,w},fQt=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)<yL&&Math.abs(w)<yL?[f,0]:[C,w]};return c.isStepper=!0,c.dt=l,c},hQt=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 fQt();default:if(s.split("(")[0]==="cubic-bezier")return E5e(s)}return typeof s=="function"?s:null};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 _5e(e){return xQt(e)||mQt(e)||S$e(e)||pQt()}function pQt(){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 mQt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function xQt(e){if(Array.isArray(e))return Wte(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 Gc(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){Vte(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 Vte(e,t,n){return t=gQt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gQt(e){var t=bQt(e,"string");return E_(t)==="symbol"?t:String(t)}function bQt(e,t){if(E_(e)!=="object"||e===null)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)}function yQt(e,t){return CQt(e)||wQt(e,t)||S$e(e,t)||vQt()}function vQt(){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 S$e(e,t){if(e){if(typeof e=="string")return Wte(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 Wte(e,t)}}function Wte(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 wQt(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 CQt(e){if(Array.isArray(e))return e}var vL=function(t,n,r){return t+(n-t)*r},qte=function(t){var n=t.from,r=t.to;return n!==r},SQt=function e(t,n,r){var s=o9(function(a,o){if(qte(o)){var l=t(o.from,o.to,o.velocity),c=yQt(l,2),u=c[0],d=c[1];return Gc(Gc({},o),{},{from:u,velocity:d})}return o},n);return r<1?o9(function(a,o){return qte(o)?Gc(Gc({},o),{},{velocity:vL(o.velocity,s[a].velocity,r),from:vL(o.from,s[a].from,r)}):o},n):e(t,s,r-1)};const NQt=function(e,t,n,r,s){var a=eQt(e,t),o=a.reduce(function(C,N){return Gc(Gc({},C),{},Vte({},N,[e[N],t[N]]))},{}),l=a.reduce(function(C,N){return Gc(Gc({},C),{},Vte({},N,{from:e[N],velocity:0,to:t[N]}))},{}),c=-1,u,d,f=function(){return null},x=function(){return o9(function(N,P){return P.from},l)},g=function(){return!Object.values(l).filter(qte).length},v=function(N){u||(u=N);var P=N-u,I=P/n.dt;l=SQt(n,l,I),s(Gc(Gc(Gc({},e),t),x())),u=N,g()||(c=requestAnimationFrame(f))},w=function(N){d||(d=N);var P=(N-d)/r,I=o9(function(O,U){return vL.apply(void 0,_5e(U).concat([n(P)]))},o);if(s(Gc(Gc(Gc({},e),t),I)),P<1)c=requestAnimationFrame(f);else{var R=o9(function(O,U){return vL.apply(void 0,_5e(U).concat([n(1)]))},o);s(Gc(Gc(Gc({},e),t),R))}};return f=n.isStepper?v:w,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(c)}}};function IN(e){"@babel/helpers - typeof";return IN=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},IN(e)}var AQt=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function jQt(e,t){if(e==null)return{};var n=EQt(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 EQt(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 cY(e){return IQt(e)||TQt(e)||kQt(e)||_Qt()}function _Qt(){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 kQt(e,t){if(e){if(typeof e=="string")return Gte(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 Gte(e,t)}}function TQt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function IQt(e){if(Array.isArray(e))return Gte(e)}function Gte(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 Fp(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){kj(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 kj(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 PQt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FQt(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 OQt(e,t,n){return FQt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function N$e(e){var t=MQt(e,"string");return IN(t)==="symbol"?t:String(t)}function MQt(e,t){if(IN(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(IN(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function RQt(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&&Kte(e,t)}function Kte(e,t){return Kte=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},Kte(e,t)}function LQt(e){var t=DQt();return function(){var r=wL(e),s;if(t){var a=wL(this).constructor;s=Reflect.construct(r,arguments,a)}else s=r.apply(this,arguments);return Yte(this,s)}}function Yte(e,t){if(t&&(IN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xte(e)}function Xte(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function DQt(){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 wL(e){return wL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},wL(e)}var Sm=function(e){RQt(n,e);var t=LQt(n);function n(r,s){var a;PQt(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(Xte(a)),a.changeStyle=a.changeStyle.bind(Xte(a)),!l||g<=0)return a.state={style:{}},typeof x=="function"&&(a.state={style:d}),Yte(a);if(f&&f.length)a.state={style:f[0].style};else if(u){if(typeof x=="function")return a.state={style:u},Yte(a);a.state={style:c?kj({},c,u):u}}else a.state={style:{}};return a}return OQt(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?kj({},c,d):d};this.state&&x&&(c&&x[c]!==d||!c&&x!==d)&&this.setState(g);return}if(!(VXt(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?kj({},c,w):w};(c&&x[c]!==w||!c&&x!==w)&&this.setState(C)}this.runAnimation(Fp(Fp({},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=NQt(o,l,hQt(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 P=C.duration,I=C.easing,R=I===void 0?"ease":I,O=C.style,U=C.properties,L=C.onAnimationEnd,z=N>0?o[N-1]:C,X=U||Object.keys(O);if(typeof R=="function"||R==="spring")return[].concat(cY(w),[a.runJSAnimation.bind(a,{from:z.style,to:O,duration:P,easing:R}),P]);var ne=A5e(X,P,R),J=Fp(Fp(Fp({},z.style),O),{},{transition:ne});return[].concat(cY(w),[J,P,L]).filter(tQt)};return this.manager.start([c].concat(cY(o.reduce(g,[d,Math.max(x,l)])),[s.onAnimationEnd]))}},{key:"runAnimation",value:function(s){this.manager||(this.manager=QXt());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?kj({},l,c):c,C=A5e(Object.keys(w),o,u);v.start([d,a,Fp(Fp({},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=jQt(s,AQt),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,P=m.cloneElement(g,Fp(Fp({},c),{},{style:Fp(Fp({},C),d),className:N}));return P};return u===1?f(m.Children.only(a)):Ae.createElement("div",null,m.Children.map(a,function(x){return f(x)}))}}]),n}(m.PureComponent);Sm.displayName="Animate";Sm.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Sm.propTypes={from:Fa.oneOfType([Fa.object,Fa.string]),to:Fa.oneOfType([Fa.object,Fa.string]),attributeName:Fa.string,duration:Fa.number,begin:Fa.number,easing:Fa.oneOfType([Fa.string,Fa.func]),steps:Fa.arrayOf(Fa.shape({duration:Fa.number.isRequired,style:Fa.object.isRequired,easing:Fa.oneOfType([Fa.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Fa.func]),properties:Fa.arrayOf("string"),onAnimationEnd:Fa.func})),children:Fa.oneOfType([Fa.node,Fa.func]),isActive:Fa.bool,canBegin:Fa.bool,onAnimationEnd:Fa.func,shouldReAnimate:Fa.bool,onAnimationStart:Fa.func,onAnimationReStart:Fa.func};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)}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 BQt(e,t){return HQt(e)||zQt(e,t)||UQt(e,t)||$Qt()}function $Qt(){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 UQt(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 zQt(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 HQt(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){VQt(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 VQt(e,t,n){return t=WQt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WQt(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)}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},GQt=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},KQt={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({},KQt),t),r=m.useRef(),s=m.useState(-1),a=BQt(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,P=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||d===0||f===0)return null;var I=ia("recharts-rectangle",g);return P?Ae.createElement(Sm,{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:P},function(R){var O=R.width,U=R.height,L=R.x,z=R.y;return Ae.createElement(Sm,{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},Ae.createElement("path",CL({},wi(n,!0),{className:I,d:O5e(L,z,O,U,x),ref:r})))}):Ae.createElement("path",CL({},wi(n,!0),{className:I,d:O5e(c,u,d,f,x)}))};function Qte(){return Qte=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},Qte.apply(this,arguments)}var J$=function(t){var n=t.cx,r=t.cy,s=t.r,a=t.className,o=ia("recharts-dot",a);return n===+n&&r===+r&&s===+s?Ae.createElement("circle",Qte({},wi(t,!1),WR(t),{className:o,cx:n,cy:r,r:s})):null};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)}var YQt=["x","y","top","left","width","height","className"];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 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 XQt(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){QQt(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 QQt(e,t,n){return t=ZQt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZQt(e){var t=JQt(e,"string");return k_(t)=="symbol"?t:t+""}function JQt(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)}function eZt(e,t){if(e==null)return{};var n=tZt(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 tZt(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 nZt=function(t,n,r,s,a,o){return"M".concat(t,",").concat(a,"v").concat(s,"M").concat(o,",").concat(n,"h").concat(r)},rZt=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=eZt(t,YQt),C=XQt({x:r,y:a,top:l,left:u,width:f,height:g},w);return!ns(r)||!ns(a)||!ns(f)||!ns(g)||!ns(l)||!ns(u)?null:Ae.createElement("path",Zte({},wi(C,!0),{className:ia("recharts-cross",v),d:nZt(r,a,f,g,l,u)}))},uY,R5e;function sZt(){if(R5e)return uY;R5e=1;var e=HDe(),t=e(Object.getPrototypeOf,Object);return uY=t,uY}var dY,L5e;function iZt(){if(L5e)return dY;L5e=1;var e=k1(),t=sZt(),n=T1(),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 dY=u,dY}var aZt=iZt();const oZt=Ii(aZt);var fY,D5e;function lZt(){if(D5e)return fY;D5e=1;var e=k1(),t=T1(),n="[object Boolean]";function r(s){return s===!0||s===!1||t(s)&&e(s)==n}return fY=r,fY}var cZt=lZt();const uZt=Ii(cZt);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 SL(){return SL=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},SL.apply(this,arguments)}function dZt(e,t){return mZt(e)||pZt(e,t)||hZt(e,t)||fZt()}function fZt(){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 hZt(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 pZt(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 mZt(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){xZt(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 xZt(e,t,n){return t=gZt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gZt(e){var t=bZt(e,"string");return T_(t)=="symbol"?t:t+""}function bZt(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)}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},yZt={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},vZt=function(t){var n=U5e(U5e({},yZt),t),r=m.useRef(),s=m.useState(-1),a=dZt(s,2),o=a[0],l=a[1];m.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var I=r.current.getTotalLength();I&&l(I)}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 P=ia("recharts-trapezoid",g);return N?Ae.createElement(Sm,{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(I){var R=I.upperWidth,O=I.lowerWidth,U=I.height,L=I.x,z=I.y;return Ae.createElement(Sm,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:C,duration:w,easing:v},Ae.createElement("path",SL({},wi(n,!0),{className:P,d:z5e(L,z,R,O,U),ref:r})))}):Ae.createElement("g",null,Ae.createElement("path",SL({},wi(n,!0),{className:P,d:z5e(c,u,d,f,x)})))},wZt=["option","shapeType","propTransformer","activeClassName","isActive"];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 CZt(e,t){if(e==null)return{};var n=SZt(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 SZt(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 NL(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){NZt(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 NZt(e,t,n){return t=AZt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AZt(e){var t=jZt(e,"string");return I_(t)=="symbol"?t:t+""}function jZt(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 EZt(e,t){return NL(NL({},t),e)}function _Zt(e,t){return e==="symbols"}function V5e(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return Ae.createElement(yce,n);case"trapezoid":return Ae.createElement(vZt,n);case"sector":return Ae.createElement(g$e,n);case"symbols":if(_Zt(t))return Ae.createElement($$,n);break;default:return null}}function kZt(e){return m.isValidElement(e)?e.props:e}function Jte(e){var t=e.option,n=e.shapeType,r=e.propTransformer,s=r===void 0?EZt:r,a=e.activeClassName,o=a===void 0?"recharts-active-shape":a,l=e.isActive,c=CZt(e,wZt),u;if(m.isValidElement(t))u=m.cloneElement(t,NL(NL({},c),kZt(t)));else if(ji(t))u=t(c);else if(oZt(t)&&!uZt(t)){var d=s(t,c);u=Ae.createElement(V5e,{shapeType:n,elementProps:d})}else{var f=c;u=Ae.createElement(V5e,{shapeType:n,elementProps:f})}return l?Ae.createElement(Sa,{className:o},u):u}function eU(e,t){return t!=null&&"trapezoids"in e.props}function tU(e,t){return t!=null&&"sectors"in e.props}function P_(e,t){return t!=null&&"points"in e.props}function TZt(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 IZt(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function PZt(e,t){var n=e.x===t.x,r=e.y===t.y,s=e.z===t.z;return n&&r&&s}function FZt(e,t){var n;return eU(e,t)?n=TZt:tU(e,t)?n=IZt:P_(e,t)&&(n=PZt),n}function OZt(e,t){var n;return eU(e,t)?n="trapezoids":tU(e,t)?n="sectors":P_(e,t)&&(n="points"),n}function MZt(e,t){if(eU(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(tU(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 P_(e,t)?t.payload:{}}function RZt(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,s=OZt(n,t),a=MZt(n,t),o=r.filter(function(c,u){var d=K3(a,c),f=n.props[s].filter(function(v){var w=FZt(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 hY,W5e;function LZt(){if(W5e)return hY;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 hY=n,hY}var pY,q5e;function A$e(){if(q5e)return pY;q5e=1;var e=iBe(),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 pY=r,pY}var mY,G5e;function DZt(){if(G5e)return mY;G5e=1;var e=LZt(),t=H$(),n=A$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 mY=r,mY}var xY,K5e;function BZt(){if(K5e)return xY;K5e=1;var e=DZt(),t=e();return xY=t,xY}var $Zt=BZt();const AL=Ii($Zt);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 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){j$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 j$e(e,t,n){return t=UZt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UZt(e){var t=zZt(e,"string");return F_(t)=="symbol"?t:t+""}function zZt(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)}var HZt=["Webkit","Moz","O","ms"],VZt=function(t,n){var r=t.replace(/(\w)/,function(a){return a.toUpperCase()}),s=HZt.reduce(function(a,o){return X5e(X5e({},a),{},j$e({},o+r,n))},{});return s[t]=n,s};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 jL(){return jL=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},jL.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 gY(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){Pf(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 WZt(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,_$e(r.key),r)}}function qZt(e,t,n){return Z5e(e.prototype,t),Z5e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function GZt(e,t,n){return t=EL(t),KZt(e,E$e()?Reflect.construct(t,n,EL(e).constructor):t.apply(e,n))}function KZt(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 YZt(e)}function YZt(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 EL(e){return EL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},EL(e)}function XZt(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&&ene(e,t)}function ene(e,t){return ene=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},ene(e,t)}function Pf(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=QZt(e,"string");return PN(t)=="symbol"?t:t+""}function QZt(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 ZZt=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=i9().domain(AL(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},FN=function(e){function t(n){var r;return WZt(this,t),r=GZt(this,t,[n]),Pf(r,"handleDrag",function(s){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(s):r.state.isSlideMoving&&r.handleSlideDrag(s)}),Pf(r,"handleTouchMove",function(s){s.changedTouches!=null&&s.changedTouches.length>0&&r.handleDrag(s.changedTouches[0])}),Pf(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()}),Pf(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Pf(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Pf(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Pf(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 XZt(t,e),qZt(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=sc(a[r],l,r);return ji(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},P=r.pageX-a;P>0?P=Math.min(P,f+x-g-u):P<0&&(P=Math.max(P,f-u)),N[o]=u+P;var I=this.getIndex(N),R=I.startIndex,O=I.endIndex,U=function(){var z=C.length-1;return o==="startX"&&(l>c?R%w===0:O%w===0)||l<c&&O===z||o==="endX"&&(l>c?O%w===0:R%w===0)||l>c&&O===z};this.setState(Pf(Pf({},o,u+P),"brushMoveStartX",r.pageX),function(){v&&U()&&v(I)})}},{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(Pf({},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 Ae.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?Ae.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),P=gY(gY({},wi(this.props,!1)),{},{x:N,y:u,width:d,height:f}),I=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 Ae.createElement(Sa,{tabIndex:0,role:"slider","aria-label":I,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[s],onTouchStart:this.travellerDragStartHandlers[s],onKeyDown:function(O){["ArrowLeft","ArrowRight"].includes(O.key)&&(O.preventDefault(),O.stopPropagation(),l.handleTravellerMoveKeyboard(O.key==="ArrowRight"?1:-1,s))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(x,P))}},{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 Ae.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 Ae.createElement(Sa,{className:"recharts-brush-texts"},Ae.createElement(nL,jL({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,x)-g,y:o+l/2},v),this.getTextOfTick(s)),Ae.createElement(nL,jL({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,P=x.isTravellerFocused;if(!s||!s.length||!ns(l)||!ns(c)||!ns(u)||!ns(d)||u<=0||d<=0)return null;var I=ia("recharts-brush",a),R=Ae.Children.count(o)===1,O=VZt("userSelect","none");return Ae.createElement(Sa,{className:I,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:O},this.renderBackground(),R&&this.renderPanorama(),this.renderSlide(g,v),this.renderTravellerLayer(g,"startX"),this.renderTravellerLayer(v,"endX"),(w||C||N||P||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 Ae.createElement(Ae.Fragment,null,Ae.createElement("rect",{x:s,y:a,width:o,height:l,fill:c,stroke:"none"}),Ae.createElement("line",{x1:s+1,y1:u,x2:s+o-1,y2:u,fill:"none",stroke:"#fff"}),Ae.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 Ae.isValidElement(r)?a=Ae.cloneElement(r,s):ji(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 gY({prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o},a&&a.length?ZZt({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);Pf(FN,"displayName","Brush");Pf(FN,"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 bY,e6e;function JZt(){if(e6e)return bY;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 bY=t,bY}var yY,t6e;function eJt(){if(t6e)return yY;t6e=1;var e=RDe(),t=x2(),n=JZt(),r=hf(),s=H$();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 yY=a,yY}var tJt=eJt();const nJt=Ii(tJt);var V0=function(t,n){var r=t.alwaysShow,s=t.ifOverflow;return r&&(s="extendDomain"),s===n},vY,n6e;function rJt(){if(n6e)return vY;n6e=1;var e=eBe();function t(n,r,s){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:s,writable:!0}):n[r]=s}return vY=t,vY}var wY,r6e;function sJt(){if(r6e)return wY;r6e=1;var e=rJt(),t=ZDe(),n=x2();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 wY=r,wY}var iJt=sJt();const aJt=Ii(iJt);var CY,s6e;function oJt(){if(s6e)return CY;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 CY=e,CY}var SY,i6e;function lJt(){if(i6e)return SY;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 SY=t,SY}var NY,a6e;function cJt(){if(a6e)return NY;a6e=1;var e=oJt(),t=lJt(),n=x2(),r=hf(),s=H$();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 NY=a,NY}var uJt=cJt();const k$e=Ii(uJt);var dJt=["x","y"];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 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)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tne.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 z7(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){fJt(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 fJt(e,t,n){return t=hJt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hJt(e){var t=pJt(e,"string");return O_(t)=="symbol"?t:t+""}function pJt(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 mJt(e,t){if(e==null)return{};var n=xJt(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 xJt(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 gJt(e,t){var n=e.x,r=e.y,s=mJt(e,dJt),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 z7(z7(z7(z7(z7({},t),s),o?{x:o}:{}),c?{y:c}:{}),{},{height:d,width:x,name:t.name,radius:t.radius})}function l6e(e){return Ae.createElement(Jte,tne({shapeType:"rectangle",propTransformer:gJt,activeClassName:"recharts-active-bar"},e))}var bJt=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||X3(),n)}},yJt=["value","background"],T$e;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 vJt(e,t){if(e==null)return{};var n=wJt(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 wJt(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 _L(){return _L=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},_L.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 Ol(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){by(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 CJt(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,P$e(r.key),r)}}function SJt(e,t,n){return u6e(e.prototype,t),u6e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function NJt(e,t,n){return t=kL(t),AJt(e,I$e()?Reflect.construct(t,n,kL(e).constructor):t.apply(e,n))}function AJt(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 jJt(e)}function jJt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function I$e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(I$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 EJt(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&&nne(e,t)}function nne(e,t){return nne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},nne(e,t)}function by(e,t,n){return t=P$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P$e(e){var t=_Jt(e,"string");return ON(t)=="symbol"?t:t+""}function _Jt(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 t8=function(e){function t(){var n;CJt(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=NJt(this,t,[].concat(s)),by(n,"state",{isAnimationFinished:!1}),by(n,"id",S5("recharts-bar-")),by(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),o&&o()}),by(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),o&&o()}),n}return EJt(t,e),SJt(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=wi(this.props,!1);return r&&r.map(function(f,x){var g=x===c,v=g?u:o,w=Ol(Ol(Ol({},d),f),{},{isActive:g,option:v,index:x,dataKey:l,onAnimationStart:s.handleAnimationStart,onAnimationEnd:s.handleAnimationEnd});return Ae.createElement(Sa,_L({className:"recharts-bar-rectangle"},r_(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)}),Ae.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 Ae.createElement(Sm,{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 P=x&&x[N];if(P){var I=Sl(P.x,C.x),R=Sl(P.y,C.y),O=Sl(P.width,C.width),U=Sl(P.height,C.height);return Ol(Ol({},C),{},{x:I(v),y:R(v),width:O(v),height:U(v)})}if(o==="horizontal"){var L=Sl(0,C.height),z=L(v);return Ol(Ol({},C),{},{y:C.y+C.height-z,height:z})}var X=Sl(0,C.width),ne=X(v);return Ol(Ol({},C),{},{width:ne})});return Ae.createElement(Sa,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||!K3(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=wi(this.props.background,!1);return a.map(function(u,d){u.value;var f=u.background,x=vJt(u,yJt);if(!f)return null;var g=Ol(Ol(Ol(Ol(Ol({},x),{},{fill:"#eee"},f),c),r_(r.props,u,d)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:o,index:d,className:"recharts-bar-background-rectangle"});return Ae.createElement(l6e,_L({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=of(d,e8);if(!f)return null;var x=u==="vertical"?o[0].height/2:o[0].width/2,g=function(C,N){var P=Array.isArray(C.value)?C.value[1]:C.value;return{x:C.x,y:C.y,value:P,errorVal:sc(C,N)}},v={clipPath:r?"url(#clipPath-".concat(s,")"):null};return Ae.createElement(Sa,v,f.map(function(w){return Ae.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=ia("recharts-bar",o),P=l&&l.allowDataOverflow,I=c&&c.allowDataOverflow,R=P||I,O=Ci(w)?this.id:w;return Ae.createElement(Sa,{className:N},P||I?Ae.createElement("defs",null,Ae.createElement("clipPath",{id:"clipPath-".concat(O)},Ae.createElement("rect",{x:P?u:u-f/2,y:I?d:d-x/2,width:P?f:f*2,height:I?x:x*2}))):null,Ae.createElement(Sa,{className:"recharts-bar-rectangles",clipPath:R?"url(#clipPath-".concat(O,")"):null},v?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(R,O),(!g||C)&&H0.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);T$e=t8;by(t8,"displayName","Bar");by(t8,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!mm.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});by(t8,"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=QKt(r,n);if(!g)return null;var v=t.layout,w=n.type.defaultProps,C=w!==void 0?Ol(Ol({},w),n.props):n.props,N=C.dataKey,P=C.children,I=C.minPointSize,R=v==="horizontal"?o:a,O=u?R.scale.domain():null,U=iYt({numericAxis:R}),L=of(P,Gle),z=f.map(function(X,ne){var J,K,re,he,Q,ie;u?J=ZKt(u[d+ne],O):(J=sc(X,N),Array.isArray(J)||(J=[U,J]));var oe=bJt(I,T$e.defaultProps.minPointSize)(J[1],ne);if(v==="horizontal"){var G,V=[o.scale(J[0]),o.scale(J[1])],te=V[0],ae=V[1];K=X3e({axis:a,ticks:l,bandSize:s,offset:g.offset,entry:X,index:ne}),re=(G=ae??te)!==null&&G!==void 0?G:void 0,he=g.size;var fe=te-ae;if(Q=Number.isNaN(fe)?0:fe,ie={x:K,y:o.y,width:he,height:o.height},Math.abs(oe)>0&&Math.abs(Q)<Math.abs(oe)){var Ne=cm(Q||oe)*(Math.abs(oe)-Math.abs(Q));re-=Ne,Q+=Ne}}else{var me=[a.scale(J[0]),a.scale(J[1])],we=me[0],xe=me[1];if(K=we,re=X3e({axis:o,ticks:c,bandSize:s,offset:g.offset,entry:X,index:ne}),he=xe-we,Q=g.size,ie={x:a.x,y:re,width:a.width,height:Q},Math.abs(oe)>0&&Math.abs(he)<Math.abs(oe)){var ye=cm(he||oe)*(Math.abs(oe)-Math.abs(he));he+=ye}}return Ol(Ol(Ol({},X),{},{x:K,y:re,width:he,height:Q,value:u?J:J[1],payload:X,background:ie},L[ne]&&L[ne].props),{},{tooltipPayload:[p$e(n,X)],tooltipPosition:{x:K+he/2,y:re+Q/2}})});return Ol({data:z,layout:v},x)});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 kJt(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,F$e(r.key),r)}}function TJt(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 Qp(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){nU(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 nU(e,t,n){return t=F$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F$e(e){var t=IJt(e,"string");return M_(t)=="symbol"?t:t+""}function IJt(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)}var O$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=!!Lf(u,t8);return d.reduce(function(g,v){var w=n[v],C=w.orientation,N=w.domain,P=w.padding,I=P===void 0?{}:P,R=w.mirror,O=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 K=N[1]-N[0],re=1/0,he=w.categoricalDomain.sort(L$t);if(he.forEach(function(me,we){we>0&&(re=Math.min((me||0)-(he[we-1]||0),re))}),Number.isFinite(re)){var Q=re/K,ie=w.layout==="vertical"?r.height:r.width;if(w.padding==="gap"&&(L=Q*ie/2),w.padding==="no-gap"){var oe=G3(t.barCategoryGap,Q*ie),G=Q*ie/2;L=G-oe-(G-oe)/ie*oe}}}s==="xAxis"?z=[r.left+(I.left||0)+(L||0),r.left+r.width-(I.right||0)-(L||0)]:s==="yAxis"?z=c==="horizontal"?[r.top+r.height-(I.bottom||0),r.top+(I.top||0)]:[r.top+(I.top||0)+(L||0),r.top+r.height-(I.bottom||0)-(L||0)]:z=w.range,O&&(z=[z[1],z[0]]);var V=YKt(w,a,x),te=V.scale,ae=V.realScaleType;te.domain(N).range(z),XKt(te);var fe=sYt(te,Qp(Qp({},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 Ne=Qp(Qp(Qp({},w),fe),{},{realScaleType:ae,x:X,y:ne,scale:te,width:s==="xAxis"?r.width:w.width,height:s==="yAxis"?r.height:w.height});return Ne.bandSize=xL(Ne,fe),!w.hide&&s==="xAxis"?f[U]+=(J?-1:1)*Ne.height:w.hide||(f[U]+=(J?-1:1)*Ne.width),Qp(Qp({},g),{},nU({},v,Ne))},{})},M$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)}},PJt=function(t){var n=t.x1,r=t.y1,s=t.x2,a=t.y2;return M$e({x:n,y:r},{x:s,y:a})},R$e=function(){function e(t){kJt(this,e),this.scale=t}return TJt(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)}}])}();nU(R$e,"EPS",1e-4);var vce=function(t){var n=Object.keys(t).reduce(function(r,s){return Qp(Qp({},r),{},nU({},s,R$e.create(t[s])))},{});return Qp(Qp({},n),{},{apply:function(s){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,l=a.position;return aJt(s,function(c,u){return n[u].apply(c,{bandAware:o,position:l})})},isInRange:function(s){return k$e(s,function(a,o){return n[o].isInRange(a)})}})};function FJt(e){return(e%180+180)%180}var OJt=function(t){var n=t.width,r=t.height,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=FJt(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)},AY,h6e;function MJt(){if(h6e)return AY;h6e=1;var e=x2(),t=cT(),n=U$();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 AY=r,AY}var jY,p6e;function RJt(){if(p6e)return jY;p6e=1;var e=A$e();function t(n){var r=e(n),s=r%1;return r===r?s?r-s:r:0}return jY=t,jY}var EY,m6e;function LJt(){if(m6e)return EY;m6e=1;var e=GDe(),t=x2(),n=RJt(),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 EY=s,EY}var _Y,x6e;function DJt(){if(x6e)return _Y;x6e=1;var e=MJt(),t=LJt(),n=e(t);return _Y=n,_Y}var BJt=DJt();const $Jt=Ii(BJt);var UJt=lDe();const zJt=Ii(UJt);var HJt=zJt(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),L$e=m.createContext(void 0),D$e=m.createContext({}),B$e=m.createContext(void 0),$$e=m.createContext(0),U$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=HJt(a);return Ae.createElement(wce.Provider,{value:r},Ae.createElement(Cce.Provider,{value:s},Ae.createElement(D$e.Provider,{value:a},Ae.createElement(L$e.Provider,{value:d},Ae.createElement(B$e.Provider,{value:o},Ae.createElement($$e.Provider,{value:u},Ae.createElement(U$e.Provider,{value:c},l)))))))},VJt=function(){return m.useContext(B$e)},z$e=function(t){var n=m.useContext(wce);n==null&&X3();var r=n[t];return r==null&&X3(),r},WJt=function(){var t=m.useContext(wce);return Mb(t)},qJt=function(){var t=m.useContext(Cce),n=$Jt(t,function(r){return k$e(r.domain,Number.isFinite)});return n||Mb(t)},H$e=function(t){var n=m.useContext(Cce);n==null&&X3();var r=n[t];return r==null&&X3(),r},GJt=function(){var t=m.useContext(L$e);return t},KJt=function(){return m.useContext(D$e)},Sce=function(){return m.useContext(U$e)},Nce=function(){return m.useContext($$e)};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 YJt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function XJt(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 QJt(e,t,n){return XJt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ZJt(e,t,n){return t=TL(t),JJt(e,V$e()?Reflect.construct(t,n||[],TL(e).constructor):t.apply(e,n))}function JJt(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 een(e)}function een(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 TL(e){return TL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},TL(e)}function ten(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 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=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=nen(e,"string");return MN(t)=="symbol"?t:t+""}function nen(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)}function ren(e,t){return oen(e)||aen(e,t)||ien(e,t)||sen()}function sen(){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 ien(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 aen(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 oen(e){if(Array.isArray(e))return e}function sne(){return sne=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},sne.apply(this,arguments)}var len=function(t,n){var r;return Ae.isValidElement(t)?r=Ae.cloneElement(t,n):ji(t)?r=t(n):r=Ae.createElement("line",sne({},n,{className:"recharts-reference-line-line"})),r},cen=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(V0(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,P=t.x.apply(N,{position:o});if(V0(u,"discard")&&!t.x.isInRange(P))return null;var I=[{x:P,y:f+g},{x:P,y:f}];return l==="top"?I.reverse():I}if(s){var R=u.segment,O=R.map(function(U){return t.apply(U,{position:o})});return V0(u,"discard")&&nJt(O,function(U){return!t.isInRange(U)})?null:O}return null};function uen(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=VJt(),d=z$e(s),f=H$e(a),x=GJt();if(!u||!x)return null;Xg(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var g=vce({x:d.scale,y:f.scale}),v=rc(t),w=rc(n),C=r&&r.length===2,N=cen(g,v,w,C,x,e.position,d.orientation,f.orientation,e);if(!N)return null;var P=ren(N,2),I=P[0],R=I.x,O=I.y,U=P[1],L=U.x,z=U.y,X=V0(e,"hidden")?"url(#".concat(u,")"):void 0,ne=y6e(y6e({clipPath:X},wi(e,!0)),{},{x1:R,y1:O,x2:L,y2:z});return Ae.createElement(Sa,{className:ia("recharts-reference-line",l)},len(o,ne),Eu.renderCallByParent(e,PJt({x1:R,y1:O,x2:L,y2:z})))}var jce=function(e){function t(){return YJt(this,t),ZJt(this,t,arguments)}return ten(t,e),QJt(t,[{key:"render",value:function(){return Ae.createElement(uen,this.props)}}])}(Ae.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 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)}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 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){rU(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 den(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fen(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,G$e(r.key),r)}}function hen(e,t,n){return fen(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function pen(e,t,n){return t=IL(t),men(e,q$e()?Reflect.construct(t,n||[],IL(e).constructor):t.apply(e,n))}function men(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 xen(e)}function xen(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 IL(e){return IL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},IL(e)}function gen(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&&ane(e,t)}function ane(e,t){return ane=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},ane(e,t)}function rU(e,t,n){return t=G$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G$e(e){var t=ben(e,"string");return RN(t)=="symbol"?t:t+""}function ben(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 yen=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 V0(t,"discard")&&!o.isInRange(l)?null:l},sU=function(e){function t(){return den(this,t),pen(this,t,arguments)}return gen(t,e),hen(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=rc(s),d=rc(a);if(Xg(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!d)return null;var f=yen(this.props);if(!f)return null;var x=f.x,g=f.y,v=this.props,w=v.shape,C=v.className,N=V0(this.props,"hidden")?"url(#".concat(c,")"):void 0,P=C6e(C6e({clipPath:N},wi(this.props,!0)),{},{cx:x,cy:g});return Ae.createElement(Sa,{className:ia("recharts-reference-dot",C)},t.renderDot(w,P),Eu.renderCallByParent(this.props,{x:x-o,y:g-o,width:2*o,height:2*o}))}}])}(Ae.Component);rU(sU,"displayName","ReferenceDot");rU(sU,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});rU(sU,"renderDot",function(e,t){var n;return Ae.isValidElement(e)?n=Ae.cloneElement(e,t):ji(e)?n=e(t):n=Ae.createElement(J$,ine({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function one(){return one=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},one.apply(this,arguments)}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 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){iU(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 ven(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wen(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,Y$e(r.key),r)}}function Cen(e,t,n){return wen(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Sen(e,t,n){return t=PL(t),Nen(e,K$e()?Reflect.construct(t,n||[],PL(e).constructor):t.apply(e,n))}function Nen(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 Aen(e)}function Aen(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function K$e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(K$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 jen(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&&lne(e,t)}function lne(e,t){return lne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},lne(e,t)}function iU(e,t,n){return t=Y$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y$e(e){var t=Een(e,"string");return LN(t)=="symbol"?t:t+""}function Een(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 _en=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 V0(a,"discard")&&(!x.isInRange(g)||!x.isInRange(v))?null:M$e(g,v)},aU=function(e){function t(){return ven(this,t),Sen(this,t,arguments)}return jen(t,e),Cen(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;Xg(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=rc(s),x=rc(a),g=rc(o),v=rc(l),w=this.props.shape;if(!f&&!x&&!g&&!v&&!w)return null;var C=_en(f,x,g,v,this.props);if(!C&&!w)return null;var N=V0(this.props,"hidden")?"url(#".concat(d,")"):void 0;return Ae.createElement(Sa,{className:ia("recharts-reference-area",c)},t.renderRect(w,N6e(N6e({clipPath:N},wi(this.props,!0)),C)),Eu.renderCallByParent(this.props,C))}}])}(Ae.Component);iU(aU,"displayName","ReferenceArea");iU(aU,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});iU(aU,"renderRect",function(e,t){var n;return Ae.isValidElement(e)?n=Ae.cloneElement(e,t):ji(e)?n=e(t):n=Ae.createElement(yce,one({},t,{className:"recharts-reference-area-rect"})),n});function X$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 ken(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return OJt(r,n)}function Ten(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 FL(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 Ien(e,t){return X$e(e,t+1)}function Pen(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:X$e(r,u)};var w=c,C,N=function(){return C===void 0&&(C=n(v,w)),C},P=v.coordinate,I=c===0||FL(e,P,N,d,l);I||(c=0,d=o,u+=1),I&&(d=P+e*(N()/2+s),c+=u)},x;u<=a.length;)if(x=f(),x)return x.v;return[]}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 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 Su(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){Fen(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 Fen(e,t,n){return t=Oen(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oen(e){var t=Men(e,"string");return R_(t)=="symbol"?t:t+""}function Men(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 Ren(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=Su(Su({},g),{},{tickCoord:C>0?g.coordinate-C*e:g.coordinate})}else a[x]=g=Su(Su({},g),{},{tickCoord:g.coordinate});var N=FL(e,g.tickCoord,w,l,c);N&&(c=g.tickCoord-e*(w()/2+s),a[x]=Su(Su({},g),{},{isShow:!0}))},d=o-1;d>=0;d--)u(d);return a}function Len(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=Su(Su({},d),{},{tickCoord:x>0?d.coordinate-x*e:d.coordinate});var g=FL(e,d.tickCoord,function(){return f},c,u);g&&(u=d.tickCoord-e*(f/2+s),o[l-1]=Su(Su({},d),{},{isShow:!0}))}for(var v=a?l-1:l,w=function(P){var I=o[P],R,O=function(){return R===void 0&&(R=n(I,P)),R};if(P===0){var U=e*(I.coordinate-e*O()/2-c);o[P]=I=Su(Su({},I),{},{tickCoord:U<0?I.coordinate-U*e:I.coordinate})}else o[P]=I=Su(Su({},I),{},{tickCoord:I.coordinate});var L=FL(e,I.tickCoord,O,c,u);L&&(c=I.tickCoord+e*(O()/2+s),o[P]=Su(Su({},I),{},{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(ns(c)||mm.isSsr)return Ien(s,typeof c=="number"&&ns(c)?c:0);var x=[],g=l==="top"||l==="bottom"?"width":"height",v=d&&g==="width"?s9(d,{fontSize:t,letterSpacing:n}):{width:0,height:0},w=function(I,R){var O=ji(u)?u(I.value,R):I.value;return g==="width"?ken(s9(O,{fontSize:t,letterSpacing:n}),v,f):s9(O,{fontSize:t,letterSpacing:n})[g]},C=s.length>=2?cm(s[1].coordinate-s[0].coordinate):1,N=Ten(a,C,g);return c==="equidistantPreserveStart"?Pen(C,N,w,s,o):(c==="preserveStart"||c==="preserveStartEnd"?x=Len(C,N,w,s,o,c==="preserveStartEnd"):x=Ren(C,N,w,s,o),x.filter(function(P){return P.isShow}))}var Den=["viewBox"],Ben=["viewBox"],$en=["ticks"];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 $C(){return $C=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},$C.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 Yu(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 kY(e,t){if(e==null)return{};var n=Uen(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 Uen(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 zen(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,Z$e(r.key),r)}}function Hen(e,t,n){return E6e(e.prototype,t),E6e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ven(e,t,n){return t=OL(t),Wen(e,Q$e()?Reflect.construct(t,n,OL(e).constructor):t.apply(e,n))}function Wen(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 qen(e)}function qen(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 Gen(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 _ce(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=Ken(e,"string");return DN(t)=="symbol"?t:t+""}function Ken(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 n8=function(e){function t(n){var r;return zen(this,t),r=Ven(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return Gen(t,e),Hen(t,[{key:"shouldComponentUpdate",value:function(r,s){var a=r.viewBox,o=kY(r,Den),l=this.props,c=l.viewBox,u=kY(l,Ben);return!h4(a,c)||!h4(o,u)||!h4(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,P,I=f?-1:1,R=r.tickSize||d,O=ns(r.tickCoord)?r.tickCoord:r.coordinate;switch(u){case"top":g=v=r.coordinate,C=o+ +!f*c,w=C-I*R,P=w-I*x,N=O;break;case"left":w=C=r.coordinate,v=a+ +!f*l,g=v-I*R,N=g-I*x,P=O;break;case"right":w=C=r.coordinate,v=a+ +f*l,g=v+I*R,N=g+I*x,P=O;break;default:g=v=r.coordinate,C=o+ +f*c,w=C+I*R,P=w+I*x,N=O;break}return{line:{x1:g,y1:w,x2:v,y2:C},tick:{x:N,y:P}}}},{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=Yu(Yu(Yu({},wi(this.props,!1)),wi(d,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var x=+(c==="top"&&!u||c==="bottom"&&u);f=Yu(Yu({},f),{},{x1:s,y1:a+x*l,x2:s+o,y2:a+x*l})}else{var g=+(c==="left"&&!u||c==="right"&&u);f=Yu(Yu({},f),{},{x1:s+g*o,y1:a,x2:s+g*o,y2:a+l})}return Ae.createElement("line",$C({},f,{className:ia("recharts-cartesian-axis-line",np(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(Yu(Yu({},this.props),{},{ticks:r}),s,a),v=this.getTickTextAnchor(),w=this.getTickVerticalAnchor(),C=wi(this.props,!1),N=wi(d,!1),P=Yu(Yu({},C),{},{fill:"none"},wi(c,!1)),I=g.map(function(R,O){var U=o.getTickLineCoord(R),L=U.line,z=U.tick,X=Yu(Yu(Yu(Yu({textAnchor:v,verticalAnchor:w},C),{},{stroke:"none",fill:u},N),z),{},{index:O,payload:R,visibleTicksCount:g.length,tickFormatter:f});return Ae.createElement(Sa,$C({className:"recharts-cartesian-axis-tick",key:"tick-".concat(R.value,"-").concat(R.coordinate,"-").concat(R.tickCoord)},r_(o.props,R,O)),c&&Ae.createElement("line",$C({},P,L,{className:ia("recharts-cartesian-axis-tick-line",np(c,"className"))})),d&&t.renderTickItem(d,X,"".concat(ji(f)?f(R.value,O):R.value).concat(x||"")))});return Ae.createElement("g",{className:"recharts-cartesian-axis-ticks"},I)}},{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=kY(f,$en),v=x;return ji(c)&&(v=x&&x.length>0?c(this.props):c(g)),o<=0||l<=0||!v||!v.length?null:Ae.createElement(Sa,{className:ia("recharts-cartesian-axis",u),ref:function(C){r.layerReference=C}},a&&this.renderAxisLine(),this.renderTicks(v,this.state.fontSize,this.state.letterSpacing),Eu.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,s,a){var o;return Ae.isValidElement(r)?o=Ae.cloneElement(r,s):ji(r)?o=r(s):o=Ae.createElement(nL,$C({},s,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(m.Component);_ce(n8,"displayName","CartesianAxis");_ce(n8,"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 Yen=["x1","y1","x2","y2","key"],Xen=["offset"];function Q3(e){"@babel/helpers - typeof";return Q3=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},Q3(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 _u(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){Qen(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 Qen(e,t,n){return t=Zen(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zen(e){var t=Jen(e,"string");return Q3(t)=="symbol"?t:t+""}function Jen(e,t){if(Q3(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Q3(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function aw(){return aw=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},aw.apply(this,arguments)}function k6e(e,t){if(e==null)return{};var n=etn(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 etn(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 ttn=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 Ae.createElement("rect",{x:s,y:a,ry:c,width:o,height:l,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function J$e(e,t){var n;if(Ae.isValidElement(e))n=Ae.cloneElement(e,t);else if(ji(e))n=e(t);else{var r=t.x1,s=t.y1,a=t.x2,o=t.y2,l=t.key,c=k6e(t,Yen),u=wi(c,!1);u.offset;var d=k6e(u,Xen);n=Ae.createElement("line",aw({},d,{x1:r,y1:s,x2:a,y2:o,fill:"none",key:l}))}return n}function ntn(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=_u(_u({},e),{},{x1:t,y1:l,x2:t+n,y2:l,key:"line-".concat(c),index:c});return J$e(s,u)});return Ae.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function rtn(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=_u(_u({},e),{},{x1:l,y1:t,x2:l,y2:t+n,key:"line-".concat(c),index:c});return J$e(s,u)});return Ae.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function stn(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 Ae.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 Ae.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function itn(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 Ae.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 Ae.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var atn=function(t,n){var r=t.xAxis,s=t.width,a=t.height,o=t.offset;return f$e(Ece(_u(_u(_u({},n8.defaultProps),r),{},{ticks:Bg(r,!0),viewBox:{x:0,y:0,width:s,height:a}})),o.left,o.left+o.width,n)},otn=function(t,n){var r=t.yAxis,s=t.width,a=t.height,o=t.offset;return f$e(Ece(_u(_u(_u({},n8.defaultProps),r),{},{ticks:Bg(r,!0),viewBox:{x:0,y:0,width:s,height:a}})),o.top,o.top+o.height,n)},nC={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function eUe(e){var t,n,r,s,a,o,l=Sce(),c=Nce(),u=KJt(),d=_u(_u({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:nC.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:nC.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:nC.horizontal,horizontalFill:(s=e.horizontalFill)!==null&&s!==void 0?s:nC.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:nC.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:nC.verticalFill,x:ns(e.x)?e.x:u.left,y:ns(e.y)?e.y:u.top,width:ns(e.width)?e.width:u.width,height:ns(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,P=WJt(),I=qJt();if(!ns(g)||g<=0||!ns(v)||v<=0||!ns(f)||f!==+f||!ns(x)||x!==+x)return null;var R=d.verticalCoordinatesGenerator||atn,O=d.horizontalCoordinatesGenerator||otn,U=d.horizontalPoints,L=d.verticalPoints;if((!U||!U.length)&&ji(O)){var z=C&&C.length,X=O({yAxis:I?_u(_u({},I),{},{ticks:z?C:I.ticks}):void 0,width:l,height:c,offset:u},z?!0:w);Xg(Array.isArray(X),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Q3(X),"]")),Array.isArray(X)&&(U=X)}if((!L||!L.length)&&ji(R)){var ne=N&&N.length,J=R({xAxis:P?_u(_u({},P),{},{ticks:ne?N:P.ticks}):void 0,width:l,height:c,offset:u},ne?!0:w);Xg(Array.isArray(J),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Q3(J),"]")),Array.isArray(J)&&(L=J)}return Ae.createElement("g",{className:"recharts-cartesian-grid"},Ae.createElement(ttn,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),Ae.createElement(ntn,aw({},d,{offset:u,horizontalPoints:U,xAxis:P,yAxis:I})),Ae.createElement(rtn,aw({},d,{offset:u,verticalPoints:L,xAxis:P,yAxis:I})),Ae.createElement(stn,aw({},d,{horizontalPoints:U})),Ae.createElement(itn,aw({},d,{verticalPoints:L})))}eUe.displayName="CartesianGrid";var ltn=["type","layout","connectNulls","ref"],ctn=["key"];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 T6e(e,t){if(e==null)return{};var n=utn(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 utn(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 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 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 kf(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){Zp(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 rC(e){return ptn(e)||htn(e)||ftn(e)||dtn()}function dtn(){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 ftn(e,t){if(e){if(typeof e=="string")return une(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 une(e,t)}}function htn(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ptn(e){if(Array.isArray(e))return une(e)}function une(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 mtn(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,nUe(r.key),r)}}function xtn(e,t,n){return P6e(e.prototype,t),P6e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function gtn(e,t,n){return t=ML(t),btn(e,tUe()?Reflect.construct(t,n,ML(e).constructor):t.apply(e,n))}function btn(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 ytn(e)}function ytn(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 vtn(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&&dne(e,t)}function dne(e,t){return dne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},dne(e,t)}function Zp(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=wtn(e,"string");return BN(t)=="symbol"?t:t+""}function wtn(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 I0=function(e){function t(){var n;mtn(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=gtn(this,t,[].concat(s)),Zp(n,"state",{isAnimationFinished:!0,totalLength:0}),Zp(n,"generateSimpleStrokeDasharray",function(o,l){return"".concat(l,"px ").concat(o-l,"px")}),Zp(n,"getStrokeDasharray",function(o,l,c){var u=c.reduce(function(N,P){return N+P});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(rC(c.slice(0,v)),[f-w]);break}var C=g.length%2===0?[0,x]:[x];return[].concat(rC(t.repeat(c,d)),rC(g),C).map(function(N){return"".concat(N,"px")}).join(", ")}),Zp(n,"id",S5("recharts-line-")),Zp(n,"pathRef",function(o){n.mainCurve=o}),Zp(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Zp(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return vtn(t,e),xtn(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=of(d,e8);if(!f)return null;var x=function(w,C){return{x:w.x,y:w.y,value:w.value,errorVal:sc(w.payload,C)}},g={clipPath:r?"url(#clipPath-".concat(s,")"):null};return Ae.createElement(Sa,g,f.map(function(v){return Ae.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=wi(this.props,!1),x=wi(c,!0),g=u.map(function(w,C){var N=kf(kf(kf({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 Ae.createElement(Sa,l9({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,ltn),x=kf(kf(kf({},wi(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 Ae.createElement(l3,l9({},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,P=N.prevPoints,I=N.totalLength;return Ae.createElement(Sm,{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 O=R.t;if(P){var U=P.length/l.length,L=l.map(function(K,re){var he=Math.floor(re*U);if(P[he]){var Q=P[he],ie=Sl(Q.x,K.x),oe=Sl(Q.y,K.y);return kf(kf({},K),{},{x:ie(O),y:oe(O)})}if(v){var G=Sl(w*2,K.x),V=Sl(C/2,K.y);return kf(kf({},K),{},{x:G(O),y:V(O)})}return kf(kf({},K),{},{x:K.x,y:K.y})});return a.renderCurveStatically(L,r,s)}var z=Sl(0,I),X=z(O),ne;if(c){var J="".concat(c).split(/[,\s]+/gim).map(function(K){return parseFloat(K)});ne=a.getStrokeDasharray(X,I,J)}else ne=a.generateSimpleStrokeDasharray(I,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||!K3(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,P=l.length===1,I=ia("recharts-line",c),R=u&&u.allowDataOverflow,O=d&&d.allowDataOverflow,U=R||O,L=Ci(C)?this.id:C,z=(r=wi(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},X=z.r,ne=X===void 0?3:X,J=z.strokeWidth,K=J===void 0?2:J,re=hDe(o)?o:{},he=re.clipDot,Q=he===void 0?!0:he,ie=ne*2+K;return Ae.createElement(Sa,{className:I},R||O?Ae.createElement("defs",null,Ae.createElement("clipPath",{id:"clipPath-".concat(L)},Ae.createElement("rect",{x:R?x:x-g/2,y:O?f:f-v/2,width:R?g:g*2,height:O?v:v*2})),!Q&&Ae.createElement("clipPath",{id:"clipPath-dots-".concat(L)},Ae.createElement("rect",{x:x-ie/2,y:f-ie/2,width:g+ie,height:v+ie}))):null,!P&&this.renderCurve(U,L),this.renderErrorBar(U,L),(P||o)&&this.renderDots(U,Q,L),(!w||N)&&H0.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(rC(r),[0]):r,o=[],l=0;l<s;++l)o=[].concat(rC(o),rC(a));return o}},{key:"renderDotItem",value:function(r,s){var a;if(Ae.isValidElement(r))a=Ae.cloneElement(r,s);else if(ji(r))a=r(s);else{var o=s.key,l=T6e(s,ctn),c=ia("recharts-line-dot",typeof r!="boolean"?r.className:"");a=Ae.createElement(J$,l9({key:o},l,{className:c}))}return a}}])}(m.PureComponent);Zp(I0,"displayName","Line");Zp(I0,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!mm.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Zp(I0,"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=sc(x,o);return d==="horizontal"?{x:TN({axis:n,ticks:s,bandSize:l,entry:x,index:g}),y:Ci(v)?null:r.scale(v),value:v,payload:x}:{x:Ci(v)?null:n.scale(v),y:TN({axis:r,ticks:a,bandSize:l,entry:x,index:g}),value:v,payload:x}});return kf({points:f,layout:d},u)});var Ctn=["layout","type","stroke","connectNulls","isRange","ref"],Stn=["key"],rUe;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 sUe(e,t){if(e==null)return{};var n=Ntn(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 Ntn(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 ow(){return ow=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},ow.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 jb(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){P0(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 Atn(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,aUe(r.key),r)}}function jtn(e,t,n){return O6e(e.prototype,t),O6e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Etn(e,t,n){return t=RL(t),_tn(e,iUe()?Reflect.construct(t,n,RL(e).constructor):t.apply(e,n))}function _tn(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 ktn(e)}function ktn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function iUe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(iUe=function(){return!!e})()}function RL(e){return RL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},RL(e)}function Ttn(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 P0(e,t,n){return t=aUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aUe(e){var t=Itn(e,"string");return $N(t)=="symbol"?t:t+""}function Itn(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 E5=function(e){function t(){var n;Atn(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=Etn(this,t,[].concat(s)),P0(n,"state",{isAnimationFinished:!0}),P0(n,"id",S5("recharts-area-")),P0(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),ji(o)&&o()}),P0(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),ji(o)&&o()}),n}return Ttn(t,e),jtn(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=wi(this.props,!1),g=wi(u,!0),v=d.map(function(C,N){var P=jb(jb(jb({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,P)}),w={clipPath:r?"url(#clipPath-".concat(s?"":"dots-").concat(a,")"):null};return Ae.createElement(Sa,ow({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=gy(o.map(function(x){return x.y||0}));return ns(a)&&typeof a=="number"?f=Math.max(a,f):a&&Array.isArray(a)&&a.length&&(f=Math.max(gy(a.map(function(x){return x.y||0})),f)),ns(f)?Ae.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=gy(o.map(function(x){return x.x||0}));return ns(a)&&typeof a=="number"?f=Math.max(a,f):a&&Array.isArray(a)&&a.length&&(f=Math.max(gy(a.map(function(x){return x.x||0})),f)),ns(f)?Ae.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=sUe(l,Ctn);return Ae.createElement(Sa,{clipPath:a?"url(#clipPath-".concat(o,")"):null},Ae.createElement(l3,ow({},wi(g,!0),{points:r,connectNulls:f,type:u,baseLine:s,layout:c,stroke:"none",className:"recharts-area-area"})),d!=="none"&&Ae.createElement(l3,ow({},wi(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:f,fill:"none",points:r})),d!=="none"&&x&&Ae.createElement(l3,ow({},wi(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 Ae.createElement(Sm,{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 P=N.t;if(w){var I=w.length/l.length,R=l.map(function(z,X){var ne=Math.floor(X*I);if(w[ne]){var J=w[ne],K=Sl(J.x,z.x),re=Sl(J.y,z.y);return jb(jb({},z),{},{x:K(P),y:re(P)})}return z}),O;if(ns(c)&&typeof c=="number"){var U=Sl(C,c);O=U(P)}else if(Ci(c)||YA(c)){var L=Sl(C,0);O=L(P)}else O=c.map(function(z,X){var ne=Math.floor(X*I);if(C[ne]){var J=C[ne],K=Sl(J.x,z.x),re=Sl(J.y,z.y);return jb(jb({},z),{},{x:K(P),y:re(P)})}return z});return a.renderAreaStatically(R,O,r,s)}return Ae.createElement(Sa,null,Ae.createElement("defs",null,Ae.createElement("clipPath",{id:"animationClipPath-".concat(s)},a.renderClipRect(P))),Ae.createElement(Sa,{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||!K3(d,o)||!K3(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,P=l.length===1,I=ia("recharts-area",c),R=f&&f.allowDataOverflow,O=x&&x.allowDataOverflow,U=R||O,L=Ci(C)?this.id:C,z=(r=wi(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},X=z.r,ne=X===void 0?3:X,J=z.strokeWidth,K=J===void 0?2:J,re=hDe(o)?o:{},he=re.clipDot,Q=he===void 0?!0:he,ie=ne*2+K;return Ae.createElement(Sa,{className:I},R||O?Ae.createElement("defs",null,Ae.createElement("clipPath",{id:"clipPath-".concat(L)},Ae.createElement("rect",{x:R?d:d-g/2,y:O?u:u-v/2,width:R?g:g*2,height:O?v:v*2})),!Q&&Ae.createElement("clipPath",{id:"clipPath-dots-".concat(L)},Ae.createElement("rect",{x:d-ie/2,y:u-ie/2,width:g+ie,height:v+ie}))):null,P?null:this.renderArea(U,L),(o||P)&&this.renderDots(U,Q,L),(!w||N)&&H0.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);rUe=E5;P0(E5,"displayName","Area");P0(E5,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!mm.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});P0(E5,"getBaseValue",function(e,t,n,r){var s=e.layout,a=e.baseValue,o=t.props.baseValue,l=o??a;if(ns(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]});P0(E5,"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=rUe.getBaseValue(t,n,r,s),C=g==="horizontal",N=!1,P=f.map(function(R,O){var U;v?U=u[d+O]:(U=sc(R,c),Array.isArray(U)?N=!0:U=[w,U]);var L=U[1]==null||v&&sc(R,c)==null;return C?{x:TN({axis:r,ticks:a,bandSize:l,entry:R,index:O}),y:L?null:s.scale(U[1]),value:U,payload:R}:{x:L?null:r.scale(U[1]),y:TN({axis:s,ticks:o,bandSize:l,entry:R,index:O}),value:U,payload:R}}),I;return v||N?I=P.map(function(R){var O=Array.isArray(R.value)?R.value[0]:null;return C?{x:R.x,y:O!=null&&R.y!=null?s.scale(O):null}:{x:O!=null?r.scale(O):null,y:R.y}}):I=C?s.scale(w):r.scale(w),jb({points:P,baseLine:I,layout:g,isRange:N},x)});P0(E5,"renderDotItem",function(e,t){var n;if(Ae.isValidElement(e))n=Ae.cloneElement(e,t);else if(ji(e))n=e(t);else{var r=ia("recharts-area-dot",typeof e!="boolean"?e.className:""),s=t.key,a=sUe(t,Stn);n=Ae.createElement(J$,ow({},a,{key:s,className:r}))}return n});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 Ptn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ftn(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,cUe(r.key),r)}}function Otn(e,t,n){return Ftn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Mtn(e,t,n){return t=LL(t),Rtn(e,oUe()?Reflect.construct(t,n||[],LL(e).constructor):t.apply(e,n))}function Rtn(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 Ltn(e)}function Ltn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oUe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(oUe=function(){return!!e})()}function LL(e){return LL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},LL(e)}function Dtn(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 lUe(e,t,n){return t=cUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cUe(e){var t=Btn(e,"string");return UN(t)=="symbol"?t:t+""}function Btn(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)}var oU=function(e){function t(){return Ptn(this,t),Mtn(this,t,arguments)}return Dtn(t,e),Otn(t,[{key:"render",value:function(){return null}}])}(Ae.Component);lUe(oU,"displayName","ZAxis");lUe(oU,"defaultProps",{zAxisId:0,range:[64,64],scale:"auto",type:"number"});var $tn=["option","isActive"];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 Utn(e,t){if(e==null)return{};var n=ztn(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 ztn(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 Htn(e){var t=e.option,n=e.isActive,r=Utn(e,$tn);return typeof t=="string"?Ae.createElement(Jte,c9({option:Ae.createElement($$,c9({type:t},r)),isActive:n,shapeType:"symbols"},r)):Ae.createElement(Jte,c9({option:t,isActive:n,shapeType:"symbols"},r))}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 u9(){return u9=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},u9.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 Mh(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){yy(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 Vtn(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,dUe(r.key),r)}}function Wtn(e,t,n){return R6e(e.prototype,t),R6e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function qtn(e,t,n){return t=DL(t),Gtn(e,uUe()?Reflect.construct(t,n,DL(e).constructor):t.apply(e,n))}function Gtn(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 Ktn(e)}function Ktn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function uUe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(uUe=function(){return!!e})()}function DL(e){return DL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},DL(e)}function Ytn(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 yy(e,t,n){return t=dUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dUe(e){var t=Xtn(e,"string");return zN(t)=="symbol"?t:t+""}function Xtn(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)}var lU=function(e){function t(){var n;Vtn(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=qtn(this,t,[].concat(s)),yy(n,"state",{isAnimationFinished:!1}),yy(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0})}),yy(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1})}),yy(n,"id",S5("recharts-scatter-")),n}return Ytn(t,e),Wtn(t,[{key:"renderSymbolsStatically",value:function(r){var s=this,a=this.props,o=a.shape,l=a.activeShape,c=a.activeIndex,u=wi(this.props,!1);return r.map(function(d,f){var x=c===f,g=x?l:o,v=Mh(Mh({},u),d);return Ae.createElement(Sa,u9({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)},r_(s.props,d,f),{role:"img"}),Ae.createElement(Htn,u9({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 Ae.createElement(Sm,{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 P=Sl(N.cx,w.cx),I=Sl(N.cy,w.cy),R=Sl(N.size,w.size);return Mh(Mh({},w),{},{cx:P(g),cy:I(g),size:R(g)})}var O=Sl(0,w.size);return Mh(Mh({},w),{},{size:O(g)})});return Ae.createElement(Sa,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||!K3(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=of(c,e8);return u?u.map(function(d,f){var x=d.props,g=x.direction,v=x.dataKey;return Ae.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:sc(C,N)}}})}):null}},{key:"renderLine",value:function(){var r=this.props,s=r.points,a=r.line,o=r.lineType,l=r.lineJointType,c=wi(this.props,!1),u=wi(a,!1),d,f;if(o==="joint")d=s.map(function(I){return{x:I.cx,y:I.cy}});else if(o==="fitting"){var x=R$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 P=Mh(Mh(Mh({},c),{},{fill:"none",stroke:c&&c.fill},u),{},{points:d});return Ae.isValidElement(a)?f=Ae.cloneElement(a,P):ji(a)?f=a(P):f=Ae.createElement(l3,u9({},P,{type:l})),Ae.createElement(Sa,{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=ia("recharts-scatter",l),P=c&&c.allowDataOverflow,I=u&&u.allowDataOverflow,R=P||I,O=Ci(v)?this.id:v;return Ae.createElement(Sa,{className:N,clipPath:R?"url(#clipPath-".concat(O,")"):null},P||I?Ae.createElement("defs",null,Ae.createElement("clipPath",{id:"clipPath-".concat(O)},Ae.createElement("rect",{x:P?d:d-x/2,y:I?f:f-g/2,width:P?x:x*2,height:I?g:g*2}))):null,o&&this.renderLine(),this.renderErrorBar(),Ae.createElement(Sa,{key:"recharts-scatter-symbols"},this.renderSymbols()),(!w||C)&&H0.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);yy(lU,"displayName","Scatter");yy(lU,"defaultProps",{xAxisId:0,yAxisId:0,zAxisId:0,legendType:"circle",lineType:"joint",lineJointType:"linear",data:[],shape:"circle",hide:!1,isAnimationActive:!mm.isSsr,animationBegin:0,animationDuration:400,animationEasing:"linear"});yy(lU,"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=of(s.props.children,Gle),f=Ci(t.dataKey)?s.props.dataKey:t.dataKey,x=Ci(n.dataKey)?s.props.dataKey:n.dataKey,g=r&&r.dataKey,v=r?r.range:oU.defaultProps.range,w=v&&v[0],C=t.scale.bandwidth?t.scale.bandwidth():0,N=n.scale.bandwidth?n.scale.bandwidth():0,P=a.map(function(I,R){var O=sc(I,f),U=sc(I,x),L=!Ci(g)&&sc(I,g)||"-",z=[{name:Ci(t.dataKey)?s.props.name:t.name||t.dataKey,unit:t.unit||"",value:O,payload:I,dataKey:f,type:u},{name:Ci(n.dataKey)?s.props.name:n.name||n.dataKey,unit:n.unit||"",value:U,payload:I,dataKey:x,type:u}];L!=="-"&&z.push({name:r.name||r.dataKey,unit:r.unit||"",value:L,payload:I,dataKey:g,type:u});var X=TN({axis:t,ticks:o,bandSize:C,entry:I,index:R,dataKey:f}),ne=TN({axis:n,ticks:l,bandSize:N,entry:I,index:R,dataKey:x}),J=L!=="-"?r.scale(L):w,K=Math.sqrt(Math.max(J,0)/Math.PI);return Mh(Mh({},I),{},{cx:X,cy:ne,x:X-K,y:ne-K,xAxis:t,yAxis:n,zAxis:r,width:2*K,height:2*K,size:J,node:{x:O,y:U,z:L},tooltipPayload:z,tooltipPosition:{x:X,y:ne},payload:I},d[R]&&d[R].props)});return Mh({points:P},c)});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 Qtn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ztn(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 Jtn(e,t,n){return Ztn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function enn(e,t,n){return t=BL(t),tnn(e,fUe()?Reflect.construct(t,n||[],BL(e).constructor):t.apply(e,n))}function tnn(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 nnn(e)}function nnn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fUe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(fUe=function(){return!!e})()}function BL(e){return BL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},BL(e)}function rnn(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 hUe(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 HN(t)=="symbol"?t:t+""}function snn(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)}function xne(){return xne=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},xne.apply(this,arguments)}function inn(e){var t=e.xAxisId,n=Sce(),r=Nce(),s=z$e(t);return s==null?null:Ae.createElement(n8,xne({},s,{className:ia("recharts-".concat(s.axisType," ").concat(s.axisType),s.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(o){return Bg(o,!0)}}))}var r8=function(e){function t(){return Qtn(this,t),enn(this,t,arguments)}return rnn(t,e),Jtn(t,[{key:"render",value:function(){return Ae.createElement(inn,this.props)}}])}(Ae.Component);hUe(r8,"displayName","XAxis");hUe(r8,"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 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 ann(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function onn(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,gUe(r.key),r)}}function lnn(e,t,n){return onn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function cnn(e,t,n){return t=$L(t),unn(e,mUe()?Reflect.construct(t,n||[],$L(e).constructor):t.apply(e,n))}function unn(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 dnn(e)}function dnn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mUe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(mUe=function(){return!!e})()}function $L(e){return $L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},$L(e)}function fnn(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&&gne(e,t)}function gne(e,t){return gne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},gne(e,t)}function xUe(e,t,n){return t=gUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gUe(e){var t=hnn(e,"string");return VN(t)=="symbol"?t:t+""}function hnn(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)}function bne(){return bne=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},bne.apply(this,arguments)}var pnn=function(t){var n=t.yAxisId,r=Sce(),s=Nce(),a=H$e(n);return a==null?null:Ae.createElement(n8,bne({},a,{className:ia("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:r,height:s},ticksGenerator:function(l){return Bg(l,!0)}}))},s8=function(e){function t(){return ann(this,t),cnn(this,t,arguments)}return fnn(t,e),lnn(t,[{key:"render",value:function(){return Ae.createElement(pnn,this.props)}}])}(Ae.Component);xUe(s8,"displayName","YAxis");xUe(s8,"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 bnn(e)||gnn(e)||xnn(e)||mnn()}function mnn(){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 xnn(e,t){if(e){if(typeof e=="string")return yne(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 yne(e,t)}}function gnn(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function bnn(e){if(Array.isArray(e))return yne(e)}function yne(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 vne=function(t,n,r,s,a){var o=of(t,jce),l=of(t,sU),c=[].concat(L6e(o),L6e(l)),u=of(t,aU),d="".concat(s,"Id"),f=s[0],x=n;if(c.length&&(x=c.reduce(function(w,C){if(C.props[d]===r&&V0(C.props,"extendDomain")&&ns(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&&V0(C.props,"extendDomain")&&ns(C.props[g])&&ns(C.props[v])){var N=C.props[g],P=C.props[v];return[Math.min(w[0],N,P),Math.max(w[1],N,P)]}return w},x)}return a&&a.length&&(x=a.reduce(function(w,C){return ns(C)?[Math.min(w[0],C),Math.max(w[1],C)]:w},x)),x},TY={exports:{}},D6e;function ynn(){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,P,I;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(I=1,P=new Array(N-1);I<N;I++)P[I-1]=arguments[I];C.fn.apply(C.context,P)}else{var R=C.length,O;for(I=0;I<R;I++)switch(C[I].once&&this.removeListener(u,C[I].fn,void 0,!0),N){case 1:C[I].fn.call(C[I].context);break;case 2:C[I].fn.call(C[I].context,d);break;case 3:C[I].fn.call(C[I].context,d,f);break;case 4:C[I].fn.call(C[I].context,d,f,x);break;default:if(!P)for(O=1,P=new Array(N-1);O<N;O++)P[O-1]=arguments[O];C[I].fn.apply(C[I].context,P)}}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}(TY)),TY.exports}var vnn=ynn();const wnn=Ii(vnn);var IY=new wnn,PY="recharts.syncMouseEvents";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 Cnn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Snn(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 Nnn(e,t,n){return Snn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function FY(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=Ann(e,"string");return L_(t)=="symbol"?t:t+""}function Ann(e,t){if(L_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(L_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var jnn=function(){function e(){Cnn(this,e),FY(this,"activeIndex",0),FY(this,"coordinateList",[]),FY(this,"layout","horizontal")}return Nnn(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 Enn(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&&ns(r)&&ns(s))return!0}return!1}function _nn(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 yUe(e){var t=e.cx,n=e.cy,r=e.radius,s=e.startAngle,a=e.endAngle,o=nu(t,n,r,s),l=nu(t,n,r,a);return{points:[o,l],cx:t,cy:n,radius:r,startAngle:s,endAngle:a}}function knn(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=nu(l,c,u,f),g=nu(l,c,d,f);r=x.x,s=x.y,a=g.x,o=g.y}else return yUe(t);return[{x:r,y:s},{x:a,y:o}]}function D_(e){"@babel/helpers - typeof";return D_=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},D_(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 MP(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){Tnn(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 Tnn(e,t,n){return t=Inn(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Inn(e){var t=Pnn(e,"string");return D_(t)=="symbol"?t:t+""}function Pnn(e,t){if(D_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(D_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fnn(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=l3;if(x==="ScatterChart")v=o,w=rZt;else if(x==="BarChart")v=_nn(f,o,c,d),w=yce;else if(f==="radial"){var C=yUe(o),N=C.cx,P=C.cy,I=C.radius,R=C.startAngle,O=C.endAngle;v={cx:N,cy:P,startAngle:R,endAngle:O,innerRadius:I,outerRadius:I},w=g$e}else v={points:knn(f,o,c)},w=l3;var U=MP(MP(MP(MP({stroke:"#ccc",pointerEvents:"none"},c),v),wi(g,!1)),{},{payload:l,payloadIndex:u,className:ia("recharts-tooltip-cursor",g.className)});return m.isValidElement(g)?m.cloneElement(g,U):m.createElement(w,U)}var Onn=["item"],Mnn=["children","className","width","height","style","compact","title","desc"];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)}function UC(){return UC=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},UC.apply(this,arguments)}function $6e(e,t){return Dnn(e)||Lnn(e,t)||wUe(e,t)||Rnn()}function Rnn(){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 Lnn(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 Dnn(e){if(Array.isArray(e))return e}function U6e(e,t){if(e==null)return{};var n=Bnn(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 Bnn(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 $nn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Unn(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,CUe(r.key),r)}}function znn(e,t,n){return Unn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Hnn(e,t,n){return t=UL(t),Vnn(e,vUe()?Reflect.construct(t,n,UL(e).constructor):t.apply(e,n))}function Vnn(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 Wnn(e)}function Wnn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vUe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(vUe=function(){return!!e})()}function UL(e){return UL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},UL(e)}function qnn(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&&wne(e,t)}function wne(e,t){return wne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},wne(e,t)}function qN(e){return Ynn(e)||Knn(e)||wUe(e)||Gnn()}function Gnn(){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 wUe(e,t){if(e){if(typeof e=="string")return Cne(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 Cne(e,t)}}function Knn(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ynn(e){if(Array.isArray(e))return Cne(e)}function Cne(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 Nr(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){ti(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 ti(e,t,n){return t=CUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CUe(e){var t=Xnn(e,"string");return WN(t)=="symbol"?t:t+""}function Xnn(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)}var Qnn={xAxis:["bottom","top"],yAxis:["left","right"]},Znn={width:"100%",height:"100%"},SUe={x:0,y:0};function RP(e){return e}var Jnn=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},ern=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 Nr(Nr(Nr({},s),nu(s.cx,s.cy,l,o)),{},{angle:o,radius:l})}var c=a.coordinate,u=s.angle;return Nr(Nr(Nr({},s),nu(s.cx,s.cy,c,u)),{},{angle:u,radius:c})}return SUe},cU=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(qN(l),qN(u)):l},[]);return o.length>0?o:t&&t.length&&ns(s)&&ns(a)?t.slice(s,a+1):[]};function NUe(e){return e==="number"?[0,"auto"]:void 0}var Sne=function(t,n,r,s){var a=t.graphicalItems,o=t.tooltipAxis,l=cU(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=VR(g,o.dataKey,s)}else x=f&&f[r]||l[r];return x?[].concat(qN(c),[p$e(u,x)]):c},[])},H6e=function(t,n,r,s){var a=s||{x:t.chartX,y:t.chartY},o=Jnn(a,r),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,d=HKt(o,l,u,c);if(d>=0&&u){var f=u[d]&&u[d].value,x=Sne(t,n,d,f),g=ern(r,l,d,a);return{activeTooltipIndex:d,activeLabel:f,activePayload:x,activeCoordinate:g}}return null},trn=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=d$e(d,a);return r.reduce(function(v,w){var C,N=w.type.defaultProps!==void 0?Nr(Nr({},w.type.defaultProps),w.props):w.props,P=N.type,I=N.dataKey,R=N.allowDataOverflow,O=N.allowDuplicatedCategory,U=N.scale,L=N.ticks,z=N.includeHidden,X=N[o];if(v[X])return v;var ne=cU(t.data,{graphicalItems:s.filter(function(fe){var Ne,me=o in fe.props?fe.props[o]:(Ne=fe.type.defaultProps)===null||Ne===void 0?void 0:Ne[o];return me===X}),dataStartIndex:c,dataEndIndex:u}),J=ne.length,K,re,he;Enn(N.domain,R,P)&&(K=Lte(N.domain,null,R),g&&(P==="number"||U!=="auto")&&(he=a9(ne,I,"category")));var Q=NUe(P);if(!K||K.length===0){var ie,oe=(ie=N.domain)!==null&&ie!==void 0?ie:Q;if(I){if(K=a9(ne,I,P),P==="category"&&g){var G=M$t(K);O&&G?(re=K,K=AL(0,J)):O||(K=J3e(oe,K,w).reduce(function(fe,Ne){return fe.indexOf(Ne)>=0?fe:[].concat(qN(fe),[Ne])},[]))}else if(P==="category")O?K=K.filter(function(fe){return fe!==""&&!Ci(fe)}):K=J3e(oe,K,w).reduce(function(fe,Ne){return fe.indexOf(Ne)>=0||Ne===""||Ci(Ne)?fe:[].concat(qN(fe),[Ne])},[]);else if(P==="number"){var V=KKt(ne,s.filter(function(fe){var Ne,me,we=o in fe.props?fe.props[o]:(Ne=fe.type.defaultProps)===null||Ne===void 0?void 0:Ne[o],xe="hide"in fe.props?fe.props.hide:(me=fe.type.defaultProps)===null||me===void 0?void 0:me.hide;return we===X&&(z||!xe)}),I,a,d);V&&(K=V)}g&&(P==="number"||U!=="auto")&&(he=a9(ne,I,"category"))}else g?K=AL(0,J):l&&l[X]&&l[X].hasStack&&P==="number"?K=x==="expand"?[0,1]:h$e(l[X].stackGroups,c,u):K=u$e(ne,s.filter(function(fe){var Ne=o in fe.props?fe.props[o]:fe.type.defaultProps[o],me="hide"in fe.props?fe.props.hide:fe.type.defaultProps.hide;return Ne===X&&(z||!me)}),P,d,!0);if(P==="number")K=vne(f,K,X,a,L),oe&&(K=Lte(oe,K,R));else if(P==="category"&&oe){var te=oe,ae=K.every(function(fe){return te.indexOf(fe)>=0});ae&&(K=te)}}return Nr(Nr({},v),{},ti({},X,Nr(Nr({},N),{},{axisType:a,domain:K,categoricalDomain:he,duplicateDomain:re,originalDomain:(C=N.domain)!==null&&C!==void 0?C:Q,isCategorical:g,layout:d})))},{})},nrn=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=cU(t.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:u}),g=x.length,v=d$e(d,a),w=-1;return r.reduce(function(C,N){var P=N.type.defaultProps!==void 0?Nr(Nr({},N.type.defaultProps),N.props):N.props,I=P[o],R=NUe("number");if(!C[I]){w++;var O;return v?O=AL(0,g):l&&l[I]&&l[I].hasStack?(O=h$e(l[I].stackGroups,c,u),O=vne(f,O,I,a)):(O=Lte(R,u$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===I&&!ne}),"number",d),s.defaultProps.allowDataOverflow),O=vne(f,O,I,a)),Nr(Nr({},C),{},ti({},I,Nr(Nr({axisType:a},s.defaultProps),{},{hide:!0,orientation:np(Qnn,"".concat(a,".").concat(w%2),null),domain:O,originalDomain:R,isCategorical:v,layout:d})))}return C},{})},rrn=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=of(d,a),g={};return x.length?g=trn(t,{axes:x,graphicalItems:o,axisType:s,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):o&&o.length&&(g=nrn(t,{Axis:a,graphicalItems:o,axisType:s,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),g},srn=function(t){var n=Mb(t),r=Bg(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:Wle(r,function(s){return s.coordinate}),tooltipAxis:n,tooltipAxisBandSize:xL(n,r)}},V6e=function(t){var n=t.children,r=t.defaultShowTooltip,s=Lf(n,FN),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}},irn=function(t){return!t||!t.length?!1:t.some(function(n){var r=Yg(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"}},arn=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=Lf(f,FN),v=Lf(f,i3),w=Object.keys(c).reduce(function(O,U){var L=c[U],z=L.orientation;return!L.mirror&&!L.hide?Nr(Nr({},O),{},ti({},z,O[z]+L.width)):O},{left:x.left||0,right:x.right||0}),C=Object.keys(o).reduce(function(O,U){var L=o[U],z=L.orientation;return!L.mirror&&!L.hide?Nr(Nr({},O),{},ti({},z,np(O,"".concat(z))+L.height)):O},{top:x.top||0,bottom:x.bottom||0}),N=Nr(Nr({},C),w),P=N.bottom;g&&(N.bottom+=g.props.height||FN.defaultProps.height),v&&n&&(N=qKt(N,s,r,n));var I=u-N.left-N.right,R=d-N.top-N.bottom;return Nr(Nr({brushBottom:P},N),{},{width:Math.max(I,0),height:Math.max(R,0)})},orn=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},AUe=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,P){var I=P.graphicalItems,R=P.stackGroups,O=P.offset,U=P.updateId,L=P.dataStartIndex,z=P.dataEndIndex,X=N.barSize,ne=N.layout,J=N.barGap,K=N.barCategoryGap,re=N.maxBarSize,he=W6e(ne),Q=he.numericAxisName,ie=he.cateAxisName,oe=irn(I),G=[];return I.forEach(function(V,te){var ae=cU(N.data,{graphicalItems:[V],dataStartIndex:L,dataEndIndex:z}),fe=V.type.defaultProps!==void 0?Nr(Nr({},V.type.defaultProps),V.props):V.props,Ne=fe.dataKey,me=fe.maxBarSize,we=fe["".concat(Q,"Id")],xe=fe["".concat(ie,"Id")],ye={},je=c.reduce(function(wt,nn){var cn=P["".concat(nn.axisType,"Map")],zn=fe["".concat(nn.axisType,"Id")];cn&&cn[zn]||nn.axisType==="zAxis"||X3();var Xt=cn[zn];return Nr(Nr({},wt),{},ti(ti({},nn.axisType,Xt),"".concat(nn.axisType,"Ticks"),Bg(Xt)))},ye),Pe=je[ie],Re=je["".concat(ie,"Ticks")],Xe=R&&R[we]&&R[we].hasStack&&aYt(V,R[we].stackGroups),Ke=Yg(V.type).indexOf("Bar")>=0,ut=xL(Pe,Re),et=[],tt=oe&&VKt({barSize:X,stackGroups:R,totalSize:orn(je,ie)});if(Ke){var Le,$e,ht=Ci(me)?re:me,pt=(Le=($e=xL(Pe,Re,!0))!==null&&$e!==void 0?$e:ht)!==null&&Le!==void 0?Le:0;et=WKt({barGap:J,barCategoryGap:K,bandSize:pt!==ut?pt:ut,sizeList:tt[xe],maxBarSize:ht}),pt!==ut&&(et=et.map(function(wt){return Nr(Nr({},wt),{},{position:Nr(Nr({},wt.position),{},{offset:wt.position.offset-pt/2})})}))}var Kt=V&&V.type&&V.type.getComposedData;Kt&&G.push({props:Nr(Nr({},Kt(Nr(Nr({},je),{},{displayedData:ae,props:N,dataKey:Ne,item:V,bandSize:ut,barPosition:et,offset:O,stackedData:Xe,layout:ne,dataStartIndex:L,dataEndIndex:z}))),{},ti(ti(ti({key:V.key||"item-".concat(te)},Q,je[Q]),ie,je[ie]),"animationId",U)),childIndex:K$t(V,N.children),item:V})}),G},g=function(N,P){var I=N.props,R=N.dataStartIndex,O=N.dataEndIndex,U=N.updateId;if(!p2e({props:I}))return null;var L=I.children,z=I.layout,X=I.stackOffset,ne=I.data,J=I.reverseStackOrder,K=W6e(z),re=K.numericAxisName,he=K.cateAxisName,Q=of(L,r),ie=rYt(ne,Q,"".concat(re,"Id"),"".concat(he,"Id"),X,J),oe=c.reduce(function(fe,Ne){var me="".concat(Ne.axisType,"Map");return Nr(Nr({},fe),{},ti({},me,rrn(I,Nr(Nr({},Ne),{},{graphicalItems:Q,stackGroups:Ne.axisType===re&&ie,dataStartIndex:R,dataEndIndex:O}))))},{}),G=arn(Nr(Nr({},oe),{},{props:I,graphicalItems:Q}),P==null?void 0:P.legendBBox);Object.keys(oe).forEach(function(fe){oe[fe]=d(I,oe[fe],G,fe.replace("Map",""),n)});var V=oe["".concat(he,"Map")],te=srn(V),ae=x(I,Nr(Nr({},oe),{},{dataStartIndex:R,dataEndIndex:O,updateId:U,graphicalItems:Q,stackGroups:ie,offset:G}));return Nr(Nr({formattedGraphicalItems:ae,graphicalItems:Q,offset:G,stackGroups:ie},te),oe)},v=function(C){function N(P){var I,R,O;return $nn(this,N),O=Hnn(this,N,[P]),ti(O,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),ti(O,"accessibilityManager",new jnn),ti(O,"handleLegendBBoxUpdate",function(U){if(U){var L=O.state,z=L.dataStartIndex,X=L.dataEndIndex,ne=L.updateId;O.setState(Nr({legendBBox:U},g({props:O.props,dataStartIndex:z,dataEndIndex:X,updateId:ne},Nr(Nr({},O.state),{},{legendBBox:U}))))}}),ti(O,"handleReceiveSyncEvent",function(U,L,z){if(O.props.syncId===U){if(z===O.eventEmitterSymbol&&typeof O.props.syncMethod!="function")return;O.applySyncEvent(L)}}),ti(O,"handleBrushChange",function(U){var L=U.startIndex,z=U.endIndex;if(L!==O.state.dataStartIndex||z!==O.state.dataEndIndex){var X=O.state.updateId;O.setState(function(){return Nr({dataStartIndex:L,dataEndIndex:z},g({props:O.props,dataStartIndex:L,dataEndIndex:z,updateId:X},O.state))}),O.triggerSyncEvent({dataStartIndex:L,dataEndIndex:z})}}),ti(O,"handleMouseEnter",function(U){var L=O.getMouseInfo(U);if(L){var z=Nr(Nr({},L),{},{isTooltipActive:!0});O.setState(z),O.triggerSyncEvent(z);var X=O.props.onMouseEnter;ji(X)&&X(z,U)}}),ti(O,"triggeredAfterMouseMove",function(U){var L=O.getMouseInfo(U),z=L?Nr(Nr({},L),{},{isTooltipActive:!0}):{isTooltipActive:!1};O.setState(z),O.triggerSyncEvent(z);var X=O.props.onMouseMove;ji(X)&&X(z,U)}),ti(O,"handleItemMouseEnter",function(U){O.setState(function(){return{isTooltipActive:!0,activeItem:U,activePayload:U.tooltipPayload,activeCoordinate:U.tooltipPosition||{x:U.cx,y:U.cy}}})}),ti(O,"handleItemMouseLeave",function(){O.setState(function(){return{isTooltipActive:!1}})}),ti(O,"handleMouseMove",function(U){U.persist(),O.throttleTriggeredAfterMouseMove(U)}),ti(O,"handleMouseLeave",function(U){O.throttleTriggeredAfterMouseMove.cancel();var L={isTooltipActive:!1};O.setState(L),O.triggerSyncEvent(L);var z=O.props.onMouseLeave;ji(z)&&z(L,U)}),ti(O,"handleOuterEvent",function(U){var L=G$t(U),z=np(O.props,"".concat(L));if(L&&ji(z)){var X,ne;/.*touch.*/i.test(L)?ne=O.getMouseInfo(U.changedTouches[0]):ne=O.getMouseInfo(U),z((X=ne)!==null&&X!==void 0?X:{},U)}}),ti(O,"handleClick",function(U){var L=O.getMouseInfo(U);if(L){var z=Nr(Nr({},L),{},{isTooltipActive:!0});O.setState(z),O.triggerSyncEvent(z);var X=O.props.onClick;ji(X)&&X(z,U)}}),ti(O,"handleMouseDown",function(U){var L=O.props.onMouseDown;if(ji(L)){var z=O.getMouseInfo(U);L(z,U)}}),ti(O,"handleMouseUp",function(U){var L=O.props.onMouseUp;if(ji(L)){var z=O.getMouseInfo(U);L(z,U)}}),ti(O,"handleTouchMove",function(U){U.changedTouches!=null&&U.changedTouches.length>0&&O.throttleTriggeredAfterMouseMove(U.changedTouches[0])}),ti(O,"handleTouchStart",function(U){U.changedTouches!=null&&U.changedTouches.length>0&&O.handleMouseDown(U.changedTouches[0])}),ti(O,"handleTouchEnd",function(U){U.changedTouches!=null&&U.changedTouches.length>0&&O.handleMouseUp(U.changedTouches[0])}),ti(O,"handleDoubleClick",function(U){var L=O.props.onDoubleClick;if(ji(L)){var z=O.getMouseInfo(U);L(z,U)}}),ti(O,"handleContextMenu",function(U){var L=O.props.onContextMenu;if(ji(L)){var z=O.getMouseInfo(U);L(z,U)}}),ti(O,"triggerSyncEvent",function(U){O.props.syncId!==void 0&&IY.emit(PY,O.props.syncId,U,O.eventEmitterSymbol)}),ti(O,"applySyncEvent",function(U){var L=O.props,z=L.layout,X=L.syncMethod,ne=O.state.updateId,J=U.dataStartIndex,K=U.dataEndIndex;if(U.dataStartIndex!==void 0||U.dataEndIndex!==void 0)O.setState(Nr({dataStartIndex:J,dataEndIndex:K},g({props:O.props,dataStartIndex:J,dataEndIndex:K,updateId:ne},O.state)));else if(U.activeTooltipIndex!==void 0){var re=U.chartX,he=U.chartY,Q=U.activeTooltipIndex,ie=O.state,oe=ie.offset,G=ie.tooltipTicks;if(!oe)return;if(typeof X=="function")Q=X(G,U);else if(X==="value"){Q=-1;for(var V=0;V<G.length;V++)if(G[V].value===U.activeLabel){Q=V;break}}var te=Nr(Nr({},oe),{},{x:oe.left,y:oe.top}),ae=Math.min(re,te.x+te.width),fe=Math.min(he,te.y+te.height),Ne=G[Q]&&G[Q].value,me=Sne(O.state,O.props.data,Q),we=G[Q]?{x:z==="horizontal"?G[Q].coordinate:ae,y:z==="horizontal"?fe:G[Q].coordinate}:SUe;O.setState(Nr(Nr({},U),{},{activeLabel:Ne,activeCoordinate:we,activePayload:me,activeTooltipIndex:Q}))}else O.setState(U)}),ti(O,"renderCursor",function(U){var L,z=O.state,X=z.isTooltipActive,ne=z.activeCoordinate,J=z.activePayload,K=z.offset,re=z.activeTooltipIndex,he=z.tooltipAxisBandSize,Q=O.getTooltipEventType(),ie=(L=U.props.active)!==null&&L!==void 0?L:X,oe=O.props.layout,G=U.key||"_recharts-cursor";return Ae.createElement(Fnn,{key:G,activeCoordinate:ne,activePayload:J,activeTooltipIndex:re,chartName:n,element:U,isActive:ie,layout:oe,offset:K,tooltipAxisBandSize:he,tooltipEventType:Q})}),ti(O,"renderPolarAxis",function(U,L,z){var X=np(U,"type.axisType"),ne=np(O.state,"".concat(X,"Map")),J=U.type.defaultProps,K=J!==void 0?Nr(Nr({},J),U.props):U.props,re=ne&&ne[K["".concat(X,"Id")]];return m.cloneElement(U,Nr(Nr({},re),{},{className:ia(X,re.className),key:U.key||"".concat(L,"-").concat(z),ticks:Bg(re,!0)}))}),ti(O,"renderPolarGrid",function(U){var L=U.props,z=L.radialLines,X=L.polarAngles,ne=L.polarRadius,J=O.state,K=J.radiusAxisMap,re=J.angleAxisMap,he=Mb(K),Q=Mb(re),ie=Q.cx,oe=Q.cy,G=Q.innerRadius,V=Q.outerRadius;return m.cloneElement(U,{polarAngles:Array.isArray(X)?X:Bg(Q,!0).map(function(te){return te.coordinate}),polarRadius:Array.isArray(ne)?ne:Bg(he,!0).map(function(te){return te.coordinate}),cx:ie,cy:oe,innerRadius:G,outerRadius:V,key:U.key||"polar-grid",radialLines:z})}),ti(O,"renderLegend",function(){var U=O.state.formattedGraphicalItems,L=O.props,z=L.children,X=L.width,ne=L.height,J=O.props.margin||{},K=X-(J.left||0)-(J.right||0),re=l$e({children:z,formattedGraphicalItems:U,legendWidth:K,legendContent:u});if(!re)return null;var he=re.item,Q=U6e(re,Onn);return m.cloneElement(he,Nr(Nr({},Q),{},{chartWidth:X,chartHeight:ne,margin:J,onBBoxUpdate:O.handleLegendBBoxUpdate}))}),ti(O,"renderTooltip",function(){var U,L=O.props,z=L.children,X=L.accessibilityLayer,ne=Lf(z,Xp);if(!ne)return null;var J=O.state,K=J.isTooltipActive,re=J.activeCoordinate,he=J.activePayload,Q=J.activeLabel,ie=J.offset,oe=(U=ne.props.active)!==null&&U!==void 0?U:K;return m.cloneElement(ne,{viewBox:Nr(Nr({},ie),{},{x:ie.left,y:ie.top}),active:oe,label:Q,payload:oe?he:[],coordinate:re,accessibilityLayer:X})}),ti(O,"renderBrush",function(U){var L=O.props,z=L.margin,X=L.data,ne=O.state,J=ne.offset,K=ne.dataStartIndex,re=ne.dataEndIndex,he=ne.updateId;return m.cloneElement(U,{key:U.key||"_recharts-brush",onChange:IP(O.handleBrushChange,U.props.onChange),data:X,x:ns(U.props.x)?U.props.x:J.left,y:ns(U.props.y)?U.props.y:J.top+J.height+J.brushBottom-(z.bottom||0),width:ns(U.props.width)?U.props.width:J.width,startIndex:K,endIndex:re,updateId:"brush-".concat(he)})}),ti(O,"renderReferenceElement",function(U,L,z){if(!U)return null;var X=O,ne=X.clipPathId,J=O.state,K=J.xAxisMap,re=J.yAxisMap,he=J.offset,Q=U.type.defaultProps||{},ie=U.props,oe=ie.xAxisId,G=oe===void 0?Q.xAxisId:oe,V=ie.yAxisId,te=V===void 0?Q.yAxisId:V;return m.cloneElement(U,{key:U.key||"".concat(L,"-").concat(z),xAxis:K[G],yAxis:re[te],viewBox:{x:he.left,y:he.top,width:he.width,height:he.height},clipPathId:ne})}),ti(O,"renderActivePoints",function(U){var L=U.item,z=U.activePoint,X=U.basePoint,ne=U.childIndex,J=U.isRange,K=[],re=L.props.key,he=L.item.type.defaultProps!==void 0?Nr(Nr({},L.item.type.defaultProps),L.item.props):L.item.props,Q=he.activeDot,ie=he.dataKey,oe=Nr(Nr({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},wi(Q,!1)),WR(Q));return K.push(N.renderActiveDot(Q,oe,"".concat(re,"-activePoint-").concat(ne))),X?K.push(N.renderActiveDot(Q,Nr(Nr({},oe),{},{cx:X.x,cy:X.y}),"".concat(re,"-basePoint-").concat(ne))):J&&K.push(null),K}),ti(O,"renderGraphicChild",function(U,L,z){var X=O.filterFormatItem(U,L,z);if(!X)return null;var ne=O.getTooltipEventType(),J=O.state,K=J.isTooltipActive,re=J.tooltipAxis,he=J.activeTooltipIndex,Q=J.activeLabel,ie=O.props.children,oe=Lf(ie,Xp),G=X.props,V=G.points,te=G.isRange,ae=G.baseLine,fe=X.item.type.defaultProps!==void 0?Nr(Nr({},X.item.type.defaultProps),X.item.props):X.item.props,Ne=fe.activeDot,me=fe.hide,we=fe.activeBar,xe=fe.activeShape,ye=!!(!me&&K&&oe&&(Ne||we||xe)),je={};ne!=="axis"&&oe&&oe.props.trigger==="click"?je={onClick:IP(O.handleItemMouseEnter,U.props.onClick)}:ne!=="axis"&&(je={onMouseLeave:IP(O.handleItemMouseLeave,U.props.onMouseLeave),onMouseEnter:IP(O.handleItemMouseEnter,U.props.onMouseEnter)});var Pe=m.cloneElement(U,Nr(Nr({},X.props),je));function Re(nn){return typeof re.dataKey=="function"?re.dataKey(nn.payload):null}if(ye)if(he>=0){var Xe,Ke;if(re.dataKey&&!re.allowDuplicatedCategory){var ut=typeof re.dataKey=="function"?Re:"payload.".concat(re.dataKey.toString());Xe=VR(V,ut,Q),Ke=te&&ae&&VR(ae,ut,Q)}else Xe=V==null?void 0:V[he],Ke=te&&ae&&ae[he];if(xe||we){var et=U.props.activeIndex!==void 0?U.props.activeIndex:he;return[m.cloneElement(U,Nr(Nr(Nr({},X.props),je),{},{activeIndex:et})),null,null]}if(!Ci(Xe))return[Pe].concat(qN(O.renderActivePoints({item:X,activePoint:Xe,basePoint:Ke,childIndex:he,isRange:te})))}else{var tt,Le=(tt=O.getItemByXY(O.state.activeCoordinate))!==null&&tt!==void 0?tt:{graphicalItem:Pe},$e=Le.graphicalItem,ht=$e.item,pt=ht===void 0?U:ht,Kt=$e.childIndex,wt=Nr(Nr(Nr({},X.props),je),{},{activeIndex:Kt});return[m.cloneElement(pt,wt),null,null]}return te?[Pe,null,null]:[Pe,null]}),ti(O,"renderCustomized",function(U,L,z){return m.cloneElement(U,Nr(Nr({key:"recharts-customized-".concat(z)},O.props),O.state))}),ti(O,"renderMap",{CartesianGrid:{handler:RP,once:!0},ReferenceArea:{handler:O.renderReferenceElement},ReferenceLine:{handler:RP},ReferenceDot:{handler:O.renderReferenceElement},XAxis:{handler:RP},YAxis:{handler:RP},Brush:{handler:O.renderBrush,once:!0},Bar:{handler:O.renderGraphicChild},Line:{handler:O.renderGraphicChild},Area:{handler:O.renderGraphicChild},Radar:{handler:O.renderGraphicChild},RadialBar:{handler:O.renderGraphicChild},Scatter:{handler:O.renderGraphicChild},Pie:{handler:O.renderGraphicChild},Funnel:{handler:O.renderGraphicChild},Tooltip:{handler:O.renderCursor,once:!0},PolarGrid:{handler:O.renderPolarGrid,once:!0},PolarAngleAxis:{handler:O.renderPolarAxis},PolarRadiusAxis:{handler:O.renderPolarAxis},Customized:{handler:O.renderCustomized}}),O.clipPathId="".concat((I=P.id)!==null&&I!==void 0?I:S5("recharts"),"-clip"),O.throttleTriggeredAfterMouseMove=oBe(O.triggeredAfterMouseMove,(R=P.throttleDelay)!==null&&R!==void 0?R:1e3/60),O.state={},O}return qnn(N,C),znn(N,[{key:"componentDidMount",value:function(){var I,R;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(I=this.props.margin.left)!==null&&I!==void 0?I: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 I=this.props,R=I.children,O=I.data,U=I.height,L=I.layout,z=Lf(R,Xp);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=Sne(this.state,O,X,ne),K=this.state.tooltipTicks[X].coordinate,re=(this.state.offset.top+U)/2,he=L==="horizontal",Q=he?{x:K,y:re}:{y:K,x:re},ie=this.state.formattedGraphicalItems.find(function(G){var V=G.item;return V.type.name==="Scatter"});ie&&(Q=Nr(Nr({},Q),ie.props.points[X].tooltipPosition),J=ie.props.points[X].tooltipPayload);var oe={activeTooltipIndex:X,isTooltipActive:!0,activeLabel:ne,activePayload:J,activeCoordinate:Q};this.setState(oe),this.renderCursor(z),this.accessibilityManager.setIndex(X)}}}},{key:"getSnapshotBeforeUpdate",value:function(I,R){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==R.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==I.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==I.margin){var O,U;this.accessibilityManager.setDetails({offset:{left:(O=this.props.margin.left)!==null&&O!==void 0?O:0,top:(U=this.props.margin.top)!==null&&U!==void 0?U:0}})}return null}},{key:"componentDidUpdate",value:function(I){ite([Lf(I.children,Xp)],[Lf(this.props.children,Xp)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var I=Lf(this.props.children,Xp);if(I&&typeof I.props.shared=="boolean"){var R=I.props.shared?"axis":"item";return l.indexOf(R)>=0?R:a}return a}},{key:"getMouseInfo",value:function(I){if(!this.container)return null;var R=this.container,O=R.getBoundingClientRect(),U=FVt(O),L={chartX:Math.round(I.pageX-U.left),chartY:Math.round(I.pageY-U.top)},z=O.width/R.offsetWidth||1,X=this.inRange(L.chartX,L.chartY,z);if(!X)return null;var ne=this.state,J=ne.xAxisMap,K=ne.yAxisMap,re=this.getTooltipEventType(),he=H6e(this.state,this.props.data,this.props.layout,X);if(re!=="axis"&&J&&K){var Q=Mb(J).scale,ie=Mb(K).scale,oe=Q&&Q.invert?Q.invert(L.chartX):null,G=ie&&ie.invert?ie.invert(L.chartY):null;return Nr(Nr({},L),{},{xValue:oe,yValue:G},he)}return he?Nr(Nr({},L),he):null}},{key:"inRange",value:function(I,R){var O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,U=this.props.layout,L=I/O,z=R/O;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,K=J.angleAxisMap,re=J.radiusAxisMap;if(K&&re){var he=Mb(K);return n5e({x:L,y:z},he)}return null}},{key:"parseEventsOfWrapper",value:function(){var I=this.props.children,R=this.getTooltipEventType(),O=Lf(I,Xp),U={};O&&R==="axis"&&(O.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=WR(this.props,this.handleOuterEvent);return Nr(Nr({},L),U)}},{key:"addListener",value:function(){IY.on(PY,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){IY.removeListener(PY,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(I,R,O){for(var U=this.state.formattedGraphicalItems,L=0,z=U.length;L<z;L++){var X=U[L];if(X.item===I||X.props.key===I.key||R===Yg(X.item.type)&&O===X.childIndex)return X}return null}},{key:"renderClipPath",value:function(){var I=this.clipPathId,R=this.state.offset,O=R.left,U=R.top,L=R.height,z=R.width;return Ae.createElement("defs",null,Ae.createElement("clipPath",{id:I},Ae.createElement("rect",{x:O,y:U,height:L,width:z})))}},{key:"getXScales",value:function(){var I=this.state.xAxisMap;return I?Object.entries(I).reduce(function(R,O){var U=$6e(O,2),L=U[0],z=U[1];return Nr(Nr({},R),{},ti({},L,z.scale))},{}):null}},{key:"getYScales",value:function(){var I=this.state.yAxisMap;return I?Object.entries(I).reduce(function(R,O){var U=$6e(O,2),L=U[0],z=U[1];return Nr(Nr({},R),{},ti({},L,z.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(I){var R;return(R=this.state.xAxisMap)===null||R===void 0||(R=R[I])===null||R===void 0?void 0:R.scale}},{key:"getYScaleByAxisId",value:function(I){var R;return(R=this.state.yAxisMap)===null||R===void 0||(R=R[I])===null||R===void 0?void 0:R.scale}},{key:"getItemByXY",value:function(I){var R=this.state,O=R.formattedGraphicalItems,U=R.activeItem;if(O&&O.length)for(var L=0,z=O.length;L<z;L++){var X=O[L],ne=X.props,J=X.item,K=J.type.defaultProps!==void 0?Nr(Nr({},J.type.defaultProps),J.props):J.props,re=Yg(J.type);if(re==="Bar"){var he=(ne.data||[]).find(function(G){return GQt(I,G)});if(he)return{graphicalItem:X,payload:he}}else if(re==="RadialBar"){var Q=(ne.data||[]).find(function(G){return n5e(I,G)});if(Q)return{graphicalItem:X,payload:Q}}else if(eU(X,U)||tU(X,U)||P_(X,U)){var ie=RZt({graphicalItem:X,activeTooltipItem:U,itemData:K.data}),oe=K.activeIndex===void 0?ie:K.activeIndex;return{graphicalItem:Nr(Nr({},X),{},{childIndex:oe}),payload:P_(X,U)?K.data[ie]:X.props.data[ie]}}}return null}},{key:"render",value:function(){var I=this;if(!p2e(this))return null;var R=this.props,O=R.children,U=R.className,L=R.width,z=R.height,X=R.style,ne=R.compact,J=R.title,K=R.desc,re=U6e(R,Mnn),he=wi(re,!1);if(ne)return Ae.createElement(g6e,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},Ae.createElement(ote,UC({},he,{width:L,height:z,title:J,desc:K}),this.renderClipPath(),x2e(O,this.renderMap)));if(this.props.accessibilityLayer){var Q,ie;he.tabIndex=(Q=this.props.tabIndex)!==null&&Q!==void 0?Q:0,he.role=(ie=this.props.role)!==null&&ie!==void 0?ie:"application",he.onKeyDown=function(G){I.accessibilityManager.keyboardEvent(G)},he.onFocus=function(){I.accessibilityManager.focus()}}var oe=this.parseEventsOfWrapper();return Ae.createElement(g6e,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},Ae.createElement("div",UC({className:ia("recharts-wrapper",U),style:Nr({position:"relative",cursor:"default",width:L,height:z},X)},oe,{ref:function(V){I.container=V}}),Ae.createElement(ote,UC({},he,{width:L,height:z,title:J,desc:K,style:Znn}),this.renderClipPath(),x2e(O,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(m.Component);ti(v,"displayName",n),ti(v,"defaultProps",Nr({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),ti(v,"getDerivedStateFromProps",function(C,N){var P=C.dataKey,I=C.data,R=C.children,O=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 K=V6e(C);return Nr(Nr(Nr({},K),{},{updateId:0},g(Nr(Nr({props:C},K),{},{updateId:0}),N)),{},{prevDataKey:P,prevData:I,prevWidth:O,prevHeight:U,prevLayout:L,prevStackOffset:z,prevMargin:X,prevChildren:R})}if(P!==N.prevDataKey||I!==N.prevData||O!==N.prevWidth||U!==N.prevHeight||L!==N.prevLayout||z!==N.prevStackOffset||!h4(X,N.prevMargin)){var re=V6e(C),he={chartX:N.chartX,chartY:N.chartY,isTooltipActive:N.isTooltipActive},Q=Nr(Nr({},H6e(N,I,L)),{},{updateId:N.updateId+1}),ie=Nr(Nr(Nr({},re),he),Q);return Nr(Nr(Nr({},ie),g(Nr({props:C},ie),N)),{},{prevDataKey:P,prevData:I,prevWidth:O,prevHeight:U,prevLayout:L,prevStackOffset:z,prevMargin:X,prevChildren:R})}if(!ite(R,N.prevChildren)){var oe,G,V,te,ae=Lf(R,FN),fe=ae&&(oe=(G=ae.props)===null||G===void 0?void 0:G.startIndex)!==null&&oe!==void 0?oe:ne,Ne=ae&&(V=(te=ae.props)===null||te===void 0?void 0:te.endIndex)!==null&&V!==void 0?V:J,me=fe!==ne||Ne!==J,we=!Ci(I),xe=we&&!me?N.updateId:N.updateId+1;return Nr(Nr({updateId:xe},g(Nr(Nr({props:C},N),{},{updateId:xe,dataStartIndex:fe,dataEndIndex:Ne}),N)),{},{prevChildren:R,dataStartIndex:fe,dataEndIndex:Ne})}return null}),ti(v,"renderActiveDot",function(C,N,P){var I;return m.isValidElement(C)?I=m.cloneElement(C,N):ji(C)?I=C(N):I=Ae.createElement(J$,N),Ae.createElement(Sa,{className:"recharts-active-dot",key:P},I)});var w=m.forwardRef(function(N,P){return Ae.createElement(v,UC({},N,{ref:P}))});return w.displayName=v.displayName,w},lrn=AUe({chartName:"LineChart",GraphicalChild:I0,axisComponents:[{axisType:"xAxis",AxisComp:r8},{axisType:"yAxis",AxisComp:s8}],formatAxisMap:O$e}),crn=AUe({chartName:"ComposedChart",GraphicalChild:[I0,E5,t8,lU],axisComponents:[{axisType:"xAxis",AxisComp:r8},{axisType:"yAxis",AxisComp:s8},{axisType:"zAxis",AxisComp:oU}],formatAxisMap:O$e});const urn=({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 P=(((g=(x=(await hs.post("https://api-ui.hyperliquid.xyz/info",{type:"portfolio",user:c},{headers:{Accept:"*/*","Content-Type":"application/json"},signal:u.signal})).data.find(I=>I[0]===f))==null?void 0:x[1])==null?void 0:g[s])||[]).map(([I,R])=>({time:new Date(I).getTime(),value:parseFloat(R)}));n(P)}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(YNe,{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(lBe,{width:"100%",height:40,children:i.jsxs(lrn,{data:t,children:[i.jsx(r8,{dataKey:"time",hide:!0}),i.jsx(s8,{hide:!0}),i.jsx(Xp,{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(I0,{type:"monotone",dataKey:"value",stroke:"#67FFBD",strokeWidth:2,dot:!1,isAnimationActive:!1})]})})})},drn="https://dextradata.nftinit.io/api/hyper/analytics/wallet_backtest_summary/?format=json&limit=48&offset=0&order_by=three_month_pnl&order_dir=desc",frn=({handleAddedTime:e})=>{const{trackedWatchList:t,copyTradeWatchList:n,setSignModalOpen:r}=m.useContext(Qr),{address:s}=ts(),[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),[P,I]=m.useState(null),[R,O]=m.useState("");m.useEffect(()=>{(async()=>{try{c(!0),d(null);const J=await fetch(drn);if(!J.ok)throw new Error(`HTTP error! status: ${J.status}`);const K=await J.json();o((K==null?void 0:K.data)||[])}catch{d("Failed to fetch wallets.")}finally{c(!1)}})()},[]);const U=async({walletAddress:ne,isFollow:J,isScalper:K})=>{try{O(ne);const re=window.localStorage.getItem("hyperToken"),he=window.localStorage.getItem("hyperAddress");if(!re){r(!0);return}const Q=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(Q,{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,te)=>new Date(te.created_at||0)-new Date(V.created_at||0)):G==null?void 0:G.data),I(K),w(!0)):tn.error(G.error_message)}catch(re){tn.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(w5,{open:v,setOpen:w,copyTradeData:C,copyTradeWallet:R,setCopyTradeWallet:O,isScalper:P,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(Ba,{})}):i.jsxs(i.Fragment,{children:[X==null?void 0:X.map((ne,J)=>{var he,Q,ie,oe,G,V,te,ae,fe;const K=t==null?void 0:t.some(Ne=>Ne.wallet_address===(ne==null?void 0:ne.user_token)),re=n==null?void 0:n.some(Ne=>Ne.wallet_address===(ne==null?void 0:ne.user_token));return i.jsx(am.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:Ki,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(v5,{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:K?i.jsx("img",{src:o5,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"}):i.jsx("img",{src:NA,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"})})}),i.jsx(urn,{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(OY,{title:"PNL",data:[{label:"7D:",value:(he=ne==null?void 0:ne.source_data)==null?void 0:he.portfolio_perp_week_pnl,format:Os},{label:"30D:",value:(Q=ne==null?void 0:ne.source_data)==null?void 0:Q.portfolio_perp_month_pnl,format:Os},{label:"90D:",value:(ie=ne==null?void 0:ne.source_data)==null?void 0:ie.portfolio_perp_3month_pnl,format:Os}]}),i.jsx(OY,{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(OY,{title:"Drawdown",data:[{label:"7D:",value:(te=ne==null?void 0:ne.source_data)==null?void 0:te.portfolio_perp_week_dd,format:Os},{label:"30D:",value:(ae=ne==null?void 0:ne.source_data)==null?void 0:ae.portfolio_perp_month_dd,format:Os},{label:"90D:",value:(fe=ne==null?void 0:ne.source_data)==null?void 0:fe.portfolio_perp_3month_dd,format:Os}]})]}),i.jsxs(am.button,{onClick:Ne=>{Ne.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(am.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(am.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"})]})]})})]})},OY=({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)):Os(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]"})]}),hrn=({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(Ea,{open:e,onClose:a,className:"relative z-50",children:[i.jsx(ja,{as:am.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(ga,{as:am.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(am.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:$a,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(frn,{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"})]})]})})})})]})},prn=()=>{const[e,t]=m.useState(!1);return i.jsxs(i.Fragment,{children:[i.jsx(hrn,{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 mrn(){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(prn,{})}),i.jsxs("div",{className:"h-full w-full flex items-center justify-end gap-2",children:[i.jsx(PLt,{}),i.jsx(FLt,{}),i.jsx(OLt,{}),i.jsx(MLt,{})]})]})})}const xrn=()=>{const e=oc();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(ILt,{}),i.jsx("div",{className:"hidden sm:block",children:i.jsx(rLt,{})}),i.jsx("div",{className:"block sm:hidden",children:i.jsx(TLt,{})}),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(VKe,{})})}),i.jsx(mrn,{})]})},oa=({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})]}),Qa=({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"})}),uU=({sortKey:e,state:t,className:n})=>"-"+e===t?i.jsx(Qa,{className:"text-white hover:text-[#D8D3D3] group-hover:text-[#D8D3D3] rotate-180 "+n}):e===t?i.jsx(Qa,{className:"text-white hover:text-[#D8D3D3] group-hover:text-[#D8D3D3] "+n}):i.jsx(Qa,{className:"text-[#9B9B9B] hover:text-[#D8D3D3] group-hover:text-[#D8D3D3] "+n}),Qo=({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(uU,{sortKey:t,state:n,className:""})]})})};function Fl(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(Ai,{className:"text-[#c9c9c9] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(Oa,{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 grn=({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"})}),MY=({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(grn,{})})]}),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})]})},brn=({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"})]}),yrn=({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"})}),vrn=({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"})});aBe();function wrn(e){var X,ne,J,K,re,he,Q,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 te;const V=(te=e.advancedFilters)==null?void 0:te.coin;if(e.dataCoin.length>0){const fe=V.split(",").map(Ne=>e.dataCoin.find(me=>me.value===Ne)).filter(Boolean);e.setSelectedCoins(fe)}},[e.dataCoin]),m.useEffect(()=>{var te;const V=(te=e.advancedFilters)==null?void 0:te.refcode;if(V&&e.dataReferral.length>0){const fe=V.split(",").map(Ne=>e.dataReferral.find(me=>me.value===Ne)).filter(Boolean);e.setSelectedReferrals(fe)}},[e.dataReferral]);const l=V=>{if(!V)return;const ae=Array.isArray(V)?V:[V],fe=e.selectedCoins||[],Ne=[...fe,...ae.filter(xe=>!fe.some(ye=>ye.value===xe.value))],we=Ne.map(xe=>xe.value).join(",");e.setSelectedCoins(Ne),e.setAdvancedFilters(xe=>({...xe,coin:we}))},c=V=>{if(!V)return;const ae=Array.isArray(V)?V:[V],fe=e.selectedReferrals||[],Ne=[...fe,...ae.filter(we=>!fe.some(xe=>xe.value===we.value))],me=Ne.map(we=>we.value);me.join(","),e.setSelectedReferrals(Ne),e.setAdvancedFilters(we=>({...we,refcode:me}))},u=V=>{const{name:te,value:ae}=V.target;e.setAdvancedFilters(fe=>({...fe,[te]:ae}))},d={control:(V,{isFocused:te})=>{var ae,fe,Ne,me,we,xe,ye,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((Ne=e.advancedFilters)==null?void 0:Ne.coin)=="string"&&((me=e.advancedFilters)==null?void 0:me.coin.trim())!==""?"1px solid #8d67ff":"none",boxShadow:"none",borderRadius:"6px",":hover":{border:Array.isArray((we=e.advancedFilters)==null?void 0:we.coin)&&((xe=e.advancedFilters)==null?void 0:xe.coin.length)>0||typeof((ye=e.advancedFilters)==null?void 0:ye.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:te,isDisabled:ae,isFocused:fe,isSelected:Ne})=>{const me=gi(te.color);return{...V,fontSize:"14px",fontWeight:"600",backgroundColor:ae?void 0:Ne?te.color:fe?me.alpha(.1).css():void 0,color:"white",cursor:ae?"not-allowed":"pointer",":active":{...V[":active"],backgroundColor:ae?void 0:Ne?te.color:me.alpha(.9).css()}}},multiValue:(V,{data:te})=>{const ae=gi(te.color);return{...V,backgroundColor:ae.alpha(.4).css()}},multiValueLabel:(V,{data:te})=>({...V,color:"white"}),multiValueRemove:(V,{data:te})=>({...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:te})=>{var ae,fe,Ne,me,we,xe,ye,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((Ne=e.advancedFilters)==null?void 0:Ne.refcode)=="string"&&((me=e.advancedFilters)==null?void 0:me.refcode.trim())!==""?"1px solid #8d67ff":"none",boxShadow:"none",borderRadius:"6px",":hover":{border:Array.isArray((we=e.advancedFilters)==null?void 0:we.refcode)&&((xe=e.advancedFilters)==null?void 0:xe.refcode.length)>0||typeof((ye=e.advancedFilters)==null?void 0:ye.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:te,isDisabled:ae,isFocused:fe,isSelected:Ne})=>{const me=gi(te.color);return{...V,fontSize:"14px",fontWeight:"600",backgroundColor:ae?void 0:Ne?te.color:fe?me.alpha(.1).css():void 0,color:"white",cursor:ae?"not-allowed":"pointer",":active":{...V[":active"],backgroundColor:ae?void 0:Ne?te.color:me.alpha(.9).css()}}},multiValue:(V,{data:te})=>{const ae=gi(te.color);return{...V,backgroundColor:ae.alpha(.4).css()}},multiValueLabel:(V,{data:te})=>({...V,color:"white"}),multiValueRemove:(V,{data:te})=>({...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,te)=>{var fe;const ae=(fe=te.selectedCoins)==null?void 0:fe.filter(Ne=>Ne.value!==V.value);te.setSelectedCoins(ae),te.setAdvancedFilters(Ne=>({...Ne,coin:ae==null?void 0:ae.map(we=>we.value)}))},g=(V,te)=>{var fe;const ae=(fe=te.selectedReferrals)==null?void 0:fe.filter(Ne=>Ne.value!==V.value);te.setSelectedReferrals(ae),te.setAdvancedFilters(Ne=>({...Ne,refcode:ae==null?void 0:ae.map(we=>we.value)}))};m.useEffect(()=>{const V=te=>{r.current&&!r.current.contains(te.target)&&n(!1)};return document.addEventListener("mousedown",V),()=>{document.removeEventListener("mousedown",V)}},[]),m.useEffect(()=>{const V=te=>{o.current&&!o.current.contains(te.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:te})=>{const[ae,fe]=Ae.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:te,className:"rounded-full w-5 h-5 min-w-5 min-h-5 mr-1",loading:"lazy",onError:()=>fe(!0)})},C=V=>{const{data:te,innerRef:ae,innerProps:fe,selectProps:Ne}=V,me=Ne.styles.option({},V);return i.jsxs("div",{ref:ae,...fe,style:me,className:"flex items-center p-2",children:[i.jsx(w,{src:te.icon,alt:te.label}),te.label]})},N=(V,te)=>te.reduce((ae,fe)=>{const Ne=V[fe];return Ne!==void 0&&Ne!==""&&Ne!==null&&ae++,ae},0),P=()=>{const V=e.advancedFilters.is_favorite_wallet?"":!0;e.setAdvancedFilters(te=>({...te,is_favorite_wallet:V}))},I=["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"],O=["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(_y,{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(_y,{className:"text-[#646464] absolute left-[6px] top-[7px] z-10"}),i.jsx(Nl,{closeMenuOnSelect:!1,value:[],isMulti:!0,options:e.dataCoin.filter(V=>Array.isArray(e.selectedCoins)&&!e.selectedCoins.some(te=>te.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&&((K=e.selectedCoins)==null?void 0:K.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:te=>{te.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(nw,{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(nw,{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:rke,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:P,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:P,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:Cyt,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(_y,{className:`${t?"-z-10":"z-10"} text-[#646464] absolute left-[6px] top-[7px]`}),i.jsx(Nl,{closeMenuOnSelect:!1,value:[],isMulti:!0,options:e.dataReferral.filter(V=>Array.isArray(e.selectedReferrals)&&!e.selectedReferrals.some(te=>te.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&&((Q=e.selectedReferrals)==null?void 0:Q.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:te=>{te.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(nw,{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(nw,{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(MY,{title:"Wallet Filters",titleInfo:N(e.advancedFilters,e.period!=999?I:R),icon:i.jsx(brn,{className:"text-white"}),children:[i.jsx(Fl,{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(Fl,{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(Fl,{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(Fl,{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(Fl,{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(Fl,{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(Fl,{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(Fl,{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(MY,{title:"Performance Filters",titleInfo:N(e.advancedFilters,e.period==999?U:e.period==1?L:O),icon:i.jsx(yrn,{}),children:[i.jsx(Fl,{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(Fl,{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(Fl,{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(Fl,{minFilterType:e.advancedFilters.min_sharpe,maxFilterType:e.advancedFilters.max_sharpe,handleChange:u,minInputName:"min_sharpe",maxInputName:"max_sharpe",name:"Sharpe",isTooltip:!1}),i.jsx(Fl,{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(Fl,{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(Fl,{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(Fl,{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(Fl,{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(Fl,{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(Fl,{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(Fl,{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(MY,{title:"Date Filters",titleInfo:N(e.advancedFilters,z),icon:i.jsx(vrn,{}),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 Crn=({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:P,selectedReferrals:I,setSelectedReferrals:R,isLoadingReferral:O,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(wrn,{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:P,selectedReferrals:I,setSelectedReferrals:R,isLoadingReferral:O,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"})})})})})]})})},jUe=()=>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:Vbt,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))?"-":Os(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 Srn({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(Ai,{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(rd,{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(rd,{className:`${e===r?"text-white/30":"text-white"} w-3 h-3 -rotate-90`})})]})]})}const Nrn=({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 Arn({open:e,setOpen:t}){return i.jsxs(Ea,{open:e,onClose:t,className:"relative z-50 font-manrope",children:[i.jsx(ja,{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(ga,{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:$a})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Ki,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 jrn(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 Ern=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function Ty(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}let sC=null;function EUe(e={}){return sC||(e.includeStyleProperties?(sC=e.includeStyleProperties,sC):(sC=Ty(window.getComputedStyle(document.documentElement)),sC))}function zL(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function _rn(e){const t=zL(e,"border-left-width"),n=zL(e,"border-right-width");return e.clientWidth+t+n}function krn(e){const t=zL(e,"border-top-width"),n=zL(e,"border-bottom-width");return e.clientHeight+t+n}function _Ue(e,t={}){const n=t.width||_rn(e),r=t.height||krn(e);return{width:n,height:r}}function Trn(){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 Ef=16384;function Irn(e){(e.width>Ef||e.height>Ef)&&(e.width>Ef&&e.height>Ef?e.width>e.height?(e.height*=Ef/e.width,e.width=Ef):(e.width*=Ef/e.height,e.height=Ef):e.width>Ef?(e.height*=Ef/e.width,e.width=Ef):(e.width*=Ef/e.height,e.height=Ef))}function HL(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 Prn(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Frn(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),Prn(s)}const lf=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||lf(n,t)};function Orn(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Mrn(e,t){return EUe(t).map(n=>{const r=e.getPropertyValue(n),s=e.getPropertyPriority(n);return`${n}: ${r}${s?" !important":""};`}).join(" ")}function Rrn(e,t,n,r){const s=`.${e}:${t}`,a=n.cssText?Orn(n):Mrn(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=Ern();try{t.className=`${t.className} ${o}`}catch{return}const l=document.createElement("style");l.appendChild(Rrn(o,n,s,r)),t.appendChild(l)}function Lrn(e,t,n){K6e(e,t,":before",n),K6e(e,t,":after",n)}const Y6e="application/font-woff",X6e="image/jpeg",Drn={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 Brn(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Tce(e){const t=Brn(e).toLowerCase();return Drn[t]||""}function $rn(e){return e.split(/,/)[1]}function Nne(e){return e.search(/^(data:)/)!==-1}function Urn(e,t){return`data:${t};base64,${e}`}async function kUe(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 RY={};function zrn(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=zrn(e,t,n.includeQueryParams);if(RY[r]!=null)return RY[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let s;try{const a=await kUe(e,n.fetchRequestInit,({res:o,result:l})=>(t||(t=o.headers.get("Content-Type")||""),$rn(l)));s=Urn(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 RY[r]=s,s}async function Hrn(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):HL(t)}async function Vrn(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 HL(l)}const n=e.poster,r=Tce(n),s=await Ice(n,r,t);return HL(s)}async function Wrn(e,t){var n;try{if(!((n=e==null?void 0:e.contentDocument)===null||n===void 0)&&n.body)return await dU(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function qrn(e,t){return lf(e,HTMLCanvasElement)?Hrn(e):lf(e,HTMLVideoElement)?Vrn(e,t):lf(e,HTMLIFrameElement)?Wrn(e,t):e.cloneNode(TUe(e))}const Grn=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",TUe=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function Krn(e,t,n){var r,s;if(TUe(t))return t;let a=[];return Grn(e)&&e.assignedNodes?a=Ty(e.assignedNodes()):lf(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?a=Ty(e.contentDocument.body.childNodes):a=Ty(((s=e.shadowRoot)!==null&&s!==void 0?s:e).childNodes),a.length===0||lf(e,HTMLVideoElement)||await a.reduce((o,l)=>o.then(()=>dU(l,n)).then(c=>{c&&t.appendChild(c)}),Promise.resolve()),t}function Yrn(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):EUe(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`),lf(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 Xrn(e,t){lf(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),lf(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function Qrn(e,t){if(lf(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(s=>e.value===s.getAttribute("value"));r&&r.setAttribute("selected","")}}function Zrn(e,t,n){return lf(t,Element)&&(Yrn(e,t,n),Lrn(e,t,n),Xrn(e,t),Qrn(e,t)),t}async function Jrn(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 dU(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 dU(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>qrn(r,t)).then(r=>Krn(e,r,t)).then(r=>Zrn(e,r,t)).then(r=>Jrn(r,t))}const IUe=/url\((['"]?)([^'"]+?)\1\)/g,esn=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,tsn=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function nsn(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function rsn(e){const t=[];return e.replace(IUe,(n,r,s)=>(t.push(s),n)),t.filter(n=>!Nne(n))}async function ssn(e,t,n,r,s){try{const a=n?jrn(t,n):t,o=Tce(t);let l;return s||(l=await Ice(a,o,r)),e.replace(nsn(t),`$1${l}$3`)}catch{}return e}function isn(e,{preferredFontFormat:t}){return t?e.replace(tsn,n=>{for(;;){const[r,,s]=esn.exec(n)||[];if(!s)return"";if(s===t)return`src: ${r};`}}):e}function PUe(e){return e.search(IUe)!==-1}async function FUe(e,t,n){if(!PUe(e))return e;const r=isn(e,n);return rsn(r).reduce((a,o)=>a.then(l=>ssn(l,o,t,n)),Promise.resolve(r))}async function iC(e,t,n){var r;const s=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(s){const a=await FUe(s,null,n);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function asn(e,t){await iC("background",e,t)||await iC("background-image",e,t),await iC("mask",e,t)||await iC("-webkit-mask",e,t)||await iC("mask-image",e,t)||await iC("-webkit-mask-image",e,t)}async function osn(e,t){const n=lf(e,HTMLImageElement);if(!(n&&!Nne(e.src))&&!(lf(e,SVGImageElement)&&!Nne(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 lsn(e,t){const r=Ty(e.childNodes).map(s=>OUe(s,t));await Promise.all(r).then(()=>e)}async function OUe(e,t){lf(e,Element)&&(await asn(e,t),await osn(e,t),await lsn(e,t))}function csn(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),kUe(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 usn(e,t){const n=[],r=[];return e.forEach(s=>{if("cssRules"in s)try{Ty(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{Ty(s.cssRules||[]).forEach(a=>{n.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${s.href}`,a)}}),n))}function dsn(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>PUe(t.style.getPropertyValue("src")))}async function fsn(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=Ty(e.ownerDocument.styleSheets),r=await usn(n,t);return dsn(r)}function MUe(e){return e.trim().replace(/["']/g,"")}function hsn(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(a=>{t.add(MUe(a))}),Array.from(r.children).forEach(a=>{a instanceof HTMLElement&&n(a)})}return n(e),t}async function psn(e,t){const n=await fsn(e,t),r=hsn(e);return(await Promise.all(n.filter(a=>r.has(MUe(a.style.fontFamily))).map(a=>{const o=a.parentStyleSheet?a.parentStyleSheet.href:null;return FUe(a.cssText,o,t)}))).join(`
`)}async function msn(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await psn(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 xsn(e,t={}){const{width:n,height:r}=_Ue(e,t),s=await dU(e,t,!0);return await msn(s,t),await OUe(s,t),csn(s,t),await Frn(s,n,r)}async function gsn(e,t={}){const{width:n,height:r}=_Ue(e,t),s=await xsn(e,t),a=await HL(s),o=document.createElement("canvas"),l=o.getContext("2d"),c=t.pixelRatio||Trn(),u=t.canvasWidth||n,d=t.canvasHeight||r;return o.width=u*c,o.height=d*c,t.skipAutoScale||Irn(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 P1(e,t={}){return(await gsn(e,t)).toDataURL()}function bsn({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 P1(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),tn.success("PNG successfully downloaded!")}catch(l){console.error("Error generating PNG:",l),tn.error("Failed to download PNG.")}};return i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{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(ga,{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:$a})})}),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:EA,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))?"--":`$${Os(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))?"--":Os(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:AA,alt:"",className:"h-full"}):i.jsx("img",{src:jA,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))?"--":`$${Os(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))?"--":`$${Os(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"),tn.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${Os(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 ysn({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 P1(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),tn.success("PNG successfully downloaded!")}catch(o){console.error("Error generating PNG:",o),tn.error("Failed to download PNG.")}};return i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{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(ga,{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:$a})})}),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:EA,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))?"--":`${Os(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))?"--":`$${Os(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:AA,alt:"",className:"h-full"}):i.jsx("img",{src:jA,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))?"--":`$${Os(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))?"--":`$${Os(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"),tn.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?"":"-"}$${Os(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 RUe=()=>{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(Ea,{open:e,onClose:n,className:"relative z-50 font-manrope hidden lg:block",children:[i.jsx(ja,{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(ga,{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:$a})})}),i.jsx("div",{className:"pt-2 px-2",children:i.jsx("img",{src:syt,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. 🚀"})]})]})})})})})]})},vsn=({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}`})]})})}),wsn=({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:P,getCopyTradeWatchList:I,trackedWatchList:R,getTrackedWatchList:O,setSignModalOpen:U,setTelegramChatId:L,setSubscriberRole:z,setSubsExpireDay:X,setMushboomerETH:ne,setMushboomerSOL:J,setIsReferralCode:K,isReferralCodeName:re,setIsReferralCodeName:he,setIsWhitelist:Q,setHyperToken:ie,setHyperAddress:oe}=m.useContext(Qr),{isConnected:G,address:V}=ts();Wo(),oc();const[te,ae]=m.useState(!1),[fe,Ne]=m.useState(null),[me,we]=m.useState(null),[xe,ye]=m.useState(""),[je,Pe]=m.useState(""),[Re,Xe]=m.useState(""),[Ke,ut]=m.useState(""),[et,tt]=m.useState(""),[Le,$e]=m.useState([]),[ht,pt]=m.useState(!0),[Kt,wt]=m.useState([]),[nn,cn]=m.useState([]),[zn,Xt]=m.useState(!0),[on,Zt]=m.useState([]),[Ye,Ze]=m.useState(!1),[Ft,dn]=m.useState(!1),Yt=`portfolio_perp_${{1:"day",7:"week",30:"month",90:"3month",999:"all_time"}[a]||"day"}_pnl`,Bt=`portfolio_perp_${{1:"day",7:"week",30:"month",90:"3month",999:"all_time"}[a]||"day"}_dd`,ot=`portfolio_perp_${{1:"day",7:"week",30:"month",90:"3month",999:"all_time"}[a]||"day"}_growth_rate`,De=`portfolio_perp_${{1:"day",7:"week",30:"month",90:"3month",999:"all_time"}[a]||"day"}_sharpe`;function _t(Oe){if(!Oe)return"--";const Jt=parseInt(Oe==null?void 0:Oe.split(":")[0]),sn=parseInt(Oe==null?void 0:Oe.split(":")[1]);return`${Jt}h ${sn}m`}m.useEffect(()=>{(async()=>{var Et,Xn;const Jt=window.localStorage.getItem("hyperToken"),sn=window.localStorage.getItem("hyperAddress");if(!(!Jt||!sn))try{const gn=await _i(sn.toLowerCase(),Jt);gn!=null&&gn.success?(L(gn==null?void 0:gn.telegram_chat_id),z(gn==null?void 0:gn.subscriber_role),X(gn==null?void 0:gn.subs_expire_day),ne((Et=gn==null?void 0:gn.mushboomer_counts)==null?void 0:Et.eth),J((Xn=gn==null?void 0:gn.mushboomer_counts)==null?void 0:Xn.sol),K(gn==null?void 0:gn.referral_code),he(gn==null?void 0:gn.refcode),Q(gn==null?void 0:gn.whitelist),ie(Jt),oe(sn)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),ie(""),oe(""))}catch(gn){console.error("Token verification error:",gn),console.error(gn.message||"An unknown error occurred.")}})()},[]);const ze={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};m.useEffect(()=>{(async()=>{var Jt,sn;try{const Xn=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_coins/")).json(),gn=()=>gi.random().hex(),Dt=(sn=(Jt=Xn.coins)==null?void 0:Jt.filter(en=>!en.startsWith("@")&&!en.endsWith("/USDC")))==null?void 0:sn.map(en=>({value:en,label:en.endsWith("/USDC")?en+" (Spot)":en,color:gn(),icon:`https://app.hyperliquid.xyz/coins/${ze[en]||(en==null?void 0:en.split("/")[0])}.svg`}));$e(Dt),pt(!1)}catch(Et){console.error("Data retrieval error:",Et),pt(!1)}})()},[]),m.useEffect(()=>{(async()=>{var Jt,sn;try{const Xn=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_refcodes/")).json(),gn=()=>gi.random().hex(),Dt=(sn=(Jt=Xn==null?void 0:Xn.refcodes)==null?void 0:Jt.filter(en=>en.code!=="DEXTRABOT"))==null?void 0:sn.slice(0,1300).map(en=>({value:en.code,label:en.code,color:gn()}));cn(Dt),Xt(!1)}catch(Et){console.error("Data retrieval error:",Et),Xt(!1)}})()},[]);const nt=Oe=>{const Jt=["Growth Rate","Drawdown","Drawdown PnL","Sharpe"],sn=[{header:"Popular Wallet",value:Et=>{const Xn=Number(Et.copier_count)||0;return Xn===0?"":Xn<=5?"F":Xn<=10?"FF":"FFF"}},{header:"Wallet",value:Et=>Et.user_token},{header:"PnL",value:Et=>(Et==null?void 0:Et[Yt])==null||isNaN(+(Et==null?void 0:Et[Yt]))?"--":`$${Os(Et==null?void 0:Et[Yt])}`},{header:"uPnL",value:Et=>Et.total_unrealized_pnl==null||isNaN(+Et.total_unrealized_pnl)?"--":`$${Os(Et.total_unrealized_pnl)}`},{header:"Perp Equity",value:Et=>Et.portfolio_perp_all_time_value==null||isNaN(+Et.portfolio_perp_all_time_value)?"--":`$${Os(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?"--":`${Os(Math.abs(Et.complated_trades_count))}`},{header:"Win Count",value:Et=>Et.complated_win_count==null||isNaN(+Et.complated_win_count)||Oe==999?"--":`${Os(Math.abs(Et.complated_win_count))}`},{header:"Loss Count",value:Et=>Et.complated_loss_count==null||isNaN(+Et.complated_loss_count)?"--":`${Os(Math.abs(Et.complated_loss_count))}`},{header:"Long PnL",value:Et=>Et.long_kar==null||isNaN(+Et.long_kar)||Oe==999?"--":`$${Os(Math.abs(Et.long_kar))}`},{header:"Short PnL",value:Et=>Et.short_kar==null||isNaN(+Et.short_kar)||Oe==999?"--":`$${Os(Et.short_kar)}`},{header:"Growth Rate",value:Et=>(Et==null?void 0:Et[ot])==null||isNaN(+(Et==null?void 0:Et[ot]))||Oe==1||Oe==999?"--":`%${Os(Et==null?void 0:Et[ot])}`},{header:"Drawdown",value:Et=>(Et==null?void 0:Et[Bt])==null||isNaN(+(Et==null?void 0:Et[Bt]))||Oe==999?"--":`%${Os(Et==null?void 0:Et[Bt])}`},{header:"Sharpe",value:Et=>(Et==null?void 0:Et[De])==null||isNaN(+(Et==null?void 0:Et[De]))||Oe==999?"--":`${Et==null?void 0:Et[De]}`},{header:"Tx Count",value:Et=>Et.rtx_count==null||isNaN(+Et.rtx_count)||Oe==999?"--":`${Os(Et.rtx_count)}`},{header:"ROE (%)",value:Et=>Et.margin_roi==null||isNaN(+Et.margin_roi)?"--":`${Os(Et.margin_roi)}%`},{header:"Margin / Used",value:Et=>Et.margin_used==null||isNaN(+Et.margin_used)||Et.margin_percentage==null||isNaN(+Et.margin_percentage)?"--":`${Os(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)?"--":`$${Os(Et.funding)}`},{header:"rToken #",value:Et=>Et.token_count==null||isNaN(+Et.token_count)||Oe==999?"--":Os(Et.token_count)},{header:"uToken #",value:Et=>Et.position_count==null||isNaN(+Et.position_count)?"--":Os(Et.position_count)},{header:"Avg. Dur.",value:Et=>Oe==999?"--":`${_t(Et.complated_avg_duration)}`},{header:"First Tx Time",value:Et=>Oe==999?"--":FI(Et.first_time)},{header:"Last Tx Time",value:Et=>Oe==999?"--":FI(Et.end_time)}];return Oe===1?sn.filter(Et=>!Jt.includes(Et.header)):sn},mt=()=>{if(!(f!=null&&f.length))return;const Oe=new Date,Jt=Qn=>Qn.toString().padStart(2,"0"),sn=`discoverwallet_${Jt(Oe.getDate())}${Jt(Oe.getMonth()+1)}${Oe.getFullYear()}_${Jt(Oe.getHours())}${Jt(Oe.getMinutes())}.csv`,Et=nt(a),Xn=Et.map(Qn=>`"${Qn.header}"`).join(","),gn=f==null?void 0:f.map(Qn=>Et==null?void 0:Et.map(ar=>`"${ar.value(Qn)}"`).join(",")),Dt=new Blob([Xn+`\r
`+gn.join(`\r
`)],{type:"text/csv;charset=utf-8;"}),en=URL.createObjectURL(Dt);Object.assign(document.createElement("a"),{href:en,download:sn}).click(),URL.revokeObjectURL(en)},[$t,Pt]=m.useState("-perp_pnl"),[un,an]=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 Jt={period:a===999?"all_time":a,order:$t,offset:t===-50?"0":t.toString(),limit:"50",...un},sn=Object.entries(Jt).filter(([en,In])=>In!=null).map(([en,In])=>`${encodeURIComponent(en)}=${encodeURIComponent(In)}`).join("&"),Et=`https://dextradata.nftinit.io/api/hyper/${a==999?"get_wallets_profit_all_time":"get_wallets_profit_new"}/?${sn}`,Xn=await fetch(Et.toString());if(!Xn.ok)throw new Error(`HTTP error! status: ${Xn.status}`);const gn=await Xn.json();r(Math.ceil(gn.count/50)),s(gn.count),e((t+50)/50),window.localStorage.getItem("hyperToken")&&(I(),O()),x(gn.results)}catch(Jt){x([]),console.error("Error fetching data:",Jt),C(Jt.message)}finally{v(!1)}}Oe()},[t,$t,a]);async function xn(Oe){try{v(!0);const Jt={period:a===999?"all_time":a,order:$t,offset:t===-50?"0":t.toString(),limit:"50",...un},sn=Object.entries(Jt).filter(([en,In])=>In!=null).map(([en,In])=>`${encodeURIComponent(en)}=${encodeURIComponent(In)}`).join("&"),Et=`https://dextradata.nftinit.io/api/hyper/${a==999?"get_wallets_profit_all_time":"get_wallets_profit_new"}/?${sn}`,Xn=await fetch(Et);if(!Xn.ok)throw new Error(`HTTP error! status: ${Xn.status}`);const gn=await Xn.json();e(1),r(Math.ceil(gn.count/50)),s(gn.count),n(0),window.localStorage.getItem("hyperToken")&&(I(),O()),x(gn.results)}catch(Jt){x([]),console.error("Error fetching data:",Jt),C(Jt.message)}finally{v(!1)}}async function An(Oe){try{v(!0);const Jt=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=${$t}&offset=0&limit=50`);if(!Jt.ok)throw new Error(`HTTP error! status: ${Jt.status}`);const sn=await Jt.json();e(50/50),r(Math.ceil(sn.count/50)),s(sn.count),n(0),x(sn.results),window.localStorage.getItem("hyperToken")&&(I(),O()),an({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:""}),Pe(""),Xe(""),ut(""),tt(""),wt([])}catch(Jt){x([]),console.error("Error resetting filters:",Jt),C(Jt.message)}finally{v(!1)}}const kn=async({walletAddress:Oe,isFollow:Jt,isScalper:sn})=>{try{ye(Oe);const Et=window.localStorage.getItem("hyperToken"),Xn=window.localStorage.getItem("hyperAddress");if(!Et){U(!0);return}const gn=Jt?"https://dextrabothypev2.nftinit.io/api/test_app/following/info/":"https://dextrabothypev2.nftinit.io/api/hyper/following/get_setting/",Dt=Jt?{address:V?V.toLowerCase():Xn,token:Et,follow_address:Oe.toLowerCase()}:{address:V?V.toLowerCase():Xn,token:Et},en=await fetch(gn,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(Dt)});if(!en.ok)throw new Error(`Server responded with status ${en.status}`);const In=await en.json();In.success?(Ne(Array.isArray(In==null?void 0:In.data)?[...In.data].sort((Qn,ar)=>new Date(ar.created_at||0)-new Date(Qn.created_at||0)):In==null?void 0:In.data),we(sn),ae(!0)):(console.log(In.error_message),tn.error(In.error_message))}catch(Et){console.error("Error in like function:",Et),tn.error(Et.message||"Something went wrong!")}},yn=Oe=>Oe>=640&&Oe<1024?7:Oe>=1024&&Oe<1240?6:Oe>=1240&&Oe<1540?7:Oe>=1540?10:4,[Vn,Gn]=m.useState(!1),[Rn,Yn]=m.useState(!1),[Cn,rn]=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(RUe,{}),i.jsx(Arn,{open:Ye,setOpen:Ze}),i.jsx(w5,{open:te,setOpen:ae,copyTradeData:fe,setCopyTradeData:Ne,copyTradeWallet:xe,setCopyTradeWallet:ye,isScalper:me}),i.jsx(bsn,{open:Vn,setOpen:Gn,data:Cn,setTradeInfo:rn,period:a}),i.jsx(ysn,{open:Rn,setOpen:Yn,data:Cn,setTradeInfo:rn}),i.jsxs("div",{className:"block lg:hidden w-full p-2 space-y-2",children:[i.jsx(oMe,{}),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:mt,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:()=>dn(!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(Crn,{period:a,advancedFilters:un,setAdvancedFilters:an,resetFilters:An,setFilters:xn,minFirstValue:je,setMinFirstValue:Pe,maxFirstValue:Re,setMaxFirstValue:Xe,minEndValue:Ke,setMinEndValue:ut,maxEndValue:et,setMaxEndValue:tt,dataCoin:Le,selectedCoins:Kt,setSelectedCoins:wt,isLoadingCoin:ht,setIsLoadingCoin:pt,dataReferral:nn,selectedReferrals:on,setSelectedReferrals:Zt,isLoadingReferral:zn,setIsLoadingReferral:Xt})}),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(Srn,{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:mt,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(so,{content:"🔥🔥🔥 Copytrend indicator. More flames = more followers.",positionTop:!1,alignRight:!1,tooltipCss:"max-w-[215px] min-w-[215px] leading-[16px] -mb-5"})})]})}),i.jsx(Qo,{title:"",sortKey:"copier_count",sortOption:$t,setSortOption:Pt,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(Qo,{title:"Wallet",sortKey:"user_token",sortOption:$t,setSortOption:Pt,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(Ai,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(so,{content:"Realized profit/loss from completed trades.",positionTop:!1,alignRight:!1,tooltipCss:"max-w-[200px] min-w-[200px] leading-[16px] -mb-5"})})]})}),i.jsx(Qo,{title:"PnL",sortKey:"perp_pnl",sortOption:$t,setSortOption:Pt,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(Ai,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Oa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Qo,{title:"uPnL",sortKey:"total_unrealized_pnl",sortOption:$t,setSortOption:Pt,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(Ai,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Oa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Qo,{title:"Perp Equity",sortKey:"portfolio_perp_all_time_value",sortOption:$t,setSortOption:Pt,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(Ai,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Oa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Qo,{title:"Win Rate",sortKey:"win_complated_rate",sortOption:$t,setSortOption:Pt,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(Ai,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Oa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Qo,{title:"Total/Win/Loss",sortKey:"complated_trades_count",sortOption:$t,setSortOption:Pt,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(Ai,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Oa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Qo,{title:"Long PnL",sortKey:"long_kar",sortOption:$t,setSortOption:Pt,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(Ai,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Oa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Qo,{title:"Short PnL",sortKey:"short_kar",sortOption:$t,setSortOption:Pt,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(Ai,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(so,{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(Qo,{title:"Growth Rate",sortKey:"growth_rate",sortOption:$t,setSortOption:Pt,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(Ai,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(so,{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(Qo,{title:"Drawdown",sortKey:"perp_dd",sortOption:$t,setSortOption:Pt,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(Ai,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(so,{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(Qo,{title:"Sharpe",sortKey:"sharpe",sortOption:$t,setSortOption:Pt,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(Ai,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Oa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Qo,{title:"Tx Count",sortKey:"rtx_count",sortOption:$t,setSortOption:Pt,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(Ai,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Oa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Qo,{title:"ROE",sortKey:"margin_roi",sortOption:$t,setSortOption:Pt,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(Ai,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Oa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Qo,{title:"Margin",sortKey:"margin_percentage",sortOption:$t,setSortOption:Pt,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(Ai,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(Oa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Qo,{title:"Avg. Lvg.",sortKey:"avg_uleverage_value",sortOption:$t,setSortOption:Pt,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(Ai,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Oa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Qo,{title:"Funding",sortKey:"funding",sortOption:$t,setSortOption:Pt,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(Ai,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Oa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Qo,{title:"rToken #",sortKey:"token_count",sortOption:$t,setSortOption:Pt,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(Ai,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Oa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Qo,{title:"uToken #",sortKey:"position_count",sortOption:$t,setSortOption:Pt,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(Ai,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Oa,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Qo,{title:"Avg. Dur.",sortKey:"complated_avg_duration",sortOption:$t,setSortOption:Pt,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(Qo,{title:"First Tx Time",sortKey:"first_time",sortOption:$t,setSortOption:Pt,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(Qo,{title:"Last Tx Time",sortKey:"end_time",sortOption:$t,setSortOption:Pt,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:yn(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(Ba,{})})})}):w&&!f?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:yn(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:yn(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(jUe,{})})})}):f&&(f==null?void 0:f.map((Oe,Jt)=>i.jsxs(Ae.Fragment,{children:[i.jsxs("tr",{className:`${Jt%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:`${Jt%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:sn=>{sn.preventDefault();const Et=P==null?void 0:P.some(Xn=>Xn.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:`
                                  ${P.some(sn=>sn.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(v5,{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(sn=>sn.wallet_address===(Oe==null?void 0:Oe.user_token))?i.jsx("img",{src:o5,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"}):i.jsx("img",{src:NA,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"})})})]})})}),i.jsx("td",{scope:"row",className:`${Jt%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:`${Jt%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(oa,{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:sn=>{sn.stopPropagation(),navigator.clipboard.writeText(Oe==null?void 0:Oe.user_token),tn.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:Co,alt:"",className:"cursor-pointer"})]})})}),i.jsx("td",{className:"",children:i.jsxs("div",{onClick:sn=>{sn.preventDefault(),(Oe==null?void 0:Oe[Yt])!=null&&!isNaN(parseFloat(Oe==null?void 0:Oe[Yt]))&&(rn(Et=>({...Et,pnl:Oe==null?void 0:Oe[Yt],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})),Gn(!0))},className:`${(Oe==null?void 0:Oe[Yt])!=null&&!isNaN(parseFloat(Oe==null?void 0:Oe[Yt]))?"cursor-pointer":""} flex justify-end items-center gap-1 min-w-max px-1`,children:[i.jsx(oa,{info1:`$${Os(Math.abs(Oe==null?void 0:Oe[Yt]))}`,info1_Color:`${(Oe==null?void 0:Oe[Yt])==null||isNaN(parseFloat(Oe==null?void 0:Oe[Yt]))||(Oe==null?void 0:Oe[Yt])==0?"text-white":(Oe==null?void 0:Oe[Yt])>0?"text-[#1DE6A3]":"text-[#FF7173]"}`,rowTwo:!1}),(Oe==null?void 0:Oe[Yt])!=null&&!isNaN(parseFloat(Oe==null?void 0:Oe[Yt]))&&i.jsx("div",{className:"flex justify-center items-center rounded",children:i.jsx("img",{src:bm,alt:"",className:"w-[14px] h-[14px] min-w-[14px] min-h-[14px]"})})]})}),i.jsx("td",{className:"",children:i.jsxs("div",{onClick:sn=>{sn.preventDefault(),(Oe==null?void 0:Oe.total_unrealized_pnl)!=null&&!isNaN(parseFloat(Oe==null?void 0:Oe.total_unrealized_pnl))&&(rn(Et=>({...Et,pnl:Oe==null?void 0:Oe[Yt],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})),Yn(!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(oa,{info1:(Oe==null?void 0:Oe.total_unrealized_pnl)==null||isNaN(parseFloat(Oe==null?void 0:Oe.total_unrealized_pnl))?"--":`$${Os(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:bm,alt:"",className:"w-[14px] h-[14px] min-w-[14px] min-h-[14px]"})})]})}),i.jsx("td",{className:"",children:i.jsx(oa,{info1:(Oe==null?void 0:Oe.portfolio_perp_all_time_value)==null||isNaN(parseFloat(Oe==null?void 0:Oe.portfolio_perp_all_time_value))?"--":`$${Os(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(oa,{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(vsn,{info1:(Oe==null?void 0:Oe.complated_trades_count)==null||isNaN(parseFloat(Oe==null?void 0:Oe.complated_trades_count))?"--":`${Os(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))?"--":`${Os(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))?"--":`${Os(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(oa,{info1:(Oe==null?void 0:Oe.long_kar)==null||isNaN(parseFloat(Oe==null?void 0:Oe.long_kar))?"--":`$${Os(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(oa,{info1:`$${(Oe==null?void 0:Oe.short_kar)==null||isNaN(parseFloat(Oe==null?void 0:Oe.short_kar))?"--":Os(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(xi,{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(oa,{info1:`${a==1||a==999||(Oe==null?void 0:Oe[ot])==null||isNaN(parseFloat(Oe==null?void 0:Oe[ot]))||ot=="portfolio_perp_day_growth_rate"?"--":`${Os(Oe==null?void 0:Oe[ot])}%`}`,info1_Color:`${a==1||a==999?"text-gray-600":(Oe==null?void 0:Oe[ot])==null||isNaN(parseFloat(Oe==null?void 0:Oe[ot]))||ot=="portfolio_perp_day_growth_rate"||(Oe==null?void 0:Oe[ot])==0?"text-white":(Oe==null?void 0:Oe[ot])>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(xi,{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(oa,{info1:`${a==1||a==999||(Oe==null?void 0:Oe[Bt])==null||isNaN(parseFloat(Oe==null?void 0:Oe[Bt]))||Bt=="portfolio_perp_day_dd"?"--":`${Os(Math.abs(Oe==null?void 0:Oe[Bt]))}%`}`,info1_Color:`${a==1||a==999?"text-gray-600":(Oe==null?void 0:Oe[Bt])==null||isNaN(parseFloat(Oe==null?void 0:Oe[Bt]))||Bt=="portfolio_perp_day_dd"||(Oe==null?void 0:Oe[Bt])==0?"text-white":(Oe==null?void 0:Oe[Bt])>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(xi,{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(oa,{info1:`${a==1||a==999||(Oe==null?void 0:Oe[De])==null||isNaN(parseFloat(Oe==null?void 0:Oe[De]))||De=="portfolio_perp_day_sharpe"?"--":`${Er(Oe==null?void 0:Oe[De])}`}`,info1_Color:`${a==1||a==999?"text-gray-600":(Oe==null?void 0:Oe[De])==null||isNaN(parseFloat(Oe==null?void 0:Oe[De]))||De=="portfolio_perp_day_sharpe"?"text-white":(Oe==null?void 0:Oe[De])>=1&&(Oe==null?void 0:Oe[De])<=2?"text-[#E5BB18]":(Oe==null?void 0:Oe[De])>2?"text-[#1DE6A3]":"text-[#FF7173]"}`,rowTwo:!1})}),i.jsx("td",{className:`${a==999?"hidden":""}`,children:i.jsx(oa,{info1:`${(Oe==null?void 0:Oe.rtx_count)==null||isNaN(parseFloat(Oe==null?void 0:Oe.rtx_count))?"--":Os(Oe==null?void 0:Oe.rtx_count)}`,info1_Color:"text-white",rowTwo:!1})}),i.jsx("td",{children:i.jsx(oa,{info1:`${(Oe==null?void 0:Oe.margin_roi)==null||isNaN(parseFloat(Oe==null?void 0:Oe.margin_roi))?"--":`${Os(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(Nrn,{info1:`${(Oe==null?void 0:Oe.margin_used)==null||isNaN(parseFloat(Oe==null?void 0:Oe.margin_used))?"--":Os(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(oa,{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(oa,{info1:`${(Oe==null?void 0:Oe.funding)==null||isNaN(parseFloat(Oe==null?void 0:Oe.funding))?"--":`$${Os(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))?"--":Os(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))?"--":Os(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(oa,{info1:`${_t(Oe==null?void 0:Oe.complated_avg_duration)}`,info1_Color:"text-white",rowTwo:!1})}),i.jsx("td",{className:`${a==999?"hidden":""}`,children:i.jsx(oa,{info1:`${FI(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(oa,{info1:`${FI(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"}})})]},Jt)))})]})})]})]})]})};var LY,tCe;function Csn(){if(tCe)return LY;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 LY=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}},LY}var Ssn=Csn();const Nsn=Ii(Ssn);var DY,nCe;function Asn(){if(nCe)return DY;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 DY=e,DY}var jsn=Asn();const rCe=Ii(jsn);var BY,sCe;function Esn(){return sCe||(sCe=1,BY=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}),BY}var _sn=Esn();const ksn=Ii(_sn);var LUe=(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))(LUe||{}),$Y={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(LUe),Pce={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},Tsn=Object.entries(Pce).reduce((e,[t,n])=>(e[n]=t,e),{}),um="data-rh",x4={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},g4=(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},Isn=e=>{let t=g4(e,"title");const n=g4(e,x4.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),n&&t)return n.replace(/%s/g,()=>t);const r=g4(e,x4.DEFAULT_TITLE);return t||r||void 0},Psn=e=>g4(e,x4.ON_CHANGE_CLIENT_STATE)||(()=>{}),UY=(e,t)=>t.filter(n=>typeof n[e]<"u").map(n=>n[e]).reduce((n,r)=>({...n,...r}),{}),Fsn=(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},[]),Osn=e=>console&&typeof console.warn=="function"&&console.warn(e),H7=(e,t,n)=>{const r={};return n.filter(s=>Array.isArray(s[e])?!0:(typeof s[e]<"u"&&Osn(`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()},Msn=(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},Rsn=e=>({baseTag:Fsn(["href"],e),bodyAttributes:UY("bodyAttributes",e),defer:g4(e,x4.DEFER),encode:g4(e,x4.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:UY("htmlAttributes",e),linkTags:H7("link",["rel","href"],e),metaTags:H7("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:H7("noscript",["innerHTML"],e),onChangeClientState:Psn(e),scriptTags:H7("script",["src","innerHTML"],e),styleTags:H7("style",["cssText"],e),title:Isn(e),titleAttributes:UY("titleAttributes",e),prioritizeSeoTags:Msn(e,x4.PRIORITIZE_SEO_TAGS)}),DUe=e=>Array.isArray(e)?e.join(""):e,Lsn=(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},zY=(e,t)=>Array.isArray(e)?e.reduce((n,r)=>(Lsn(r,t)?n.priority.push(r):n.default.push(r),n),{priority:[],default:[]}):{default:e,priority:[]},aCe=(e,t)=>({...e,[t]:void 0}),Dsn=["noscript","script","style"],Ane=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;"),BUe=e=>Object.keys(e).reduce((t,n)=>{const r=typeof e[n]<"u"?`${n}="${e[n]}"`:`${n}`;return t?`${t} ${r}`:r},""),Bsn=(e,t,n,r)=>{const s=BUe(n),a=DUe(t);return s?`<${e} ${um}="true" ${s}>${Ane(a,r)}</${e}>`:`<${e} ${um}="true">${Ane(a,r)}</${e}>`},$sn=(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}="${Ane(a[d],n)}"`;return u?`${u} ${f}`:f},""),l=a.innerHTML||a.cssText||"",c=Dsn.indexOf(e)===-1;return`${r}<${e} ${um}="true" ${o}${c?"/>":`>${l}</${e}>`}`},""),$Ue=(e,t={})=>Object.keys(e).reduce((n,r)=>{const s=Pce[r];return n[s||r]=e[r],n},t),Usn=(e,t,n)=>{const r={key:t,[um]:!0},s=$Ue(n,r);return[Ae.createElement("title",s,t)]},vO=(e,t)=>t.map((n,r)=>{const s={key:r,[um]:!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]}),Ae.createElement(e,s)}),Rh=(e,t,n=!0)=>{switch(e){case"title":return{toComponent:()=>Usn(e,t.title,t.titleAttributes),toString:()=>Bsn(e,t.title,t.titleAttributes,n)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>$Ue(t),toString:()=>BUe(t)};default:return{toComponent:()=>vO(e,t),toString:()=>$sn(e,t,n)}}},zsn=({metaTags:e,linkTags:t,scriptTags:n,encode:r})=>{const s=zY(e,$Y.meta),a=zY(t,$Y.link),o=zY(n,$Y.script);return{priorityMethods:{toComponent:()=>[...vO("meta",s.priority),...vO("link",a.priority),...vO("script",o.priority)],toString:()=>`${Rh("meta",s.priority,r)} ${Rh("link",a.priority,r)} ${Rh("script",o.priority,r)}`},metaTags:s.default,linkTags:a.default,scriptTags:o.default}},Hsn=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}=zsn(e)),{priority:g,base:Rh("base",t,r),bodyAttributes:Rh("bodyAttributes",n,r),htmlAttributes:Rh("htmlAttributes",s,r),link:Rh("link",d,r),meta:Rh("meta",f,r),noscript:Rh("noscript",a,r),script:Rh("script",x,r),style:Rh("style",o,r),title:Rh("title",{title:l,titleAttributes:c},r)}},UUe=Hsn,LP=[],zUe=!!(typeof window<"u"&&window.document&&window.document.createElement),jne=class{constructor(e,t){Dn(this,"instances",[]);Dn(this,"canUseDOM",zUe);Dn(this,"context");Dn(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?LP:this.instances,add:e=>{(this.canUseDOM?LP:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?LP:this.instances).indexOf(e);(this.canUseDOM?LP:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=UUe({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},Vsn={},HUe=Ae.createContext(Vsn),Uw,No=(Uw=class extends m.Component{constructor(n){super(n);Dn(this,"helmetData");this.helmetData=new jne(this.props.context||{},Uw.canUseDOM)}render(){return Ae.createElement(HUe.Provider,{value:this.helmetData.value},this.props.children)}},Dn(Uw,"canUseDOM",zUe),Uw),aC=(e,t)=>{const n=document.head||document.querySelector("head"),r=n.querySelectorAll(`${e}[${um}]`),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(um,"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}},Ene=(e,t)=>{const n=document.getElementsByTagName(e)[0];if(!n)return;const r=n.getAttribute(um),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(um):n.getAttribute(um)!==o.join(",")&&n.setAttribute(um,o.join(","))},Wsn=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=DUe(e)),Ene("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;Ene("body",r),Ene("html",s),Wsn(f,x);const g={baseTag:aC("base",n),linkTags:aC("link",a),metaTags:aC("meta",o),noscriptTags:aC("noscript",l),scriptTags:aC("script",u),styleTags:aC("style",d)},v={},w={};Object.keys(g).forEach(C=>{const{newTags:N,oldTags:P}=g[C];N.length&&(v[C]=N),P.length&&(w[C]=g[C].oldTags)}),t&&t(),c(e,v,w)},V7=null,qsn=e=>{V7&&cancelAnimationFrame(V7),e.defer?V7=requestAnimationFrame(()=>{oCe(e,()=>{V7=null})}):(oCe(e),V7=null)},Gsn=qsn,lCe=class extends m.Component{constructor(){super(...arguments);Dn(this,"rendered",!1)}shouldComponentUpdate(t){return!ksn(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=Rsn(t.get().map(a=>{const o={...a.props};return delete o.context,o}));No.canUseDOM?Gsn(s):r=UUe(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}},iQ,Lo=(iQ=class extends m.Component{shouldComponentUpdate(e){return!Nsn(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 Ae.Children.forEach(e,r=>{if(!r||!r.props)return;const{children:s,...a}=r.props,o=Object.keys(a).reduce((c,u)=>(c[Tsn[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 jne)){const s=r;r=new jne(s.context,!0),delete n.helmetData}return r?Ae.createElement(lCe,{...n,context:r.value}):Ae.createElement(HUe.Consumer,null,s=>Ae.createElement(lCe,{...n,context:s}))}},Dn(iQ,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),iQ);const Ksn=()=>{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(No,{children:i.jsxs(Lo,{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(wsn,{currentPage:e,setCurrentPage:t,offset:l,setOffset:c,totalPage:n,totalWalletCount:s,setTotalPage:r,setTotalWalletCount:a,period:x,periods:u,handlePeriodChange:v})})]})},pi=({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(uU,{sortKey:t,state:n,className:""})]})})};var DP={},BP={exports:{}};/*!
 * ApexCharts v3.54.1
 * (c) 2018-2024 ApexCharts
 * Released under the MIT License.
 */var cCe;function Ysn(){return cCe||(cCe=1,function(e,t){function n(Ee,h){(h==null||h>Ee.length)&&(h=Ee.length);for(var p=0,S=Array(h);p<h;p++)S[p]=Ee[p];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,h){if(!(Ee instanceof h))throw new TypeError("Cannot call a class as a function")}function a(Ee,h){for(var p=0;p<h.length;p++){var S=h[p];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(Ee,P(S.key),S)}}function o(Ee,h,p){return h&&a(Ee.prototype,h),p&&a(Ee,p),Object.defineProperty(Ee,"prototype",{writable:!1}),Ee}function l(Ee,h){var p=typeof Symbol<"u"&&Ee[Symbol.iterator]||Ee["@@iterator"];if(!p){if(Array.isArray(Ee)||(p=R(Ee))||h){p&&(Ee=p);var S=0,_=function(){};return{s:_,n:function(){return S>=Ee.length?{done:!0}:{done:!1,value:Ee[S++]}},e:function(W){throw W},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(){p=p.call(Ee)},n:function(){var W=p.next();return T=W.done,W},e:function(W){B=!0,k=W},f:function(){try{T||p.return==null||p.return()}finally{if(B)throw k}}}}function c(Ee){var h=x();return function(){var p,S=d(Ee);if(h){var _=d(this).constructor;p=Reflect.construct(S,arguments,_)}else p=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,p)}}function u(Ee,h,p){return(h=P(h))in Ee?Object.defineProperty(Ee,h,{value:p,enumerable:!0,configurable:!0,writable:!0}):Ee[h]=p,Ee}function d(Ee){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(h){return h.__proto__||Object.getPrototypeOf(h)},d(Ee)}function f(Ee,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function");Ee.prototype=Object.create(h&&h.prototype,{constructor:{value:Ee,writable:!0,configurable:!0}}),Object.defineProperty(Ee,"prototype",{writable:!1}),h&&w(Ee,h)}function x(){try{var Ee=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(x=function(){return!!Ee})()}function g(Ee,h){var p=Object.keys(Ee);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(Ee);h&&(S=S.filter(function(_){return Object.getOwnPropertyDescriptor(Ee,_).enumerable})),p.push.apply(p,S)}return p}function v(Ee){for(var h=1;h<arguments.length;h++){var p=arguments[h]!=null?arguments[h]:{};h%2?g(Object(p),!0).forEach(function(S){u(Ee,S,p[S])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Ee,Object.getOwnPropertyDescriptors(p)):g(Object(p)).forEach(function(S){Object.defineProperty(Ee,S,Object.getOwnPropertyDescriptor(p,S))})}return Ee}function w(Ee,h){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,S){return p.__proto__=S,p},w(Ee,h)}function C(Ee,h){return function(p){if(Array.isArray(p))return p}(Ee)||function(p,S){var _=p==null?null:typeof Symbol<"u"&&p[Symbol.iterator]||p["@@iterator"];if(_!=null){var k,T,B,W,ee=[],ce=!0,ue=!1;try{if(B=(_=_.call(p)).next,S===0){if(Object(_)!==_)return;ce=!1}else for(;!(ce=(k=B.call(_)).done)&&(ee.push(k.value),ee.length!==S);ce=!0);}catch(ge){ue=!0,T=ge}finally{try{if(!ce&&_.return!=null&&(W=_.return(),Object(W)!==W))return}finally{if(ue)throw T}}return ee}}(Ee,h)||R(Ee,h)||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(h){if(Array.isArray(h))return n(h)}(Ee)||function(h){if(typeof Symbol<"u"&&h[Symbol.iterator]!=null||h["@@iterator"]!=null)return Array.from(h)}(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 P(Ee){var h=function(p,S){if(typeof p!="object"||!p)return p;var _=p[Symbol.toPrimitive];if(_!==void 0){var k=_.call(p,S||"default");if(typeof k!="object")return k;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(p)}(Ee,"string");return typeof h=="symbol"?h:h+""}function I(Ee){return I=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},I(Ee)}function R(Ee,h){if(Ee){if(typeof Ee=="string")return n(Ee,h);var p={}.toString.call(Ee).slice(8,-1);return p==="Object"&&Ee.constructor&&(p=Ee.constructor.name),p==="Map"||p==="Set"?Array.from(Ee):p==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(p)?n(Ee,h):void 0}}var O=function(){function Ee(){s(this,Ee)}return o(Ee,[{key:"shadeRGBColor",value:function(h,p){var S=p.split(","),_=h<0?0:255,k=h<0?-1*h:h,T=parseInt(S[0].slice(4),10),B=parseInt(S[1],10),W=parseInt(S[2],10);return"rgb("+(Math.round((_-T)*k)+T)+","+(Math.round((_-B)*k)+B)+","+(Math.round((_-W)*k)+W)+")"}},{key:"shadeHexColor",value:function(h,p){var S=parseInt(p.slice(1),16),_=h<0?0:255,k=h<0?-1*h:h,T=S>>16,B=S>>8&255,W=255&S;return"#"+(16777216+65536*(Math.round((_-T)*k)+T)+256*(Math.round((_-B)*k)+B)+(Math.round((_-W)*k)+W)).toString(16).slice(1)}},{key:"shadeColor",value:function(h,p){return Ee.isColorHex(p)?this.shadeHexColor(h,p):this.shadeRGBColor(h,p)}}],[{key:"bind",value:function(h,p){return function(){return h.apply(p,arguments)}}},{key:"isObject",value:function(h){return h&&I(h)==="object"&&!Array.isArray(h)&&h!=null}},{key:"is",value:function(h,p){return Object.prototype.toString.call(p)==="[object "+h+"]"}},{key:"listToArray",value:function(h){var p,S=[];for(p=0;p<h.length;p++)S[p]=h[p];return S}},{key:"extend",value:function(h,p){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 W=arguments[B];if(W!=null)for(var ee in W)W.hasOwnProperty(ee)&&(T[ee]=W[ee])}return T});var _=Object.assign({},h);return this.isObject(h)&&this.isObject(p)&&Object.keys(p).forEach(function(k){S.isObject(p[k])&&k in h?_[k]=S.extend(h[k],p[k]):Object.assign(_,u({},k,p[k]))}),_}},{key:"extendArray",value:function(h,p){var S=[];return h.map(function(_){S.push(Ee.extend(p,_))}),h=S}},{key:"monthMod",value:function(h){return h%12}},{key:"clone",value:function(h){if(Ee.is("Array",h)){for(var p=[],S=0;S<h.length;S++)p[S]=this.clone(h[S]);return p}if(Ee.is("Null",h))return null;if(Ee.is("Date",h))return h;if(I(h)==="object"){var _={};for(var k in h)h.hasOwnProperty(k)&&(_[k]=this.clone(h[k]));return _}return h}},{key:"log10",value:function(h){return Math.log(h)/Math.LN10}},{key:"roundToBase10",value:function(h){return Math.pow(10,Math.floor(Math.log10(h)))}},{key:"roundToBase",value:function(h,p){return Math.pow(p,Math.floor(Math.log(h)/Math.log(p)))}},{key:"parseNumber",value:function(h){return h===null?h:parseFloat(h)}},{key:"stripNumber",value:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return Number.isInteger(h)?h:parseFloat(h.toPrecision(p))}},{key:"randomId",value:function(){return(Math.random()+1).toString(36).substring(4)}},{key:"noExponents",value:function(h){var p=String(h).split(/[eE]/);if(p.length===1)return p[0];var S="",_=h<0?"-":"",k=p[0].replace(".",""),T=Number(p[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(h){var p=getComputedStyle(h,null),S=h.clientHeight,_=h.clientWidth;return S-=parseFloat(p.paddingTop)+parseFloat(p.paddingBottom),[_-=parseFloat(p.paddingLeft)+parseFloat(p.paddingRight),S]}},{key:"getBoundingClientRect",value:function(h){var p=h.getBoundingClientRect();return{top:p.top,right:p.right,bottom:p.bottom,left:p.left,width:h.clientWidth,height:h.clientHeight,x:p.left,y:p.top}}},{key:"getLargestStringFromArr",value:function(h){return h.reduce(function(p,S){return Array.isArray(S)&&(S=S.reduce(function(_,k){return _.length>k.length?_:k})),p.length>S.length?p:S},0)}},{key:"hexToRgba",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"#999999",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:.6;h.substring(0,1)!=="#"&&(h="#999999");var S=h.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 p!==void 0&&S.push(p),"rgba("+S.join(",")+")"}},{key:"getOpacityFromRGBA",value:function(h){return parseFloat(h.replace(/^.*,(.+)\)/,"$1"))}},{key:"rgb2hex",value:function(h){return(h=h.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i))&&h.length===4?"#"+("0"+parseInt(h[1],10).toString(16)).slice(-2)+("0"+parseInt(h[2],10).toString(16)).slice(-2)+("0"+parseInt(h[3],10).toString(16)).slice(-2):""}},{key:"isColorHex",value:function(h){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)|(^#[0-9A-F]{8}$)/i.test(h)}},{key:"getPolygonPos",value:function(h,p){for(var S=[],_=2*Math.PI/p,k=0;k<p;k++){var T={};T.x=h*Math.sin(k*_),T.y=-h*Math.cos(k*_),S.push(T)}return S}},{key:"polarToCartesian",value:function(h,p,S,_){var k=(_-90)*Math.PI/180;return{x:h+S*Math.cos(k),y:p+S*Math.sin(k)}}},{key:"escapeString",value:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"x",S=h.toString().slice();return S=S.replace(/[` ~!@#$%^&*()|+\=?;:'",.<>{}[\]\\/]/gi,p)}},{key:"negToZero",value:function(h){return h<0?0:h}},{key:"moveIndexInArray",value:function(h,p,S){if(S>=h.length)for(var _=S-h.length+1;_--;)h.push(void 0);return h.splice(S,0,h.splice(p,1)[0]),h}},{key:"extractNumber",value:function(h){return parseFloat(h.replace(/[^\d.]*/g,""))}},{key:"findAncestor",value:function(h,p){for(;(h=h.parentElement)&&!h.classList.contains(p););return h}},{key:"setELstyles",value:function(h,p){for(var S in p)p.hasOwnProperty(S)&&(h.style.key=p[S])}},{key:"preciseAddition",value:function(h,p){var S=(String(h).split(".")[1]||"").length,_=(String(p).split(".")[1]||"").length,k=Math.pow(10,Math.max(S,_));return(Math.round(h*k)+Math.round(p*k))/k}},{key:"isNumber",value:function(h){return!isNaN(h)&&parseFloat(Number(h))===h&&!isNaN(parseInt(h,10))}},{key:"isFloat",value:function(h){return Number(h)===h&&h%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 h=window.navigator.userAgent,p=h.indexOf("Edge/");return p>0&&parseInt(h.substring(p+5,h.indexOf(".",p)),10)}},{key:"getGCD",value:function(h,p){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:7,_=Math.pow(10,S-Math.floor(Math.log10(Math.max(h,p))));for(h=Math.round(Math.abs(h)*_),p=Math.round(Math.abs(p)*_);p;){var k=p;p=h%p,h=k}return h/_}},{key:"getPrimeFactors",value:function(h){for(var p=[],S=2;h>=2;)h%S==0?(p.push(S),h/=S):S++;return p}},{key:"mod",value:function(h,p){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:7,_=Math.pow(10,S-Math.floor(Math.log10(Math.max(h,p))));return(h=Math.round(Math.abs(h)*_))%(p=Math.round(Math.abs(p)*_))/_}}]),Ee}(),U=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w,this.setEasingFunctions()}return o(Ee,[{key:"setEasingFunctions",value:function(){var h;if(!this.w.globals.easing){switch(this.w.config.chart.animations.easing){case"linear":h="-";break;case"easein":h="<";break;case"easeout":h=">";break;case"easeinout":default:h="<>";break;case"swing":h=function(p){var S=1.70158;return(p-=1)*p*((S+1)*p+S)+1};break;case"bounce":h=function(p){return p<1/2.75?7.5625*p*p:p<2/2.75?7.5625*(p-=1.5/2.75)*p+.75:p<2.5/2.75?7.5625*(p-=2.25/2.75)*p+.9375:7.5625*(p-=2.625/2.75)*p+.984375};break;case"elastic":h=function(p){return p===!!p?p:Math.pow(2,-10*p)*Math.sin((p-.075)*(2*Math.PI)/.3)+1}}this.w.globals.easing=h}}},{key:"animateLine",value:function(h,p,S,_){h.attr(p).animate(_).attr(S)}},{key:"animateMarker",value:function(h,p,S,_){h.attr({opacity:0}).animate(p,S).attr({opacity:1}).afterAll(function(){_()})}},{key:"animateRect",value:function(h,p,S,_,k){h.attr(p).animate(_).attr(S).afterAll(function(){return k()})}},{key:"animatePathsGradually",value:function(h){var p=h.el,S=h.realIndex,_=h.j,k=h.fill,T=h.pathFrom,B=h.pathTo,W=h.speed,ee=h.delay,ce=this.w,ue=0;ce.config.chart.animations.animateGradually.enabled&&(ue=ce.config.chart.animations.animateGradually.delay),ce.config.chart.animations.dynamicAnimation.enabled&&ce.globals.dataChanged&&ce.config.chart.type!=="bar"&&(ue=0),this.morphSVG(p,S,_,ce.config.chart.type!=="line"||ce.globals.comboCharts?k:"stroke",T,B,W,ee*ue)}},{key:"showDelayedElements",value:function(){this.w.globals.delayedElements.forEach(function(h){var p=h.el;p.classList.remove("apexcharts-element-hidden"),p.classList.add("apexcharts-hidden-element-shown")})}},{key:"animationCompleted",value:function(h){var p=this.w;p.globals.animationEnded||(p.globals.animationEnded=!0,this.showDelayedElements(),typeof p.config.chart.events.animationEnd=="function"&&p.config.chart.events.animationEnd(this.ctx,{el:h,w:p}))}},{key:"morphSVG",value:function(h,p,S,_,k,T,B,W){var ee=this,ce=this.w;k||(k=h.attr("pathFrom")),T||(T=h.attr("pathTo"));var ue=function(ge){return ce.config.chart.type==="radar"&&(B=1),"M 0 ".concat(ce.globals.gridHeight)};(!k||k.indexOf("undefined")>-1||k.indexOf("NaN")>-1)&&(k=ue()),(!T||T.indexOf("undefined")>-1||T.indexOf("NaN")>-1)&&(T=ue()),ce.globals.shouldAnimate||(B=1),h.plot(k).animate(1,ce.globals.easing,W).plot(k).animate(B,ce.globals.easing,W).plot(T).afterAll(function(){O.isNumber(S)?S===ce.globals.series[ce.globals.maxValsInArrayIndex].length-2&&ce.globals.shouldAnimate&&ee.animationCompleted(h):_!=="none"&&ce.globals.shouldAnimate&&(!ce.globals.comboCharts&&p===ce.globals.series.length-1||ce.globals.comboCharts)&&ee.animationCompleted(h),ee.showDelayedElements()})}}]),Ee}(),L=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"getDefaultFilter",value:function(h,p){var S=this.w;h.unfilter(!0),new window.SVG.Filter().size("120%","180%","-5%","-40%"),S.config.states.normal.filter!=="none"?this.applyFilter(h,p,S.config.states.normal.filter.type,S.config.states.normal.filter.value):S.config.chart.dropShadow.enabled&&this.dropShadow(h,S.config.chart.dropShadow,p)}},{key:"addNormalFilter",value:function(h,p){var S=this.w;S.config.chart.dropShadow.enabled&&!h.node.classList.contains("apexcharts-marker")&&this.dropShadow(h,S.config.chart.dropShadow,p)}},{key:"addLightenFilter",value:function(h,p,S){var _=this,k=this.w,T=S.intensity;h.unfilter(!0),new window.SVG.Filter,h.filter(function(B){var W=k.config.chart.dropShadow;(W.enabled?_.addShadow(B,p,W):B).componentTransfer({rgb:{type:"linear",slope:1.5,intercept:T}})}),h.filterer.node.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(h.filterer.node)}},{key:"addDarkenFilter",value:function(h,p,S){var _=this,k=this.w,T=S.intensity;h.unfilter(!0),new window.SVG.Filter,h.filter(function(B){var W=k.config.chart.dropShadow;(W.enabled?_.addShadow(B,p,W):B).componentTransfer({rgb:{type:"linear",slope:T}})}),h.filterer.node.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(h.filterer.node)}},{key:"applyFilter",value:function(h,p,S){var _=arguments.length>3&&arguments[3]!==void 0?arguments[3]:.5;switch(S){case"none":this.addNormalFilter(h,p);break;case"lighten":this.addLightenFilter(h,p,{intensity:_});break;case"darken":this.addDarkenFilter(h,p,{intensity:_})}}},{key:"addShadow",value:function(h,p,S){var _,k=this.w,T=S.blur,B=S.top,W=S.left,ee=S.color,ce=S.opacity;if(((_=k.config.chart.dropShadow.enabledOnSeries)===null||_===void 0?void 0:_.length)>0&&k.config.chart.dropShadow.enabledOnSeries.indexOf(p)===-1)return h;var ue=h.flood(Array.isArray(ee)?ee[p]:ee,ce).composite(h.sourceAlpha,"in").offset(W,B).gaussianBlur(T).merge(h.source);return h.blend(h.source,ue)}},{key:"dropShadow",value:function(h,p){var S,_,k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,T=p.top,B=p.left,W=p.blur,ee=p.color,ce=p.opacity,ue=p.noUserSpaceOnUse,ge=this.w;return h.unfilter(!0),O.isMsEdge()&&ge.config.chart.type==="radialBar"||((S=ge.config.chart.dropShadow.enabledOnSeries)===null||S===void 0?void 0:S.length)>0&&((_=ge.config.chart.dropShadow.enabledOnSeries)===null||_===void 0?void 0:_.indexOf(k))===-1||(ee=Array.isArray(ee)?ee[k]:ee,h.filter(function(Se){var ke=null;ke=O.isSafari()||O.isFirefox()||O.isMsEdge()?Se.flood(ee,ce).composite(Se.sourceAlpha,"in").offset(B,T).gaussianBlur(W):Se.flood(ee,ce).composite(Se.sourceAlpha,"in").offset(B,T).gaussianBlur(W).merge(Se.source),Se.blend(Se.source,ke)}),ue||h.filterer.node.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(h.filterer.node)),h}},{key:"setSelectionFilter",value:function(h,p,S){var _=this.w;if(_.globals.selectedDataPoints[p]!==void 0&&_.globals.selectedDataPoints[p].indexOf(S)>-1){h.node.setAttribute("selected",!0);var k=_.config.states.active.filter;k!=="none"&&this.applyFilter(h,p,k.type,k.value)}}},{key:"_scaleFilterSize",value:function(h){(function(p){for(var S in p)p.hasOwnProperty(S)&&h.setAttribute(S,p[S])})({width:"200%",height:"200%",x:"-50%",y:"-50%"})}}]),Ee}(),z=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"roundPathCorners",value:function(h,p){function S(rt,ct,yt){var Lt=ct.x-rt.x,ft=ct.y-rt.y,Tt=Math.sqrt(Lt*Lt+ft*ft);return _(rt,ct,Math.min(1,yt/Tt))}function _(rt,ct,yt){return{x:rt.x+(ct.x-rt.x)*yt,y:rt.y+(ct.y-rt.y)*yt}}function k(rt,ct){rt.length>2&&(rt[rt.length-2]=ct.x,rt[rt.length-1]=ct.y)}function T(rt){return{x:parseFloat(rt[rt.length-2]),y:parseFloat(rt[rt.length-1])}}h.indexOf("NaN")>-1&&(h="");var B=h.split(/[,\s]/).reduce(function(rt,ct){var yt=ct.match("([a-zA-Z])(.+)");return yt?(rt.push(yt[1]),rt.push(yt[2])):rt.push(ct),rt},[]).reduce(function(rt,ct){return parseFloat(ct)==ct&&rt.length?rt[rt.length-1].push(ct):rt.push([ct]),rt},[]),W=[];if(B.length>1){var ee=T(B[0]),ce=null;B[B.length-1][0]=="Z"&&B[0].length>2&&(ce=["L",ee.x,ee.y],B[B.length-1]=ce),W.push(B[0]);for(var ue=1;ue<B.length;ue++){var ge=W[W.length-1],Se=B[ue],ke=Se==ce?B[1]:B[ue+1];if(ke&&ge&&ge.length>2&&Se[0]=="L"&&ke.length>2&&ke[0]=="L"){var Me,qe,Fe=T(ge),at=T(Se),se=T(ke);Me=S(at,Fe,p),qe=S(at,se,p),k(Se,Me),Se.origPoint=at,W.push(Se);var Ce=_(Me,at,.5),Ue=_(at,qe,.5),Be=["C",Ce.x,Ce.y,Ue.x,Ue.y,qe.x,qe.y];Be.origPoint=at,W.push(Be)}else W.push(Se)}if(ce){var _e=T(W[W.length-1]);W.push(["Z"]),k(W[0],_e)}}else W=B;return W.reduce(function(rt,ct){return rt+ct.join(" ")+" "},"")}},{key:"drawLine",value:function(h,p,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,W=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"butt";return this.w.globals.dom.Paper.line().attr({x1:h,y1:p,x2:S,y2:_,stroke:k,"stroke-dasharray":T,"stroke-width":B,"stroke-linecap":W})}},{key:"drawRect",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,p=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,W=arguments.length>7&&arguments[7]!==void 0?arguments[7]:null,ee=arguments.length>8&&arguments[8]!==void 0?arguments[8]:null,ce=arguments.length>9&&arguments[9]!==void 0?arguments[9]:0,ue=this.w.globals.dom.Paper.rect();return ue.attr({x:h,y:p,width:S>0?S:0,height:_>0?_:0,rx:k,ry:k,opacity:B,"stroke-width":W!==null?W:0,stroke:ee!==null?ee:"none","stroke-dasharray":ce}),ue.node.setAttribute("fill",T),ue}},{key:"drawPolygon",value:function(h){var p=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(h).attr({fill:_,stroke:p,"stroke-width":S})}},{key:"drawCircle",value:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;h<0&&(h=0);var S=this.w.globals.dom.Paper.circle(2*h);return p!==null&&S.attr(p),S}},{key:"drawPath",value:function(h){var p=h.d,S=p===void 0?"":p,_=h.stroke,k=_===void 0?"#a8a8a8":_,T=h.strokeWidth,B=T===void 0?1:T,W=h.fill,ee=h.fillOpacity,ce=ee===void 0?1:ee,ue=h.strokeOpacity,ge=ue===void 0?1:ue,Se=h.classes,ke=h.strokeLinecap,Me=ke===void 0?null:ke,qe=h.strokeDashArray,Fe=qe===void 0?0:qe,at=this.w;return Me===null&&(Me=at.config.stroke.lineCap),(S.indexOf("undefined")>-1||S.indexOf("NaN")>-1)&&(S="M 0 ".concat(at.globals.gridHeight)),at.globals.dom.Paper.path(S).attr({fill:W,"fill-opacity":ce,stroke:k,"stroke-opacity":ge,"stroke-linecap":Me,"stroke-width":B,"stroke-dasharray":Fe,class:Se})}},{key:"group",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,p=this.w.globals.dom.Paper.group();return h!==null&&p.attr(h),p}},{key:"move",value:function(h,p){var S=["M",h,p].join(" ");return S}},{key:"line",value:function(h,p){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,_=null;return S===null?_=[" L",h,p].join(" "):S==="H"?_=[" H",h].join(" "):S==="V"&&(_=[" V",p].join(" ")),_}},{key:"curve",value:function(h,p,S,_,k,T){var B=["C",h,p,S,_,k,T].join(" ");return B}},{key:"quadraticCurve",value:function(h,p,S,_){return["Q",h,p,S,_].join(" ")}},{key:"arc",value:function(h,p,S,_,k,T,B){var W="A";arguments.length>7&&arguments[7]!==void 0&&arguments[7]&&(W="a");var ee=[W,h,p,S,_,k,T,B].join(" ");return ee}},{key:"renderPaths",value:function(h){var p,S=h.j,_=h.realIndex,k=h.pathFrom,T=h.pathTo,B=h.stroke,W=h.strokeWidth,ee=h.strokeLinecap,ce=h.fill,ue=h.animationDelay,ge=h.initialSpeed,Se=h.dataChangeSpeed,ke=h.className,Me=h.chartType,qe=h.shouldClipToGrid,Fe=qe===void 0||qe,at=h.bindEventsOnPaths,se=at===void 0||at,Ce=h.drawShadow,Ue=Ce===void 0||Ce,Be=this.w,_e=new L(this.ctx),rt=new U(this.ctx),ct=this.w.config.chart.animations.enabled,yt=ct&&this.w.config.chart.animations.dynamicAnimation.enabled,Lt=!!(ct&&!Be.globals.resized||yt&&Be.globals.dataChanged&&Be.globals.shouldAnimate);Lt?p=k:(p=T,Be.globals.animationEnded=!0);var ft=Be.config.stroke.dashArray,Tt=0;Tt=Array.isArray(ft)?ft[_]:Be.config.stroke.dashArray;var Ge=this.drawPath({d:p,stroke:B,strokeWidth:W,fill:ce,fillOpacity:1,classes:ke,strokeLinecap:ee,strokeDashArray:Tt});if(Ge.attr("index",_),Fe&&(Me==="bar"&&!Be.globals.isHorizontal||Be.globals.comboCharts?Ge.attr({"clip-path":"url(#gridRectBarMask".concat(Be.globals.cuid,")")}):Ge.attr({"clip-path":"url(#gridRectMask".concat(Be.globals.cuid,")")})),Be.config.states.normal.filter.type!=="none")_e.getDefaultFilter(Ge,_);else if(Be.config.chart.dropShadow.enabled&&Ue){var At=Be.config.chart.dropShadow;_e.dropShadow(Ge,At,_)}se&&(Ge.node.addEventListener("mouseenter",this.pathMouseEnter.bind(this,Ge)),Ge.node.addEventListener("mouseleave",this.pathMouseLeave.bind(this,Ge)),Ge.node.addEventListener("mousedown",this.pathMouseDown.bind(this,Ge))),Ge.attr({pathTo:T,pathFrom:k});var Ot={el:Ge,j:S,realIndex:_,pathFrom:k,pathTo:T,fill:ce,strokeWidth:W,delay:ue};return!ct||Be.globals.resized||Be.globals.dataChanged?!Be.globals.resized&&Be.globals.dataChanged||rt.showDelayedElements():rt.animatePathsGradually(v(v({},Ot),{},{speed:ge})),Be.globals.dataChanged&&yt&&Lt&&rt.animatePathsGradually(v(v({},Ot),{},{speed:Se})),Ge}},{key:"drawPattern",value:function(h,p,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(p,S,function(T){h==="horizontalLines"?T.line(0,0,S,0).stroke({color:_,width:k+1}):h==="verticalLines"?T.line(0,0,0,p).stroke({color:_,width:k+1}):h==="slantedLines"?T.line(0,0,p,S).stroke({color:_,width:k}):h==="squares"?T.rect(p,S).fill("none").stroke({color:_,width:k}):h==="circles"&&T.circle(p).fill("none").stroke({color:_,width:k})})}},{key:"drawGradient",value:function(h,p,S,_,k){var T,B=arguments.length>5&&arguments[5]!==void 0?arguments[5]:null,W=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null,ee=arguments.length>7&&arguments[7]!==void 0?arguments[7]:null,ce=arguments.length>8&&arguments[8]!==void 0?arguments[8]:0,ue=this.w;p.length<9&&p.indexOf("#")===0&&(p=O.hexToRgba(p,_)),S.length<9&&S.indexOf("#")===0&&(S=O.hexToRgba(S,k));var ge=0,Se=1,ke=1,Me=null;W!==null&&(ge=W[0]!==void 0?W[0]/100:0,Se=W[1]!==void 0?W[1]/100:1,ke=W[2]!==void 0?W[2]/100:1,Me=W[3]!==void 0?W[3]/100:null);var qe=!(ue.config.chart.type!=="donut"&&ue.config.chart.type!=="pie"&&ue.config.chart.type!=="polarArea"&&ue.config.chart.type!=="bubble");if(T=ee===null||ee.length===0?ue.globals.dom.Paper.gradient(qe?"radial":"linear",function(se){se.at(ge,p,_),se.at(Se,S,k),se.at(ke,S,k),Me!==null&&se.at(Me,p,_)}):ue.globals.dom.Paper.gradient(qe?"radial":"linear",function(se){(Array.isArray(ee[ce])?ee[ce]:ee).forEach(function(Ce){se.at(Ce.offset/100,Ce.color,Ce.opacity)})}),qe){var Fe=ue.globals.gridWidth/2,at=ue.globals.gridHeight/2;ue.config.chart.type!=="bubble"?T.attr({gradientUnits:"userSpaceOnUse",cx:Fe,cy:at,r:B}):T.attr({cx:.5,cy:.5,r:.8,fx:.2,fy:.2})}else h==="vertical"?T.from(0,0).to(0,1):h==="diagonal"?T.from(0,0).to(1,1):h==="horizontal"?T.from(0,1).to(1,1):h==="diagonal2"&&T.from(1,0).to(0,1);return T}},{key:"getTextBasedOnMaxWidth",value:function(h){var p=h.text,S=h.maxWidth,_=h.fontSize,k=h.fontFamily,T=this.getTextRects(p,_,k),B=T.width/p.length,W=Math.floor(S/B);return S<T.width?p.slice(0,W-3)+"...":p}},{key:"drawText",value:function(h){var p=this,S=h.x,_=h.y,k=h.text,T=h.textAnchor,B=h.fontSize,W=h.fontFamily,ee=h.fontWeight,ce=h.foreColor,ue=h.opacity,ge=h.maxWidth,Se=h.cssClass,ke=Se===void 0?"":Se,Me=h.isPlainText,qe=Me===void 0||Me,Fe=h.dominantBaseline,at=Fe===void 0?"auto":Fe,se=this.w;k===void 0&&(k="");var Ce=k;T||(T="start"),ce&&ce.length||(ce=se.config.chart.foreColor),W=W||se.config.chart.fontFamily,ee=ee||"regular";var Ue,Be={maxWidth:ge,fontSize:B=B||"11px",fontFamily:W};return Array.isArray(k)?Ue=se.globals.dom.Paper.text(function(_e){for(var rt=0;rt<k.length;rt++)Ce=k[rt],ge&&(Ce=p.getTextBasedOnMaxWidth(v({text:k[rt]},Be))),rt===0?_e.tspan(Ce):_e.tspan(Ce).newLine()}):(ge&&(Ce=this.getTextBasedOnMaxWidth(v({text:k},Be))),Ue=qe?se.globals.dom.Paper.plain(k):se.globals.dom.Paper.text(function(_e){return _e.tspan(Ce)})),Ue.attr({x:S,y:_,"text-anchor":T,"dominant-baseline":at,"font-size":B,"font-family":W,"font-weight":ee,fill:ce,class:"apexcharts-text "+ke}),Ue.node.style.fontFamily=W,Ue.node.style.opacity=ue,Ue}},{key:"getMarkerPath",value:function(h,p,S,_){var k="";switch(S){case"cross":k="M ".concat(h-(_/=1.4)," ").concat(p-_," L ").concat(h+_," ").concat(p+_,"  M ").concat(h-_," ").concat(p+_," L ").concat(h+_," ").concat(p-_);break;case"plus":k="M ".concat(h-(_/=1.12)," ").concat(p," L ").concat(h+_," ").concat(p,"  M ").concat(h," ").concat(p-_," L ").concat(h," ").concat(p+_);break;case"star":case"sparkle":var T=5;_*=1.15,S==="sparkle"&&(_/=1.1,T=4);for(var B=Math.PI/T,W=0;W<=2*T;W++){var ee=W*B,ce=W%2==0?_:_/2;k+=(W===0?"M":"L")+(h+ce*Math.sin(ee))+","+(p-ce*Math.cos(ee))}k+="Z";break;case"triangle":k="M ".concat(h," ").concat(p-_,` 
             L `).concat(h+_," ").concat(p+_,` 
             L `).concat(h-_," ").concat(p+_,` 
             Z`);break;case"square":case"rect":k="M ".concat(h-(_/=1.125)," ").concat(p-_,` 
           L `).concat(h+_," ").concat(p-_,` 
           L `).concat(h+_," ").concat(p+_,` 
           L `).concat(h-_," ").concat(p+_,` 
           Z`);break;case"diamond":_*=1.05,k="M ".concat(h," ").concat(p-_,` 
             L `).concat(h+_," ").concat(p,` 
             L `).concat(h," ").concat(p+_,` 
             L `).concat(h-_," ").concat(p,` 
            Z`);break;case"line":k="M ".concat(h-(_/=1.1)," ").concat(p,` 
           L `).concat(h+_," ").concat(p);break;default:_*=2,k="M ".concat(h,", ").concat(p,` 
           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(h,p,S,_,k){var T=this.drawPath({d:this.getMarkerPath(h,p,S,_,k),stroke:k.pointStrokeColor,strokeDashArray:k.pointStrokeDashArray,strokeWidth:k.pointStrokeWidth,fill:k.pointFillColor,fillOpacity:k.pointFillOpacity,strokeOpacity:k.pointStrokeOpacity});return T.attr({cx:h,cy:p,shape:k.shape,class:k.class?k.class:""}),T}},{key:"drawMarker",value:function(h,p,S){h=h||0;var _=S.pSize||0;return O.isNumber(p)||(_=0,p=0),this.drawMarkerShape(h,p,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(h,p){var S=this.w,_=new L(this.ctx),k=parseInt(h.node.getAttribute("index"),10),T=parseInt(h.node.getAttribute("j"),10);if(typeof S.config.chart.events.dataPointMouseEnter=="function"&&S.config.chart.events.dataPointMouseEnter(p,this.ctx,{seriesIndex:k,dataPointIndex:T,w:S}),this.ctx.events.fireEvent("dataPointMouseEnter",[p,this.ctx,{seriesIndex:k,dataPointIndex:T,w:S}]),(S.config.states.active.filter.type==="none"||h.node.getAttribute("selected")!=="true")&&S.config.states.hover.filter.type!=="none"&&!S.globals.isTouchDevice){var B=S.config.states.hover.filter;_.applyFilter(h,k,B.type,B.value)}}},{key:"pathMouseLeave",value:function(h,p){var S=this.w,_=new L(this.ctx),k=parseInt(h.node.getAttribute("index"),10),T=parseInt(h.node.getAttribute("j"),10);typeof S.config.chart.events.dataPointMouseLeave=="function"&&S.config.chart.events.dataPointMouseLeave(p,this.ctx,{seriesIndex:k,dataPointIndex:T,w:S}),this.ctx.events.fireEvent("dataPointMouseLeave",[p,this.ctx,{seriesIndex:k,dataPointIndex:T,w:S}]),S.config.states.active.filter.type!=="none"&&h.node.getAttribute("selected")==="true"||S.config.states.hover.filter.type!=="none"&&_.getDefaultFilter(h,k)}},{key:"pathMouseDown",value:function(h,p){var S=this.w,_=new L(this.ctx),k=parseInt(h.node.getAttribute("index"),10),T=parseInt(h.node.getAttribute("j"),10),B="false";if(h.node.getAttribute("selected")==="true"){if(h.node.setAttribute("selected","false"),S.globals.selectedDataPoints[k].indexOf(T)>-1){var W=S.globals.selectedDataPoints[k].indexOf(T);S.globals.selectedDataPoints[k].splice(W,1)}}else{if(!S.config.states.active.allowMultipleDataPointsSelection&&S.globals.selectedDataPoints.length>0){S.globals.selectedDataPoints=[];var ee=S.globals.dom.Paper.select(".apexcharts-series path").members,ce=S.globals.dom.Paper.select(".apexcharts-series circle, .apexcharts-series rect").members,ue=function(ke){Array.prototype.forEach.call(ke,function(Me){Me.node.setAttribute("selected","false"),_.getDefaultFilter(Me,k)})};ue(ee),ue(ce)}h.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 ge=S.config.states.active.filter;if(ge!=="none")_.applyFilter(h,k,ge.type,ge.value);else if(S.config.states.hover.filter!=="none"&&!S.globals.isTouchDevice){var Se=S.config.states.hover.filter;_.applyFilter(h,k,Se.type,Se.value)}}else S.config.states.active.filter.type!=="none"&&(S.config.states.hover.filter.type==="none"||S.globals.isTouchDevice?_.getDefaultFilter(h,k):(Se=S.config.states.hover.filter,_.applyFilter(h,k,Se.type,Se.value)));typeof S.config.chart.events.dataPointSelection=="function"&&S.config.chart.events.dataPointSelection(p,this.ctx,{selectedDataPoints:S.globals.selectedDataPoints,seriesIndex:k,dataPointIndex:T,w:S}),p&&this.ctx.events.fireEvent("dataPointSelection",[p,this.ctx,{selectedDataPoints:S.globals.selectedDataPoints,seriesIndex:k,dataPointIndex:T,w:S}])}},{key:"rotateAroundCenter",value:function(h){var p={};return h&&typeof h.getBBox=="function"&&(p=h.getBBox()),{x:p.x+p.width/2,y:p.y+p.height/2}}},{key:"getTextRects",value:function(h,p,S,_){var k=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],T=this.w,B=this.drawText({x:-200,y:-200,text:h,textAnchor:"start",fontSize:p,fontFamily:S,foreColor:"#fff",opacity:0});_&&B.attr("transform",_),T.globals.dom.Paper.add(B);var W=B.bbox();return k||(W=B.node.getBoundingClientRect()),B.remove(),{width:W.width,height:W.height}}},{key:"placeTextWithEllipsis",value:function(h,p,S){if(typeof h.getComputedTextLength=="function"&&(h.textContent=p,p.length>0&&h.getComputedTextLength()>=S/1.1)){for(var _=p.length-3;_>0;_-=3)if(h.getSubStringLength(0,_)<=S/1.1)return void(h.textContent=p.substring(0,_)+"...");h.textContent="."}}}],[{key:"setAttrs",value:function(h,p){for(var S in p)p.hasOwnProperty(S)&&h.setAttribute(S,p[S])}}]),Ee}(),X=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"getStackedSeriesTotals",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],p=this.w,S=[];if(p.globals.series.length===0)return S;for(var _=0;_<p.globals.series[p.globals.maxValsInArrayIndex].length;_++){for(var k=0,T=0;T<p.globals.series.length;T++)p.globals.series[T][_]!==void 0&&h.indexOf(T)===-1&&(k+=p.globals.series[T][_]);S.push(k)}return S}},{key:"getSeriesTotalByIndex",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return h===null?this.w.config.series.reduce(function(p,S){return p+S},0):this.w.globals.series[h].reduce(function(p,S){return p+S},0)}},{key:"getStackedSeriesTotalsByGroups",value:function(){var h=this,p=this.w,S=[];return p.globals.seriesGroups.forEach(function(_){var k=[];p.config.series.forEach(function(B,W){_.indexOf(p.globals.seriesNames[W])>-1&&k.push(W)});var T=p.globals.series.map(function(B,W){return k.indexOf(W)===-1?W:-1}).filter(function(B){return B!==-1});S.push(h.getStackedSeriesTotals(T))}),S}},{key:"setSeriesYAxisMappings",value:function(){var h=this.w.globals,p=this.w.config,S=[],_=[],k=[],T=h.series.length>p.yaxis.length||p.yaxis.some(function(ue){return Array.isArray(ue.seriesName)});p.series.forEach(function(ue,ge){k.push(ge),_.push(null)}),p.yaxis.forEach(function(ue,ge){S[ge]=[]});var B=[];p.yaxis.forEach(function(ue,ge){var Se=!1;if(ue.seriesName){var ke=[];Array.isArray(ue.seriesName)?ke=ue.seriesName:ke.push(ue.seriesName),ke.forEach(function(Me){p.series.forEach(function(qe,Fe){if(qe.name===Me){var at=Fe;ge===Fe||T?!T||k.indexOf(Fe)>-1?S[ge].push([ge,Fe]):console.warn("Series '"+qe.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,ge]),at=ge),Se=!0,(at=k.indexOf(at))!==-1&&k.splice(at,1)}})})}Se||B.push(ge)}),S=S.map(function(ue,ge){var Se=[];return ue.forEach(function(ke){_[ke[1]]=ke[0],Se.push(ke[1])}),Se});for(var W=p.yaxis.length-1,ee=0;ee<B.length&&(W=B[ee],S[W]=[],k);ee++){var ce=k[0];k.shift(),S[W].push(ce),_[ce]=W}k.forEach(function(ue){S[W].push(ue),_[ue]=W}),h.seriesYAxisMap=S.map(function(ue){return ue}),h.seriesYAxisReverseMap=_.map(function(ue){return ue}),h.seriesYAxisMap.forEach(function(ue,ge){ue.forEach(function(Se){p.series[Se]&&p.series[Se].group===void 0&&(p.series[Se].group="apexcharts-axis-".concat(ge.toString()))})})}},{key:"isSeriesNull",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return(h===null?this.w.config.series.filter(function(p){return p!==null}):this.w.config.series[h].data.filter(function(p){return p!==null})).length===0}},{key:"seriesHaveSameValues",value:function(h){return this.w.globals.series[h].every(function(p,S,_){return p===_[0]})}},{key:"getCategoryLabels",value:function(h){var p=this.w,S=h.slice();return p.config.xaxis.convertedCatToNumeric&&(S=h.map(function(_,k){return p.config.xaxis.labels.formatter(_-p.globals.minX+1)})),S}},{key:"getLargestSeries",value:function(){var h=this.w;h.globals.maxValsInArrayIndex=h.globals.series.map(function(p){return p.length}).indexOf(Math.max.apply(Math,h.globals.series.map(function(p){return p.length})))}},{key:"getLargestMarkerSize",value:function(){var h=this.w,p=0;return h.globals.markers.size.forEach(function(S){p=Math.max(p,S)}),h.config.markers.discrete&&h.config.markers.discrete.length&&h.config.markers.discrete.forEach(function(S){p=Math.max(p,S.size)}),p>0&&(h.config.markers.hover.size>0?p=h.config.markers.hover.size:p+=h.config.markers.hover.sizeOffset),h.globals.markers.largestSize=p,p}},{key:"getSeriesTotals",value:function(){var h=this.w;h.globals.seriesTotals=h.globals.series.map(function(p,S){var _=0;if(Array.isArray(p))for(var k=0;k<p.length;k++)_+=p[k];else _+=p;return _})}},{key:"getSeriesTotalsXRange",value:function(h,p){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]>h&&S.globals.seriesX[k][B]<p&&(T+=_[B]);return T})}},{key:"getPercentSeries",value:function(){var h=this.w;h.globals.seriesPercent=h.globals.series.map(function(p,S){var _=[];if(Array.isArray(p))for(var k=0;k<p.length;k++){var T=h.globals.stackedSeriesTotals[k],B=0;T&&(B=100*p[k]/T),_.push(B)}else{var W=100*p/h.globals.seriesTotals.reduce(function(ee,ce){return ee+ce},0);_.push(W)}return _})}},{key:"getCalculatedRatios",value:function(){var h,p,S,_=this,k=this.w,T=k.globals,B=[],W=0,ee=[],ce=.1,ue=0;if(T.yRange=[],T.isMultipleYAxis)for(var ge=0;ge<T.minYArr.length;ge++)T.yRange.push(Math.abs(T.minYArr[ge]-T.maxYArr[ge])),ee.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 Se=0;Se<T.yRange.length;Se++)B.push(T.yRange[Se]/T.gridHeight);if(p=T.xRange/T.gridWidth,h=T.yRange/T.gridWidth,S=T.xRange/T.gridHeight,(W=T.zRange/T.gridHeight*16)||(W=1),T.minY!==Number.MIN_VALUE&&Math.abs(T.minY)!==0&&(T.hasNegs=!0),k.globals.seriesYAxisReverseMap.length>0){var ke=function(qe,Fe){var at=k.config.yaxis[k.globals.seriesYAxisReverseMap[Fe]],se=qe<0?-1:1;return qe=Math.abs(qe),at.logarithmic&&(qe=_.getBaseLog(at.logBase,qe)),-se*qe/B[Fe]};if(T.isMultipleYAxis){ee=[];for(var Me=0;Me<B.length;Me++)ee.push(ke(T.minYArr[Me],Me))}else(ee=[]).push(ke(T.minY,0)),T.minY!==Number.MIN_VALUE&&Math.abs(T.minY)!==0&&(ce=-T.minY/h,ue=T.minX/p)}else(ee=[]).push(0),ce=0,ue=0;return{yRatio:B,invertedYRatio:h,zRatio:W,xRatio:p,invertedXRatio:S,baseLineInvertedY:ce,baseLineY:ee,baseLineX:ue}}},{key:"getLogSeries",value:function(h){var p=this,S=this.w;return S.globals.seriesLog=h.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:p.getLogVal(S.config.yaxis[T].logBase,B,k)}):_}),S.globals.invalidLogScale?h:S.globals.seriesLog}},{key:"getBaseLog",value:function(h,p){return Math.log(p)/Math.log(h)}},{key:"getLogVal",value:function(h,p,S){if(p<=0)return 0;var _=this.w,k=_.globals.minYArr[S]===0?-1:this.getBaseLog(h,_.globals.minYArr[S]),T=(_.globals.maxYArr[S]===0?0:this.getBaseLog(h,_.globals.maxYArr[S]))-k;return p<1?p/T:(this.getBaseLog(h,p)-k)/T}},{key:"getLogYRatios",value:function(h){var p=this,S=this.w,_=this.w.globals;return _.yLogRatio=h.slice(),_.logYRange=_.yRange.map(function(k,T){var B=S.globals.seriesYAxisReverseMap[T];if(S.config.yaxis[B]&&p.w.config.yaxis[B].logarithmic){var W,ee=-Number.MAX_VALUE,ce=Number.MIN_VALUE;return _.seriesLog.forEach(function(ue,ge){ue.forEach(function(Se){S.config.yaxis[ge]&&S.config.yaxis[ge].logarithmic&&(ee=Math.max(Se,ee),ce=Math.min(Se,ce))})}),W=Math.pow(_.yRange[T],Math.abs(ce-ee)/_.yRange[T]),_.yLogRatio[T]=W/_.gridHeight,W}}),_.invalidLogScale?h.slice():_.yLogRatio}},{key:"drawSeriesByGroup",value:function(h,p,S,_){var k=this.w,T=[];return h.series.length>0&&p.forEach(function(B){var W=[],ee=[];h.i.forEach(function(ce,ue){k.config.series[ce].group===B&&(W.push(h.series[ue]),ee.push(ce))}),W.length>0&&T.push(_.draw(W,S,ee))}),T}}],[{key:"checkComboSeries",value:function(h,p){var S=!1,_=0,k=0;return p===void 0&&(p="line"),h.length&&h[0].type!==void 0&&h.forEach(function(T){T.type!=="bar"&&T.type!=="column"&&T.type!=="candlestick"&&T.type!=="boxPlot"||_++,T.type!==void 0&&T.type!==p&&k++}),k>0&&(S=!0),{comboBarCount:_,comboCharts:S}}},{key:"extendArrayProps",value:function(h,p,S){var _,k,T,B,W,ee;return(_=p)!==null&&_!==void 0&&_.yaxis&&(p=h.extendYAxis(p,S)),(k=p)!==null&&k!==void 0&&k.annotations&&(p.annotations.yaxis&&(p=h.extendYAxisAnnotations(p)),(T=p)!==null&&T!==void 0&&(B=T.annotations)!==null&&B!==void 0&&B.xaxis&&(p=h.extendXAxisAnnotations(p)),(W=p)!==null&&W!==void 0&&(ee=W.annotations)!==null&&ee!==void 0&&ee.points&&(p=h.extendPointAnnotations(p))),p}}]),Ee}(),ne=function(){function Ee(h){s(this,Ee),this.w=h.w,this.annoCtx=h}return o(Ee,[{key:"setOrientations",value:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,S=this.w;if(h.label.orientation==="vertical"){var _=p!==null?p: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=h.label.position==="top"?T.width:-T.width;k.setAttribute("y",parseFloat(k.getAttribute("y"))+B);var W=this.annoCtx.graphics.rotateAroundCenter(k),ee=W.x,ce=W.y;k.setAttribute("transform","rotate(-90 ".concat(ee," ").concat(ce,")"))}}}},{key:"addBackgroundToAnno",value:function(h,p){var S=this.w;if(!h||!p.label.text||!String(p.label.text).trim())return null;var _=S.globals.dom.baseEl.querySelector(".apexcharts-grid").getBoundingClientRect(),k=h.getBoundingClientRect(),T=p.label.style.padding,B=T.left,W=T.right,ee=T.top,ce=T.bottom;if(p.label.orientation==="vertical"){var ue=[B,W,ee,ce];ee=ue[0],ce=ue[1],B=ue[2],W=ue[3]}var ge=k.left-_.left-B,Se=k.top-_.top-ee,ke=this.annoCtx.graphics.drawRect(ge-S.globals.barPadForNumericAxis,Se,k.width+B+W,k.height+ee+ce,p.label.borderRadius,p.label.style.background,1,p.label.borderWidth,p.label.borderColor,0);return p.id&&ke.node.classList.add(p.id),ke}},{key:"annotationsBackground",value:function(){var h=this,p=this.w,S=function(_,k,T){var B=p.globals.dom.baseEl.querySelector(".apexcharts-".concat(T,"-annotations .apexcharts-").concat(T,"-annotation-label[rel='").concat(k,"']"));if(B){var W=B.parentNode,ee=h.addBackgroundToAnno(B,_);ee&&(W.insertBefore(ee.node,B),_.label.mouseEnter&&ee.node.addEventListener("mouseenter",_.label.mouseEnter.bind(h,_)),_.label.mouseLeave&&ee.node.addEventListener("mouseleave",_.label.mouseLeave.bind(h,_)),_.label.click&&ee.node.addEventListener("click",_.label.click.bind(h,_)))}};p.config.annotations.xaxis.forEach(function(_,k){return S(_,k,"xaxis")}),p.config.annotations.yaxis.forEach(function(_,k){return S(_,k,"yaxis")}),p.config.annotations.points.forEach(function(_,k){return S(_,k,"point")})}},{key:"getY1Y2",value:function(h,p){var S,_=this.w,k=h==="y1"?p.y:p.y2,T=!1;if(this.annoCtx.invertAxis){var B=_.config.xaxis.convertedCatToNumeric?_.globals.categoryLabels:_.globals.labels,W=B.indexOf(k),ee=_.globals.dom.baseEl.querySelector(".apexcharts-yaxis-texts-g text:nth-child(".concat(W+1,")"));S=ee?parseFloat(ee.getAttribute("y")):(_.globals.gridHeight/B.length-1)*(W+1)-_.globals.barHeight,p.seriesIndex!==void 0&&_.globals.barHeight&&(S-=_.globals.barHeight/2*(_.globals.series.length-1)-_.globals.barHeight*p.seriesIndex)}else{var ce,ue=_.globals.seriesYAxisMap[p.yAxisIndex][0],ge=_.config.yaxis[p.yAxisIndex].logarithmic?new X(this.annoCtx.ctx).getLogVal(_.config.yaxis[p.yAxisIndex].logBase,k,ue)/_.globals.yLogRatio[ue]:(k-_.globals.minYArr[ue])/(_.globals.yRange[ue]/_.globals.gridHeight);S=_.globals.gridHeight-Math.min(Math.max(ge,0),_.globals.gridHeight),T=ge>_.globals.gridHeight||ge<0,!p.marker||p.y!==void 0&&p.y!==null||(S=0),(ce=_.config.yaxis[p.yAxisIndex])!==null&&ce!==void 0&&ce.reversed&&(S=ge)}return typeof k=="string"&&k.includes("px")&&(S=parseFloat(k)),{yP:S,clipped:T}}},{key:"getX1X2",value:function(h,p){var S=this.w,_=h==="x1"?p.x:p.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,W=!1,ee=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||(ee=this.getStringX(_)),typeof _=="string"&&_.includes("px")&&(ee=parseFloat(_)),_==null&&p.marker&&(ee=S.globals.gridWidth),p.seriesIndex!==void 0&&S.globals.barWidth&&!this.annoCtx.invertAxis&&(ee-=S.globals.barWidth/2*(S.globals.series.length-1)-S.globals.barWidth*p.seriesIndex),ee>S.globals.gridWidth?(ee=S.globals.gridWidth,W=!0):ee<0&&(ee=0,W=!0),{x:ee,clipped:W}}},{key:"getStringX",value:function(h){var p=this.w,S=h;p.config.xaxis.convertedCatToNumeric&&p.globals.categoryLabels.length&&(h=p.globals.categoryLabels.indexOf(h)+1);var _=p.globals.labels.map(function(T){return Array.isArray(T)?T.join(" "):T}).indexOf(h),k=p.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(h){s(this,Ee),this.w=h.w,this.annoCtx=h,this.invertAxis=this.annoCtx.invertAxis,this.helpers=new ne(this.annoCtx)}return o(Ee,[{key:"addXaxisAnnotation",value:function(h,p,S){var _,k=this.w,T=this.helpers.getX1X2("x1",h),B=T.x,W=T.clipped,ee=!0,ce=h.label.text,ue=h.strokeDashArray;if(O.isNumber(B)){if(h.x2===null||h.x2===void 0){if(!W){var ge=this.annoCtx.graphics.drawLine(B+h.offsetX,0+h.offsetY,B+h.offsetX,k.globals.gridHeight+h.offsetY,h.borderColor,ue,h.borderWidth);p.appendChild(ge.node),h.id&&ge.node.classList.add(h.id)}}else{var Se=this.helpers.getX1X2("x2",h);if(_=Se.x,ee=Se.clipped,!W||!ee){if(_<B){var ke=B;B=_,_=ke}var Me=this.annoCtx.graphics.drawRect(B+h.offsetX,0+h.offsetY,_-B,k.globals.gridHeight+h.offsetY,0,h.fillColor,h.opacity,1,h.borderColor,ue);Me.node.classList.add("apexcharts-annotation-rect"),Me.attr("clip-path","url(#gridRectMask".concat(k.globals.cuid,")")),p.appendChild(Me.node),h.id&&Me.node.classList.add(h.id)}}if(!W||!ee){var qe=this.annoCtx.graphics.getTextRects(ce,parseFloat(h.label.style.fontSize)),Fe=h.label.position==="top"?4:h.label.position==="center"?k.globals.gridHeight/2+(h.label.orientation==="vertical"?qe.width/2:0):k.globals.gridHeight,at=this.annoCtx.graphics.drawText({x:B+h.label.offsetX,y:Fe+h.label.offsetY-(h.label.orientation==="vertical"?h.label.position==="top"?qe.width/2-12:-qe.width/2:0),text:ce,textAnchor:h.label.textAnchor,fontSize:h.label.style.fontSize,fontFamily:h.label.style.fontFamily,fontWeight:h.label.style.fontWeight,foreColor:h.label.style.color,cssClass:"apexcharts-xaxis-annotation-label ".concat(h.label.style.cssClass," ").concat(h.id?h.id:"")});at.attr({rel:S}),p.appendChild(at.node),this.annoCtx.helpers.setOrientations(h,S)}}}},{key:"drawXAxisAnnotations",value:function(){var h=this,p=this.w,S=this.annoCtx.graphics.group({class:"apexcharts-xaxis-annotations"});return p.config.annotations.xaxis.map(function(_,k){h.addXaxisAnnotation(_,S.node,k)}),S}}]),Ee}(),K=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.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(h){return typeof h!="number"&&!isNaN(this.parseDate(h))}},{key:"getTimeStamp",value:function(h){return Date.parse(h)?this.w.config.xaxis.labels.datetimeUTC?new Date(new Date(h).toISOString().substr(0,25)).getTime():new Date(h).getTime():h}},{key:"getDate",value:function(h){return this.w.config.xaxis.labels.datetimeUTC?new Date(new Date(h).toUTCString()):new Date(h)}},{key:"parseDate",value:function(h){var p=Date.parse(h);if(!isNaN(p))return this.getTimeStamp(h);var S=Date.parse(h.replace(/-/g,"/").replace(/[a-z]+/gi," "));return S=this.getTimeStamp(S)}},{key:"parseDateWithTimezone",value:function(h){return Date.parse(h.replace(/-/g,"/").replace(/[a-z]+/gi," "))}},{key:"formatDate",value:function(h,p){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)),W=[""].concat(N(S.shortDays));function ee(rt,ct){var yt=rt+"";for(ct=ct||2;yt.length<ct;)yt="0"+yt;return yt}var ce=_?h.getUTCFullYear():h.getFullYear();p=(p=(p=p.replace(/(^|[^\\])yyyy+/g,"$1"+ce)).replace(/(^|[^\\])yy/g,"$1"+ce.toString().substr(2,2))).replace(/(^|[^\\])y/g,"$1"+ce);var ue=(_?h.getUTCMonth():h.getMonth())+1;p=(p=(p=(p=p.replace(/(^|[^\\])MMMM+/g,"$1"+k[0])).replace(/(^|[^\\])MMM/g,"$1"+T[0])).replace(/(^|[^\\])MM/g,"$1"+ee(ue))).replace(/(^|[^\\])M/g,"$1"+ue);var ge=_?h.getUTCDate():h.getDate();p=(p=(p=(p=p.replace(/(^|[^\\])dddd+/g,"$1"+B[0])).replace(/(^|[^\\])ddd/g,"$1"+W[0])).replace(/(^|[^\\])dd/g,"$1"+ee(ge))).replace(/(^|[^\\])d/g,"$1"+ge);var Se=_?h.getUTCHours():h.getHours(),ke=Se>12?Se-12:Se===0?12:Se;p=(p=(p=(p=p.replace(/(^|[^\\])HH+/g,"$1"+ee(Se))).replace(/(^|[^\\])H/g,"$1"+Se)).replace(/(^|[^\\])hh+/g,"$1"+ee(ke))).replace(/(^|[^\\])h/g,"$1"+ke);var Me=_?h.getUTCMinutes():h.getMinutes();p=(p=p.replace(/(^|[^\\])mm+/g,"$1"+ee(Me))).replace(/(^|[^\\])m/g,"$1"+Me);var qe=_?h.getUTCSeconds():h.getSeconds();p=(p=p.replace(/(^|[^\\])ss+/g,"$1"+ee(qe))).replace(/(^|[^\\])s/g,"$1"+qe);var Fe=_?h.getUTCMilliseconds():h.getMilliseconds();p=p.replace(/(^|[^\\])fff+/g,"$1"+ee(Fe,3)),Fe=Math.round(Fe/10),p=p.replace(/(^|[^\\])ff/g,"$1"+ee(Fe)),Fe=Math.round(Fe/10);var at=Se<12?"AM":"PM";p=(p=(p=p.replace(/(^|[^\\])f/g,"$1"+Fe)).replace(/(^|[^\\])TT+/g,"$1"+at)).replace(/(^|[^\\])T/g,"$1"+at.charAt(0));var se=at.toLowerCase();p=(p=p.replace(/(^|[^\\])tt+/g,"$1"+se)).replace(/(^|[^\\])t/g,"$1"+se.charAt(0));var Ce=-h.getTimezoneOffset(),Ue=_||!Ce?"Z":Ce>0?"+":"-";if(!_){var Be=(Ce=Math.abs(Ce))%60;Ue+=ee(Math.floor(Ce/60))+":"+ee(Be)}p=p.replace(/(^|[^\\])K/g,"$1"+Ue);var _e=(_?h.getUTCDay():h.getDay())+1;return p=(p=(p=(p=(p=p.replace(new RegExp(B[0],"g"),B[_e])).replace(new RegExp(W[0],"g"),W[_e])).replace(new RegExp(k[0],"g"),k[ue])).replace(new RegExp(T[0],"g"),T[ue])).replace(/\\(.)/g,"$1")}},{key:"getTimeUnitsfromTimestamp",value:function(h,p,S){var _=this.w;_.config.xaxis.min!==void 0&&(h=_.config.xaxis.min),_.config.xaxis.max!==void 0&&(p=_.config.xaxis.max);var k=this.getDate(h),T=this.getDate(p),B=this.formatDate(k,"yyyy MM dd HH mm ss fff").split(" "),W=this.formatDate(T,"yyyy MM dd HH mm ss fff").split(" ");return{minMillisecond:parseInt(B[6],10),maxMillisecond:parseInt(W[6],10),minSecond:parseInt(B[5],10),maxSecond:parseInt(W[5],10),minMinute:parseInt(B[4],10),maxMinute:parseInt(W[4],10),minHour:parseInt(B[3],10),maxHour:parseInt(W[3],10),minDate:parseInt(B[2],10),maxDate:parseInt(W[2],10),minMonth:parseInt(B[1],10)-1,maxMonth:parseInt(W[1],10)-1,minYear:parseInt(B[0],10),maxYear:parseInt(W[0],10)}}},{key:"isLeapYear",value:function(h){return h%4==0&&h%100!=0||h%400==0}},{key:"calculcateLastDaysOfMonth",value:function(h,p,S){return this.determineDaysOfMonths(h,p)-S}},{key:"determineDaysOfYear",value:function(h){var p=365;return this.isLeapYear(h)&&(p=366),p}},{key:"determineRemainingDaysOfYear",value:function(h,p,S){var _=this.daysCntOfYear[p]+S;return p>1&&this.isLeapYear()&&_++,_}},{key:"determineDaysOfMonths",value:function(h,p){var S=30;switch(h=O.monthMod(h),!0){case this.months30.indexOf(h)>-1:h===2&&(S=this.isLeapYear(p)?29:28);break;case this.months31.indexOf(h)>-1:default:S=31}return S}}]),Ee}(),re=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w,this.tooltipKeyFormat="dd MMM"}return o(Ee,[{key:"xLabelFormat",value:function(h,p,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 K(this.ctx);return T.formatDate(T.getDate(p),k.config.tooltip.x.format)}return h(p,S,_)}},{key:"defaultGeneralFormatter",value:function(h){return Array.isArray(h)?h.map(function(p){return p}):h}},{key:"defaultYFormatter",value:function(h,p,S){var _=this.w;if(O.isNumber(h))if(_.globals.yValueDecimal!==0)h=h.toFixed(p.decimalsInFloat!==void 0?p.decimalsInFloat:_.globals.yValueDecimal);else{var k=h.toFixed(0);h=h==k?k:h.toFixed(1)}return h}},{key:"setLabelFormatters",value:function(){var h=this,p=this.w;return p.globals.xaxisTooltipFormatter=function(S){return h.defaultGeneralFormatter(S)},p.globals.ttKeyFormatter=function(S){return h.defaultGeneralFormatter(S)},p.globals.ttZFormatter=function(S){return S},p.globals.legendFormatter=function(S){return h.defaultGeneralFormatter(S)},p.config.xaxis.labels.formatter!==void 0?p.globals.xLabelFormatter=p.config.xaxis.labels.formatter:p.globals.xLabelFormatter=function(S){if(O.isNumber(S)){if(!p.config.xaxis.convertedCatToNumeric&&p.config.xaxis.type==="numeric"){if(O.isNumber(p.config.xaxis.decimalsInFloat))return S.toFixed(p.config.xaxis.decimalsInFloat);var _=p.globals.maxX-p.globals.minX;return _>0&&_<100?S.toFixed(1):S.toFixed(0)}return p.globals.isBarHorizontal&&p.globals.maxY-p.globals.minYArr<4?S.toFixed(1):S.toFixed(0)}return S},typeof p.config.tooltip.x.formatter=="function"?p.globals.ttKeyFormatter=p.config.tooltip.x.formatter:p.globals.ttKeyFormatter=p.globals.xLabelFormatter,typeof p.config.xaxis.tooltip.formatter=="function"&&(p.globals.xaxisTooltipFormatter=p.config.xaxis.tooltip.formatter),(Array.isArray(p.config.tooltip.y)||p.config.tooltip.y.formatter!==void 0)&&(p.globals.ttVal=p.config.tooltip.y),p.config.tooltip.z.formatter!==void 0&&(p.globals.ttZFormatter=p.config.tooltip.z.formatter),p.config.legend.formatter!==void 0&&(p.globals.legendFormatter=p.config.legend.formatter),p.config.yaxis.forEach(function(S,_){S.labels.formatter!==void 0?p.globals.yLabelFormatters[_]=S.labels.formatter:p.globals.yLabelFormatters[_]=function(k){return p.globals.xyCharts?Array.isArray(k)?k.map(function(T){return h.defaultYFormatter(T,S,_)}):h.defaultYFormatter(k,S,_):k}}),p.globals}},{key:"heatmapLabelFormatters",value:function(){var h=this.w;if(h.config.chart.type==="heatmap"){h.globals.yAxisScale[0].result=h.globals.seriesNames.slice();var p=h.globals.seriesNames.reduce(function(S,_){return S.length>_.length?S:_},0);h.globals.yAxisScale[0].niceMax=p,h.globals.yAxisScale[0].niceMin=p}}}]),Ee}(),he=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"getLabel",value:function(h,p,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],W=this.w,ee=h[_]===void 0?"":h[_],ce=ee,ue=W.globals.xLabelFormatter,ge=W.config.xaxis.labels.formatter,Se=!1,ke=new re(this.ctx),Me=ee;B&&(ce=ke.xLabelFormat(ue,ee,Me,{i:_,dateFormatter:new K(this.ctx).formatDate,w:W}),ge!==void 0&&(ce=ge(ee,h[_],{i:_,dateFormatter:new K(this.ctx).formatDate,w:W})));var qe,Fe;p.length>0?(qe=p[_].unit,Fe=null,p.forEach(function(Ue){Ue.unit==="month"?Fe="year":Ue.unit==="day"?Fe="month":Ue.unit==="hour"?Fe="day":Ue.unit==="minute"&&(Fe="hour")}),Se=Fe===qe,S=p[_].position,ce=p[_].value):W.config.xaxis.type==="datetime"&&ge===void 0&&(ce=""),ce===void 0&&(ce=""),ce=Array.isArray(ce)?ce:ce.toString();var at=new z(this.ctx),se={};se=W.globals.rotateXLabels&&B?at.getTextRects(ce,parseInt(T,10),null,"rotate(".concat(W.config.xaxis.labels.rotate," 0 0)"),!1):at.getTextRects(ce,parseInt(T,10));var Ce=!W.config.xaxis.labels.showDuplicates&&this.ctx.timeScale;return!Array.isArray(ce)&&(String(ce)==="NaN"||k.indexOf(ce)>=0&&Ce)&&(ce=""),{x:S,text:ce,textRect:se,isBold:Se}}},{key:"checkLabelBasedOnTickamount",value:function(h,p,S){var _=this.w,k=_.config.xaxis.tickAmount;return k==="dataPoints"&&(k=Math.round(_.globals.gridWidth/120)),k>S||h%Math.round(S/(k+1))==0||(p.text=""),p}},{key:"checkForOverflowingLabels",value:function(h,p,S,_,k){var T=this.w;if(h===0&&T.globals.skipFirstTimelinelabel&&(p.text=""),h===S-1&&T.globals.skipLastTimelinelabel&&(p.text=""),T.config.xaxis.labels.hideOverlappingLabels&&_.length>0){var B=k[k.length-1];p.x<B.textRect.width/(T.globals.rotateXLabels?Math.abs(T.config.xaxis.labels.rotate)/12:1.01)+B.x&&(p.text="")}return p}},{key:"checkForReversedLabels",value:function(h,p){var S=this.w;return S.config.yaxis[h]&&S.config.yaxis[h].reversed&&p.reverse(),p}},{key:"yAxisAllSeriesCollapsed",value:function(h){var p=this.w.globals;return!p.seriesYAxisMap[h].some(function(S){return p.collapsedSeriesIndices.indexOf(S)===-1})}},{key:"translateYAxisIndex",value:function(h){var p=this.w,S=p.globals,_=p.config.yaxis;return S.series.length>_.length||_.some(function(k){return Array.isArray(k.seriesName)})?h:S.seriesYAxisReverseMap[h]}},{key:"isYAxisHidden",value:function(h){var p=this.w,S=p.config.yaxis[h];if(!S.show||this.yAxisAllSeriesCollapsed(h))return!0;if(!S.showForNullSeries){var _=p.globals.seriesYAxisMap[h],k=new X(this.ctx);return _.every(function(T){return k.isSeriesNull(T)})}return!1}},{key:"getYAxisForeColor",value:function(h,p){var S=this.w;return Array.isArray(h)&&S.globals.yAxisScale[p]&&this.ctx.theme.pushExtraColors(h,S.globals.yAxisScale[p].result.length,!1),h}},{key:"drawYAxisTicks",value:function(h,p,S,_,k,T,B){var W=this.w,ee=new z(this.ctx),ce=W.globals.translateY+W.config.yaxis[k].labels.offsetY;if(W.globals.isBarHorizontal?ce=0:W.config.chart.type==="heatmap"&&(ce+=T/2),_.show&&p>0){W.config.yaxis[k].opposite===!0&&(h+=_.width);for(var ue=p;ue>=0;ue--){var ge=ee.drawLine(h+S.offsetX-_.width+_.offsetX,ce+_.offsetY,h+S.offsetX+_.offsetX,ce+_.offsetY,_.color);B.add(ge),ce+=T}}}}]),Ee}(),Q=function(){function Ee(h){s(this,Ee),this.w=h.w,this.annoCtx=h,this.helpers=new ne(this.annoCtx),this.axesUtils=new he(this.annoCtx)}return o(Ee,[{key:"addYaxisAnnotation",value:function(h,p,S){var _,k=this.w,T=h.strokeDashArray,B=this.helpers.getY1Y2("y1",h),W=B.yP,ee=B.clipped,ce=!0,ue=!1,ge=h.label.text;if(h.y2===null||h.y2===void 0){if(!ee){ue=!0;var Se=this.annoCtx.graphics.drawLine(0+h.offsetX,W+h.offsetY,this._getYAxisAnnotationWidth(h),W+h.offsetY,h.borderColor,T,h.borderWidth);p.appendChild(Se.node),h.id&&Se.node.classList.add(h.id)}}else{if(_=(B=this.helpers.getY1Y2("y2",h)).yP,ce=B.clipped,_>W){var ke=W;W=_,_=ke}if(!ee||!ce){ue=!0;var Me=this.annoCtx.graphics.drawRect(0+h.offsetX,_+h.offsetY,this._getYAxisAnnotationWidth(h),W-_,0,h.fillColor,h.opacity,1,h.borderColor,T);Me.node.classList.add("apexcharts-annotation-rect"),Me.attr("clip-path","url(#gridRectMask".concat(k.globals.cuid,")")),p.appendChild(Me.node),h.id&&Me.node.classList.add(h.id)}}if(ue){var qe=h.label.position==="right"?k.globals.gridWidth:h.label.position==="center"?k.globals.gridWidth/2:0,Fe=this.annoCtx.graphics.drawText({x:qe+h.label.offsetX,y:(_??W)+h.label.offsetY-3,text:ge,textAnchor:h.label.textAnchor,fontSize:h.label.style.fontSize,fontFamily:h.label.style.fontFamily,fontWeight:h.label.style.fontWeight,foreColor:h.label.style.color,cssClass:"apexcharts-yaxis-annotation-label ".concat(h.label.style.cssClass," ").concat(h.id?h.id:"")});Fe.attr({rel:S}),p.appendChild(Fe.node)}}},{key:"_getYAxisAnnotationWidth",value:function(h){var p=this.w;return p.globals.gridWidth,(h.width.indexOf("%")>-1?p.globals.gridWidth*parseInt(h.width,10)/100:parseInt(h.width,10))+h.offsetX}},{key:"drawYAxisAnnotations",value:function(){var h=this,p=this.w,S=this.annoCtx.graphics.group({class:"apexcharts-yaxis-annotations"});return p.config.annotations.yaxis.forEach(function(_,k){_.yAxisIndex=h.axesUtils.translateYAxisIndex(_.yAxisIndex),h.axesUtils.isYAxisHidden(_.yAxisIndex)&&h.axesUtils.yAxisAllSeriesCollapsed(_.yAxisIndex)||h.addYaxisAnnotation(_,S.node,k)}),S}}]),Ee}(),ie=function(){function Ee(h){s(this,Ee),this.w=h.w,this.annoCtx=h,this.helpers=new ne(this.annoCtx)}return o(Ee,[{key:"addPointAnnotation",value:function(h,p,S){if(!(this.w.globals.collapsedSeriesIndices.indexOf(h.seriesIndex)>-1)){var _=this.helpers.getX1X2("x1",h),k=_.x,T=_.clipped,B=(_=this.helpers.getY1Y2("y1",h)).yP,W=_.clipped;if(O.isNumber(k)&&!W&&!T){var ee={pSize:h.marker.size,pointStrokeWidth:h.marker.strokeWidth,pointFillColor:h.marker.fillColor,pointStrokeColor:h.marker.strokeColor,shape:h.marker.shape,pRadius:h.marker.radius,class:"apexcharts-point-annotation-marker ".concat(h.marker.cssClass," ").concat(h.id?h.id:"")},ce=this.annoCtx.graphics.drawMarker(k+h.marker.offsetX,B+h.marker.offsetY,ee);p.appendChild(ce.node);var ue=h.label.text?h.label.text:"",ge=this.annoCtx.graphics.drawText({x:k+h.label.offsetX,y:B+h.label.offsetY-h.marker.size-parseFloat(h.label.style.fontSize)/1.6,text:ue,textAnchor:h.label.textAnchor,fontSize:h.label.style.fontSize,fontFamily:h.label.style.fontFamily,fontWeight:h.label.style.fontWeight,foreColor:h.label.style.color,cssClass:"apexcharts-point-annotation-label ".concat(h.label.style.cssClass," ").concat(h.id?h.id:"")});if(ge.attr({rel:S}),p.appendChild(ge.node),h.customSVG.SVG){var Se=this.annoCtx.graphics.group({class:"apexcharts-point-annotations-custom-svg "+h.customSVG.cssClass});Se.attr({transform:"translate(".concat(k+h.customSVG.offsetX,", ").concat(B+h.customSVG.offsetY,")")}),Se.node.innerHTML=h.customSVG.SVG,p.appendChild(Se.node)}if(h.image.path){var ke=h.image.width?h.image.width:20,Me=h.image.height?h.image.height:20;ce=this.annoCtx.addImage({x:k+h.image.offsetX-ke/2,y:B+h.image.offsetY-Me/2,width:ke,height:Me,path:h.image.path,appendTo:".apexcharts-point-annotations"})}h.mouseEnter&&ce.node.addEventListener("mouseenter",h.mouseEnter.bind(this,h)),h.mouseLeave&&ce.node.addEventListener("mouseleave",h.mouseLeave.bind(this,h)),h.click&&ce.node.addEventListener("click",h.click.bind(this,h))}}}},{key:"drawPointAnnotations",value:function(){var h=this,p=this.w,S=this.annoCtx.graphics.group({class:"apexcharts-point-annotations"});return p.config.annotations.points.map(function(_,k){h.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(h){return h}},value:{show:!0,fontSize:"14px",fontFamily:void 0,fontWeight:400,color:void 0,offsetY:16,formatter:function(h){return h+"%"}},total:{show:!1,label:"Total",fontSize:"16px",fontWeight:600,fontFamily:void 0,color:void 0,formatter:function(h){return h.globals.seriesTotals.reduce(function(p,S){return p+S},0)/h.globals.series.length+"%"}}},barLabels:{enabled:!1,offsetX:0,offsetY:0,useSeriesColors:!0,fontFamily:void 0,fontWeight:600,fontSize:"16px",formatter:function(h){return h},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(h){return h}},value:{show:!0,fontSize:"20px",fontFamily:void 0,fontWeight:400,color:void 0,offsetY:10,formatter:function(h){return h}},total:{show:!1,showAlways:!1,label:"Total",fontSize:"16px",fontWeight:400,fontFamily:void 0,color:void 0,formatter:function(h){return h.globals.seriesTotals.reduce(function(p,S){return p+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(h){return h!==null?h:""},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(h){return h?h+": ":""}}},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(h){s(this,Ee),this.ctx=h,this.w=h.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 Q(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 h=this.w;if(h.globals.axisCharts&&h.globals.dataPoints){for(var p=this.yAxisAnnotations.drawYAxisAnnotations(),S=this.xAxisAnnotations.drawXAxisAnnotations(),_=this.pointsAnnotations.drawPointAnnotations(),k=h.config.chart.animations.enabled,T=[p,S,_],B=[S.node,p.node,_.node],W=0;W<3;W++)h.globals.dom.elGraphical.add(T[W]),!k||h.globals.resized||h.globals.dataChanged||h.config.chart.type!=="scatter"&&h.config.chart.type!=="bubble"&&h.globals.dataPoints>1&&B[W].classList.add("apexcharts-element-hidden"),h.globals.delayedElements.push({el:B[W],index:0});this.helpers.annotationsBackground()}}},{key:"drawImageAnnos",value:function(){var h=this;this.w.config.annotations.images.map(function(p,S){h.addImage(p,S)})}},{key:"drawTextAnnos",value:function(){var h=this;this.w.config.annotations.texts.map(function(p,S){h.addText(p,S)})}},{key:"addXaxisAnnotation",value:function(h,p,S){this.xAxisAnnotations.addXaxisAnnotation(h,p,S)}},{key:"addYaxisAnnotation",value:function(h,p,S){this.yAxisAnnotations.addYaxisAnnotation(h,p,S)}},{key:"addPointAnnotation",value:function(h,p,S){this.pointsAnnotations.addPointAnnotation(h,p,S)}},{key:"addText",value:function(h,p){var S=h.x,_=h.y,k=h.text,T=h.textAnchor,B=h.foreColor,W=h.fontSize,ee=h.fontFamily,ce=h.fontWeight,ue=h.cssClass,ge=h.backgroundColor,Se=h.borderWidth,ke=h.strokeDashArray,Me=h.borderRadius,qe=h.borderColor,Fe=h.appendTo,at=Fe===void 0?".apexcharts-svg":Fe,se=h.paddingLeft,Ce=se===void 0?4:se,Ue=h.paddingRight,Be=Ue===void 0?4:Ue,_e=h.paddingBottom,rt=_e===void 0?2:_e,ct=h.paddingTop,yt=ct===void 0?2:ct,Lt=this.w,ft=this.graphics.drawText({x:S,y:_,text:k,textAnchor:T||"start",fontSize:W||"12px",fontWeight:ce||"regular",fontFamily:ee||Lt.config.chart.fontFamily,foreColor:B||Lt.config.chart.foreColor,cssClass:ue}),Tt=Lt.globals.dom.baseEl.querySelector(at);Tt&&Tt.appendChild(ft.node);var Ge=ft.bbox();if(k){var At=this.graphics.drawRect(Ge.x-Ce,Ge.y-yt,Ge.width+Ce+Be,Ge.height+rt+yt,Me,ge||"transparent",1,Se,qe,ke);Tt.insertBefore(At.node,ft.node)}}},{key:"addImage",value:function(h,p){var S=this.w,_=h.path,k=h.x,T=k===void 0?0:k,B=h.y,W=B===void 0?0:B,ee=h.width,ce=ee===void 0?20:ee,ue=h.height,ge=ue===void 0?20:ue,Se=h.appendTo,ke=Se===void 0?".apexcharts-svg":Se,Me=S.globals.dom.Paper.image(_);Me.size(ce,ge).move(T,W);var qe=S.globals.dom.baseEl.querySelector(ke);return qe&&qe.appendChild(Me.node),Me}},{key:"addXaxisAnnotationExternal",value:function(h,p,S){return this.addAnnotationExternal({params:h,pushToMemory:p,context:S,type:"xaxis",contextMethod:S.addXaxisAnnotation}),S}},{key:"addYaxisAnnotationExternal",value:function(h,p,S){return this.addAnnotationExternal({params:h,pushToMemory:p,context:S,type:"yaxis",contextMethod:S.addYaxisAnnotation}),S}},{key:"addPointAnnotationExternal",value:function(h,p,S){return this.invertAxis===void 0&&(this.invertAxis=S.w.globals.isBarHorizontal),this.addAnnotationExternal({params:h,pushToMemory:p,context:S,type:"point",contextMethod:S.addPointAnnotation}),S}},{key:"addAnnotationExternal",value:function(h){var p=h.params,S=h.pushToMemory,_=h.context,k=h.type,T=h.contextMethod,B=_,W=B.w,ee=W.globals.dom.baseEl.querySelector(".apexcharts-".concat(k,"-annotations")),ce=ee.childNodes.length+1,ue=new G,ge=Object.assign({},k==="xaxis"?ue.xAxisAnnotation:k==="yaxis"?ue.yAxisAnnotation:ue.pointAnnotation),Se=O.extend(ge,p);switch(k){case"xaxis":this.addXaxisAnnotation(Se,ee,ce);break;case"yaxis":this.addYaxisAnnotation(Se,ee,ce);break;case"point":this.addPointAnnotation(Se,ee,ce)}var ke=W.globals.dom.baseEl.querySelector(".apexcharts-".concat(k,"-annotations .apexcharts-").concat(k,"-annotation-label[rel='").concat(ce,"']")),Me=this.helpers.addBackgroundToAnno(ke,Se);return Me&&ee.insertBefore(Me.node,ke),S&&W.globals.memory.methodsToExec.push({context:B,id:Se.id?Se.id:O.randomId(),method:T,label:"addAnnotation",params:p}),_}},{key:"clearAnnotations",value:function(h){for(var p=h.w,S=p.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis-annotations, .apexcharts-xaxis-annotations, .apexcharts-point-annotations"),_=p.globals.memory.methodsToExec.length-1;_>=0;_--)p.globals.memory.methodsToExec[_].label!=="addText"&&p.globals.memory.methodsToExec[_].label!=="addAnnotation"||p.globals.memory.methodsToExec.splice(_,1);S=O.listToArray(S),Array.prototype.forEach.call(S,function(k){for(;k.firstChild;)k.removeChild(k.firstChild)})}},{key:"removeAnnotation",value:function(h,p){var S=h.w,_=S.globals.dom.baseEl.querySelectorAll(".".concat(p));_&&(S.globals.memory.methodsToExec.map(function(k,T){k.id===p&&S.globals.memory.methodsToExec.splice(T,1)}),Array.prototype.forEach.call(_,function(k){k.parentElement.removeChild(k)}))}}]),Ee}(),te=function(Ee){var h,p=Ee.isTimeline,S=Ee.ctx,_=Ee.seriesIndex,k=Ee.dataPointIndex,T=Ee.y1,B=Ee.y2,W=Ee.w,ee=W.globals.seriesRangeStart[_][k],ce=W.globals.seriesRangeEnd[_][k],ue=W.globals.labels[k],ge=W.config.series[_].name?W.config.series[_].name:"",Se=W.globals.ttKeyFormatter,ke=W.config.tooltip.y.title.formatter,Me={w:W,seriesIndex:_,dataPointIndex:k,start:ee,end:ce};typeof ke=="function"&&(ge=ke(ge,Me)),(h=W.config.series[_].data[k])!==null&&h!==void 0&&h.x&&(ue=W.config.series[_].data[k].x),p||W.config.xaxis.type==="datetime"&&(ue=new re(S).xLabelFormat(W.globals.ttKeyFormatter,ue,ue,{i:void 0,dateFormatter:new K(S).formatDate,w:W})),typeof Se=="function"&&(ue=Se(ue,Me)),Number.isFinite(T)&&Number.isFinite(B)&&(ee=T,ce=B);var qe="",Fe="",at=W.globals.colors[_];if(W.config.tooltip.x.formatter===void 0)if(W.config.xaxis.type==="datetime"){var se=new K(S);qe=se.formatDate(se.getDate(ee),W.config.tooltip.x.format),Fe=se.formatDate(se.getDate(ce),W.config.tooltip.x.format)}else qe=ee,Fe=ce;else qe=W.config.tooltip.x.formatter(ee),Fe=W.config.tooltip.x.formatter(ce);return{start:ee,end:ce,startVal:qe,endVal:Fe,ylabel:ue,color:at,seriesName:ge}},ae=function(Ee){var h=Ee.color,p=Ee.seriesName,S=Ee.ylabel,_=Ee.start,k=Ee.end,T=Ee.seriesIndex,B=Ee.dataPointIndex,W=Ee.ctx.tooltip.tooltipLabels.getFormatters(T);_=W.yLbFormatter(_),k=W.yLbFormatter(k);var ee=W.yLbFormatter(Ee.w.globals.series[T][B]),ce=`<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: '+h+'">'+(p||"")+'</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"?ce:"<span>".concat(ee,"</span>"):ce)+" </div></div>"},fe=function(){function Ee(h){s(this,Ee),this.opts=h}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(h){return this.hideYAxis(),O.extend(h,{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(h,p){var S=p.w.config.series[p.seriesIndex].name;return h!==null?S+": "+h:""},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 h=this;return{stroke:{width:1,colors:["#333"]},fill:{opacity:1},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:function(p){var S=p.seriesIndex,_=p.dataPointIndex,k=p.w;return h._getBoxTooltip(k,S,_,["Open","High","","Low","Close"],"candlestick")}},states:{active:{filter:{type:"none"}}},xaxis:{crosshairs:{width:1}}}}},{key:"boxPlot",value:function(){var h=this;return{chart:{animations:{dynamicAnimation:{enabled:!1}}},stroke:{width:1,colors:["#24292e"]},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:function(p){var S=p.seriesIndex,_=p.dataPointIndex,k=p.w;return h._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(h,p){p.ctx;var S=p.seriesIndex,_=p.dataPointIndex,k=p.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():h:T()},background:{enabled:!1},style:{colors:["#fff"]}},markers:{size:10},tooltip:{shared:!1,followCursor:!0,custom:function(h){return h.w.config.plotOptions&&h.w.config.plotOptions.bar&&h.w.config.plotOptions.bar.horizontal?function(p){var S=te(v(v({},p),{},{isTimeline:!0})),_=S.color,k=S.seriesName,T=S.ylabel,B=S.startVal,W=S.endVal;return ae(v(v({},p),{},{color:_,seriesName:k,ylabel:T,start:B,end:W}))}(h):function(p){var S=te(p),_=S.color,k=S.seriesName,T=S.ylabel,B=S.start,W=S.end;return ae(v(v({},p),{},{color:_,seriesName:k,ylabel:T,start:B,end:W}))}(h)}},xaxis:{tickPlacement:"between",tooltip:{enabled:!1},crosshairs:{stroke:{width:0}}}}}},{key:"dumbbell",value:function(h){var p,S;return(p=h.plotOptions.bar)!==null&&p!==void 0&&p.barHeight||(h.plotOptions.bar.barHeight=2),(S=h.plotOptions.bar)!==null&&S!==void 0&&S.columnWidth||(h.plotOptions.bar.columnWidth=2),h}},{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(h){return function(p){var S=te(p),_=S.color,k=S.seriesName,T=S.ylabel,B=S.start,W=S.end;return ae(v(v({},p),{},{color:_,seriesName:k,ylabel:T,start:B,end:W}))}(h)}}}}},{key:"brush",value:function(h){return O.extend(h,{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(h){h.dataLabels=h.dataLabels||{},h.dataLabels.formatter=h.dataLabels.formatter||void 0;var p=h.dataLabels.formatter;return h.yaxis.forEach(function(S,_){h.yaxis[_].min=0,h.yaxis[_].max=100}),h.chart.type==="bar"&&(h.dataLabels.formatter=p||function(S){return typeof S=="number"&&S?S.toFixed(0)+"%":S}),h}},{key:"stackedBars",value:function(){var h=this.bar();return v(v({},h),{},{plotOptions:v(v({},h.plotOptions),{},{bar:v(v({},h.plotOptions.bar),{},{borderRadiusApplication:"end",borderRadiusWhenStacked:"last"})})})}},{key:"convertCatToNumeric",value:function(h){return h.xaxis.convertedCatToNumeric=!0,h}},{key:"convertCatToNumericXaxis",value:function(h,p,S){h.xaxis.type="numeric",h.xaxis.labels=h.xaxis.labels||{},h.xaxis.labels.formatter=h.xaxis.labels.formatter||function(T){return O.isNumber(T)?Math.floor(T):T};var _=h.xaxis.labels.formatter,k=h.xaxis.categories&&h.xaxis.categories.length?h.xaxis.categories:h.labels;return S&&S.length&&(k=S.map(function(T){return Array.isArray(T)?T:String(T)})),k&&k.length&&(h.xaxis.labels.formatter=function(T){return O.isNumber(T)?_(k[Math.floor(T)-1]):_(T)}),h.xaxis.categories=[],h.labels=[],h.xaxis.tickAmount=h.xaxis.tickAmount||"dataPoints",h}},{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(h){return h.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(h){return h.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(h){return h.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(h){return h},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(h,p,S,_,k){var T=h.globals.seriesCandleO[p][S],B=h.globals.seriesCandleH[p][S],W=h.globals.seriesCandleM[p][S],ee=h.globals.seriesCandleL[p][S],ce=h.globals.seriesCandleC[p][S];return h.config.series[p].type&&h.config.series[p].type!==k?`<div class="apexcharts-custom-tooltip">
          `.concat(h.config.series[p].name?h.config.series[p].name:"series-"+(p+1),": <strong>").concat(h.globals.series[p][S],`</strong>
        </div>`):'<div class="apexcharts-tooltip-box apexcharts-tooltip-'.concat(h.config.chart.type,'">')+"<div>".concat(_[0],': <span class="value">')+T+"</span></div>"+"<div>".concat(_[1],': <span class="value">')+B+"</span></div>"+(W?"<div>".concat(_[2],': <span class="value">')+W+"</span></div>":"")+"<div>".concat(_[3],': <span class="value">')+ee+"</span></div>"+"<div>".concat(_[4],': <span class="value">')+ce+"</span></div></div>"}}]),Ee}(),Ne=function(){function Ee(h){s(this,Ee),this.opts=h}return o(Ee,[{key:"init",value:function(h){var p=h.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&&I(S)==="object"){var W,ee,ce,ue,ge,Se,ke,Me,qe,Fe,at={};at=["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(),(W=S.plotOptions)!==null&&W!==void 0&&(ee=W.bar)!==null&&ee!==void 0&&ee.isFunnel&&(at=k.funnel()),S.chart.stacked&&S.chart.type==="bar"&&(at=k.stackedBars()),(ce=S.chart.brush)!==null&&ce!==void 0&&ce.enabled&&(at=k.brush(at)),(ue=S.plotOptions)!==null&&ue!==void 0&&(ge=ue.line)!==null&&ge!==void 0&&ge.isSlopeChart&&(at=k.slope()),S.chart.stacked&&S.chart.stackType==="100%"&&(S=k.stacked100(S)),(Se=S.plotOptions)!==null&&Se!==void 0&&(ke=Se.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||{},p||(S.xaxis.convertedCatToNumeric=!1),((Me=(S=this.checkForCatToNumericXAxis(this.chartType,at,S)).chart.sparkline)!==null&&Me!==void 0&&Me.enabled||(qe=window.Apex.chart)!==null&&qe!==void 0&&(Fe=qe.sparkline)!==null&&Fe!==void 0&&Fe.enabled)&&(at=k.sparkline(at)),B=O.extend(T,at)}var se=O.extend(B,window.Apex);return T=O.extend(se,S),T=this.handleUserInputErrors(T)}},{key:"checkForCatToNumericXAxis",value:function(h,p,S){var _,k,T=new fe(S),B=(h==="bar"||h==="boxPlot")&&((_=S.plotOptions)===null||_===void 0||(k=_.bar)===null||k===void 0?void 0:k.horizontal),W=h==="pie"||h==="polarArea"||h==="donut"||h==="radar"||h==="radialBar"||h==="heatmap",ee=S.xaxis.type!=="datetime"&&S.xaxis.type!=="numeric",ce=S.xaxis.tickPlacement?S.xaxis.tickPlacement:p.xaxis&&p.xaxis.tickPlacement;return B||W||!ee||ce==="between"||(S=T.convertCatToNumeric(S)),S}},{key:"extendYAxis",value:function(h,p){var S=new G;(h.yaxis===void 0||!h.yaxis||Array.isArray(h.yaxis)&&h.yaxis.length===0)&&(h.yaxis={}),h.yaxis.constructor!==Array&&window.Apex.yaxis&&window.Apex.yaxis.constructor!==Array&&(h.yaxis=O.extend(h.yaxis,window.Apex.yaxis)),h.yaxis.constructor!==Array?h.yaxis=[O.extend(S.yAxis,h.yaxis)]:h.yaxis=O.extendArray(h.yaxis,S.yAxis);var _=!1;h.yaxis.forEach(function(T){T.logarithmic&&(_=!0)});var k=h.series;return p&&!k&&(k=p.config.series),_&&k.length!==h.yaxis.length&&k.length&&(h.yaxis=k.map(function(T,B){if(T.name||(k[B].name="series-".concat(B+1)),h.yaxis[B])return h.yaxis[B].seriesName=k[B].name,h.yaxis[B];var W=O.extend(S.yAxis,h.yaxis[0]);return W.show=!1,W})),_&&k.length>1&&k.length!==h.yaxis.length&&console.warn("A multi-series logarithmic chart should have equal number of series and y-axes"),h}},{key:"extendAnnotations",value:function(h){return h.annotations===void 0&&(h.annotations={},h.annotations.yaxis=[],h.annotations.xaxis=[],h.annotations.points=[]),h=this.extendYAxisAnnotations(h),h=this.extendXAxisAnnotations(h),h=this.extendPointAnnotations(h)}},{key:"extendYAxisAnnotations",value:function(h){var p=new G;return h.annotations.yaxis=O.extendArray(h.annotations.yaxis!==void 0?h.annotations.yaxis:[],p.yAxisAnnotation),h}},{key:"extendXAxisAnnotations",value:function(h){var p=new G;return h.annotations.xaxis=O.extendArray(h.annotations.xaxis!==void 0?h.annotations.xaxis:[],p.xAxisAnnotation),h}},{key:"extendPointAnnotations",value:function(h){var p=new G;return h.annotations.points=O.extendArray(h.annotations.points!==void 0?h.annotations.points:[],p.pointAnnotation),h}},{key:"checkForDarkTheme",value:function(h){h.theme&&h.theme.mode==="dark"&&(h.tooltip||(h.tooltip={}),h.tooltip.theme!=="light"&&(h.tooltip.theme="dark"),h.chart.foreColor||(h.chart.foreColor="#f6f7f8"),h.theme.palette||(h.theme.palette="palette4"))}},{key:"handleUserInputErrors",value:function(h){var p=h;if(p.tooltip.shared&&p.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(p.chart.type==="bar"&&p.plotOptions.bar.horizontal){if(p.yaxis.length>1)throw new Error("Multiple Y Axis for bars are not supported. Switch to column chart by setting plotOptions.bar.horizontal=false");p.yaxis[0].reversed&&(p.yaxis[0].opposite=!0),p.xaxis.tooltip.enabled=!1,p.yaxis[0].tooltip.enabled=!1,p.chart.zoom.enabled=!1}return p.chart.type!=="bar"&&p.chart.type!=="rangeBar"||p.tooltip.shared&&p.xaxis.crosshairs.width==="barWidth"&&p.series.length>1&&(p.xaxis.crosshairs.width="tickWidth"),p.chart.type!=="candlestick"&&p.chart.type!=="boxPlot"||p.yaxis[0].reversed&&(console.warn("Reversed y-axis in ".concat(p.chart.type," chart is not supported.")),p.yaxis[0].reversed=!1),p}}]),Ee}(),me=function(){function Ee(){s(this,Ee)}return o(Ee,[{key:"initGlobalVars",value:function(h){h.series=[],h.seriesCandleO=[],h.seriesCandleH=[],h.seriesCandleM=[],h.seriesCandleL=[],h.seriesCandleC=[],h.seriesRangeStart=[],h.seriesRangeEnd=[],h.seriesRange=[],h.seriesPercent=[],h.seriesGoals=[],h.seriesX=[],h.seriesZ=[],h.seriesNames=[],h.seriesTotals=[],h.seriesLog=[],h.seriesColors=[],h.stackedSeriesTotals=[],h.seriesXvalues=[],h.seriesYvalues=[],h.labels=[],h.hasXaxisGroups=!1,h.groups=[],h.barGroups=[],h.lineGroups=[],h.areaGroups=[],h.hasSeriesGroups=!1,h.seriesGroups=[],h.categoryLabels=[],h.timescaleLabels=[],h.noLabelsProvided=!1,h.resizeTimer=null,h.selectionResizeTimer=null,h.lastWheelExecution=0,h.delayedElements=[],h.pointsArray=[],h.dataLabelsRects=[],h.isXNumeric=!1,h.skipLastTimelinelabel=!1,h.skipFirstTimelinelabel=!1,h.isDataXYZ=!1,h.isMultiLineX=!1,h.isMultipleYAxis=!1,h.maxY=-Number.MAX_VALUE,h.minY=Number.MIN_VALUE,h.minYArr=[],h.maxYArr=[],h.maxX=-Number.MAX_VALUE,h.minX=Number.MAX_VALUE,h.initialMaxX=-Number.MAX_VALUE,h.initialMinX=Number.MAX_VALUE,h.maxDate=0,h.minDate=Number.MAX_VALUE,h.minZ=Number.MAX_VALUE,h.maxZ=-Number.MAX_VALUE,h.minXDiff=Number.MAX_VALUE,h.yAxisScale=[],h.xAxisScale=null,h.xAxisTicksPositions=[],h.yLabelsCoords=[],h.yTitleCoords=[],h.barPadForNumericAxis=0,h.padHorizontal=0,h.xRange=0,h.yRange=[],h.zRange=0,h.dataPoints=0,h.xTickAmount=0,h.multiAxisTickAmount=0}},{key:"globalVars",value:function(h){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:h.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:h.chart.toolbar.autoSelected==="zoom"&&h.chart.toolbar.tools.zoom&&h.chart.zoom.enabled,panEnabled:h.chart.toolbar.autoSelected==="pan"&&h.chart.toolbar.tools.pan,selectionEnabled:h.chart.toolbar.autoSelected==="selection"&&h.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:h.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(h){var p=this.globalVars(h);return this.initGlobalVars(p),p.initialConfig=O.extend({},h),p.initialSeries=O.clone(h.series),p.lastXAxis=O.clone(p.initialConfig.xaxis),p.lastYAxis=O.clone(p.initialConfig.yaxis),p}}]),Ee}(),we=function(){function Ee(h){s(this,Ee),this.opts=h}return o(Ee,[{key:"init",value:function(){var h=new Ne(this.opts).init({responsiveOverride:!1});return{config:h,globals:new me().init(h)}}}]),Ee}(),xe=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w,this.opts=null,this.seriesIndex=0,this.patternIDs=[]}return o(Ee,[{key:"clippedImgArea",value:function(h){var p=this.w,S=p.config,_=parseInt(p.globals.gridWidth,10),k=parseInt(p.globals.gridHeight,10),T=_>k?_:k,B=h.image,W=0,ee=0;h.width===void 0&&h.height===void 0?S.fill.image.width!==void 0&&S.fill.image.height!==void 0?(W=S.fill.image.width+1,ee=S.fill.image.height):(W=T+1,ee=T):(W=h.width,ee=h.height);var ce=document.createElementNS(p.globals.SVGNS,"pattern");z.setAttrs(ce,{id:h.patternID,patternUnits:h.patternUnits?h.patternUnits:"userSpaceOnUse",width:W+"px",height:ee+"px"});var ue=document.createElementNS(p.globals.SVGNS,"image");ce.appendChild(ue),ue.setAttributeNS(window.SVG.xlink,"href",B),z.setAttrs(ue,{x:0,y:0,preserveAspectRatio:"none",width:W+"px",height:ee+"px"}),ue.style.opacity=h.opacity,p.globals.dom.elDefs.node.appendChild(ce)}},{key:"getSeriesIndex",value:function(h){var p=this.w,S=p.config.chart.type;return(S==="bar"||S==="rangeBar")&&p.config.plotOptions.bar.distributed||S==="heatmap"||S==="treemap"?this.seriesIndex=h.seriesNumber:this.seriesIndex=h.seriesNumber%p.globals.series.length,this.seriesIndex}},{key:"fillPath",value:function(h){var p=this.w;this.opts=h;var S,_,k,T=this.w.config;this.seriesIndex=this.getSeriesIndex(h);var B=this.getFillColors()[this.seriesIndex];p.globals.seriesColors[this.seriesIndex]!==void 0&&(B=p.globals.seriesColors[this.seriesIndex]),typeof B=="function"&&(B=B({seriesIndex:this.seriesIndex,dataPointIndex:h.dataPointIndex,value:h.value,w:p}));var W=h.fillType?h.fillType:this.getFillType(this.seriesIndex),ee=Array.isArray(T.fill.opacity)?T.fill.opacity[this.seriesIndex]:T.fill.opacity;h.color&&(B=h.color),B||(B="#fff",console.warn("undefined color - ApexCharts"));var ce=B;if(B.indexOf("rgb")===-1?B.length<9&&(ce=O.hexToRgba(B,ee)):B.indexOf("rgba")>-1&&(ee=O.getOpacityFromRGBA(B)),h.opacity&&(ee=h.opacity),W==="pattern"&&(_=this.handlePatternFill({fillConfig:h.fillConfig,patternFill:_,fillColor:B,fillOpacity:ee,defaultColor:ce})),W==="gradient"&&(k=this.handleGradientFill({fillConfig:h.fillConfig,fillColor:B,fillOpacity:ee,i:this.seriesIndex})),W==="image"){var ue=T.fill.image.src,ge=h.patternID?h.patternID:"",Se="pattern".concat(p.globals.cuid).concat(h.seriesNumber+1).concat(ge);this.patternIDs.indexOf(Se)===-1&&(this.clippedImgArea({opacity:ee,image:Array.isArray(ue)?h.seriesNumber<ue.length?ue[h.seriesNumber]:ue[0]:ue,width:h.width?h.width:void 0,height:h.height?h.height:void 0,patternUnits:h.patternUnits,patternID:Se}),this.patternIDs.push(Se)),S="url(#".concat(Se,")")}else S=W==="gradient"?k:W==="pattern"?_:ce;return h.solid&&(S=ce),S}},{key:"getFillType",value:function(h){var p=this.w;return Array.isArray(p.config.fill.type)?p.config.fill.type[h]:p.config.fill.type}},{key:"getFillColors",value:function(){var h=this.w,p=h.config,S=this.opts,_=[];return h.globals.comboCharts?h.config.series[this.seriesIndex].type==="line"?Array.isArray(h.globals.stroke.colors)?_=h.globals.stroke.colors:_.push(h.globals.stroke.colors):Array.isArray(h.globals.fill.colors)?_=h.globals.fill.colors:_.push(h.globals.fill.colors):p.chart.type==="line"?Array.isArray(h.globals.stroke.colors)?_=h.globals.stroke.colors:_.push(h.globals.stroke.colors):Array.isArray(h.globals.fill.colors)?_=h.globals.fill.colors:_.push(h.globals.fill.colors),S.fillColors!==void 0&&(_=[],Array.isArray(S.fillColors)?_=S.fillColors.slice():_.push(S.fillColors)),_}},{key:"handlePatternFill",value:function(h){var p=h.fillConfig,S=h.patternFill,_=h.fillColor,k=h.fillOpacity,T=h.defaultColor,B=this.w.config.fill;p&&(B=p);var W=this.opts,ee=new z(this.ctx),ce=Array.isArray(B.pattern.strokeWidth)?B.pattern.strokeWidth[this.seriesIndex]:B.pattern.strokeWidth,ue=_;return Array.isArray(B.pattern.style)?S=B.pattern.style[W.seriesNumber]!==void 0?ee.drawPattern(B.pattern.style[W.seriesNumber],B.pattern.width,B.pattern.height,ue,ce,k):T:S=ee.drawPattern(B.pattern.style,B.pattern.width,B.pattern.height,ue,ce,k),S}},{key:"handleGradientFill",value:function(h){var p=h.fillColor,S=h.fillOpacity,_=h.fillConfig,k=h.i,T=this.w.config.fill;_&&(T=v(v({},T),_));var B,W=this.opts,ee=new z(this.ctx),ce=new O,ue=T.gradient.type,ge=p,Se=T.gradient.opacityFrom===void 0?S:Array.isArray(T.gradient.opacityFrom)?T.gradient.opacityFrom[k]:T.gradient.opacityFrom;ge.indexOf("rgba")>-1&&(Se=O.getOpacityFromRGBA(ge));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"?ce.shadeColor(-1*parseFloat(T.gradient.shadeIntensity),p.indexOf("rgb")>-1?O.rgb2hex(p):p):ce.shadeColor(parseFloat(T.gradient.shadeIntensity),p.indexOf("rgb")>-1?O.rgb2hex(p):p);else if(T.gradient.gradientToColors[W.seriesNumber]){var Me=T.gradient.gradientToColors[W.seriesNumber];B=Me,Me.indexOf("rgba")>-1&&(ke=O.getOpacityFromRGBA(Me))}else B=p;if(T.gradient.gradientFrom&&(ge=T.gradient.gradientFrom),T.gradient.gradientTo&&(B=T.gradient.gradientTo),T.gradient.inverseColors){var qe=ge;ge=B,B=qe}return ge.indexOf("rgb")>-1&&(ge=O.rgb2hex(ge)),B.indexOf("rgb")>-1&&(B=O.rgb2hex(B)),ee.drawGradient(ue,ge,B,Se,ke,W.size,T.gradient.stops,T.gradient.colorStops,k)}}]),Ee}(),ye=function(){function Ee(h,p){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"setGlobalMarkerSize",value:function(){var h=this.w;if(h.globals.markers.size=Array.isArray(h.config.markers.size)?h.config.markers.size:[h.config.markers.size],h.globals.markers.size.length>0){if(h.globals.markers.size.length<h.globals.series.length+1)for(var p=0;p<=h.globals.series.length;p++)h.globals.markers.size[p]===void 0&&h.globals.markers.size.push(h.globals.markers.size[0])}else h.globals.markers.size=h.config.series.map(function(S){return h.config.markers.size})}},{key:"plotChartMarkers",value:function(h,p,S,_){var k,T=arguments.length>4&&arguments[4]!==void 0&&arguments[4],B=this.w,W=p,ee=h,ce=null,ue=new z(this.ctx),ge=B.config.markers.discrete&&B.config.markers.discrete.length;if((B.globals.markers.size[p]>0||T||ge)&&(ce=ue.group({class:T||ge?"":"apexcharts-series-markers"})).attr("clip-path","url(#gridRectMarkerMask".concat(B.globals.cuid,")")),Array.isArray(ee.x))for(var Se=0;Se<ee.x.length;Se++){var ke=S;S===1&&Se===0&&(ke=0),S===1&&Se===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[p]>0:B.config.markers.size>0)||T||ge){O.isNumber(ee.y[Se])?Me+=" w".concat(O.randomId()):Me="apexcharts-nullpoint";var qe=this.getMarkerConfig({cssClass:Me,seriesIndex:p,dataPointIndex:ke});B.config.series[W].data[ke]&&(B.config.series[W].data[ke].fillColor&&(qe.pointFillColor=B.config.series[W].data[ke].fillColor),B.config.series[W].data[ke].strokeColor&&(qe.pointStrokeColor=B.config.series[W].data[ke].strokeColor)),_!==void 0&&(qe.pSize=_),(ee.x[Se]<-B.globals.markers.largestSize||ee.x[Se]>B.globals.gridWidth+B.globals.markers.largestSize||ee.y[Se]<-B.globals.markers.largestSize||ee.y[Se]>B.globals.gridHeight+B.globals.markers.largestSize)&&(qe.pSize=0),(k=ue.drawMarker(ee.x[Se],ee.y[Se],qe)).attr("rel",ke),k.attr("j",ke),k.attr("index",p),k.node.setAttribute("default-marker-size",qe.pSize),new L(this.ctx).setSelectionFilter(k,p,ke),this.addEvents(k),ce&&ce.add(k)}else B.globals.pointsArray[p]===void 0&&(B.globals.pointsArray[p]=[]),B.globals.pointsArray[p].push([ee.x[Se],ee.y[Se]])}return ce}},{key:"getMarkerConfig",value:function(h){var p=h.cssClass,S=h.seriesIndex,_=h.dataPointIndex,k=_===void 0?null:_,T=h.radius,B=T===void 0?null:T,W=h.size,ee=W===void 0?null:W,ce=h.strokeWidth,ue=ce===void 0?null:ce,ge=this.w,Se=this.getMarkerStyle(S),ke=ee===null?ge.globals.markers.size[S]:ee,Me=ge.config.markers;return k!==null&&Me.discrete.length&&Me.discrete.map(function(qe){qe.seriesIndex===S&&qe.dataPointIndex===k&&(Se.pointStrokeColor=qe.strokeColor,Se.pointFillColor=qe.fillColor,ke=qe.size,Se.pointShape=qe.shape)}),{pSize:B===null?ke:B,pRadius:B!==null?B:Me.radius,pointStrokeWidth:ue!==null?ue:Array.isArray(Me.strokeWidth)?Me.strokeWidth[S]:Me.strokeWidth,pointStrokeColor:Se.pointStrokeColor,pointFillColor:Se.pointFillColor,shape:Se.pointShape||(Array.isArray(Me.shape)?Me.shape[S]:Me.shape),class:p,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(h){var p=this.w,S=new z(this.ctx);h.node.addEventListener("mouseenter",S.pathMouseEnter.bind(this.ctx,h)),h.node.addEventListener("mouseleave",S.pathMouseLeave.bind(this.ctx,h)),h.node.addEventListener("mousedown",S.pathMouseDown.bind(this.ctx,h)),h.node.addEventListener("click",p.config.markers.onClick),h.node.addEventListener("dblclick",p.config.markers.onDblClick),h.node.addEventListener("touchstart",S.pathMouseDown.bind(this.ctx,h),{passive:!0})}},{key:"getMarkerStyle",value:function(h){var p=this.w,S=p.globals.markers.colors,_=p.config.markers.strokeColor||p.config.markers.strokeColors;return{pointStrokeColor:Array.isArray(_)?_[h]:_,pointFillColor:Array.isArray(S)?S[h]:S}}}]),Ee}(),je=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w,this.initialAnim=this.w.config.chart.animations.enabled}return o(Ee,[{key:"draw",value:function(h,p,S){var _=this.w,k=new z(this.ctx),T=S.realIndex,B=S.pointsPos,W=S.zRatio,ee=S.elParent,ce=k.group({class:"apexcharts-series-markers apexcharts-series-".concat(_.config.chart.type)});if(ce.attr("clip-path","url(#gridRectMarkerMask".concat(_.globals.cuid,")")),Array.isArray(B.x))for(var ue=0;ue<B.x.length;ue++){var ge=p+1,Se=!0;p===0&&ue===0&&(ge=0),p===0&&ue===1&&(ge=1);var ke=_.globals.markers.size[T];if(W!==1/0){var Me=_.config.plotOptions.bubble;ke=_.globals.seriesZ[T][ge],Me.zScaling&&(ke/=W),Me.minBubbleRadius&&ke<Me.minBubbleRadius&&(ke=Me.minBubbleRadius),Me.maxBubbleRadius&&ke>Me.maxBubbleRadius&&(ke=Me.maxBubbleRadius)}var qe=B.x[ue],Fe=B.y[ue];if(ke=ke||0,Fe!==null&&_.globals.series[T][ge]!==void 0||(Se=!1),Se){var at=this.drawPoint(qe,Fe,ke,T,ge,p);ce.add(at)}ee.add(ce)}}},{key:"drawPoint",value:function(h,p,S,_,k,T){var B=this.w,W=_,ee=new U(this.ctx),ce=new L(this.ctx),ue=new xe(this.ctx),ge=new ye(this.ctx),Se=new z(this.ctx),ke=ge.getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:W,dataPointIndex:k,radius:B.config.chart.type==="bubble"||B.globals.comboCharts&&B.config.series[_]&&B.config.series[_].type==="bubble"?S:null}),Me=ue.fillPath({seriesNumber:_,dataPointIndex:k,color:ke.pointFillColor,patternUnits:"objectBoundingBox",value:B.globals.series[_][T]}),qe=Se.drawMarker(h,p,ke);if(B.config.series[W].data[k]&&B.config.series[W].data[k].fillColor&&(Me=B.config.series[W].data[k].fillColor),qe.attr({fill:Me}),B.config.chart.dropShadow.enabled){var Fe=B.config.chart.dropShadow;ce.dropShadow(qe,Fe,_)}if(!this.initialAnim||B.globals.dataChanged||B.globals.resized)B.globals.animationEnded=!0;else{var at=B.config.chart.animations.speed;ee.animateMarker(qe,at,B.globals.easing,function(){window.setTimeout(function(){ee.animationCompleted(qe)},100)})}return qe.attr({rel:k,j:k,index:_,"default-marker-size":ke.pSize}),ce.setSelectionFilter(qe,_,k),ge.addEvents(qe),qe.node.classList.add("apexcharts-marker"),qe}},{key:"centerTextInBubble",value:function(h){var p=this.w;return{y:h+=parseInt(p.config.dataLabels.style.fontSize,10)/4}}}]),Ee}(),Pe=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"dataLabelsCorrection",value:function(h,p,S,_,k,T,B){var W=this.w,ee=!1,ce=new z(this.ctx).getTextRects(S,B),ue=ce.width,ge=ce.height;p<0&&(p=0),p>W.globals.gridHeight+ge&&(p=W.globals.gridHeight+ge/2),W.globals.dataLabelsRects[_]===void 0&&(W.globals.dataLabelsRects[_]=[]),W.globals.dataLabelsRects[_].push({x:h,y:p,width:ue,height:ge});var Se=W.globals.dataLabelsRects[_].length-2,ke=W.globals.lastDrawnDataLabelsIndexes[_]!==void 0?W.globals.lastDrawnDataLabelsIndexes[_][W.globals.lastDrawnDataLabelsIndexes[_].length-1]:0;if(W.globals.dataLabelsRects[_][Se]!==void 0){var Me=W.globals.dataLabelsRects[_][ke];(h>Me.x+Me.width||p>Me.y+Me.height||p+ge<Me.y||h+ue<Me.x)&&(ee=!0)}return(k===0||T)&&(ee=!0),{x:h,y:p,textRects:ce,drawnextLabel:ee}}},{key:"drawDataLabel",value:function(h){var p=this,S=h.type,_=h.pos,k=h.i,T=h.j,B=h.isRangeStart,W=h.strokeWidth,ee=W===void 0?2:W,ce=this.w,ue=new z(this.ctx),ge=ce.config.dataLabels,Se=0,ke=0,Me=T,qe=null;if(ce.globals.collapsedSeriesIndices.indexOf(k)!==-1||!ge.enabled||!Array.isArray(_.x))return qe;qe=ue.group({class:"apexcharts-data-labels"});for(var Fe=0;Fe<_.x.length;Fe++)if(Se=_.x[Fe]+ge.offsetX,ke=_.y[Fe]+ge.offsetY+ee,!isNaN(Se)){T===1&&Fe===0&&(Me=0),T===1&&Fe===1&&(Me=1);var at=ce.globals.series[k][Me];S==="rangeArea"&&(at=B?ce.globals.seriesRangeStart[k][Me]:ce.globals.seriesRangeEnd[k][Me]);var se="",Ce=function(Be){return ce.config.dataLabels.formatter(Be,{ctx:p.ctx,seriesIndex:k,dataPointIndex:Me,w:ce})};ce.config.chart.type==="bubble"?(se=Ce(at=ce.globals.seriesZ[k][Me]),ke=_.y[Fe],ke=new je(this.ctx).centerTextInBubble(ke,k,Me).y):at!==void 0&&(se=Ce(at));var Ue=ce.config.dataLabels.textAnchor;ce.globals.isSlopeChart&&(Ue=Me===0?"end":Me===ce.config.series[k].data.length-1?"start":"middle"),this.plotDataLabelsText({x:Se,y:ke,text:se,i:k,j:Me,parent:qe,offsetCorrection:!0,dataLabelsConfig:ce.config.dataLabels,textAnchor:Ue})}return qe}},{key:"plotDataLabelsText",value:function(h){var p=this.w,S=new z(this.ctx),_=h.x,k=h.y,T=h.i,B=h.j,W=h.text,ee=h.textAnchor,ce=h.fontSize,ue=h.parent,ge=h.dataLabelsConfig,Se=h.color,ke=h.alwaysDrawDataLabel,Me=h.offsetCorrection,qe=h.className,Fe=null;if(Array.isArray(p.config.dataLabels.enabledOnSeries)&&p.config.dataLabels.enabledOnSeries.indexOf(T)<0)return Fe;var at={x:_,y:k,drawnextLabel:!0,textRects:null};Me&&(at=this.dataLabelsCorrection(_,k,W,T,B,ke,parseInt(ge.style.fontSize,10))),p.globals.zoomed||(_=at.x,k=at.y),at.textRects&&(_<-20-at.textRects.width||_>p.globals.gridWidth+at.textRects.width+30)&&(W="");var se=p.globals.dataLabels.style.colors[T];((p.config.chart.type==="bar"||p.config.chart.type==="rangeBar")&&p.config.plotOptions.bar.distributed||p.config.dataLabels.distributed)&&(se=p.globals.dataLabels.style.colors[B]),typeof se=="function"&&(se=se({series:p.globals.series,seriesIndex:T,dataPointIndex:B,w:p})),Se&&(se=Se);var Ce=ge.offsetX,Ue=ge.offsetY;if(p.config.chart.type!=="bar"&&p.config.chart.type!=="rangeBar"||(Ce=0,Ue=0),p.globals.isSlopeChart&&(B!==0&&(Ce=-2*ge.offsetX+5),B!==0&&B!==p.config.series[T].data.length-1&&(Ce=0)),at.drawnextLabel){if((Fe=S.drawText({width:100,height:parseInt(ge.style.fontSize,10),x:_+Ce,y:k+Ue,foreColor:se,textAnchor:ee||ge.textAnchor,text:W,fontSize:ce||ge.style.fontSize,fontFamily:ge.style.fontFamily,fontWeight:ge.style.fontWeight||"normal"})).attr({class:qe||"apexcharts-datalabel",cx:_,cy:k}),ge.dropShadow.enabled){var Be=ge.dropShadow;new L(this.ctx).dropShadow(Fe,Be)}ue.add(Fe),p.globals.lastDrawnDataLabelsIndexes[T]===void 0&&(p.globals.lastDrawnDataLabelsIndexes[T]=[]),p.globals.lastDrawnDataLabelsIndexes[T].push(B)}return Fe}},{key:"addBackgroundToDataLabel",value:function(h,p){var S=this.w,_=S.config.dataLabels.background,k=_.padding,T=_.padding/2,B=p.width,W=p.height,ee=new z(this.ctx).drawRect(p.x-k,p.y-T/2,B+2*k,W+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(ee,_.dropShadow),ee}},{key:"dataLabelsBackground",value:function(){var h=this.w;if(h.config.chart.type!=="bubble")for(var p=h.globals.dom.baseEl.querySelectorAll(".apexcharts-datalabels text"),S=0;S<p.length;S++){var _=p[S],k=_.getBBox(),T=null;if(k.width&&k.height&&(T=this.addBackgroundToDataLabel(_,k)),T){_.parentNode.insertBefore(T.node,_);var B=_.getAttribute("fill");h.config.chart.animations.enabled&&!h.globals.resized&&!h.globals.dataChanged?T.animate().attr({fill:B}):T.attr({fill:B}),_.setAttribute("fill",h.config.dataLabels.background.foreColor)}}}},{key:"bringForward",value:function(){for(var h=this.w,p=h.globals.dom.baseEl.querySelectorAll(".apexcharts-datalabels"),S=h.globals.dom.baseEl.querySelector(".apexcharts-plot-series:last-child"),_=0;_<p.length;_++)S&&S.insertBefore(p[_],S.nextSibling)}}]),Ee}(),Re=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.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(h){return this.w.globals.dom.baseEl.querySelector(".apexcharts-inner .apexcharts-series[seriesName='".concat(O.escapeString(h),"']"))}},{key:"isSeriesHidden",value:function(h){var p=this.getSeriesByName(h),S=parseInt(p.getAttribute("data:realIndex"),10);return{isHidden:p.classList.contains("apexcharts-series-collapsed"),realIndex:S}}},{key:"addCollapsedClassToSeries",value:function(h,p){var S=this.w;function _(k){for(var T=0;T<k.length;T++)k[T].index===p&&h.node.classList.add("apexcharts-series-collapsed")}_(S.globals.collapsedSeries),_(S.globals.ancillaryCollapsedSeries)}},{key:"toggleSeries",value:function(h){var p=this.isSeriesHidden(h);return this.ctx.legend.legendHelpers.toggleDataSeries(p.realIndex,p.isHidden),p.isHidden}},{key:"showSeries",value:function(h){var p=this.isSeriesHidden(h);p.isHidden&&this.ctx.legend.legendHelpers.toggleDataSeries(p.realIndex,!0)}},{key:"hideSeries",value:function(h){var p=this.isSeriesHidden(h);p.isHidden||this.ctx.legend.legendHelpers.toggleDataSeries(p.realIndex,!1)}},{key:"resetSeries",value:function(){var h=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],p=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],S=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],_=this.w,k=O.clone(_.globals.initialSeries);_.globals.previousPaths=[],S?(_.globals.collapsedSeries=[],_.globals.ancillaryCollapsedSeries=[],_.globals.collapsedSeriesIndices=[],_.globals.ancillaryCollapsedSeriesIndices=[]):k=this.emptyCollapsedSeries(k),_.config.series=k,h&&(p&&(_.globals.zoomed=!1,this.ctx.updateHelpers.revertDefaultAxisMinMax()),this.ctx.updateHelpers._updateSeries(k,_.config.chart.animations.dynamicAnimation.enabled))}},{key:"emptyCollapsedSeries",value:function(h){for(var p=this.w,S=0;S<h.length;S++)p.globals.collapsedSeriesIndices.indexOf(S)>-1&&(h[S].data=[]);return h}},{key:"highlightSeries",value:function(h){var p=this.w,S=this.getSeriesByName(h),_=parseInt(S==null?void 0:S.getAttribute("data:realIndex"),10),k=p.globals.dom.baseEl.querySelectorAll(".apexcharts-series, .apexcharts-datalabels, .apexcharts-yaxis"),T=null,B=null,W=null;if(p.globals.axisCharts||p.config.chart.type==="radialBar")if(p.globals.axisCharts){T=p.globals.dom.baseEl.querySelector(".apexcharts-series[data\\:realIndex='".concat(_,"']")),B=p.globals.dom.baseEl.querySelector(".apexcharts-datalabels[data\\:realIndex='".concat(_,"']"));var ee=p.globals.seriesYAxisReverseMap[_];W=p.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(ee,"']"))}else T=p.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(_+1,"']"));else T=p.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(_+1,"'] path"));for(var ce=0;ce<k.length;ce++)k[ce].classList.add(this.legendInactiveClass);if(T)p.globals.axisCharts||T.parentNode.classList.remove(this.legendInactiveClass),T.classList.remove(this.legendInactiveClass),B!==null&&B.classList.remove(this.legendInactiveClass),W!==null&&W.classList.remove(this.legendInactiveClass);else for(var ue=0;ue<k.length;ue++)k[ue].classList.remove(this.legendInactiveClass)}},{key:"toggleSeriesOnHover",value:function(h,p){var S=this.w;p||(p=h.target);var _=S.globals.dom.baseEl.querySelectorAll(".apexcharts-series, .apexcharts-datalabels, .apexcharts-yaxis");if(h.type==="mousemove"){var k=parseInt(p.getAttribute("rel"),10)-1;this.highlightSeries(S.globals.seriesNames[k])}else if(h.type==="mouseout")for(var T=0;T<_.length;T++)_[T].classList.remove(this.legendInactiveClass)}},{key:"highlightRangeInSeries",value:function(h,p){var S=this,_=this.w,k=_.globals.dom.baseEl.getElementsByClassName("apexcharts-heatmap-rect"),T=function(ee){for(var ce=0;ce<k.length;ce++)k[ce].classList[ee](S.legendInactiveClass)};if(h.type==="mousemove"){var B=parseInt(p.getAttribute("rel"),10)-1;T("add");var W=_.config.plotOptions.heatmap.colorScale.ranges;(function(ee,ce){for(var ue=0;ue<k.length;ue++){var ge=Number(k[ue].getAttribute("val"));ge>=ee.from&&(ge<ee.to||ee.to===ce&&ge===ce)&&k[ue].classList.remove(S.legendInactiveClass)}})(W[B],W.reduce(function(ee,ce){return Math.max(ee,ce.to)},0))}else h.type==="mouseout"&&T("remove")}},{key:"getActiveConfigSeriesIndex",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"asc",p=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,W){return B.data&&B.data.length>0&&S.globals.collapsedSeriesIndices.indexOf(W)===-1&&(!S.globals.comboCharts||p.length===0||p.length&&p.indexOf(S.config.series[W].type)>-1)?W:-1}),T=h==="asc"?0:k.length-1;h==="asc"?T<k.length:T>=0;h==="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(h,p){return h.type==="bar"||h.type==="column"?p:-1}).filter(function(h){return h!==-1}):this.w.config.series.map(function(h,p){return p})}},{key:"getPreviousPaths",value:function(){var h=this.w;function p(T,B,W){for(var ee=T[B].childNodes,ce={type:W,paths:[],realIndex:T[B].getAttribute("data:realIndex")},ue=0;ue<ee.length;ue++)if(ee[ue].hasAttribute("pathTo")){var ge=ee[ue].getAttribute("pathTo");ce.paths.push({d:ge})}h.globals.previousPaths.push(ce)}h.globals.previousPaths=[],["line","area","bar","rangebar","rangeArea","candlestick","radar"].forEach(function(T){for(var B,W=(B=T,h.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(B,"-series .apexcharts-series"))),ee=0;ee<W.length;ee++)p(W,ee,T)}),this.handlePrevBubbleScatterPaths("bubble"),this.handlePrevBubbleScatterPaths("scatter");var S=h.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(h.config.chart.type," .apexcharts-series"));if(S.length>0)for(var _=function(T){for(var B=h.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(h.config.chart.type," .apexcharts-series[data\\:realIndex='").concat(T,"'] rect")),W=[],ee=function(ue){var ge=function(ke){return B[ue].getAttribute(ke)},Se={x:parseFloat(ge("x")),y:parseFloat(ge("y")),width:parseFloat(ge("width")),height:parseFloat(ge("height"))};W.push({rect:Se,color:B[ue].getAttribute("color")})},ce=0;ce<B.length;ce++)ee(ce);h.globals.previousPaths.push(W)},k=0;k<S.length;k++)_(k);h.globals.axisCharts||(h.globals.previousPaths=h.globals.series)}},{key:"handlePrevBubbleScatterPaths",value:function(h){var p=this.w,S=p.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(h,"-series .apexcharts-series"));if(S.length>0)for(var _=0;_<S.length;_++){for(var k=p.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(h,"-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")});p.globals.previousPaths.push(T)}}},{key:"clearPreviousPaths",value:function(){var h=this.w;h.globals.previousPaths=[],h.globals.allSeriesCollapsed=!1}},{key:"handleNoData",value:function(){var h=this.w,p=h.config.noData,S=new z(this.ctx),_=h.globals.svgWidth/2,k=h.globals.svgHeight/2,T="middle";if(h.globals.noData=!0,h.globals.animationEnded=!0,p.align==="left"?(_=10,T="start"):p.align==="right"&&(_=h.globals.svgWidth-10,T="end"),p.verticalAlign==="top"?k=50:p.verticalAlign==="bottom"&&(k=h.globals.svgHeight-50),_+=p.offsetX,k=k+parseInt(p.style.fontSize,10)+2+p.offsetY,p.text!==void 0&&p.text!==""){var B=S.drawText({x:_,y:k,text:p.text,textAnchor:T,fontSize:p.style.fontSize,fontFamily:p.style.fontFamily,foreColor:p.style.color,opacity:1,class:"apexcharts-text-nodata"});h.globals.dom.Paper.add(B)}}},{key:"setNullSeriesToZeroValues",value:function(h){for(var p=this.w,S=0;S<h.length;S++)if(h[S].length===0)for(var _=0;_<h[p.globals.maxValsInArrayIndex].length;_++)h[S].push(0);return h}},{key:"hasAllSeriesEqualX",value:function(){for(var h=!0,p=this.w,S=this.filteredSeriesX(),_=0;_<S.length-1;_++)if(S[_][0]!==S[_+1][0]){h=!1;break}return p.globals.allSeriesHasEqualX=h,h}},{key:"filteredSeriesX",value:function(){var h=this.w.globals.seriesX.map(function(p){return p.length>0?p:[]});return h}}]),Ee}(),Xe=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.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 h=this.w.config.series.slice(),p=new Re(this.ctx);if(this.activeSeriesIndex=p.getActiveConfigSeriesIndex(),h[this.activeSeriesIndex].data!==void 0&&h[this.activeSeriesIndex].data.length>0&&h[this.activeSeriesIndex].data[0]!==null&&h[this.activeSeriesIndex].data[0].x!==void 0&&h[this.activeSeriesIndex].data[0]!==null)return!0}},{key:"isFormat2DArray",value:function(){var h=this.w.config.series.slice(),p=new Re(this.ctx);if(this.activeSeriesIndex=p.getActiveConfigSeriesIndex(),h[this.activeSeriesIndex].data!==void 0&&h[this.activeSeriesIndex].data.length>0&&h[this.activeSeriesIndex].data[0]!==void 0&&h[this.activeSeriesIndex].data[0]!==null&&h[this.activeSeriesIndex].data[0].constructor===Array)return!0}},{key:"handleFormat2DArray",value:function(h,p){for(var S=this.w.config,_=this.w.globals,k=S.chart.type==="boxPlot"||S.series[p].type==="boxPlot",T=0;T<h[p].data.length;T++)if(h[p].data[T][1]!==void 0&&(Array.isArray(h[p].data[T][1])&&h[p].data[T][1].length===4&&!k?this.twoDSeries.push(O.parseNumber(h[p].data[T][1][3])):h[p].data[T].length>=5?this.twoDSeries.push(O.parseNumber(h[p].data[T][4])):this.twoDSeries.push(O.parseNumber(h[p].data[T][1])),_.dataFormatXNumeric=!0),S.xaxis.type==="datetime"){var B=new Date(h[p].data[T][0]);B=new Date(B).getTime(),this.twoDSeriesX.push(B)}else this.twoDSeriesX.push(h[p].data[T][0]);for(var W=0;W<h[p].data.length;W++)h[p].data[W][2]!==void 0&&(this.threeDSeries.push(h[p].data[W][2]),_.isDataXYZ=!0)}},{key:"handleFormatXY",value:function(h,p){var S=this.w.config,_=this.w.globals,k=new K(this.ctx),T=p;_.collapsedSeriesIndices.indexOf(p)>-1&&(T=this.activeSeriesIndex);for(var B=0;B<h[p].data.length;B++)h[p].data[B].y!==void 0&&(Array.isArray(h[p].data[B].y)?this.twoDSeries.push(O.parseNumber(h[p].data[B].y[h[p].data[B].y.length-1])):this.twoDSeries.push(O.parseNumber(h[p].data[B].y))),h[p].data[B].goals!==void 0&&Array.isArray(h[p].data[B].goals)?(this.seriesGoals[p]===void 0&&(this.seriesGoals[p]=[]),this.seriesGoals[p].push(h[p].data[B].goals)):(this.seriesGoals[p]===void 0&&(this.seriesGoals[p]=[]),this.seriesGoals[p].push(null));for(var W=0;W<h[T].data.length;W++){var ee=typeof h[T].data[W].x=="string",ce=Array.isArray(h[T].data[W].x),ue=!ce&&!!k.isValidDate(h[T].data[W].x);if(ee||ue)if(ee||S.xaxis.convertedCatToNumeric){var ge=_.isBarHorizontal&&_.isRangeData;S.xaxis.type!=="datetime"||ge?(this.fallbackToCategory=!0,this.twoDSeriesX.push(h[T].data[W].x),isNaN(h[T].data[W].x)||this.w.config.xaxis.type==="category"||typeof h[T].data[W].x=="string"||(_.isXNumeric=!0)):this.twoDSeriesX.push(k.parseDate(h[T].data[W].x))}else S.xaxis.type==="datetime"?this.twoDSeriesX.push(k.parseDate(h[T].data[W].x.toString())):(_.dataFormatXNumeric=!0,_.isXNumeric=!0,this.twoDSeriesX.push(parseFloat(h[T].data[W].x)));else ce?(this.fallbackToCategory=!0,this.twoDSeriesX.push(h[T].data[W].x)):(_.isXNumeric=!0,_.dataFormatXNumeric=!0,this.twoDSeriesX.push(h[T].data[W].x))}if(h[p].data[0]&&h[p].data[0].z!==void 0){for(var Se=0;Se<h[p].data.length;Se++)this.threeDSeries.push(h[p].data[Se].z);_.isDataXYZ=!0}}},{key:"handleRangeData",value:function(h,p){var S=this.w.globals,_={};return this.isFormat2DArray()?_=this.handleRangeDataFormat("array",h,p):this.isFormatXY()&&(_=this.handleRangeDataFormat("xy",h,p)),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,W){B.y.forEach(function(ee,ce){for(var ue=0;ue<B.y.length;ue++)if(ce!==ue){var ge=ee.y1,Se=ee.y2,ke=B.y[ue].y1;ge<=B.y[ue].y2&&ke<=Se&&(B.overlaps.indexOf(ee.rangeName)<0&&B.overlaps.push(ee.rangeName),B.overlaps.indexOf(B.y[ue].rangeName)<0&&B.overlaps.push(B.y[ue].rangeName))}})})}),_}},{key:"handleCandleStickBoxData",value:function(h,p){var S=this.w.globals,_={};return this.isFormat2DArray()?_=this.handleCandleStickBoxDataFormat("array",h,p):this.isFormatXY()&&(_=this.handleCandleStickBoxDataFormat("xy",h,p)),S.seriesCandleO[p]=_.o,S.seriesCandleH[p]=_.h,S.seriesCandleM[p]=_.m,S.seriesCandleL[p]=_.l,S.seriesCandleC[p]=_.c,_}},{key:"handleRangeDataFormat",value:function(h,p,S){var _=[],k=[],T=p[S].data.filter(function(ce,ue,ge){return ue===ge.findIndex(function(Se){return Se.x===ce.x})}).map(function(ce,ue){return{x:ce.x,overlaps:[],y:[]}});if(h==="array")for(var B=0;B<p[S].data.length;B++)Array.isArray(p[S].data[B])?(_.push(p[S].data[B][1][0]),k.push(p[S].data[B][1][1])):(_.push(p[S].data[B]),k.push(p[S].data[B]));else if(h==="xy")for(var W=function(ce){var ue=Array.isArray(p[S].data[ce].y),ge=O.randomId(),Se=p[S].data[ce].x,ke={y1:ue?p[S].data[ce].y[0]:p[S].data[ce].y,y2:ue?p[S].data[ce].y[1]:p[S].data[ce].y,rangeName:ge};p[S].data[ce].rangeName=ge;var Me=T.findIndex(function(qe){return qe.x===Se});T[Me].y.push(ke),_.push(ke.y1),k.push(ke.y2)},ee=0;ee<p[S].data.length;ee++)W(ee);return{start:_,end:k,rangeUniques:T}}},{key:"handleCandleStickBoxDataFormat",value:function(h,p,S){var _=this.w,k=_.config.chart.type==="boxPlot"||_.config.series[S].type==="boxPlot",T=[],B=[],W=[],ee=[],ce=[];if(h==="array")if(k&&p[S].data[0].length===6||!k&&p[S].data[0].length===5)for(var ue=0;ue<p[S].data.length;ue++)T.push(p[S].data[ue][1]),B.push(p[S].data[ue][2]),k?(W.push(p[S].data[ue][3]),ee.push(p[S].data[ue][4]),ce.push(p[S].data[ue][5])):(ee.push(p[S].data[ue][3]),ce.push(p[S].data[ue][4]));else for(var ge=0;ge<p[S].data.length;ge++)Array.isArray(p[S].data[ge][1])&&(T.push(p[S].data[ge][1][0]),B.push(p[S].data[ge][1][1]),k?(W.push(p[S].data[ge][1][2]),ee.push(p[S].data[ge][1][3]),ce.push(p[S].data[ge][1][4])):(ee.push(p[S].data[ge][1][2]),ce.push(p[S].data[ge][1][3])));else if(h==="xy")for(var Se=0;Se<p[S].data.length;Se++)Array.isArray(p[S].data[Se].y)&&(T.push(p[S].data[Se].y[0]),B.push(p[S].data[Se].y[1]),k?(W.push(p[S].data[Se].y[2]),ee.push(p[S].data[Se].y[3]),ce.push(p[S].data[Se].y[4])):(ee.push(p[S].data[Se].y[2]),ce.push(p[S].data[Se].y[3])));return{o:T,h:B,m:W,l:ee,c:ce}}},{key:"parseDataAxisCharts",value:function(h){var p=this,S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.ctx,_=this.w.config,k=this.w.globals,T=new K(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),h.forEach(function(Se,ke){Se.name!==void 0?k.seriesNames.push(Se.name):k.seriesNames.push("series-"+parseInt(ke+1,10))}),this.coreUtils.setSeriesYAxisMappings();var W=[],ee=N(new Set(_.series.map(function(Se){return Se.group})));_.series.forEach(function(Se,ke){var Me=ee.indexOf(Se.group);W[Me]||(W[Me]=[]),W[Me].push(k.seriesNames[ke])}),k.seriesGroups=W;for(var ce=function(){for(var Se=0;Se<B.length;Se++)if(typeof B[Se]=="string"){if(!T.isValidDate(B[Se]))throw new Error("You have provided invalid Date format. Please provide a valid JavaScript Date");p.twoDSeriesX.push(T.parseDate(B[Se]))}else p.twoDSeriesX.push(B[Se])},ue=0;ue<h.length;ue++){if(this.twoDSeries=[],this.twoDSeriesX=[],this.threeDSeries=[],h[ue].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"&&h[ue].type!=="rangeBar"&&h[ue].type!=="rangeArea"||(k.isRangeData=!0,_.chart.type!=="rangeBar"&&_.chart.type!=="rangeArea"||this.handleRangeData(h,ue)),this.isMultiFormat())this.isFormat2DArray()?this.handleFormat2DArray(h,ue):this.isFormatXY()&&this.handleFormatXY(h,ue),_.chart.type!=="candlestick"&&h[ue].type!=="candlestick"&&_.chart.type!=="boxPlot"&&h[ue].type!=="boxPlot"||this.handleCandleStickBoxData(h,ue),k.series.push(this.twoDSeries),k.labels.push(this.twoDSeriesX),k.seriesX.push(this.twoDSeriesX),k.seriesGoals=this.seriesGoals,ue!==this.activeSeriesIndex||this.fallbackToCategory||(k.isXNumeric=!0);else{_.xaxis.type==="datetime"?(k.isXNumeric=!0,ce(),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 ge=h[ue].data.map(function(Se){return O.parseNumber(Se)});k.series.push(ge)}k.seriesZ.push(this.threeDSeries),h[ue].color!==void 0?k.seriesColors.push(h[ue].color):k.seriesColors.push(void 0)}return this.w}},{key:"parseDataNonAxisCharts",value:function(h){var p=this.w.globals,S=this.w.config;p.series=h.slice(),p.seriesNames=S.labels.slice();for(var _=0;_<p.series.length;_++)p.seriesNames[_]===void 0&&p.seriesNames.push("series-"+(_+1));return this.w}},{key:"handleExternalLabelsData",value:function(h){var p=this.w.config,S=this.w.globals;p.xaxis.categories.length>0?S.labels=p.xaxis.categories:p.labels.length>0?S.labels=p.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)),p.xaxis.convertedCatToNumeric&&(new fe(p).convertCatToNumericXaxis(p,this.ctx,S.seriesX[0]),this._generateExternalLabels(h))):this._generateExternalLabels(h)}},{key:"_generateExternalLabels",value:function(h){var p=this.w.globals,S=this.w.config,_=[];if(p.axisCharts){if(p.series.length>0)if(this.isFormatXY())for(var k=S.series.map(function(ue,ge){return ue.data.filter(function(Se,ke,Me){return Me.findIndex(function(qe){return qe.x===Se.x})===ke})}),T=k.reduce(function(ue,ge,Se,ke){return ke[ue].length>ge.length?ue:Se},0),B=0;B<k[T].length;B++)_.push(B+1);else for(var W=0;W<p.series[p.maxValsInArrayIndex].length;W++)_.push(W+1);p.seriesX=[];for(var ee=0;ee<h.length;ee++)p.seriesX.push(_);this.w.globals.isBarHorizontal||(p.isXNumeric=!0)}if(_.length===0){_=p.axisCharts?[]:p.series.map(function(ue,ge){return ge+1});for(var ce=0;ce<h.length;ce++)p.seriesX.push(_)}p.labels=_,S.xaxis.convertedCatToNumeric&&(p.categoryLabels=_.map(function(ue){return S.xaxis.labels.formatter(ue)})),p.noLabelsProvided=!0}},{key:"parseData",value:function(h){var p=this.w,S=p.config,_=p.globals;if(this.excludeCollapsedSeriesInYAxis(),this.fallbackToCategory=!1,this.ctx.core.resetGlobals(),this.ctx.core.isMultipleY(),_.axisCharts?(this.parseDataAxisCharts(h),this.coreUtils.getLargestSeries()):this.parseDataNonAxisCharts(h),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(h);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 h=this.w,p=[];h.globals.seriesYAxisMap.forEach(function(S,_){var k=0;S.forEach(function(T){h.globals.collapsedSeriesIndices.indexOf(T)!==-1&&k++}),k>0&&k==S.length&&p.push(_)}),h.globals.ignoreYAxisIndexes=p.map(function(S){return S})}}]),Ee}(),Ke=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"scaleSvgNode",value:function(h,p){var S=parseFloat(h.getAttributeNS(null,"width")),_=parseFloat(h.getAttributeNS(null,"height"));h.setAttributeNS(null,"width",S*p),h.setAttributeNS(null,"height",_*p),h.setAttributeNS(null,"viewBox","0 0 "+S+" "+_)}},{key:"getSvgString",value:function(){var h=this;return new Promise(function(p){var S=h.w,_=S.config.chart.toolbar.export.width,k=S.config.chart.toolbar.export.scale||_/S.globals.svgWidth;k||(k=1);var T=h.w.globals.dom.Paper.svg(),B=h.w.globals.dom.Paper.node.cloneNode(!0);k!==1&&h.scaleSvgNode(B,k),h.convertImagesToBase64(B).then(function(){T=new XMLSerializer().serializeToString(B),p(T.replace(/&nbsp;/g,"&#160;"))})})}},{key:"convertImagesToBase64",value:function(h){var p=this,S=h.getElementsByTagName("image"),_=Array.from(S).map(function(k){var T=k.getAttributeNS("http://www.w3.org/1999/xlink","href");return T&&!T.startsWith("data:")?p.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(h){return new Promise(function(p,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),p(k.toDataURL())},_.onerror=S,_.src=h})}},{key:"cleanup",value:function(){var h=this.w,p=h.globals.dom.baseEl.getElementsByClassName("apexcharts-xcrosshairs"),S=h.globals.dom.baseEl.getElementsByClassName("apexcharts-ycrosshairs"),_=h.globals.dom.baseEl.querySelectorAll(".apexcharts-zoom-rect, .apexcharts-selection-rect");Array.prototype.forEach.call(_,function(k){k.setAttribute("width",0)}),p&&p[0]&&(p[0].setAttribute("x",-500),p[0].setAttribute("x1",-500),p[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 h=this;return new Promise(function(p){h.cleanup(),h.getSvgString().then(function(S){var _=new Blob([S],{type:"image/svg+xml;charset=utf-8"});p(URL.createObjectURL(_))})})}},{key:"dataURI",value:function(h){var p=this;return new Promise(function(S){var _=p.w,k=h?h.scale||h.width/_.globals.svgWidth:1;p.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",W=T.getContext("2d");W.fillStyle=B,W.fillRect(0,0,T.width*k,T.height*k),p.getSvgString().then(function(ee){var ce="data:image/svg+xml,"+encodeURIComponent(ee),ue=new Image;ue.crossOrigin="anonymous",ue.onload=function(){if(W.drawImage(ue,0,0),T.msToBlob){var ge=T.msToBlob();S({blob:ge})}else{var Se=T.toDataURL("image/png");S({imgURI:Se})}},ue.src=ce})})}},{key:"exportToSVG",value:function(){var h=this;this.svgUrl().then(function(p){h.triggerDownload(p,h.w.config.chart.toolbar.export.svg.filename,".svg")})}},{key:"exportToPng",value:function(){var h=this,p=this.w.config.chart.toolbar.export.scale,S=this.w.config.chart.toolbar.export.width,_=p?{scale:p}:S?{width:S}:void 0;this.dataURI(_).then(function(k){var T=k.imgURI,B=k.blob;B?navigator.msSaveOrOpenBlob(B,h.w.globals.chartID+".png"):h.triggerDownload(T,h.w.config.chart.toolbar.export.png.filename,".png")})}},{key:"exportToCSV",value:function(h){var p=this,S=h.series,_=h.fileName,k=h.columnDelimiter,T=k===void 0?",":k,B=h.lineDelimiter,W=B===void 0?`
`:B,ee=this.w;S||(S=ee.config.series);var ce,ue,ge=[],Se=[],ke="",Me=ee.globals.series.map(function(_e,rt){return ee.globals.collapsedSeriesIndices.indexOf(rt)===-1?_e:[]}),qe=function(_e){return typeof ee.config.chart.toolbar.export.csv.categoryFormatter=="function"?ee.config.chart.toolbar.export.csv.categoryFormatter(_e):ee.config.xaxis.type==="datetime"&&String(_e).length>=10?new Date(_e).toDateString():O.isNumber(_e)?_e:_e.split(T).join("")},Fe=function(_e){return typeof ee.config.chart.toolbar.export.csv.valueFormatter=="function"?ee.config.chart.toolbar.export.csv.valueFormatter(_e):_e},at=Math.max.apply(Math,N(S.map(function(_e){return _e.data?_e.data.length:0}))),se=new Xe(this.ctx),Ce=new he(this.ctx),Ue=function(_e){var rt="";if(ee.globals.axisCharts){if(ee.config.xaxis.type==="category"||ee.config.xaxis.convertedCatToNumeric)if(ee.globals.isBarHorizontal){var ct=ee.globals.yLabelFormatters[0],yt=new Re(p.ctx).getActiveConfigSeriesIndex();rt=ct(ee.globals.labels[_e],{seriesIndex:yt,dataPointIndex:_e,w:ee})}else rt=Ce.getLabel(ee.globals.labels,ee.globals.timescaleLabels,0,_e).text;ee.config.xaxis.type==="datetime"&&(ee.config.xaxis.categories.length?rt=ee.config.xaxis.categories[_e]:ee.config.labels.length&&(rt=ee.config.labels[_e]))}else rt=ee.config.labels[_e];return rt===null?"nullvalue":(Array.isArray(rt)&&(rt=rt.join(" ")),O.isNumber(rt)?rt:rt.split(T).join(""))},Be=function(_e,rt){if(ge.length&&rt===0&&Se.push(ge.join(T)),_e.data){_e.data=_e.data.length&&_e.data||N(Array(at)).map(function(){return""});for(var ct=0;ct<_e.data.length;ct++){ge=[];var yt=Ue(ct);if(yt!=="nullvalue"){if(yt||(se.isFormatXY()?yt=S[rt].data[ct].x:se.isFormat2DArray()&&(yt=S[rt].data[ct]?S[rt].data[ct][0]:"")),rt===0){ge.push(qe(yt));for(var Lt=0;Lt<ee.globals.series.length;Lt++){var ft,Tt=se.isFormatXY()?(ft=S[Lt].data[ct])===null||ft===void 0?void 0:ft.y:Me[Lt][ct];ge.push(Fe(Tt))}}(ee.config.chart.type==="candlestick"||_e.type&&_e.type==="candlestick")&&(ge.pop(),ge.push(ee.globals.seriesCandleO[rt][ct]),ge.push(ee.globals.seriesCandleH[rt][ct]),ge.push(ee.globals.seriesCandleL[rt][ct]),ge.push(ee.globals.seriesCandleC[rt][ct])),(ee.config.chart.type==="boxPlot"||_e.type&&_e.type==="boxPlot")&&(ge.pop(),ge.push(ee.globals.seriesCandleO[rt][ct]),ge.push(ee.globals.seriesCandleH[rt][ct]),ge.push(ee.globals.seriesCandleM[rt][ct]),ge.push(ee.globals.seriesCandleL[rt][ct]),ge.push(ee.globals.seriesCandleC[rt][ct])),ee.config.chart.type==="rangeBar"&&(ge.pop(),ge.push(ee.globals.seriesRangeStart[rt][ct]),ge.push(ee.globals.seriesRangeEnd[rt][ct])),ge.length&&Se.push(ge.join(T))}}}};ge.push(ee.config.chart.toolbar.export.csv.headerCategory),ee.config.chart.type==="boxPlot"?(ge.push("minimum"),ge.push("q1"),ge.push("median"),ge.push("q3"),ge.push("maximum")):ee.config.chart.type==="candlestick"?(ge.push("open"),ge.push("high"),ge.push("low"),ge.push("close")):ee.config.chart.type==="rangeBar"?(ge.push("minimum"),ge.push("maximum")):S.map(function(_e,rt){var ct=(_e.name?_e.name:"series-".concat(rt))+"";ee.globals.axisCharts&&ge.push(ct.split(T).join("")?ct.split(T).join(""):"series-".concat(rt))}),ee.globals.axisCharts||(ge.push(ee.config.chart.toolbar.export.csv.headerValue),Se.push(ge.join(T))),ee.globals.allSeriesHasEqualX||!ee.globals.axisCharts||ee.config.xaxis.categories.length||ee.config.labels.length?S.map(function(_e,rt){ee.globals.axisCharts?Be(_e,rt):((ge=[]).push(qe(ee.globals.labels[rt])),ge.push(Fe(Me[rt])),Se.push(ge.join(T)))}):(ce=new Set,ue={},S.forEach(function(_e,rt){_e==null||_e.data.forEach(function(ct){var yt,Lt;if(se.isFormatXY())yt=ct.x,Lt=ct.y;else{if(!se.isFormat2DArray())return;yt=ct[0],Lt=ct[1]}ue[yt]||(ue[yt]=Array(S.length).fill("")),ue[yt][rt]=Fe(Lt),ce.add(yt)})}),ge.length&&Se.push(ge.join(T)),Array.from(ce).sort().forEach(function(_e){Se.push([qe(_e),ue[_e].join(T)])})),ke+=Se.join(W),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\uFEFF"+ke),_||ee.config.chart.toolbar.export.csv.filename,".csv")}},{key:"triggerDownload",value:function(h,p,S){var _=document.createElement("a");_.href=h,_.download=(p||this.w.globals.chartID)+S,document.body.appendChild(_),_.click(),document.body.removeChild(_)}}]),Ee}(),ut=function(){function Ee(h,p){s(this,Ee),this.ctx=h,this.elgrid=p,this.w=h.w;var S=this.w;this.axesUtils=new he(h),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 h=this.w,p=new z(this.ctx),S=p.group({class:"apexcharts-xaxis",transform:"translate(".concat(h.config.xaxis.offsetX,", ").concat(h.config.xaxis.offsetY,")")}),_=p.group({class:"apexcharts-xaxis-texts-g",transform:"translate(".concat(h.globals.translateXAxisX,", ").concat(h.globals.translateXAxisY,")")});S.add(_);for(var k=[],T=0;T<this.xaxisLabels.length;T++)k.push(this.xaxisLabels[T]);if(this.drawXAxisLabelAndGroup(!0,p,_,k,h.globals.isXNumeric,function(ke,Me){return Me}),h.globals.hasXaxisGroups){var B=h.globals.groups;k=[];for(var W=0;W<B.length;W++)k.push(B[W].title);var ee={};h.config.xaxis.group.style&&(ee.xaxisFontSize=h.config.xaxis.group.style.fontSize,ee.xaxisFontFamily=h.config.xaxis.group.style.fontFamily,ee.xaxisForeColors=h.config.xaxis.group.style.colors,ee.fontWeight=h.config.xaxis.group.style.fontWeight,ee.cssClass=h.config.xaxis.group.style.cssClass),this.drawXAxisLabelAndGroup(!1,p,_,k,!1,function(ke,Me){return B[ke].cols*Me},ee)}if(h.config.xaxis.title.text!==void 0){var ce=p.group({class:"apexcharts-xaxis-title"}),ue=p.drawText({x:h.globals.gridWidth/2+h.config.xaxis.title.offsetX,y:this.offY+parseFloat(this.xaxisFontSize)+(h.config.xaxis.position==="bottom"?h.globals.xAxisLabelsHeight:-h.globals.xAxisLabelsHeight-10)+h.config.xaxis.title.offsetY,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 "+h.config.xaxis.title.style.cssClass});ce.add(ue),S.add(ce)}if(h.config.xaxis.axisBorder.show){var ge=h.globals.barPadForNumericAxis,Se=p.drawLine(h.globals.padHorizontal+h.config.xaxis.axisBorder.offsetX-ge,this.offY,this.xaxisBorderWidth+ge,this.offY,h.config.xaxis.axisBorder.color,0,this.xaxisBorderHeight);this.elgrid&&this.elgrid.elGridBorders&&h.config.grid.show?this.elgrid.elGridBorders.add(Se):S.add(Se)}return S}},{key:"drawXAxisLabelAndGroup",value:function(h,p,S,_,k,T){var B,W=this,ee=arguments.length>6&&arguments[6]!==void 0?arguments[6]:{},ce=[],ue=[],ge=this.w,Se=ee.xaxisFontSize||this.xaxisFontSize,ke=ee.xaxisFontFamily||this.xaxisFontFamily,Me=ee.xaxisForeColors||this.xaxisForeColors,qe=ee.fontWeight||ge.config.xaxis.labels.style.fontWeight,Fe=ee.cssClass||ge.config.xaxis.labels.style.cssClass,at=ge.globals.padHorizontal,se=_.length,Ce=ge.config.xaxis.type==="category"?ge.globals.dataPoints:se;if(Ce===0&&se>Ce&&(Ce=se),k){var Ue=Ce>1?Ce-1:Ce;B=ge.globals.gridWidth/Math.min(Ue,se-1),at=at+T(0,B)/2+ge.config.xaxis.labels.offsetX}else B=ge.globals.gridWidth/Ce,at=at+T(0,B)+ge.config.xaxis.labels.offsetX;for(var Be=function(rt){var ct=at-T(rt,B)/2+ge.config.xaxis.labels.offsetX;rt===0&&se===1&&B/2===at&&Ce===1&&(ct=ge.globals.gridWidth/2);var yt=W.axesUtils.getLabel(_,ge.globals.timescaleLabels,ct,rt,ce,Se,h),Lt=28;if(ge.globals.rotateXLabels&&h&&(Lt=22),ge.config.xaxis.title.text&&ge.config.xaxis.position==="top"&&(Lt+=parseFloat(ge.config.xaxis.title.style.fontSize)+2),h||(Lt=Lt+parseFloat(Se)+(ge.globals.xAxisLabelsHeight-ge.globals.xAxisGroupLabelsHeight)+(ge.globals.rotateXLabels?10:0)),yt=ge.config.xaxis.tickAmount!==void 0&&ge.config.xaxis.tickAmount!=="dataPoints"&&ge.config.xaxis.type!=="datetime"?W.axesUtils.checkLabelBasedOnTickamount(rt,yt,se):W.axesUtils.checkForOverflowingLabels(rt,yt,se,ce,ue),ge.config.xaxis.labels.show){var ft=p.drawText({x:yt.x,y:W.offY+ge.config.xaxis.labels.offsetY+Lt-(ge.config.xaxis.position==="top"?ge.globals.xAxisHeight+ge.config.xaxis.axisTicks.height-2:0),text:yt.text,textAnchor:"middle",fontWeight:yt.isBold?600:qe,fontSize:Se,fontFamily:ke,foreColor:Array.isArray(Me)?h&&ge.config.xaxis.convertedCatToNumeric?Me[ge.globals.minX+rt-1]:Me[rt]:Me,isPlainText:!1,cssClass:(h?"apexcharts-xaxis-label ":"apexcharts-xaxis-group-label ")+Fe});if(S.add(ft),ft.on("click",function(Ge){if(typeof ge.config.chart.events.xAxisLabelClick=="function"){var At=Object.assign({},ge,{labelIndex:rt});ge.config.chart.events.xAxisLabelClick(Ge,W.ctx,At)}}),h){var Tt=document.createElementNS(ge.globals.SVGNS,"title");Tt.textContent=Array.isArray(yt.text)?yt.text.join(" "):yt.text,ft.node.appendChild(Tt),yt.text!==""&&(ce.push(yt.text),ue.push(yt))}}rt<se-1&&(at+=T(rt+1,B))},_e=0;_e<=se-1;_e++)Be(_e)}},{key:"drawXaxisInversed",value:function(h){var p,S,_=this,k=this.w,T=new z(this.ctx),B=k.config.yaxis[0].opposite?k.globals.translateYAxisX[h]:0,W=T.group({class:"apexcharts-yaxis apexcharts-xaxis-inversed",rel:h}),ee=T.group({class:"apexcharts-yaxis-texts-g apexcharts-xaxis-inversed-texts-g",transform:"translate("+B+", 0)"});W.add(ee);var ce=[];if(k.config.yaxis[h].show)for(var ue=0;ue<this.xaxisLabels.length;ue++)ce.push(this.xaxisLabels[ue]);p=k.globals.gridHeight/ce.length,S=-p/2.2;var ge=k.globals.yLabelFormatters[0],Se=k.config.yaxis[0].labels;if(Se.show)for(var ke=function(Ue){var Be=ce[Ue]===void 0?"":ce[Ue];Be=ge(Be,{seriesIndex:h,dataPointIndex:Ue,w:k});var _e=_.axesUtils.getYAxisForeColor(Se.style.colors,h),rt=0;Array.isArray(Be)&&(rt=Be.length/2*parseInt(Se.style.fontSize,10));var ct=Se.offsetX-15,yt="end";_.yaxis.opposite&&(yt="start"),k.config.yaxis[0].labels.align==="left"?(ct=Se.offsetX,yt="start"):k.config.yaxis[0].labels.align==="center"?(ct=Se.offsetX,yt="middle"):k.config.yaxis[0].labels.align==="right"&&(yt="end");var Lt=T.drawText({x:ct,y:S+p+Se.offsetY-rt,text:Be,textAnchor:yt,foreColor:Array.isArray(_e)?_e[Ue]:_e,fontSize:Se.style.fontSize,fontFamily:Se.style.fontFamily,fontWeight:Se.style.fontWeight,isPlainText:!1,cssClass:"apexcharts-yaxis-label "+Se.style.cssClass,maxWidth:Se.maxWidth});ee.add(Lt),Lt.on("click",function(Ge){if(typeof k.config.chart.events.xAxisLabelClick=="function"){var At=Object.assign({},k,{labelIndex:Ue});k.config.chart.events.xAxisLabelClick(Ge,_.ctx,At)}});var ft=document.createElementNS(k.globals.SVGNS,"title");if(ft.textContent=Array.isArray(Be)?Be.join(" "):Be,Lt.node.appendChild(ft),k.config.yaxis[h].labels.rotate!==0){var Tt=T.rotateAroundCenter(Lt.node);Lt.node.setAttribute("transform","rotate(".concat(k.config.yaxis[h].labels.rotate," 0 ").concat(Tt.y,")"))}S+=p},Me=0;Me<=ce.length-1;Me++)ke(Me);if(k.config.yaxis[0].title.text!==void 0){var qe=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});qe.add(Fe),W.add(qe)}var at=0;this.isCategoryBarHorizontal&&k.config.yaxis[0].opposite&&(at=k.globals.gridWidth);var se=k.config.xaxis.axisBorder;if(se.show){var Ce=T.drawLine(k.globals.padHorizontal+se.offsetX+at,1+se.offsetY,k.globals.padHorizontal+se.offsetX+at,k.globals.gridHeight+se.offsetY,se.color,0);this.elgrid&&this.elgrid.elGridBorders&&k.config.grid.show?this.elgrid.elGridBorders.add(Ce):W.add(Ce)}return k.config.yaxis[0].axisTicks.show&&this.axesUtils.drawYAxisTicks(at,ce.length,k.config.yaxis[0].axisBorder,k.config.yaxis[0].axisTicks,0,p,W),W}},{key:"drawXaxisTicks",value:function(h,p,S){var _=this.w,k=h;if(!(h<0||h-2>_.globals.gridWidth)){var T=this.offY+_.config.xaxis.axisTicks.offsetY;if(p=p+T+_.config.xaxis.axisTicks.height,_.config.xaxis.position==="top"&&(p=T-_.config.xaxis.axisTicks.height),_.config.xaxis.axisTicks.show){var B=new z(this.ctx).drawLine(h+_.config.xaxis.axisTicks.offsetX,T+_.config.xaxis.offsetY,k+_.config.xaxis.axisTicks.offsetX,p+_.config.xaxis.offsetY,_.config.xaxis.axisTicks.color);S.add(B),B.node.classList.add("apexcharts-xaxis-tick")}}}},{key:"getXAxisTicksPositions",value:function(){var h=this.w,p=[],S=this.xaxisLabels.length,_=h.globals.padHorizontal;if(h.globals.timescaleLabels.length>0)for(var k=0;k<S;k++)_=this.xaxisLabels[k].position,p.push(_);else for(var T=S,B=0;B<T;B++){var W=T;h.globals.isXNumeric&&h.config.chart.type!=="bar"&&(W-=1),_+=h.globals.gridWidth/W,p.push(_)}return p}},{key:"xAxisLabelCorrections",value:function(){var h=this.w,p=new z(this.ctx),S=h.globals.dom.baseEl.querySelector(".apexcharts-xaxis-texts-g"),_=h.globals.dom.baseEl.querySelectorAll(".apexcharts-xaxis-texts-g text:not(.apexcharts-xaxis-group-label)"),k=h.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis-inversed text"),T=h.globals.dom.baseEl.querySelectorAll(".apexcharts-xaxis-inversed-texts-g text tspan");if(h.globals.rotateXLabels||h.config.xaxis.labels.rotateAlways)for(var B=0;B<_.length;B++){var W=p.rotateAroundCenter(_[B]);W.y=W.y-1,W.x=W.x+1,_[B].setAttribute("transform","rotate(".concat(h.config.xaxis.labels.rotate," ").concat(W.x," ").concat(W.y,")")),_[B].setAttribute("text-anchor","end"),S.setAttribute("transform","translate(0, ".concat(-10,")"));var ee=_[B].childNodes;h.config.xaxis.labels.trim&&Array.prototype.forEach.call(ee,function(Se){p.placeTextWithEllipsis(Se,Se.textContent,h.globals.xAxisLabelsHeight-(h.config.legend.position==="bottom"?20:10))})}else(function(){for(var Se=h.globals.gridWidth/(h.globals.labels.length+1),ke=0;ke<_.length;ke++){var Me=_[ke].childNodes;h.config.xaxis.labels.trim&&h.config.xaxis.type!=="datetime"&&Array.prototype.forEach.call(Me,function(qe){p.placeTextWithEllipsis(qe,qe.textContent,Se)})}})();if(k.length>0){var ce=k[k.length-1].getBBox(),ue=k[0].getBBox();ce.x<-20&&k[k.length-1].parentNode.removeChild(k[k.length-1]),ue.x+ue.width>h.globals.gridWidth&&!h.globals.isBarHorizontal&&k[0].parentNode.removeChild(k[0]);for(var ge=0;ge<T.length;ge++)p.placeTextWithEllipsis(T[ge],T[ge].textContent,h.config.yaxis[0].labels.maxWidth-(h.config.yaxis[0].title.text?2*parseFloat(h.config.yaxis[0].title.style.fontSize):0)-15)}}}]),Ee}(),et=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w;var p=this.w;this.xaxisLabels=p.globals.labels.slice(),this.axesUtils=new he(h),this.isRangeBar=p.globals.seriesRange.length&&p.globals.isBarHorizontal,p.globals.timescaleLabels.length>0&&(this.xaxisLabels=p.globals.timescaleLabels.slice())}return o(Ee,[{key:"drawGridArea",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,p=this.w,S=new z(this.ctx);h||(h=S.group({class:"apexcharts-grid"}));var _=S.drawLine(p.globals.padHorizontal,1,p.globals.padHorizontal,p.globals.gridHeight,"transparent"),k=S.drawLine(p.globals.padHorizontal,p.globals.gridHeight,p.globals.gridWidth,p.globals.gridHeight,"transparent");return h.add(k),h.add(_),h}},{key:"drawGrid",value:function(){if(this.w.globals.axisCharts){var h=this.renderGrid();return this.drawGridArea(h.el),h}return null}},{key:"createGridMask",value:function(){var h=this.w,p=h.globals,S=new z(this.ctx),_=Array.isArray(h.config.stroke.width)?Math.max.apply(Math,N(h.config.stroke.width)):h.config.stroke.width,k=function(ce){var ue=document.createElementNS(p.SVGNS,"clipPath");return ue.setAttribute("id",ce),ue};p.dom.elGridRectMask=k("gridRectMask".concat(p.cuid)),p.dom.elGridRectBarMask=k("gridRectBarMask".concat(p.cuid)),p.dom.elGridRectMarkerMask=k("gridRectMarkerMask".concat(p.cuid)),p.dom.elForecastMask=k("forecastMask".concat(p.cuid)),p.dom.elNonForecastMask=k("nonForecastMask".concat(p.cuid));var T=0,B=0;(["bar","rangeBar","candlestick","boxPlot"].includes(h.config.chart.type)||h.globals.comboBarCount>0)&&h.globals.isXNumeric&&!h.globals.isBarHorizontal&&(T=Math.max(h.config.grid.padding.left,p.barPadForNumericAxis),B=Math.max(h.config.grid.padding.right,p.barPadForNumericAxis)),p.dom.elGridRect=S.drawRect(0,0,p.gridWidth,p.gridHeight,0,"#fff"),p.dom.elGridRectBar=S.drawRect(-_/2-T-2,-_/2-2,p.gridWidth+_+B+T+4,p.gridHeight+_+4,0,"#fff");var W=h.globals.markers.largestSize;p.dom.elGridRectMarker=S.drawRect(-W,-W,p.gridWidth+2*W,p.gridHeight+2*W,0,"#fff"),p.dom.elGridRectMask.appendChild(p.dom.elGridRect.node),p.dom.elGridRectBarMask.appendChild(p.dom.elGridRectBar.node),p.dom.elGridRectMarkerMask.appendChild(p.dom.elGridRectMarker.node);var ee=p.dom.baseEl.querySelector("defs");ee.appendChild(p.dom.elGridRectMask),ee.appendChild(p.dom.elGridRectBarMask),ee.appendChild(p.dom.elGridRectMarkerMask),ee.appendChild(p.dom.elForecastMask),ee.appendChild(p.dom.elNonForecastMask)}},{key:"_drawGridLines",value:function(h){var p=h.i,S=h.x1,_=h.y1,k=h.x2,T=h.y2,B=h.xCount,W=h.parent,ee=this.w;if(!(p===0&&ee.globals.skipFirstTimelinelabel||p===B-1&&ee.globals.skipLastTimelinelabel&&!ee.config.xaxis.labels.formatter||ee.config.chart.type==="radar")){ee.config.grid.xaxis.lines.show&&this._drawGridLine({i:p,x1:S,y1:_,x2:k,y2:T,xCount:B,parent:W});var ce=0;if(ee.globals.hasXaxisGroups&&ee.config.xaxis.tickPlacement==="between"){var ue=ee.globals.groups;if(ue){for(var ge=0,Se=0;ge<p&&Se<ue.length;Se++)ge+=ue[Se].cols;ge===p&&(ce=.6*ee.globals.xAxisLabelsHeight)}}new ut(this.ctx).drawXaxisTicks(S,ce,ee.globals.dom.elGraphical)}}},{key:"_drawGridLine",value:function(h){var p=h.i,S=h.x1,_=h.y1,k=h.x2,T=h.y2,B=h.xCount,W=h.parent,ee=this.w,ce=W.node.classList.contains("apexcharts-gridlines-horizontal"),ue=ee.globals.barPadForNumericAxis,ge=_===0&&T===0||S===0&&k===0||_===ee.globals.gridHeight&&T===ee.globals.gridHeight||ee.globals.isBarHorizontal&&(p===0||p===B-1),Se=new z(this).drawLine(S-(ce?ue:0),_,k+(ce?ue:0),T,ee.config.grid.borderColor,ee.config.grid.strokeDashArray);Se.node.classList.add("apexcharts-gridline"),ge&&ee.config.grid.show?this.elGridBorders.add(Se):W.add(Se)}},{key:"_drawGridBandRect",value:function(h){var p=h.c,S=h.x1,_=h.y1,k=h.x2,T=h.y2,B=h.type,W=this.w,ee=new z(this.ctx),ce=W.globals.barPadForNumericAxis,ue=W.config.grid[B].colors[p],ge=ee.drawRect(S-(B==="row"?ce:0),_,k+(B==="row"?2*ce:0),T,0,ue,W.config.grid[B].opacity);this.elg.add(ge),ge.attr("clip-path","url(#gridRectMask".concat(W.globals.cuid,")")),ge.node.classList.add("apexcharts-grid-".concat(B))}},{key:"_drawXYLines",value:function(h){var p=this,S=h.xCount,_=h.tickAmount,k=this.w;if(k.config.grid.xaxis.lines.show||k.config.xaxis.axisTicks.show){var T,B=k.globals.padHorizontal,W=k.globals.gridHeight;k.globals.timescaleLabels.length?function(ke){for(var Me=ke.xC,qe=ke.x1,Fe=ke.y1,at=ke.x2,se=ke.y2,Ce=0;Ce<Me;Ce++)qe=p.xaxisLabels[Ce].position,at=p.xaxisLabels[Ce].position,p._drawGridLines({i:Ce,x1:qe,y1:Fe,x2:at,y2:se,xCount:S,parent:p.elgridLinesV})}({xC:S,x1:B,y1:0,x2:T,y2:W}):(k.globals.isXNumeric&&(S=k.globals.xAxisScale.result.length),function(ke){for(var Me=ke.xC,qe=ke.x1,Fe=ke.y1,at=ke.x2,se=ke.y2,Ce=0;Ce<Me+(k.globals.isXNumeric?0:1);Ce++)Ce===0&&Me===1&&k.globals.dataPoints===1&&(at=qe=k.globals.gridWidth/2),p._drawGridLines({i:Ce,x1:qe,y1:Fe,x2:at,y2:se,xCount:S,parent:p.elgridLinesV}),at=qe+=k.globals.gridWidth/(k.globals.isXNumeric?Me-1:Me)}({xC:S,x1:B,y1:0,x2:T,y2:W}))}if(k.config.grid.yaxis.lines.show){var ee=0,ce=0,ue=k.globals.gridWidth,ge=_+1;this.isRangeBar&&(ge=k.globals.labels.length);for(var Se=0;Se<ge+(this.isRangeBar?1:0);Se++)this._drawGridLine({i:Se,xCount:ge+(this.isRangeBar?1:0),x1:0,y1:ee,x2:ue,y2:ce,parent:this.elgridLinesH}),ce=ee+=k.globals.gridHeight/(this.isRangeBar?ge:_)}}},{key:"_drawInvertedXYLines",value:function(h){var p=h.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<p+1;B++)S.config.grid.xaxis.lines.show&&this._drawGridLine({i:B,xCount:p+1,x1:k,y1:0,x2:_,y2:T,parent:this.elgridLinesV}),new ut(this.ctx).drawXaxisTicks(k,0,S.globals.dom.elGraphical),_=k+=S.globals.gridWidth/p;if(S.config.grid.yaxis.lines.show)for(var W=0,ee=0,ce=S.globals.gridWidth,ue=0;ue<S.globals.dataPoints+1;ue++)this._drawGridLine({i:ue,xCount:S.globals.dataPoints+1,x1:0,y1:W,x2:ce,y2:ee,parent:this.elgridLinesH}),ee=W+=S.globals.gridHeight/S.globals.dataPoints}},{key:"renderGrid",value:function(){var h=this.w,p=h.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),h.config.grid.show||(this.elgridLinesV.hide(),this.elgridLinesH.hide(),this.elGridBorders.hide());for(var _=0;_<p.seriesYAxisMap.length&&p.ignoreYAxisIndexes.includes(_);)_++;_===p.seriesYAxisMap.length&&(_=0);var k,T=p.yAxisScale[_].result.length-1;if(!p.isBarHorizontal||this.isRangeBar){var B,W,ee;k=this.xaxisLabels.length,this.isRangeBar&&(T=p.labels.length,h.config.xaxis.tickAmount&&h.config.xaxis.labels.formatter&&(k=h.config.xaxis.tickAmount),((B=p.yAxisScale)===null||B===void 0||(W=B[_])===null||W===void 0||(ee=W.result)===null||ee===void 0?void 0:ee.length)>0&&h.config.xaxis.type!=="datetime"&&(k=p.yAxisScale[_].result.length-1)),this._drawXYLines({xCount:k,tickAmount:T})}else k=T,T=p.xTickAmount,this._drawInvertedXYLines({xCount:k,tickAmount:T});return this.drawGridBands(k,T),{el:this.elg,elGridBorders:this.elGridBorders,xAxisTickWidth:p.gridWidth/k}}},{key:"drawGridBands",value:function(h,p){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,qe,Fe,at,se){for(var Ce=0,Ue=0;Ce<Me;Ce++,Ue++)Ue>=T.config.grid[ke].colors.length&&(Ue=0),k._drawGridBandRect({c:Ue,x1:qe,y1:Fe,x2:at,y2:se,type:ke}),Fe+=T.globals.gridHeight/p}("row",p,0,0,T.globals.gridWidth,T.globals.gridHeight/p),((_=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?h:h-1;T.globals.isXNumeric&&(B=T.globals.xAxisScale.result.length-1);for(var W=T.globals.padHorizontal,ee=T.globals.padHorizontal+T.globals.gridWidth/B,ce=T.globals.gridHeight,ue=0,ge=0;ue<h;ue++,ge++){var Se;ge>=T.config.grid.column.colors.length&&(ge=0),T.config.xaxis.type==="datetime"&&(W=this.xaxisLabels[ue].position,ee=(((Se=this.xaxisLabels[ue+1])===null||Se===void 0?void 0:Se.position)||T.globals.gridWidth)-this.xaxisLabels[ue].position),this._drawGridBandRect({c:ge,x1:W,y1:0,x2:ee,y2:ce,type:"column"}),W+=T.globals.gridWidth/B}}}}]),Ee}(),tt=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w,this.coreUtils=new X(this.ctx)}return o(Ee,[{key:"niceScale",value:function(h,p){var S,_,k,T,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,W=1e-11,ee=this.w,ce=ee.globals;ce.isBarHorizontal?(S=ee.config.xaxis,_=Math.max((ce.svgWidth-100)/25,2)):(S=ee.config.yaxis[B],_=Math.max((ce.svgHeight-100)/15,2)),O.isNumber(_)||(_=10),k=S.min!==void 0&&S.min!==null,T=S.max!==void 0&&S.min!==null;var ue=S.stepSize!==void 0&&S.stepSize!==null,ge=S.tickAmount!==void 0&&S.tickAmount!==null,Se=ge?S.tickAmount:ce.niceScaleDefaultTicks[Math.min(Math.round(_/2),ce.niceScaleDefaultTicks.length-1)];if(ce.isMultipleYAxis&&!ge&&ce.multiAxisTickAmount>0&&(Se=ce.multiAxisTickAmount,ge=!0),Se=Se==="dataPoints"?ce.dataPoints-1:Math.abs(Math.round(Se)),(h===Number.MIN_VALUE&&p===0||!O.isNumber(h)&&!O.isNumber(p)||h===Number.MIN_VALUE&&p===-Number.MAX_VALUE)&&(h=O.isNumber(S.min)?S.min:0,p=O.isNumber(S.max)?S.max:h+Se,ce.allSeriesCollapsed=!1),h>p){console.warn("axis.min cannot be greater than axis.max: swapping min and max");var ke=p;p=h,h=ke}else h===p&&(h=h===0?0:h-1,p=p===0?2:p+1);var Me=[];Se<1&&(Se=1);var qe=Se,Fe=Math.abs(p-h);!k&&h>0&&h/Fe<.15&&(h=0,k=!0),!T&&p<0&&-p/Fe<.15&&(p=0,T=!0);var at=(Fe=Math.abs(p-h))/qe,se=at,Ce=Math.floor(Math.log10(se)),Ue=Math.pow(10,Ce),Be=Math.ceil(se/Ue);if(at=se=(Be=ce.niceScaleAllowedMagMsd[ce.yValueDecimal===0?0:1][Be])*Ue,ce.isBarHorizontal&&S.stepSize&&S.type!=="datetime"?(at=S.stepSize,ue=!0):ue&&(at=S.stepSize),ue&&S.forceNiceScale){var _e=Math.floor(Math.log10(at));at*=Math.pow(10,Ce-_e)}if(k&&T){var rt=Fe/qe;if(ge)if(ue)if(O.mod(Fe,at)!=0){var ct=O.getGCD(at,rt);at=rt/ct<10?ct:rt}else O.mod(at,rt)==0?at=rt:(rt=at,ge=!1);else at=rt;else if(ue)O.mod(Fe,at)==0?rt=at:at=rt;else if(O.mod(Fe,at)==0)rt=at;else{rt=Fe/(qe=Math.ceil(Fe/at));var yt=O.getGCD(Fe,at);Fe/yt<_&&(rt=yt),at=rt}qe=Math.round(Fe/at)}else{if(k||T){if(T)if(ge)h=p-at*qe;else{var Lt=h;h=at*Math.floor(h/at),Math.abs(p-h)/O.getGCD(Fe,at)>_&&(h=p-at*Se,h+=at*Math.floor((Lt-h)/at))}else if(k)if(ge)p=h+at*qe;else{var ft=p;p=at*Math.ceil(p/at),Math.abs(p-h)/O.getGCD(Fe,at)>_&&(p=h+at*Se,p+=at*Math.ceil((ft-p)/at))}}else if(ce.isMultipleYAxis&&ge){var Tt=at*Math.floor(h/at),Ge=Tt+at*qe;Ge<p&&(at*=2),Ge=p,p=(h=Tt)+at*qe,Fe=Math.abs(p-h),h>0&&h<Math.abs(Ge-p)&&(h=0,p=at*qe),p<0&&-p<Math.abs(Tt-h)&&(p=0,h=-at*qe)}else h=at*Math.floor(h/at),p=at*Math.ceil(p/at);Fe=Math.abs(p-h),at=O.getGCD(Fe,at),qe=Math.round(Fe/at)}if(ge||k||T||(qe=Math.ceil((Fe-W)/(at+W)))>16&&O.getPrimeFactors(qe).length<2&&qe++,!ge&&S.forceNiceScale&&ce.yValueDecimal===0&&qe>Fe&&(qe=Fe,at=Math.round(Fe/qe)),qe>_&&(!ge&&!ue||S.forceNiceScale)){var At=O.getPrimeFactors(qe),Ot=At.length-1,it=qe;e:for(var jt=0;jt<Ot;jt++)for(var Nn=0;Nn<=Ot-jt;Nn++){for(var mn=Math.min(Nn+jt,Ot),ir=it,Sn=1,Bn=Nn;Bn<=mn;Bn++)Sn*=At[Bn];if((ir/=Sn)<_){it=ir;break e}}at=it===qe?Fe:Fe/it,qe=Math.round(Fe/at)}ce.isMultipleYAxis&&ce.multiAxisTickAmount==0&&ce.ignoreYAxisIndexes.indexOf(B)<0&&(ce.multiAxisTickAmount=qe);var rr=h-at,ur=at*W;do rr+=at,Me.push(O.stripNumber(rr,7));while(p-rr>ur);return{result:Me,niceMin:Me[0],niceMax:Me[Me.length-1]}}},{key:"linearScale",value:function(h,p){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(p-h),B=[];if(h===p)return{result:B=[h],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 W=h;S>=0;)B.push(W),W=O.preciseAddition(W,k),S-=1;return{result:B,niceMin:B[0],niceMax:B[B.length-1]}}},{key:"logarithmicScaleNice",value:function(h,p,S){p<=0&&(p=Math.max(h,S)),h<=0&&(h=Math.min(p,S));for(var _=[],k=Math.ceil(Math.log(p)/Math.log(S)+1),T=Math.floor(Math.log(h)/Math.log(S));T<k;T++)_.push(Math.pow(S,T));return{result:_,niceMin:_[0],niceMax:_[_.length-1]}}},{key:"logarithmicScale",value:function(h,p,S){p<=0&&(p=Math.max(h,S)),h<=0&&(h=Math.min(p,S));for(var _=[],k=Math.log(p)/Math.log(S),T=Math.log(h)/Math.log(S),B=k-T,W=Math.round(B),ee=B/W,ce=0,ue=T;ce<W;ce++,ue+=ee)_.push(Math.pow(S,ue));return _.push(Math.pow(S,k)),{result:_,niceMin:h,niceMax:p}}},{key:"_adjustTicksForSmallRange",value:function(h,p,S){var _=h;if(p!==void 0&&this.w.config.yaxis[p].labels.formatter&&this.w.config.yaxis[p].tickAmount===void 0){var k=Number(this.w.config.yaxis[p].labels.formatter(1));O.isNumber(k)&&this.w.globals.yValueDecimal===0&&(_=Math.ceil(S))}return _<h?_:h}},{key:"setYScaleForIndex",value:function(h,p,S){var _=this.w.globals,k=this.w.config,T=_.isBarHorizontal?k.xaxis:k.yaxis[h];_.yAxisScale[h]===void 0&&(_.yAxisScale[h]=[]);var B=Math.abs(S-p);T.logarithmic&&B<=5&&(_.invalidLogScale=!0),T.logarithmic&&B>5?(_.allSeriesCollapsed=!1,_.yAxisScale[h]=T.forceNiceScale?this.logarithmicScaleNice(p,S,T.logBase):this.logarithmicScale(p,S,T.logBase)):S!==-Number.MAX_VALUE&&O.isNumber(S)&&p!==Number.MAX_VALUE&&O.isNumber(p)?(_.allSeriesCollapsed=!1,_.yAxisScale[h]=this.niceScale(p,S,h)):_.yAxisScale[h]=this.niceScale(Number.MIN_VALUE,0,h)}},{key:"setXScale",value:function(h,p){var S=this.w,_=S.globals,k=Math.abs(p-h);if(p!==-Number.MAX_VALUE&&O.isNumber(p)){var T=_.xTickAmount+1;k<10&&k>1&&(T=k),_.xAxisScale=this.linearScale(h,p,T,0,S.config.xaxis.stepSize)}else _.xAxisScale=this.linearScale(0,10,10);return _.xAxisScale}},{key:"scaleMultipleYAxes",value:function(){var h=this,p=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,W){var ee=[];B.forEach(function(ce){var ue=p.series[ce].group;ee.indexOf(ue)<0&&ee.push(ue)}),B.length>0?function(){var ce,ue,ge=Number.MAX_VALUE,Se=-Number.MAX_VALUE,ke=ge,Me=Se;if(p.chart.stacked)(function(){var at=new Array(S.dataPoints).fill(0),se=[],Ce=[],Ue=[];ee.forEach(function(){se.push(at.map(function(){return Number.MIN_VALUE})),Ce.push(at.map(function(){return Number.MIN_VALUE})),Ue.push(at.map(function(){return Number.MIN_VALUE}))});for(var Be=function(rt){!ce&&p.series[B[rt]].type&&(ce=p.series[B[rt]].type);var ct=B[rt];ue=p.series[ct].group?p.series[ct].group:"axis-".concat(W),!(S.collapsedSeriesIndices.indexOf(ct)<0&&S.ancillaryCollapsedSeriesIndices.indexOf(ct)<0)||(S.allSeriesCollapsed=!1,ee.forEach(function(yt,Lt){if(p.series[ct].group===yt)for(var ft=0;ft<S.series[ct].length;ft++){var Tt=S.series[ct][ft];Tt>=0?Ce[Lt][ft]+=Tt:Ue[Lt][ft]+=Tt,se[Lt][ft]+=Tt,ke=Math.min(ke,Tt),Me=Math.max(Me,Tt)}})),ce!=="bar"&&ce!=="column"||S.barGroups.push(ue)},_e=0;_e<B.length;_e++)Be(_e);ce||(ce=p.chart.type),ce==="bar"||ce==="column"?ee.forEach(function(rt,ct){ge=Math.min(ge,Math.min.apply(null,Ue[ct])),Se=Math.max(Se,Math.max.apply(null,Ce[ct]))}):(ee.forEach(function(rt,ct){ke=Math.min(ke,Math.min.apply(null,se[ct])),Me=Math.max(Me,Math.max.apply(null,se[ct]))}),ge=ke,Se=Me),ge===Number.MIN_VALUE&&Se===Number.MIN_VALUE&&(Se=-Number.MAX_VALUE)})();else for(var qe=0;qe<B.length;qe++){var Fe=B[qe];ge=Math.min(ge,k[Fe]),Se=Math.max(Se,T[Fe]),!(S.collapsedSeriesIndices.indexOf(Fe)<0&&S.ancillaryCollapsedSeriesIndices.indexOf(Fe)<0)||(S.allSeriesCollapsed=!1)}p.yaxis[W].min!==void 0&&(ge=typeof p.yaxis[W].min=="function"?p.yaxis[W].min(ge):p.yaxis[W].min),p.yaxis[W].max!==void 0&&(Se=typeof p.yaxis[W].max=="function"?p.yaxis[W].max(Se):p.yaxis[W].max),S.barGroups=S.barGroups.filter(function(at,se,Ce){return Ce.indexOf(at)===se}),h.setYScaleForIndex(W,ge,Se),B.forEach(function(at){k[at]=S.yAxisScale[W].niceMin,T[at]=S.yAxisScale[W].niceMax})}():h.setYScaleForIndex(W,0,-Number.MAX_VALUE)})}}]),Ee}(),Le=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w,this.scales=new tt(h)}return o(Ee,[{key:"init",value:function(){this.setYRange(),this.setXRange(),this.setZRange()}},{key:"getMinYMaxY",value:function(h){var p=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,W=Number.MIN_VALUE;_===null&&(_=h+1);var ee=T.series,ce=ee,ue=ee;k.chart.type==="candlestick"?(ce=T.seriesCandleL,ue=T.seriesCandleH):k.chart.type==="boxPlot"?(ce=T.seriesCandleO,ue=T.seriesCandleC):T.isRangeData&&(ce=T.seriesRangeStart,ue=T.seriesRangeEnd);var ge=!1;if(T.seriesX.length>=_){var Se,ke=(Se=T.brushSource)===null||Se===void 0?void 0:Se.w.config.chart.brush;(k.chart.zoom.enabled&&k.chart.zoom.autoScaleYaxis||ke!=null&&ke.enabled&&ke!=null&&ke.autoScaleYaxis)&&(ge=!0)}for(var Me=h;Me<_;Me++){T.dataPoints=Math.max(T.dataPoints,ee[Me].length);var qe=k.series[Me].type;T.categoryLabels.length&&(T.dataPoints=T.categoryLabels.filter(function(Ue){return Ue!==void 0}).length),T.labels.length&&k.xaxis.type!=="datetime"&&T.series.reduce(function(Ue,Be){return Ue+Be.length},0)!==0&&(T.dataPoints=Math.max(T.dataPoints,T.labels.length));var Fe=0,at=ee[Me].length-1;if(ge){if(k.xaxis.min)for(;Fe<at&&T.seriesX[Me][Fe]<k.xaxis.min;Fe++);if(k.xaxis.max)for(;at>Fe&&T.seriesX[Me][at]>k.xaxis.max;at--);}for(var se=Fe;se<=at&&se<T.series[Me].length;se++){var Ce=ee[Me][se];if(Ce!==null&&O.isNumber(Ce)){switch(ue[Me][se]!==void 0&&(B=Math.max(B,ue[Me][se]),p=Math.min(p,ue[Me][se])),ce[Me][se]!==void 0&&(p=Math.min(p,ce[Me][se]),S=Math.max(S,ce[Me][se])),qe){case"candlestick":T.seriesCandleC[Me][se]!==void 0&&(B=Math.max(B,T.seriesCandleH[Me][se]),p=Math.min(p,T.seriesCandleL[Me][se]));break;case"boxPlot":T.seriesCandleC[Me][se]!==void 0&&(B=Math.max(B,T.seriesCandleC[Me][se]),p=Math.min(p,T.seriesCandleO[Me][se]))}qe&&qe!=="candlestick"&&qe!=="boxPlot"&&qe!=="rangeArea"&&qe!=="rangeBar"&&(B=Math.max(B,T.series[Me][se]),p=Math.min(p,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(Ue){W!==Number.MIN_VALUE&&(W=Math.min(W,Ue.value),p=W),B=Math.max(B,Ue.value),S=B}),O.isFloat(Ce)&&(Ce=O.noExponents(Ce),T.yValueDecimal=Math.max(T.yValueDecimal,Ce.toString().split(".")[1].length)),W>ce[Me][se]&&ce[Me][se]<0&&(W=ce[Me][se])}else T.hasNullValues=!0}qe!=="bar"&&qe!=="column"||(W<0&&B<0&&(B=0,S=Math.max(S,0)),W===Number.MIN_VALUE&&(W=0,p=Math.min(p,0)))}return k.chart.type==="rangeBar"&&T.seriesRangeStart.length&&T.isBarHorizontal&&(W=p),k.chart.type==="bar"&&(W<0&&B<0&&(B=0),W===Number.MIN_VALUE&&(W=0)),{minY:W,maxY:B,lowestY:p,highestY:S}}},{key:"setYRange",value:function(){var h=this.w.globals,p=this.w.config;h.maxY=-Number.MAX_VALUE,h.minY=Number.MIN_VALUE;var S,_=Number.MAX_VALUE;if(h.isMultipleYAxis){_=Number.MAX_VALUE;for(var k=0;k<h.series.length;k++)S=this.getMinYMaxY(k),h.minYArr[k]=S.lowestY,h.maxYArr[k]=S.highestY,_=Math.min(_,S.lowestY)}return S=this.getMinYMaxY(0,_,null,h.series.length),p.chart.type==="bar"?(h.minY=S.minY,h.maxY=S.maxY):(h.minY=S.lowestY,h.maxY=S.highestY),_=S.lowestY,p.chart.stacked&&this._setStackedMinMax(),p.chart.type==="line"||p.chart.type==="area"||p.chart.type==="scatter"||p.chart.type==="candlestick"||p.chart.type==="boxPlot"||p.chart.type==="rangeBar"&&!h.isBarHorizontal?h.minY===Number.MIN_VALUE&&_!==-Number.MAX_VALUE&&_!==h.maxY&&(h.minY=_):h.minY=h.minY!==Number.MIN_VALUE?Math.min(S.minY,h.minY):S.minY,p.yaxis.forEach(function(T,B){T.max!==void 0&&(typeof T.max=="number"?h.maxYArr[B]=T.max:typeof T.max=="function"&&(h.maxYArr[B]=T.max(h.isMultipleYAxis?h.maxYArr[B]:h.maxY)),h.maxY=h.maxYArr[B]),T.min!==void 0&&(typeof T.min=="number"?h.minYArr[B]=T.min:typeof T.min=="function"&&(h.minYArr[B]=T.min(h.isMultipleYAxis?h.minYArr[B]===Number.MIN_VALUE?0:h.minYArr[B]:h.minY)),h.minY=h.minYArr[B])}),h.isBarHorizontal&&["min","max"].forEach(function(T){p.xaxis[T]!==void 0&&typeof p.xaxis[T]=="number"&&(T==="min"?h.minY=p.xaxis[T]:h.maxY=p.xaxis[T])}),h.isMultipleYAxis?(this.scales.scaleMultipleYAxes(),h.minY=_):(this.scales.setYScaleForIndex(0,h.minY,h.maxY),h.minY=h.yAxisScale[0].niceMin,h.maxY=h.yAxisScale[0].niceMax,h.minYArr[0]=h.minY,h.maxYArr[0]=h.maxY),h.barGroups=[],h.lineGroups=[],h.areaGroups=[],p.series.forEach(function(T){switch(T.type||p.chart.type){case"bar":case"column":h.barGroups.push(T.group);break;case"line":h.lineGroups.push(T.group);break;case"area":h.areaGroups.push(T.group)}}),h.barGroups=h.barGroups.filter(function(T,B,W){return W.indexOf(T)===B}),h.lineGroups=h.lineGroups.filter(function(T,B,W){return W.indexOf(T)===B}),h.areaGroups=h.areaGroups.filter(function(T,B,W){return W.indexOf(T)===B}),{minY:h.minY,maxY:h.maxY,minYArr:h.minYArr,maxYArr:h.maxYArr,yAxisScale:h.yAxisScale}}},{key:"setXRange",value:function(){var h=this.w.globals,p=this.w.config,S=p.xaxis.type==="numeric"||p.xaxis.type==="datetime"||p.xaxis.type==="category"&&!h.noLabelsProvided||h.noLabelsProvided||h.isXNumeric;if(h.isXNumeric&&function(){for(var W=0;W<h.series.length;W++)if(h.labels[W])for(var ee=0;ee<h.labels[W].length;ee++)h.labels[W][ee]!==null&&O.isNumber(h.labels[W][ee])&&(h.maxX=Math.max(h.maxX,h.labels[W][ee]),h.initialMaxX=Math.max(h.maxX,h.labels[W][ee]),h.minX=Math.min(h.minX,h.labels[W][ee]),h.initialMinX=Math.min(h.minX,h.labels[W][ee]))}(),h.noLabelsProvided&&p.xaxis.categories.length===0&&(h.maxX=h.labels[h.labels.length-1],h.initialMaxX=h.labels[h.labels.length-1],h.minX=1,h.initialMinX=1),h.isXNumeric||h.noLabelsProvided||h.dataFormatXNumeric){var _=10;if(p.xaxis.tickAmount===void 0)_=Math.round(h.svgWidth/150),p.xaxis.type==="numeric"&&h.dataPoints<30&&(_=h.dataPoints-1),_>h.dataPoints&&h.dataPoints!==0&&(_=h.dataPoints-1);else if(p.xaxis.tickAmount==="dataPoints"){if(h.series.length>1&&(_=h.series[h.maxValsInArrayIndex].length-1),h.isXNumeric){var k=h.maxX-h.minX;k<30&&(_=k-1)}}else _=p.xaxis.tickAmount;if(h.xTickAmount=_,p.xaxis.max!==void 0&&typeof p.xaxis.max=="number"&&(h.maxX=p.xaxis.max),p.xaxis.min!==void 0&&typeof p.xaxis.min=="number"&&(h.minX=p.xaxis.min),p.xaxis.range!==void 0&&(h.minX=h.maxX-p.xaxis.range),h.minX!==Number.MAX_VALUE&&h.maxX!==-Number.MAX_VALUE)if(p.xaxis.convertedCatToNumeric&&!h.dataFormatXNumeric){for(var T=[],B=h.minX-1;B<h.maxX;B++)T.push(B+1);h.xAxisScale={result:T,niceMin:T[0],niceMax:T[T.length-1]}}else h.xAxisScale=this.scales.setXScale(h.minX,h.maxX);else h.xAxisScale=this.scales.linearScale(0,_,_,0,p.xaxis.stepSize),h.noLabelsProvided&&h.labels.length>0&&(h.xAxisScale=this.scales.linearScale(1,h.labels.length,_-1,0,p.xaxis.stepSize),h.seriesX=h.labels.slice());S&&(h.labels=h.xAxisScale.result.slice())}return h.isBarHorizontal&&h.labels.length&&(h.xTickAmount=h.labels.length),this._handleSingleDataPoint(),this._getMinXDiff(),{minX:h.minX,maxX:h.maxX}}},{key:"setZRange",value:function(){var h=this.w.globals;if(h.isDataXYZ){for(var p=0;p<h.series.length;p++)if(h.seriesZ[p]!==void 0)for(var S=0;S<h.seriesZ[p].length;S++)h.seriesZ[p][S]!==null&&O.isNumber(h.seriesZ[p][S])&&(h.maxZ=Math.max(h.maxZ,h.seriesZ[p][S]),h.minZ=Math.min(h.minZ,h.seriesZ[p][S]))}}},{key:"_handleSingleDataPoint",value:function(){var h=this.w.globals,p=this.w.config;if(h.minX===h.maxX){var S=new K(this.ctx);if(p.xaxis.type==="datetime"){var _=S.getDate(h.minX);p.xaxis.labels.datetimeUTC?_.setUTCDate(_.getUTCDate()-2):_.setDate(_.getDate()-2),h.minX=new Date(_).getTime();var k=S.getDate(h.maxX);p.xaxis.labels.datetimeUTC?k.setUTCDate(k.getUTCDate()+2):k.setDate(k.getDate()+2),h.maxX=new Date(k).getTime()}else(p.xaxis.type==="numeric"||p.xaxis.type==="category"&&!h.noLabelsProvided)&&(h.minX=h.minX-2,h.initialMinX=h.minX,h.maxX=h.maxX+2,h.initialMaxX=h.maxX)}}},{key:"_getMinXDiff",value:function(){var h=this.w.globals;h.isXNumeric&&h.seriesX.forEach(function(p,S){p.length===1&&p.push(h.seriesX[h.maxValsInArrayIndex][h.seriesX[h.maxValsInArrayIndex].length-1]);var _=p.slice();_.sort(function(k,T){return k-T}),_.forEach(function(k,T){if(T>0){var B=k-_[T-1];B>0&&(h.minXDiff=Math.min(B,h.minXDiff))}}),h.dataPoints!==1&&h.minXDiff!==Number.MAX_VALUE||(h.minXDiff=.5)})}},{key:"_setStackedMinMax",value:function(){var h=this,p=this.w.globals;if(p.series.length){var S=p.seriesGroups;S.length||(S=[this.w.globals.seriesNames.map(function(T){return T})]);var _={},k={};S.forEach(function(T){_[T]=[],k[T]=[],h.w.config.series.map(function(B,W){return T.indexOf(p.seriesNames[W])>-1?W:null}).filter(function(B){return B!==null}).forEach(function(B){for(var W=0;W<p.series[p.maxValsInArrayIndex].length;W++){var ee,ce,ue,ge;_[T][W]===void 0&&(_[T][W]=0,k[T][W]=0),(h.w.config.chart.stacked&&!p.comboCharts||h.w.config.chart.stacked&&p.comboCharts&&(!h.w.config.chart.stackOnlyBar||((ee=h.w.config.series)===null||ee===void 0||(ce=ee[B])===null||ce===void 0?void 0:ce.type)==="bar"||((ue=h.w.config.series)===null||ue===void 0||(ge=ue[B])===null||ge===void 0?void 0:ge.type)==="column"))&&p.series[B][W]!==null&&O.isNumber(p.series[B][W])&&(p.series[B][W]>0?_[T][W]+=parseFloat(p.series[B][W])+1e-4:k[T][W]+=parseFloat(p.series[B][W]))}})}),Object.entries(_).forEach(function(T){var B=C(T,1)[0];_[B].forEach(function(W,ee){p.maxY=Math.max(p.maxY,_[B][ee]),p.minY=Math.min(p.minY,k[B][ee])})})}}}]),Ee}(),$e=function(){function Ee(h,p){s(this,Ee),this.ctx=h,this.elgrid=p,this.w=h.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(h)}return o(Ee,[{key:"drawYaxis",value:function(h){var p=this.w,S=new z(this.ctx),_=p.config.yaxis[h].labels.style,k=_.fontSize,T=_.fontFamily,B=_.fontWeight,W=S.group({class:"apexcharts-yaxis",rel:h,transform:"translate(".concat(p.globals.translateYAxisX[h],", 0)")});if(this.axesUtils.isYAxisHidden(h))return W;var ee=S.group({class:"apexcharts-yaxis-texts-g"});W.add(ee);var ce=p.globals.yAxisScale[h].result.length-1,ue=p.globals.gridHeight/ce,ge=p.globals.yLabelFormatters[h],Se=this.axesUtils.checkForReversedLabels(h,p.globals.yAxisScale[h].result.slice());if(p.config.yaxis[h].labels.show){var ke=p.globals.translateY+p.config.yaxis[h].labels.offsetY;p.globals.isBarHorizontal?ke=0:p.config.chart.type==="heatmap"&&(ke-=ue/2),ke+=parseInt(k,10)/3;for(var Me=ce;Me>=0;Me--){var qe=ge(Se[Me],Me,p),Fe=p.config.yaxis[h].labels.padding;p.config.yaxis[h].opposite&&p.config.yaxis.length!==0&&(Fe*=-1);var at=this.getTextAnchor(p.config.yaxis[h].labels.align,p.config.yaxis[h].opposite),se=this.axesUtils.getYAxisForeColor(_.colors,h),Ce=Array.isArray(se)?se[Me]:se,Ue=O.listToArray(p.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis[rel='".concat(h,"'] .apexcharts-yaxis-label tspan"))).map(function(_e){return _e.textContent}),Be=S.drawText({x:Fe,y:ke,text:Ue.includes(qe)&&!p.config.yaxis[h].labels.showDuplicates?"":qe,textAnchor:at,fontSize:k,fontFamily:T,fontWeight:B,maxWidth:p.config.yaxis[h].labels.maxWidth,foreColor:Ce,isPlainText:!1,cssClass:"apexcharts-yaxis-label ".concat(_.cssClass)});ee.add(Be),this.addTooltip(Be,qe),p.config.yaxis[h].labels.rotate!==0&&this.rotateLabel(S,Be,firstLabel,p.config.yaxis[h].labels.rotate),ke+=ue}}return this.addYAxisTitle(S,W,h),this.addAxisBorder(S,W,h,ce,ue),W}},{key:"getTextAnchor",value:function(h,p){return h==="left"?"start":h==="center"?"middle":h==="right"?"end":p?"start":"end"}},{key:"addTooltip",value:function(h,p){var S=document.createElementNS(this.w.globals.SVGNS,"title");S.textContent=Array.isArray(p)?p.join(" "):p,h.node.appendChild(S)}},{key:"rotateLabel",value:function(h,p,S,_){var k=h.rotateAroundCenter(S.node),T=h.rotateAroundCenter(p.node);p.node.setAttribute("transform","rotate(".concat(_," ").concat(k.x," ").concat(T.y,")"))}},{key:"addYAxisTitle",value:function(h,p,S){var _=this.w;if(_.config.yaxis[S].title.text!==void 0){var k=h.group({class:"apexcharts-yaxis-title"}),T=_.config.yaxis[S].opposite?_.globals.translateYAxisX[S]:0,B=h.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),p.add(k)}}},{key:"addAxisBorder",value:function(h,p,S,_,k){var T=this.w,B=T.config.yaxis[S].axisBorder,W=31+B.offsetX;if(T.config.yaxis[S].opposite&&(W=-31-B.offsetX),B.show){var ee=h.drawLine(W,T.globals.translateY+B.offsetY-2,W,T.globals.gridHeight+T.globals.translateY+B.offsetY+2,B.color,0,B.width);p.add(ee)}T.config.yaxis[S].axisTicks.show&&this.axesUtils.drawYAxisTicks(W,_,B,T.config.yaxis[S].axisTicks,S,k,p)}},{key:"drawYaxisInversed",value:function(h){var p=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(p.globals.translateXAxisX,", ").concat(p.globals.translateXAxisY,")")});_.add(k);var T=p.globals.yAxisScale[h].result.length-1,B=p.globals.gridWidth/T+.1,W=B+p.config.xaxis.labels.offsetX,ee=p.globals.xLabelFormatter,ce=this.axesUtils.checkForReversedLabels(h,p.globals.yAxisScale[h].result.slice()),ue=p.globals.timescaleLabels;if(ue.length>0&&(this.xaxisLabels=ue.slice(),T=(ce=ue.slice()).length),p.config.xaxis.labels.show)for(var ge=ue.length?0:T;ue.length?ge<ue.length:ge>=0;ue.length?ge++:ge--){var Se=ee(ce[ge],ge,p),ke=p.globals.gridWidth+p.globals.padHorizontal-(W-B+p.config.xaxis.labels.offsetX);if(ue.length){var Me=this.axesUtils.getLabel(ce,ue,ke,ge,this.drawnLabels,this.xaxisFontSize);ke=Me.x,Se=Me.text,this.drawnLabels.push(Me.text),ge===0&&p.globals.skipFirstTimelinelabel&&(Se=""),ge===ce.length-1&&p.globals.skipLastTimelinelabel&&(Se="")}var qe=S.drawText({x:ke,y:this.xAxisoffX+p.config.xaxis.labels.offsetY+30-(p.config.xaxis.position==="top"?p.globals.xAxisHeight+p.config.xaxis.axisTicks.height-2:0),text:Se,textAnchor:"middle",foreColor:Array.isArray(this.xaxisForeColors)?this.xaxisForeColors[h]:this.xaxisForeColors,fontSize:this.xaxisFontSize,fontFamily:this.xaxisFontFamily,fontWeight:p.config.xaxis.labels.style.fontWeight,isPlainText:!1,cssClass:"apexcharts-xaxis-label ".concat(p.config.xaxis.labels.style.cssClass)});k.add(qe),qe.tspan(Se),this.addTooltip(qe,Se),W+=B}return this.inversedYAxisTitleText(_),this.inversedYAxisBorder(_),_}},{key:"inversedYAxisBorder",value:function(h){var p=this.w,S=new z(this.ctx),_=p.config.xaxis.axisBorder;if(_.show){var k=0;p.config.chart.type==="bar"&&p.globals.isXNumeric&&(k-=15);var T=S.drawLine(p.globals.padHorizontal+k+_.offsetX,this.xAxisoffX,p.globals.gridWidth,this.xAxisoffX,_.color,0,_.height);this.elgrid&&this.elgrid.elGridBorders&&p.config.grid.show?this.elgrid.elGridBorders.add(T):h.add(T)}}},{key:"inversedYAxisTitleText",value:function(h){var p=this.w,S=new z(this.ctx);if(p.config.xaxis.title.text!==void 0){var _=S.group({class:"apexcharts-xaxis-title apexcharts-yaxis-title-inversed"}),k=S.drawText({x:p.globals.gridWidth/2+p.config.xaxis.title.offsetX,y:this.xAxisoffX+parseFloat(this.xaxisFontSize)+parseFloat(p.config.xaxis.title.style.fontSize)+p.config.xaxis.title.offsetY+20,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 ".concat(p.config.xaxis.title.style.cssClass)});_.add(k),h.add(_)}}},{key:"yAxisTitleRotate",value:function(h,p){var S=this.w,_=new z(this.ctx),k=S.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(h,"'] .apexcharts-yaxis-texts-g")),T=k?k.getBoundingClientRect():{width:0,height:0},B=S.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(h,"'] .apexcharts-yaxis-title text")),W=B?B.getBoundingClientRect():{width:0,height:0};if(B){var ee=this.xPaddingForYAxisTitle(h,T,W,p);B.setAttribute("x",ee.xPos-(p?10:0));var ce=_.rotateAroundCenter(B);B.setAttribute("transform","rotate(".concat(p?-1*S.config.yaxis[h].title.rotate:S.config.yaxis[h].title.rotate," ").concat(ce.x," ").concat(ce.y,")"))}}},{key:"xPaddingForYAxisTitle",value:function(h,p,S,_){var k=this.w,T=0,B=10;return k.config.yaxis[h].title.text===void 0||h<0?{xPos:T,padd:0}:(_?T=p.width+k.config.yaxis[h].title.offsetX+S.width/2+B/2:(T=-1*p.width+k.config.yaxis[h].title.offsetX+B/2+S.width/2,k.globals.isBarHorizontal&&(B=25,T=-1*p.width-k.config.yaxis[h].title.offsetX-B)),{xPos:T,padd:B})}},{key:"setYAxisXPosition",value:function(h,p){var S=this.w,_=0,k=0,T=18,B=1;S.config.yaxis.length>1&&(this.multipleYs=!0),S.config.yaxis.forEach(function(W,ee){var ce=S.globals.ignoreYAxisIndexes.includes(ee)||!W.show||W.floating||h[ee].width===0,ue=h[ee].width+p[ee].width;W.opposite?S.globals.isBarHorizontal?(k=S.globals.gridWidth+S.globals.translateX-1,S.globals.translateYAxisX[ee]=k-W.labels.offsetX):(k=S.globals.gridWidth+S.globals.translateX+B,ce||(B+=ue+20),S.globals.translateYAxisX[ee]=k-W.labels.offsetX+20):(_=S.globals.translateX-T,ce||(T+=ue+20),S.globals.translateYAxisX[ee]=_+W.labels.offsetX)})}},{key:"setYAxisTextAlignments",value:function(){var h=this.w;O.listToArray(h.globals.dom.baseEl.getElementsByClassName("apexcharts-yaxis")).forEach(function(p,S){var _=h.config.yaxis[S];if(_&&!_.floating&&_.labels.align!==void 0){var k=h.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(S,"'] .apexcharts-yaxis-texts-g")),T=O.listToArray(h.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis[rel='".concat(S,"'] .apexcharts-yaxis-label"))),B=k.getBoundingClientRect();T.forEach(function(W){W.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}(),ht=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w,this.documentEvent=O.bind(this.documentEvent,this)}return o(Ee,[{key:"addEventListener",value:function(h,p){var S=this.w;S.globals.events.hasOwnProperty(h)?S.globals.events[h].push(p):S.globals.events[h]=[p]}},{key:"removeEventListener",value:function(h,p){var S=this.w;if(S.globals.events.hasOwnProperty(h)){var _=S.globals.events[h].indexOf(p);_!==-1&&S.globals.events[h].splice(_,1)}}},{key:"fireEvent",value:function(h,p){var S=this.w;if(S.globals.events.hasOwnProperty(h)){p&&p.length||(p=[]);for(var _=S.globals.events[h],k=_.length,T=0;T<k;T++)_[T].apply(null,p)}}},{key:"setupEventHandlers",value:function(){var h=this,p=this.w,S=this.ctx,_=p.globals.dom.baseEl.querySelector(p.globals.chartClass);this.ctx.eventList.forEach(function(k){_.addEventListener(k,function(T){var B=Object.assign({},p,{seriesIndex:p.globals.axisCharts?p.globals.capturedSeriesIndex:0,dataPointIndex:p.globals.capturedDataPointIndex});T.type==="mousemove"||T.type==="touchmove"?typeof p.config.chart.events.mouseMove=="function"&&p.config.chart.events.mouseMove(T,S,B):T.type==="mouseleave"||T.type==="touchleave"?typeof p.config.chart.events.mouseLeave=="function"&&p.config.chart.events.mouseLeave(T,S,B):(T.type==="mouseup"&&T.which===1||T.type==="touchend")&&(typeof p.config.chart.events.click=="function"&&p.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){p.globals.dom.baseEl.addEventListener(k,h.documentEvent,{passive:!0})}),this.ctx.core.setupBrushHandler()}},{key:"documentEvent",value:function(h){var p=this.w,S=h.target.className;if(h.type==="click"){var _=p.globals.dom.baseEl.querySelector(".apexcharts-menu");_&&_.classList.contains("apexcharts-menu-open")&&S!=="apexcharts-menu-icon"&&_.classList.remove("apexcharts-menu-open")}p.globals.clientX=h.type==="touchmove"?h.touches[0].clientX:h.clientX,p.globals.clientY=h.type==="touchmove"?h.touches[0].clientY:h.clientY}}]),Ee}(),pt=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"setCurrentLocaleValues",value:function(h){var p=this.w.config.chart.locales;window.Apex.chart&&window.Apex.chart.locales&&window.Apex.chart.locales.length>0&&(p=this.w.config.chart.locales.concat(window.Apex.chart.locales));var S=p.filter(function(k){return k.name===h})[0];if(!S)throw new Error("Wrong locale name provided. Please make sure you set the correct locale name in options");var _=O.extend(oe,S);this.w.globals.locale=_.options}}]),Ee}(),Kt=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"drawAxis",value:function(h,p){var S,_,k=this,T=this.w.globals,B=this.w.config,W=new ut(this.ctx,p),ee=new $e(this.ctx,p);T.axisCharts&&h!=="radar"&&(T.isBarHorizontal?(_=ee.drawYaxisInversed(0),S=W.drawXaxisInversed(0),T.dom.elGraphical.add(S),T.dom.elGraphical.add(_)):(S=W.drawXaxis(),T.dom.elGraphical.add(S),B.yaxis.map(function(ce,ue){if(T.ignoreYAxisIndexes.indexOf(ue)===-1&&(_=ee.drawYaxis(ue),T.dom.Paper.add(_),k.w.config.grid.position==="back")){var ge=T.dom.Paper.children()[1];ge.remove(),T.dom.Paper.add(ge)}})))}}]),Ee}(),wt=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"drawXCrosshairs",value:function(){var h=this.w,p=new z(this.ctx),S=new L(this.ctx),_=h.config.xaxis.crosshairs.fill.gradient,k=h.config.xaxis.crosshairs.dropShadow,T=h.config.xaxis.crosshairs.fill.type,B=_.colorFrom,W=_.colorTo,ee=_.opacityFrom,ce=_.opacityTo,ue=_.stops,ge=k.enabled,Se=k.left,ke=k.top,Me=k.blur,qe=k.color,Fe=k.opacity,at=h.config.xaxis.crosshairs.fill.color;if(h.config.xaxis.crosshairs.show){T==="gradient"&&(at=p.drawGradient("vertical",B,W,ee,ce,null,ue,null));var se=p.drawRect();h.config.xaxis.crosshairs.width===1&&(se=p.drawLine());var Ce=h.globals.gridHeight;(!O.isNumber(Ce)||Ce<0)&&(Ce=0);var Ue=h.config.xaxis.crosshairs.width;(!O.isNumber(Ue)||Ue<0)&&(Ue=0),se.attr({class:"apexcharts-xcrosshairs",x:0,y:0,y2:Ce,width:Ue,height:Ce,fill:at,filter:"none","fill-opacity":h.config.xaxis.crosshairs.opacity,stroke:h.config.xaxis.crosshairs.stroke.color,"stroke-width":h.config.xaxis.crosshairs.stroke.width,"stroke-dasharray":h.config.xaxis.crosshairs.stroke.dashArray}),ge&&(se=S.dropShadow(se,{left:Se,top:ke,blur:Me,color:qe,opacity:Fe})),h.globals.dom.elGraphical.add(se)}}},{key:"drawYCrosshairs",value:function(){var h=this.w,p=new z(this.ctx),S=h.config.yaxis[0].crosshairs,_=h.globals.barPadForNumericAxis;if(h.config.yaxis[0].crosshairs.show){var k=p.drawLine(-_,0,h.globals.gridWidth+_,0,S.stroke.color,S.stroke.dashArray,S.stroke.width);k.attr({class:"apexcharts-ycrosshairs"}),h.globals.dom.elGraphical.add(k)}var T=p.drawLine(-_,0,h.globals.gridWidth+_,0,S.stroke.color,0,0);T.attr({class:"apexcharts-ycrosshairs-hidden"}),h.globals.dom.elGraphical.add(T)}}]),Ee}(),nn=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"checkResponsiveConfig",value:function(h){var p=this,S=this.w,_=S.config;if(_.responsive.length!==0){var k=_.responsive.slice();k.sort(function(ee,ce){return ee.breakpoint>ce.breakpoint?1:ce.breakpoint>ee.breakpoint?-1:0}).reverse();var T=new Ne({}),B=function(){var ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ce=k[0].breakpoint,ue=window.innerWidth>0?window.innerWidth:screen.width;if(ue>ce){var ge=O.clone(S.globals.initialConfig);ge.series=O.clone(S.config.series);var Se=X.extendArrayProps(T,ge,S);ee=O.extend(Se,ee),ee=O.extend(S.config,ee),p.overrideResponsiveOptions(ee)}else for(var ke=0;ke<k.length;ke++)ue<k[ke].breakpoint&&(ee=X.extendArrayProps(T,k[ke].options,S),ee=O.extend(S.config,ee),p.overrideResponsiveOptions(ee))};if(h){var W=X.extendArrayProps(T,h,S);W=O.extend(S.config,W),B(W=O.extend(W,h))}else B({})}}},{key:"overrideResponsiveOptions",value:function(h){var p=new Ne(h).init({responsiveOverride:!0});this.w.config=p}}]),Ee}(),cn=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w,this.colors=[],this.isColorFn=!1,this.isHeatmapDistributed=this.checkHeatmapDistributed(),this.isBarDistributed=this.checkBarDistributed()}return o(Ee,[{key:"checkHeatmapDistributed",value:function(){var h=this.w.config,p=h.chart,S=h.plotOptions;return p.type==="treemap"&&S.treemap&&S.treemap.distributed||p.type==="heatmap"&&S.heatmap&&S.heatmap.distributed}},{key:"checkBarDistributed",value:function(){var h=this.w.config,p=h.chart,S=h.plotOptions;return S.bar&&S.bar.distributed&&(p.type==="bar"||p.type==="rangeBar")}},{key:"init",value:function(){this.setDefaultColors()}},{key:"setDefaultColors",value:function(){var h=this.w,p=new O;h.globals.dom.elWrap.classList.add("apexcharts-theme-".concat(h.config.theme.mode));var S=N(h.config.colors||h.config.fill.colors||[]);h.globals.colors=this.getColors(S),this.applySeriesColors(h.globals.seriesColors,h.globals.colors),h.config.theme.monochrome.enabled&&(h.globals.colors=this.getMonochromeColors(h.config.theme.monochrome,h.globals.series,p));var _=h.globals.colors.slice();this.pushExtraColors(h.globals.colors),this.applyColorTypes(["fill","stroke"],_),this.applyDataLabelsColors(_),this.applyRadarPolygonsColors(),this.applyMarkersColors(_)}},{key:"getColors",value:function(h){var p=this,S=this.w;return h&&h.length!==0?Array.isArray(h)&&h.length>0&&typeof h[0]=="function"?(this.isColorFn=!0,S.config.series.map(function(_,k){var T=h[k]||h[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:p.w}):T})):h:this.predefined()}},{key:"applySeriesColors",value:function(h,p){h.forEach(function(S,_){S&&(p[_]=S)})}},{key:"getMonochromeColors",value:function(h,p,S){var _=h.color,k=h.shadeIntensity,T=h.shadeTo,B=this.isBarDistributed||this.isHeatmapDistributed?p[0].length*p.length:p.length,W=1/(B/k),ee=0;return Array.from({length:B},function(){var ce=T==="dark"?S.shadeColor(-1*ee,_):S.shadeColor(ee,_);return ee+=W,ce})}},{key:"applyColorTypes",value:function(h,p){var S=this,_=this.w;h.forEach(function(k){_.globals[k].colors=_.config[k].colors===void 0?S.isColorFn?_.config.colors:p:_.config[k].colors.slice(),S.pushExtraColors(_.globals[k].colors)})}},{key:"applyDataLabelsColors",value:function(h){var p=this.w;p.globals.dataLabels.style.colors=p.config.dataLabels.style.colors===void 0?h:p.config.dataLabels.style.colors.slice(),this.pushExtraColors(p.globals.dataLabels.style.colors,50)}},{key:"applyRadarPolygonsColors",value:function(){var h=this.w;h.globals.radarPolygons.fill.colors=h.config.plotOptions.radar.polygons.fill.colors===void 0?[h.config.theme.mode==="dark"?"#424242":"none"]:h.config.plotOptions.radar.polygons.fill.colors.slice(),this.pushExtraColors(h.globals.radarPolygons.fill.colors,20)}},{key:"applyMarkersColors",value:function(h){var p=this.w;p.globals.markers.colors=p.config.markers.colors===void 0?h:p.config.markers.colors.slice(),this.pushExtraColors(p.globals.markers.colors)}},{key:"pushExtraColors",value:function(h,p){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,_=this.w,k=p||_.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),h.length<k)for(var T=k-h.length,B=0;B<T;B++)h.push(h[B])}},{key:"updateThemeOptions",value:function(h){h.chart=h.chart||{},h.tooltip=h.tooltip||{};var p=h.theme.mode,S=p==="dark"?"palette4":p==="light"?"palette1":h.theme.palette||"palette1",_=p==="dark"?"#f6f7f8":p==="light"?"#373d3f":h.chart.foreColor||"#373d3f";return h.tooltip.theme=p||"light",h.chart.foreColor=_,h.theme.palette=S,h}},{key:"predefined",value:function(){var h={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 h[this.w.config.theme.palette]||h.default}}]),Ee}(),zn=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"draw",value:function(){this.drawTitleSubtitle("title"),this.drawTitleSubtitle("subtitle")}},{key:"drawTitleSubtitle",value:function(h){var p=this.w,S=h==="title"?p.config.title:p.config.subtitle,_=p.globals.svgWidth/2,k=S.offsetY,T="middle";if(S.align==="left"?(_=10,T="start"):S.align==="right"&&(_=p.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(h,"-text")),p.globals.dom.Paper.add(B)}}}]),Ee}(),Xt=function(){function Ee(h){s(this,Ee),this.w=h.w,this.dCtx=h}return o(Ee,[{key:"getTitleSubtitleCoords",value:function(h){var p=this.w,S=0,_=0,k=h==="title"?p.config.title.floating:p.config.subtitle.floating,T=p.globals.dom.baseEl.querySelector(".apexcharts-".concat(h,"-text"));if(T!==null&&!k){var B=T.getBoundingClientRect();S=B.width,_=p.globals.axisCharts?B.height+5:B.height}return{width:S,height:_}}},{key:"getLegendsRect",value:function(){var h=this.w,p=h.globals.dom.elLegendWrap;h.config.legend.height||h.config.legend.position!=="top"&&h.config.legend.position!=="bottom"||(p.style.maxHeight=h.globals.svgHeight/2+"px");var S=Object.assign({},O.getBoundingClientRect(p));return p!==null&&!h.config.legend.floating&&h.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},h.config.legend.position!=="left"&&h.config.legend.position!=="right"||1.5*this.dCtx.lgRect.width>h.globals.svgWidth&&(this.dCtx.lgRect.width=h.globals.svgWidth/1.5),this.dCtx.lgRect}},{key:"getDatalabelsRect",value:function(){var h=this,p=this.w,S=[];p.config.series.forEach(function(W,ee){W.data.forEach(function(ce,ue){var ge;ge=p.globals.series[ee][ue],_=p.config.dataLabels.formatter(ge,{ctx:h.dCtx.ctx,seriesIndex:ee,dataPointIndex:ue,w:p}),S.push(_)})});var _=O.getLargestStringFromArr(S),k=new z(this.dCtx.ctx),T=p.config.dataLabels.style,B=k.getTextRects(_,parseInt(T.fontSize),T.fontFamily);return{width:1.05*B.width,height:B.height}}},{key:"getLargestStringFromMultiArr",value:function(h,p){var S=h;if(this.w.globals.isMultiLineX){var _=p.map(function(T,B){return Array.isArray(T)?T.length:1}),k=Math.max.apply(Math,N(_));S=p[_.indexOf(k)]}return S}}]),Ee}(),on=function(){function Ee(h){s(this,Ee),this.w=h.w,this.dCtx=h}return o(Ee,[{key:"getxAxisLabelsCoords",value:function(){var h,p=this.w,S=p.globals.labels.slice();if(p.config.xaxis.convertedCatToNumeric&&S.length===0&&(S=p.globals.categoryLabels),p.globals.timescaleLabels.length>0){var _=this.getxAxisTimeScaleLabelsCoords();h={width:_.width,height:_.height},p.globals.rotateXLabels=!1}else{this.dCtx.lgWidthForSideLegends=p.config.legend.position!=="left"&&p.config.legend.position!=="right"||p.config.legend.floating?0:this.dCtx.lgRect.width;var k=p.globals.xLabelFormatter,T=O.getLargestStringFromArr(S),B=this.dCtx.dimHelpers.getLargestStringFromMultiArr(T,S);p.globals.isBarHorizontal&&(B=T=p.globals.yAxisScale[0].result.reduce(function(ke,Me){return ke.length>Me.length?ke:Me},0));var W=new re(this.dCtx.ctx),ee=T;T=W.xLabelFormat(k,T,ee,{i:void 0,dateFormatter:new K(this.dCtx.ctx).formatDate,w:p}),B=W.xLabelFormat(k,B,ee,{i:void 0,dateFormatter:new K(this.dCtx.ctx).formatDate,w:p}),(p.config.xaxis.convertedCatToNumeric&&T===void 0||String(T).trim()==="")&&(B=T="1");var ce=new z(this.dCtx.ctx),ue=ce.getTextRects(T,p.config.xaxis.labels.style.fontSize),ge=ue;if(T!==B&&(ge=ce.getTextRects(B,p.config.xaxis.labels.style.fontSize)),(h={width:ue.width>=ge.width?ue.width:ge.width,height:ue.height>=ge.height?ue.height:ge.height}).width*S.length>p.globals.svgWidth-this.dCtx.lgWidthForSideLegends-this.dCtx.yAxisWidth-this.dCtx.gridPad.left-this.dCtx.gridPad.right&&p.config.xaxis.labels.rotate!==0||p.config.xaxis.labels.rotateAlways){if(!p.globals.isBarHorizontal){p.globals.rotateXLabels=!0;var Se=function(ke){return ce.getTextRects(ke,p.config.xaxis.labels.style.fontSize,p.config.xaxis.labels.style.fontFamily,"rotate(".concat(p.config.xaxis.labels.rotate," 0 0)"),!1)};ue=Se(T),T!==B&&(ge=Se(B)),h.height=(ue.height>ge.height?ue.height:ge.height)/1.5,h.width=ue.width>ge.width?ue.width:ge.width}}else p.globals.rotateXLabels=!1}return p.config.xaxis.labels.show||(h={width:0,height:0}),{width:h.width,height:h.height}}},{key:"getxAxisGroupLabelsCoords",value:function(){var h,p=this.w;if(!p.globals.hasXaxisGroups)return{width:0,height:0};var S,_=((h=p.config.xaxis.group.style)===null||h===void 0?void 0:h.fontSize)||p.config.xaxis.labels.style.fontSize,k=p.globals.groups.map(function(ue){return ue.title}),T=O.getLargestStringFromArr(k),B=this.dCtx.dimHelpers.getLargestStringFromMultiArr(T,k),W=new z(this.dCtx.ctx),ee=W.getTextRects(T,_),ce=ee;return T!==B&&(ce=W.getTextRects(B,_)),S={width:ee.width>=ce.width?ee.width:ce.width,height:ee.height>=ce.height?ee.height:ce.height},p.config.xaxis.labels.show||(S={width:0,height:0}),{width:S.width,height:S.height}}},{key:"getxAxisTitleCoords",value:function(){var h=this.w,p=0,S=0;if(h.config.xaxis.title.text!==void 0){var _=new z(this.dCtx.ctx).getTextRects(h.config.xaxis.title.text,h.config.xaxis.title.style.fontSize);p=_.width,S=_.height}return{width:p,height:S}}},{key:"getxAxisTimeScaleLabelsCoords",value:function(){var h,p=this.w;this.dCtx.timescaleLabels=p.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*(h=new z(this.dCtx.ctx).getTextRects(_,p.config.xaxis.labels.style.fontSize)).width*S.length>p.globals.gridWidth&&p.config.xaxis.labels.rotate!==0&&(p.globals.overlappingXLabels=!0),h}},{key:"additionalPaddingXLabels",value:function(h){var p=this,S=this.w,_=S.globals,k=S.config,T=k.xaxis.type,B=h.width;_.skipLastTimelinelabel=!1,_.skipFirstTimelinelabel=!1;var W=S.config.yaxis[0].opposite&&S.globals.isBarHorizontal,ee=function(ce,ue){k.yaxis.length>1&&function(ge){return _.collapsedSeriesIndices.indexOf(ge)!==-1}(ue)||function(ge){if(p.dCtx.timescaleLabels&&p.dCtx.timescaleLabels.length){var Se=p.dCtx.timescaleLabels[0],ke=p.dCtx.timescaleLabels[p.dCtx.timescaleLabels.length-1].position+B/1.75-p.dCtx.yAxisWidthRight,Me=Se.position-B/1.75+p.dCtx.yAxisWidthLeft,qe=S.config.legend.position==="right"&&p.dCtx.lgRect.width>0?p.dCtx.lgRect.width:0;ke>_.svgWidth-_.translateX-qe&&(_.skipLastTimelinelabel=!0),Me<-(ge.show&&!ge.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"?p.dCtx.gridPad.right<B&&!_.rotateXLabels&&(_.skipLastTimelinelabel=!0):T!=="datetime"&&p.dCtx.gridPad.right<B/2-p.dCtx.yAxisWidthRight&&!_.rotateXLabels&&!S.config.xaxis.labels.trim&&(p.dCtx.xPadRight=B/2+1)}(ce)};k.yaxis.forEach(function(ce,ue){W?(p.dCtx.gridPad.left<B&&(p.dCtx.xPadLeft=B/2+1),p.dCtx.xPadRight=B/2+1):ee(ce,ue)})}}]),Ee}(),Zt=function(){function Ee(h){s(this,Ee),this.w=h.w,this.dCtx=h}return o(Ee,[{key:"getyAxisLabelsCoords",value:function(){var h=this,p=this.w,S=[],_=10,k=new he(this.dCtx.ctx);return p.config.yaxis.map(function(T,B){var W={seriesIndex:B,dataPointIndex:-1,w:p},ee=p.globals.yAxisScale[B],ce=0;if(!k.isYAxisHidden(B)&&T.labels.show&&T.labels.minWidth!==void 0&&(ce=T.labels.minWidth),!k.isYAxisHidden(B)&&T.labels.show&&ee.result.length){var ue=p.globals.yLabelFormatters[B],ge=ee.niceMin===Number.MIN_VALUE?0:ee.niceMin,Se=ee.result.reduce(function(Ce,Ue){var Be,_e;return((Be=String(ue(Ce,W)))===null||Be===void 0?void 0:Be.length)>((_e=String(ue(Ue,W)))===null||_e===void 0?void 0:_e.length)?Ce:Ue},ge),ke=Se=ue(Se,W);if(Se!==void 0&&Se.length!==0||(Se=ee.niceMax),p.globals.isBarHorizontal){_=0;var Me=p.globals.labels.slice();Se=O.getLargestStringFromArr(Me),Se=ue(Se,{seriesIndex:B,dataPointIndex:-1,w:p}),ke=h.dCtx.dimHelpers.getLargestStringFromMultiArr(Se,Me)}var qe=new z(h.dCtx.ctx),Fe="rotate(".concat(T.labels.rotate," 0 0)"),at=qe.getTextRects(Se,T.labels.style.fontSize,T.labels.style.fontFamily,Fe,!1),se=at;Se!==ke&&(se=qe.getTextRects(ke,T.labels.style.fontSize,T.labels.style.fontFamily,Fe,!1)),S.push({width:(ce>se.width||ce>at.width?ce:se.width>at.width?se.width:at.width)+_,height:se.height>at.height?se.height:at.height})}else S.push({width:0,height:0})}),S}},{key:"getyAxisTitleCoords",value:function(){var h=this,p=this.w,S=[];return p.config.yaxis.map(function(_,k){if(_.show&&_.title.text!==void 0){var T=new z(h.dCtx.ctx),B="rotate(".concat(_.title.rotate," 0 0)"),W=T.getTextRects(_.title.text,_.title.style.fontSize,_.title.style.fontFamily,B,!1);S.push({width:W.width,height:W.height})}else S.push({width:0,height:0})}),S}},{key:"getTotalYAxisWidth",value:function(){var h=this.w,p=0,S=0,_=0,k=h.globals.yAxisScale.length>1?10:0,T=new he(this.dCtx.ctx),B=function(W,ee){var ce=h.config.yaxis[ee].floating,ue=0;W.width>0&&!ce?(ue=W.width+k,function(ge){return h.globals.ignoreYAxisIndexes.indexOf(ge)>-1}(ee)&&(ue=ue-W.width-k)):ue=ce||T.isYAxisHidden(ee)?0:5,h.config.yaxis[ee].opposite?_+=ue:S+=ue,p+=ue};return h.globals.yLabelsCoords.map(function(W,ee){B(W,ee)}),h.globals.yTitleCoords.map(function(W,ee){B(W,ee)}),h.globals.isBarHorizontal&&!h.config.yaxis[0].floating&&(p=h.globals.yLabelsCoords[0].width+h.globals.yTitleCoords[0].width+15),this.dCtx.yAxisWidthLeft=S,this.dCtx.yAxisWidthRight=_,p}}]),Ee}(),Ye=function(){function Ee(h){s(this,Ee),this.w=h.w,this.dCtx=h}return o(Ee,[{key:"gridPadForColumnsInNumericAxis",value:function(h){var p=this.w,S=p.config,_=p.globals;if(_.noData||_.collapsedSeries.length+_.ancillaryCollapsedSeries.length===S.series.length)return 0;var k=function(Se){return["bar","rangeBar","candlestick","boxPlot"].includes(Se)},T=S.chart.type,B=0,W=k(T)?S.series.length:1;_.comboBarCount>0&&(W=_.comboBarCount),_.collapsedSeries.forEach(function(Se){k(Se.type)&&(W-=1)}),S.chart.stacked&&(W=1);var ee=k(T)||_.comboBarCount>0,ce=Math.abs(_.initialMaxX-_.initialMinX);if(ee&&_.isXNumeric&&!_.isBarHorizontal&&W>0&&ce!==0){ce<=3&&(ce=_.dataPoints);var ue=ce/h,ge=_.minXDiff&&_.minXDiff/ue>0?_.minXDiff/ue:0;ge>h/2&&(ge/=2),(B=ge*parseInt(S.plotOptions.bar.columnWidth,10)/100)<1&&(B=1),_.barPadForNumericAxis=B}return B}},{key:"gridPadFortitleSubtitle",value:function(){var h=this,p=this.w,S=p.globals,_=this.dCtx.isSparkline||!S.axisCharts?0:10;["title","subtitle"].forEach(function(B){p.config[B].text!==void 0?_+=p.config[B].margin:_+=h.dCtx.isSparkline||!S.axisCharts?0:5}),!p.config.legend.show||p.config.legend.position!=="bottom"||p.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(h,p){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-=p[T].width+h[T].width+parseInt(k.labels.style.fontSize,10)/1.2+12),S.globals.translateX<2&&(S.globals.translateX=2))})}}]),Ee}(),Ze=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.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 Xt(this),this.dimYAxis=new Zt(this),this.dimXAxis=new on(this),this.dimGrid=new Ye(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 h=this,p=this.w,S=p.globals;this.lgRect=this.dimHelpers.getLegendsRect(),this.datalabelsCoords={width:0,height:0};var _=Array.isArray(p.config.stroke.width)?Math.max.apply(Math,N(p.config.stroke.width)):p.config.stroke.width;this.isSparkline&&((p.config.markers.discrete.length>0||p.config.markers.size>0)&&Object.entries(this.gridPad).forEach(function(T){var B=C(T,2),W=B[0],ee=B[1];h.gridPad[W]=Math.max(ee,h.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 h=this,p=this.w,S=p.globals,_=this.dimYAxis.getyAxisLabelsCoords(),k=this.dimYAxis.getyAxisTitleCoords();S.isSlopeChart&&(this.datalabelsCoords=this.dimHelpers.getDatalabelsRect()),p.globals.yLabelsCoords=[],p.globals.yTitleCoords=[],p.config.yaxis.map(function(Se,ke){p.globals.yLabelsCoords.push({width:_[ke].width,index:ke}),p.globals.yTitleCoords.push({width:k[ke].width,index:ke})}),this.yAxisWidth=this.dimYAxis.getTotalYAxisWidth();var T=this.dimXAxis.getxAxisLabelsCoords(),B=this.dimXAxis.getxAxisGroupLabelsCoords(),W=this.dimXAxis.getxAxisTitleCoords();this.conditionalChecksForAxisCoords(T,W,B),S.translateXAxisY=p.globals.rotateXLabels?this.xAxisHeight/8:-4,S.translateXAxisX=p.globals.rotateXLabels&&p.globals.isXNumeric&&p.config.xaxis.labels.rotate<=-45?-this.xAxisWidth/4:0,p.globals.isBarHorizontal&&(S.rotateXLabels=!1,S.translateXAxisY=parseInt(p.config.xaxis.labels.style.fontSize,10)/1.5*-1),S.translateXAxisY=S.translateXAxisY+p.config.xaxis.labels.offsetY,S.translateXAxisX=S.translateXAxisX+p.config.xaxis.labels.offsetX;var ee=this.yAxisWidth,ce=this.xAxisHeight;S.xAxisLabelsHeight=this.xAxisHeight-W.height,S.xAxisGroupLabelsHeight=S.xAxisLabelsHeight-T.height,S.xAxisLabelsWidth=this.xAxisWidth,S.xAxisHeight=this.xAxisHeight;var ue=10;(p.config.chart.type==="radar"||this.isSparkline)&&(ee=0,ce=0),this.isSparkline&&(this.lgRect={height:0,width:0}),(this.isSparkline||p.config.chart.type==="treemap")&&(ee=0,ce=0,ue=0),this.isSparkline||p.config.chart.type==="treemap"||this.dimXAxis.additionalPaddingXLabels(T);var ge=function(){S.translateX=ee+h.datalabelsCoords.width,S.gridHeight=S.svgHeight-h.lgRect.height-ce-(h.isSparkline||p.config.chart.type==="treemap"?0:p.globals.rotateXLabels?10:15),S.gridWidth=S.svgWidth-ee-2*h.datalabelsCoords.width};switch(p.config.xaxis.position==="top"&&(ue=S.xAxisHeight-p.config.xaxis.axisTicks.height-5),p.config.legend.position){case"bottom":S.translateY=ue,ge();break;case"top":S.translateY=this.lgRect.height+ue,ge();break;case"left":S.translateY=ue,S.translateX=this.lgRect.width+ee+this.datalabelsCoords.width,S.gridHeight=S.svgHeight-ce-12,S.gridWidth=S.svgWidth-this.lgRect.width-ee-2*this.datalabelsCoords.width;break;case"right":S.translateY=ue,S.translateX=ee+this.datalabelsCoords.width,S.gridHeight=S.svgHeight-ce-12,S.gridWidth=S.svgWidth-this.lgRect.width-ee-2*this.datalabelsCoords.width-5;break;default:throw new Error("Legend position not supported")}this.dimGrid.setGridXPosForDualYAxis(k,_),new $e(this.ctx).setYAxisXPosition(_,k)}},{key:"setDimensionsForNonAxisCharts",value:function(){var h=this.w,p=h.globals,S=h.config,_=0;h.config.legend.show&&!h.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){p.gridHeight=p.svgHeight;var W=p.dom.elWrap.getBoundingClientRect().width;return p.gridWidth=Math.min(W,p.gridHeight),p.translateY=T,void(p.translateX=B+(p.svgWidth-p.gridWidth)/2)}switch(S.legend.position){case"bottom":p.gridHeight=p.svgHeight-this.lgRect.height,p.gridWidth=p.svgWidth,p.translateY=T-10,p.translateX=B+(p.svgWidth-p.gridWidth)/2;break;case"top":p.gridHeight=p.svgHeight-this.lgRect.height,p.gridWidth=p.svgWidth,p.translateY=this.lgRect.height+T+10,p.translateX=B+(p.svgWidth-p.gridWidth)/2;break;case"left":p.gridWidth=p.svgWidth-this.lgRect.width-_,p.gridHeight=S.chart.height!=="auto"?p.svgHeight:p.gridWidth,p.translateY=T,p.translateX=B+this.lgRect.width+_;break;case"right":p.gridWidth=p.svgWidth-this.lgRect.width-_-5,p.gridHeight=S.chart.height!=="auto"?p.svgHeight:p.gridWidth,p.translateY=T,p.translateX=B+10;break;default:throw new Error("Legend position not supported")}}},{key:"conditionalChecksForAxisCoords",value:function(h,p,S){var _=this.w,k=_.globals.hasXaxisGroups?2:1,T=S.height+h.height+p.height,B=_.globals.isMultiLineX?1.2:_.globals.LINE_HEIGHT_RATIO,W=_.globals.rotateXLabels?22:10,ee=_.globals.rotateXLabels&&_.config.legend.position==="bottom"?10:0;this.xAxisHeight=T*B+k*W+ee,this.xAxisWidth=h.width,this.xAxisHeight-p.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 ce=0,ue=0;_.config.yaxis.forEach(function(ge){ce+=ge.labels.minWidth,ue+=ge.labels.maxWidth}),this.yAxisWidth<ce&&(this.yAxisWidth=ce),this.yAxisWidth>ue&&(this.yAxisWidth=ue)}}]),Ee}(),Ft=function(){function Ee(h){s(this,Ee),this.w=h.w,this.lgCtx=h}return o(Ee,[{key:"getLegendStyles",value:function(){var h,p,S,_=document.createElement("style");_.setAttribute("type","text/css");var k=((h=this.lgCtx.ctx)===null||h===void 0||(p=h.opts)===null||p===void 0||(S=p.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 h=this.w.globals.dom.baseEl.querySelector(".apexcharts-legend").getBoundingClientRect(),p=h.width;return{clwh:h.height,clww:p}}},{key:"appendToForeignObject",value:function(){this.w.globals.dom.elLegendForeign.appendChild(this.getLegendStyles())}},{key:"toggleDataSeries",value:function(h,p){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(h,"']")),T=parseInt(k.getAttribute("data:realIndex"),10)):(k=_.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(h+1,"']")),T=parseInt(k.getAttribute("rel"),10)-1),p?[{cs:_.globals.collapsedSeries,csi:_.globals.collapsedSeriesIndices},{cs:_.globals.ancillaryCollapsedSeries,csi:_.globals.ancillaryCollapsedSeriesIndices}].forEach(function(ce){S.riseCollapsedSeries(ce.cs,ce.csi,T)}):this.hideSeries({seriesEl:k,realIndex:T})}else{var B=_.globals.dom.Paper.select(" .apexcharts-series[rel='".concat(h+1,"'] path")),W=_.config.chart.type;if(W==="pie"||W==="polarArea"||W==="donut"){var ee=_.config.plotOptions.pie.donut.labels;new z(this.lgCtx.ctx).pathMouseDown(B.members[0],null),this.lgCtx.ctx.pie.printDataLabelsInner(B.members[0].node,ee)}B.fire("click")}}},{key:"getSeriesAfterCollapsing",value:function(h){var p=h.realIndex,S=this.w,_=S.globals,k=O.clone(S.config.series);if(_.axisCharts){var T=S.config.yaxis[_.seriesYAxisReverseMap[p]],B={index:p,data:k[p].data.slice(),type:k[p].type||S.config.chart.type};if(T&&T.show&&T.showAlways)_.ancillaryCollapsedSeriesIndices.indexOf(p)<0&&(_.ancillaryCollapsedSeries.push(B),_.ancillaryCollapsedSeriesIndices.push(p));else if(_.collapsedSeriesIndices.indexOf(p)<0){_.collapsedSeries.push(B),_.collapsedSeriesIndices.push(p);var W=_.risingSeries.indexOf(p);_.risingSeries.splice(W,1)}}else _.collapsedSeries.push({index:p,data:k[p]}),_.collapsedSeriesIndices.push(p);return _.allSeriesCollapsed=_.collapsedSeries.length+_.ancillaryCollapsedSeries.length===S.config.series.length,this._getSeriesBasedOnCollapsedState(k)}},{key:"hideSeries",value:function(h){for(var p=h.seriesEl,S=h.realIndex,_=this.w,k=this.getSeriesAfterCollapsing({realIndex:S}),T=p.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(h,p,S){var _=this.w,k=O.clone(_.config.series);if(h.length>0){for(var T=0;T<h.length;T++)h[T].index===S&&(_.globals.axisCharts?k[S].data=h[T].data.slice():k[S]=h[T].data,k[S].hidden=!1,h.splice(T,1),p.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(h){var p=this.w,S=0;return p.globals.axisCharts?h.forEach(function(_,k){p.globals.collapsedSeriesIndices.indexOf(k)<0&&p.globals.ancillaryCollapsedSeriesIndices.indexOf(k)<0||(h[k].data=[],S++)}):h.forEach(function(_,k){!p.globals.collapsedSeriesIndices.indexOf(k)<0&&(h[k]=0,S++)}),p.globals.allSeriesCollapsed=S===h.length,h}}]),Ee}(),dn=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.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 h=this.w,p=h.globals,S=h.config,_=S.legend.showForSingleSeries&&p.series.length===1||this.isBarsDistributed||p.series.length>1;if(this.legendHelpers.appendToForeignObject(),(_||!p.axisCharts)&&S.legend.show){for(;p.dom.elLegendWrap.firstChild;)p.dom.elLegendWrap.removeChild(p.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(h){var p=h.i,S=h.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[p]);var W=Array.isArray(_.config.legend.markers.size)?parseFloat(_.config.legend.markers.size[p]):parseFloat(_.config.legend.markers.size),ee=Array.isArray(_.config.legend.markers.offsetX)?parseFloat(_.config.legend.markers.offsetX[p]):parseFloat(_.config.legend.markers.offsetX),ce=Array.isArray(_.config.legend.markers.offsetY)?parseFloat(_.config.legend.markers.offsetY[p]):parseFloat(_.config.legend.markers.offsetY),ue=Array.isArray(_.config.legend.markers.strokeWidth)?parseFloat(_.config.legend.markers.strokeWidth[p]):parseFloat(_.config.legend.markers.strokeWidth),ge=k.style;if(ge.height=2*(W+ue)+"px",ge.width=2*(W+ue)+"px",ge.left=ee+"px",ge.top=ce+"px",_.config.legend.markers.customHTML)ge.background="transparent",ge.color=S[p],Array.isArray(_.config.legend.markers.customHTML)?_.config.legend.markers.customHTML[p]&&(k.innerHTML=_.config.legend.markers.customHTML[p]()):k.innerHTML=_.config.legend.markers.customHTML();else{var Se=new ye(this.ctx).getMarkerConfig({cssClass:"apexcharts-legend-marker apexcharts-marker apexcharts-marker-".concat(B),seriesIndex:p,strokeWidth:ue,size:W}),ke=SVG(k).size("100%","100%"),Me=new z(this.ctx).drawMarker(0,0,v(v({},Se),{},{pointFillColor:Array.isArray(S)?S[p]:Se.pointFillColor,shape:B}));SVG.select(".apexcharts-legend-marker.apexcharts-marker").members.forEach(function(qe){qe.node.classList.contains("apexcharts-marker-triangle")?qe.node.style.transform="translate(50%, 45%)":qe.node.style.transform="translate(50%, 50%)"}),ke.add(Me)}return k}},{key:"drawLegends",value:function(){var h=this,p=this.w,S=p.config.legend.fontFamily,_=p.globals.seriesNames,k=p.config.legend.markers.fillColors?p.config.legend.markers.fillColors.slice():p.globals.colors.slice();if(p.config.chart.type==="heatmap"){var T=p.config.plotOptions.heatmap.colorScale.ranges;_=T.map(function(Ue){return Ue.name?Ue.name:Ue.from+" - "+Ue.to}),k=T.map(function(Ue){return Ue.color})}else this.isBarsDistributed&&(_=p.globals.labels.slice());p.config.legend.customLegendItems.length&&(_=p.config.legend.customLegendItems);for(var B=p.globals.legendFormatter,W=p.config.legend.inverseOrder,ee=W?_.length-1:0;W?ee>=0:ee<=_.length-1;W?ee--:ee++){var ce,ue=B(_[ee],{seriesIndex:ee,w:p}),ge=!1,Se=!1;if(p.globals.collapsedSeries.length>0)for(var ke=0;ke<p.globals.collapsedSeries.length;ke++)p.globals.collapsedSeries[ke].index===ee&&(ge=!0);if(p.globals.ancillaryCollapsedSeriesIndices.length>0)for(var Me=0;Me<p.globals.ancillaryCollapsedSeriesIndices.length;Me++)p.globals.ancillaryCollapsedSeriesIndices[Me]===ee&&(Se=!0);var qe=this.createLegendMarker({i:ee,fillcolor:k});z.setAttrs(qe,{rel:ee+1,"data:collapsed":ge||Se}),(ge||Se)&&qe.classList.add("apexcharts-inactive-legend");var Fe=document.createElement("div"),at=document.createElement("span");at.classList.add("apexcharts-legend-text"),at.innerHTML=Array.isArray(ue)?ue.join(" "):ue;var se=p.config.legend.labels.useSeriesColors?p.globals.colors[ee]:Array.isArray(p.config.legend.labels.colors)?(ce=p.config.legend.labels.colors)===null||ce===void 0?void 0:ce[ee]:p.config.legend.labels.colors;se||(se=p.config.chart.foreColor),at.style.color=se,at.style.fontSize=parseFloat(p.config.legend.fontSize)+"px",at.style.fontWeight=p.config.legend.fontWeight,at.style.fontFamily=S||p.config.chart.fontFamily,z.setAttrs(at,{rel:ee+1,i:ee,"data:default-text":encodeURIComponent(ue),"data:collapsed":ge||Se}),Fe.appendChild(qe),Fe.appendChild(at);var Ce=new X(this.ctx);p.config.legend.showForZeroSeries||Ce.getSeriesTotalByIndex(ee)===0&&Ce.seriesHaveSameValues(ee)&&!Ce.isSeriesNull(ee)&&p.globals.collapsedSeriesIndices.indexOf(ee)===-1&&p.globals.ancillaryCollapsedSeriesIndices.indexOf(ee)===-1&&Fe.classList.add("apexcharts-hidden-zero-series"),p.config.legend.showForNullSeries||Ce.isSeriesNull(ee)&&p.globals.collapsedSeriesIndices.indexOf(ee)===-1&&p.globals.ancillaryCollapsedSeriesIndices.indexOf(ee)===-1&&Fe.classList.add("apexcharts-hidden-null-series"),p.globals.dom.elLegendWrap.appendChild(Fe),p.globals.dom.elLegendWrap.classList.add("apexcharts-align-".concat(p.config.legend.horizontalAlign)),p.globals.dom.elLegendWrap.classList.add("apx-legend-position-"+p.config.legend.position),Fe.classList.add("apexcharts-legend-series"),Fe.style.margin="".concat(p.config.legend.itemMargin.vertical,"px ").concat(p.config.legend.itemMargin.horizontal,"px"),p.globals.dom.elLegendWrap.style.width=p.config.legend.width?p.config.legend.width+"px":"",p.globals.dom.elLegendWrap.style.height=p.config.legend.height?p.config.legend.height+"px":"",z.setAttrs(Fe,{rel:ee+1,seriesName:O.escapeString(_[ee]),"data:collapsed":ge||Se}),(ge||Se)&&Fe.classList.add("apexcharts-inactive-legend"),p.config.legend.onItemClick.toggleDataSeries||Fe.classList.add("apexcharts-no-click")}p.globals.dom.elWrap.addEventListener("click",h.onLegendClick,!0),p.config.legend.onItemHover.highlightDataSeries&&p.config.legend.customLegendItems.length===0&&(p.globals.dom.elWrap.addEventListener("mousemove",h.onLegendHovered,!0),p.globals.dom.elWrap.addEventListener("mouseout",h.onLegendHovered,!0))}},{key:"setLegendWrapXY",value:function(h,p){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 W=new Ze(this.ctx),ee=W.dimHelpers.getTitleSubtitleCoords("title").height,ce=W.dimHelpers.getTitleSubtitleCoords("subtitle").height;B=(ee>0?ee-10:0)+(ce>0?ce-10:0)}_.style.position="absolute",T=T+h+S.config.legend.offsetX,B=B+p+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(ue){_.style[ue]&&(_.style[ue]=parseInt(S.config.legend[ue],10)+"px")})}},{key:"legendAlignHorizontal",value:function(){var h=this.w;h.globals.dom.elLegendWrap.style.right=0;var p=new Ze(this.ctx),S=p.dimHelpers.getTitleSubtitleCoords("title"),_=p.dimHelpers.getTitleSubtitleCoords("subtitle"),k=0;h.config.legend.position==="top"&&(k=S.height+_.height+h.config.title.margin+h.config.subtitle.margin-10),this.setLegendWrapXY(20,k)}},{key:"legendAlignVertical",value:function(){var h=this.w,p=this.legendHelpers.getLegendDimensions(),S=0;h.config.legend.position==="left"&&(S=20),h.config.legend.position==="right"&&(S=h.globals.svgWidth-p.clww-10),this.setLegendWrapXY(S,20)}},{key:"onLegendHovered",value:function(h){var p=this.w,S=h.target.classList.contains("apexcharts-legend-series")||h.target.classList.contains("apexcharts-legend-text")||h.target.classList.contains("apexcharts-legend-marker");if(p.config.chart.type==="heatmap"||this.isBarsDistributed){if(S){var _=parseInt(h.target.getAttribute("rel"),10)-1;this.ctx.events.fireEvent("legendHover",[this.ctx,_,this.w]),new Re(this.ctx).highlightRangeInSeries(h,h.target)}}else!h.target.classList.contains("apexcharts-inactive-legend")&&S&&new Re(this.ctx).toggleSeriesOnHover(h,h.target)}},{key:"onLegendClick",value:function(h){var p=this.w;if(!p.config.legend.customLegendItems.length&&(h.target.classList.contains("apexcharts-legend-series")||h.target.classList.contains("apexcharts-legend-text")||h.target.classList.contains("apexcharts-legend-marker"))){var S=parseInt(h.target.getAttribute("rel"),10)-1,_=h.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"&&h.target.classList.contains("apexcharts-legend-marker")&&(T(this.ctx,S,this.w),this.ctx.events.fireEvent("legendMarkerClick",[this.ctx,S,this.w])),p.config.chart.type!=="treemap"&&p.config.chart.type!=="heatmap"&&!this.isBarsDistributed&&p.config.legend.onItemClick.toggleDataSeries&&this.legendHelpers.toggleDataSeries(S,_)}}}]),Ee}(),Yt=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w;var p=this.w;this.ev=this.w.config.chart.events,this.selectedClass="apexcharts-selected",this.localeValues=this.w.globals.locale.toolbar,this.minX=p.globals.minX,this.maxX=p.globals.maxX}return o(Ee,[{key:"createToolbar",value:function(){var h=this,p=this.w,S=function(){return document.createElement("div")},_=S();if(_.setAttribute("class","apexcharts-toolbar"),_.style.top=p.config.chart.toolbar.offsetY+"px",_.style.right=3-p.config.chart.toolbar.offsetX+"px",p.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=p.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(ue,ge,Se){var ke=ue.toLowerCase();h.t[ke]&&p.config.chart.zoom.enabled&&T.push({el:ge,icon:typeof h.t[ke]=="string"?h.t[ke]:Se,title:h.localeValues[ue],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 W=function(ue){h.t[ue]&&p.config.chart[ue].enabled&&T.push({el:ue==="zoom"?h.elZoom:h.elSelection,icon:typeof h.t[ue]=="string"?h.t[ue]:ue==="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:h.localeValues[ue==="zoom"?"selectionZoom":"selection"],class:p.globals.isTouchDevice?"apexcharts-element-hidden":"apexcharts-".concat(ue,"-icon")})};W("zoom"),W("selection"),this.t.pan&&p.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:p.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 ee=0;ee<this.elCustomIcons.length;ee++)T.push({el:this.elCustomIcons[ee],icon:this.t.customIcons[ee].icon,title:this.t.customIcons[ee].title,index:this.t.customIcons[ee].index,class:"apexcharts-toolbar-custom-icon "+this.t.customIcons[ee].class});T.forEach(function(ue,ge){ue.index&&O.moveIndexInArray(T,ge,ue.index)});for(var ce=0;ce<T.length;ce++)z.setAttrs(T[ce].el,{class:T[ce].class,title:T[ce].title}),T[ce].el.innerHTML=T[ce].icon,_.appendChild(T[ce].el);this._createHamburgerMenu(_),p.globals.zoomEnabled?this.elZoom.classList.add(this.selectedClass):p.globals.panEnabled?this.elPan.classList.add(this.selectedClass):p.globals.selectionEnabled&&this.elSelection.classList.add(this.selectedClass),this.addToolbarEventListeners()}},{key:"_createHamburgerMenu",value:function(h){this.elMenuItems=[],h.appendChild(this.elMenu),z.setAttrs(this.elMenu,{class:"apexcharts-menu"});for(var p=[{name:"exportSVG",title:this.localeValues.exportToSVG},{name:"exportPNG",title:this.localeValues.exportToPNG},{name:"exportCSV",title:this.localeValues.exportToCSV}],S=0;S<p.length;S++)this.elMenuItems.push(document.createElement("div")),this.elMenuItems[S].innerHTML=p[S].title,z.setAttrs(this.elMenuItems[S],{class:"apexcharts-menu-item ".concat(p[S].name),title:p[S].title}),this.elMenu.appendChild(this.elMenuItems[S])}},{key:"addToolbarEventListeners",value:function(){var h=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",h.handleDownload.bind(h,"svg")):S.classList.contains("exportPNG")?S.addEventListener("click",h.handleDownload.bind(h,"png")):S.classList.contains("exportCSV")&&S.addEventListener("click",h.handleDownload.bind(h,"csv"))});for(var p=0;p<this.t.customIcons.length;p++)this.elCustomIcons[p].addEventListener("click",this.t.customIcons[p].click.bind(this,this.ctx,this.ctx.w))}},{key:"toggleZoomSelection",value:function(h){this.ctx.getSyncedCharts().forEach(function(p){p.ctx.toolbar.toggleOtherControls();var S=h==="selection"?p.ctx.toolbar.elSelection:p.ctx.toolbar.elZoom,_=h==="selection"?"selectionEnabled":"zoomEnabled";p.w.globals[_]=!p.w.globals[_],S.classList.contains(p.ctx.toolbar.selectedClass)?S.classList.remove(p.ctx.toolbar.selectedClass):S.classList.add(p.ctx.toolbar.selectedClass)})}},{key:"getToolbarIconsReference",value:function(){var h=this.w;this.elZoom||(this.elZoom=h.globals.dom.baseEl.querySelector(".apexcharts-zoom-icon")),this.elPan||(this.elPan=h.globals.dom.baseEl.querySelector(".apexcharts-pan-icon")),this.elSelection||(this.elSelection=h.globals.dom.baseEl.querySelector(".apexcharts-selection-icon"))}},{key:"enableZoomPanFromToolbar",value:function(h){this.toggleOtherControls(),h==="pan"?this.w.globals.panEnabled=!0:this.w.globals.zoomEnabled=!0;var p=h==="pan"?this.elPan:this.elZoom,S=h==="pan"?this.elZoom:this.elPan;p&&p.classList.add(this.selectedClass),S&&S.classList.remove(this.selectedClass)}},{key:"togglePanning",value:function(){this.ctx.getSyncedCharts().forEach(function(h){h.ctx.toolbar.toggleOtherControls(),h.w.globals.panEnabled=!h.w.globals.panEnabled,h.ctx.toolbar.elPan.classList.contains(h.ctx.toolbar.selectedClass)?h.ctx.toolbar.elPan.classList.remove(h.ctx.toolbar.selectedClass):h.ctx.toolbar.elPan.classList.add(h.ctx.toolbar.selectedClass)})}},{key:"toggleOtherControls",value:function(){var h=this,p=this.w;p.globals.panEnabled=!1,p.globals.zoomEnabled=!1,p.globals.selectionEnabled=!1,this.getToolbarIconsReference(),[this.elPan,this.elSelection,this.elZoom].forEach(function(S){S&&S.classList.remove(h.selectedClass)})}},{key:"handleZoomIn",value:function(){var h=this.w;h.globals.isRangeBar&&(this.minX=h.globals.minY,this.maxX=h.globals.maxY);var p=(this.minX+this.maxX)/2,S=(this.minX+p)/2,_=(this.maxX+p)/2,k=this._getNewMinXMaxX(S,_);h.globals.disableZoomIn||this.zoomUpdateOptions(k.minX,k.maxX)}},{key:"handleZoomOut",value:function(){var h=this.w;if(h.globals.isRangeBar&&(this.minX=h.globals.minY,this.maxX=h.globals.maxY),!(h.config.xaxis.type==="datetime"&&new Date(this.minX).getUTCFullYear()<1e3)){var p=(this.minX+this.maxX)/2,S=this.minX-(p-this.minX),_=this.maxX-(p-this.maxX),k=this._getNewMinXMaxX(S,_);h.globals.disableZoomOut||this.zoomUpdateOptions(k.minX,k.maxX)}}},{key:"_getNewMinXMaxX",value:function(h,p){var S=this.w.config.xaxis.convertedCatToNumeric;return{minX:S?Math.floor(h):h,maxX:S?Math.floor(p):p}}},{key:"zoomUpdateOptions",value:function(h,p){var S=this.w;if(h!==void 0||p!==void 0){if(!(S.config.xaxis.convertedCatToNumeric&&(h<1&&(h=1,p=S.globals.dataPoints),p-h<2))){var _={min:h,max:p},k=this.getBeforeZoomRange(_);k&&(_=k.xaxis);var T={xaxis:_},B=O.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(h,p){typeof this.ev.zoomed=="function"&&this.ev.zoomed(this.ctx,{xaxis:h,yaxis:p})}},{key:"getBeforeZoomRange",value:function(h,p){var S=null;return typeof this.ev.beforeZoom=="function"&&(S=this.ev.beforeZoom(this,{xaxis:h,yaxis:p})),S}},{key:"toggleMenu",value:function(){var h=this;window.setTimeout(function(){h.elMenu.classList.contains("apexcharts-menu-open")?h.elMenu.classList.remove("apexcharts-menu-open"):h.elMenu.classList.add("apexcharts-menu-open")},0)}},{key:"handleDownload",value:function(h){var p=this.w,S=new Ke(this.ctx);switch(h){case"svg":S.exportToSVG(this.ctx);break;case"png":S.exportToPng(this.ctx);break;case"csv":S.exportToCSV({series:p.config.series,columnDelimiter:p.config.chart.toolbar.export.csv.columnDelimiter})}}},{key:"handleZoomReset",value:function(h){this.ctx.getSyncedCharts().forEach(function(p){var S=p.w;if(S.globals.lastXAxis.min=S.globals.initialConfig.xaxis.min,S.globals.lastXAxis.max=S.globals.initialConfig.xaxis.max,p.updateHelpers.revertDefaultAxisMinMax(),typeof S.config.chart.events.beforeResetZoom=="function"){var _=S.config.chart.events.beforeResetZoom(p,S);_&&p.updateHelpers.revertDefaultAxisMinMax(_)}typeof S.config.chart.events.zoomed=="function"&&p.ctx.toolbar.zoomCallback({min:S.config.xaxis.min,max:S.config.xaxis.max}),S.globals.zoomed=!1;var k=p.ctx.series.emptyCollapsedSeries(O.clone(S.globals.initialSeries));p.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}(),Bt=function(Ee){f(p,Yt);var h=c(p);function p(S){var _;return s(this,p),(_=h.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(p,[{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(W){_.hoverArea.addEventListener(W,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,W=k.globals.zoomEnabled?k.config.chart.zoom.type:k.config.chart.selection.type,ee=k.config.chart.toolbar.autoSelected;if(_.shiftKey?(this.shiftWasPressed=!0,B.enableZoomPanFromToolbar(ee==="pan"?"zoom":"pan")):this.shiftWasPressed&&(B.enableZoomPanFromToolbar(ee),this.shiftWasPressed=!1),_.target){var ce,ue=_.target.classList;if(_.target.parentNode&&_.target.parentNode!==null&&(ce=_.target.parentNode.classList),!(ue.contains("apexcharts-selection-rect")||ue.contains("apexcharts-legend-marker")||ue.contains("apexcharts-legend-text")||ce&&ce.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 ge=T.gridRect.getBoundingClientRect();T.startX=T.clientX-ge.left,T.startY=T.clientY-ge.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:W,xyRatios:S})):(T.w.globals.mousedown&&k.globals.zoomEnabled||T.w.globals.mousedown&&k.globals.selectionEnabled)&&(T.selection=T.selectionDrawing({context:T,zoomtype:W}))),_.type==="mouseup"||_.type==="touchend"||_.type==="mouseleave"){var Se,ke=(Se=T.gridRect)===null||Se===void 0?void 0:Se.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:W}),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,W,ee,ce=(S.clientX-T.left)/T.width,ue=this.minX,ge=this.maxX,Se=ge-ue;if(S.deltaY<0){var ke=ue+ce*Se;W=ke-(B=.5*Se)/2,ee=ke+B/2}else W=ue-(B=1.5*Se)/2,ee=ge+B/2;if(!k.globals.isRangeBar){W=Math.max(W,k.globals.initialMinX),ee=Math.min(ee,k.globals.initialMaxX);var Me=.01*(k.globals.initialMaxX-k.globals.initialMinX);if(ee-W<Me){var qe=(W+ee)/2;W=qe-Me/2,ee=qe+Me/2}}var Fe=this._getNewMinXMaxX(W,ee);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,W=S.translateX,ee=W===void 0?0:W,ce=S.translateY,ue=ce===void 0?0:ce,ge=this.w,Se=this.zoomRect,ke=this.selectionRect;if(this.dragged||ge.globals.selection!==null){var Me={transform:"translate("+ee+", "+ue+")"};ge.globals.zoomEnabled&&this.dragged&&(T<0&&(T=1),Se.attr({x:_,y:k,width:T,height:B,fill:ge.config.chart.zoom.zoomedArea.fill.color,"fill-opacity":ge.config.chart.zoom.zoomedArea.fill.opacity,stroke:ge.config.chart.zoom.zoomedArea.stroke.color,"stroke-width":ge.config.chart.zoom.zoomedArea.stroke.width,"stroke-opacity":ge.config.chart.zoom.zoomedArea.stroke.opacity}),z.setAttrs(Se.node,Me)),ge.globals.selectionEnabled&&(ke.attr({x:_,y:k,width:T>0?T:0,height:B>0?B:0,fill:ge.config.chart.selection.fill.color,"fill-opacity":ge.config.chart.selection.fill.opacity,stroke:ge.config.chart.selection.stroke.color,"stroke-width":ge.config.chart.selection.stroke.width,"stroke-dasharray":ge.config.chart.selection.stroke.dashArray,"stroke-opacity":ge.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=_,W=this.gridRect.getBoundingClientRect(),ee=B.startX-1,ce=B.startY,ue=!1,ge=!1,Se=B.clientX-W.left-ee,ke=B.clientY-W.top-ce,Me={};return Math.abs(Se+ee)>T.globals.gridWidth?Se=T.globals.gridWidth-ee:B.clientX-W.left<0&&(Se=ee),ee>B.clientX-W.left&&(ue=!0,Se=Math.abs(Se)),ce>B.clientY-W.top&&(ge=!0,ke=Math.abs(ke)),Me=k==="x"?{x:ue?ee-Se:ee,y:0,width:Se,height:T.globals.gridHeight}:k==="y"?{x:0,y:ge?ce-ke:ce,width:T.globals.gridWidth,height:ke}:{x:ue?ee-Se:ee,y:ge?ce-ke:ce,width:Se,height:ke},B.drawSelectionRect(Me),B.selectionDragging("resizing"),Me}},{key:"selectionDragging",value:function(S,_){var k=this,T=this.w,B=this.xyRatios,W=this.selectionRect,ee=0;S==="resizing"&&(ee=30);var ce=function(ge){return parseFloat(W.node.getAttribute(ge))},ue={x:ce("x"),y:ce("y"),width:ce("width"),height:ce("height")};T.globals.selection=ue,typeof T.config.chart.events.selection=="function"&&T.globals.selectionEnabled&&(clearTimeout(this.w.globals.selectionResizeTimer),this.w.globals.selectionResizeTimer=window.setTimeout(function(){var ge,Se,ke,Me,qe=k.gridRect.getBoundingClientRect(),Fe=W.node.getBoundingClientRect();T.globals.isRangeBar?(ge=T.globals.yAxisScale[0].niceMin+(Fe.left-qe.left)*B.invertedYRatio,Se=T.globals.yAxisScale[0].niceMin+(Fe.right-qe.left)*B.invertedYRatio,ke=0,Me=1):(ge=T.globals.xAxisScale.niceMin+(Fe.left-qe.left)*B.xRatio,Se=T.globals.xAxisScale.niceMin+(Fe.right-qe.left)*B.xRatio,ke=T.globals.yAxisScale[0].niceMin+(qe.bottom-Fe.bottom)*B.yRatio[0],Me=T.globals.yAxisScale[0].niceMax-(Fe.top-qe.top)*B.yRatio[0]);var at={xaxis:{min:ge,max:Se},yaxis:{min:ke,max:Me}};T.config.chart.events.selection(k.ctx,at),T.config.chart.brush.enabled&&T.config.chart.events.brushScrolled!==void 0&&T.config.chart.events.brushScrolled(k.ctx,at)},ee))}},{key:"selectionDrawn",value:function(S){var _=S.context,k=S.zoomtype,T=this.w,B=_,W=this.xyRatios,ee=this.ctx.toolbar;if(B.startX>B.endX){var ce=B.startX;B.startX=B.endX,B.endX=ce}if(B.startY>B.endY){var ue=B.startY;B.startY=B.endY,B.endY=ue}var ge=void 0,Se=void 0;T.globals.isRangeBar?(ge=T.globals.yAxisScale[0].niceMin+B.startX*W.invertedYRatio,Se=T.globals.yAxisScale[0].niceMin+B.endX*W.invertedYRatio):(ge=T.globals.xAxisScale.niceMin+B.startX*W.xRatio,Se=T.globals.xAxisScale.niceMin+B.endX*W.xRatio);var ke=[],Me=[];if(T.config.yaxis.forEach(function(Be,_e){var rt=T.globals.seriesYAxisMap[_e][0];ke.push(T.globals.yAxisScale[_e].niceMax-W.yRatio[rt]*B.startY),Me.push(T.globals.yAxisScale[_e].niceMax-W.yRatio[rt]*B.endY)}),B.dragged&&(B.dragX>10||B.dragY>10)&&ge!==Se){if(T.globals.zoomEnabled){var qe=O.clone(T.globals.initialConfig.yaxis),Fe=O.clone(T.globals.initialConfig.xaxis);if(T.globals.zoomed=!0,T.config.xaxis.convertedCatToNumeric&&(ge=Math.floor(ge),Se=Math.floor(Se),ge<1&&(ge=1,Se=T.globals.dataPoints),Se-ge<2&&(Se=ge+1)),k!=="xy"&&k!=="x"||(Fe={min:ge,max:Se}),k!=="xy"&&k!=="y"||qe.forEach(function(Be,_e){qe[_e].min=Me[_e],qe[_e].max=ke[_e]}),ee){var at=ee.getBeforeZoomRange(Fe,qe);at&&(Fe=at.xaxis?at.xaxis:Fe,qe=at.yaxis?at.yaxis:qe)}var se={xaxis:Fe};T.config.chart.group||(se.yaxis=qe),B.ctx.updateHelpers._updateOptions(se,!1,B.w.config.chart.animations.dynamicAnimation.enabled),typeof T.config.chart.events.zoomed=="function"&&ee.zoomCallback(Fe,qe)}else if(T.globals.selectionEnabled){var Ce,Ue=null;Ce={min:ge,max:Se},k!=="xy"&&k!=="y"||(Ue=O.clone(T.config.yaxis)).forEach(function(Be,_e){Ue[_e].min=Me[_e],Ue[_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:Ue})}}}},{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,W=k.globals.lastClientPosition.y-T.clientY;Math.abs(B)>Math.abs(W)&&B>0?this.moveDirection="left":Math.abs(B)>Math.abs(W)&&B<0?this.moveDirection="right":Math.abs(W)>Math.abs(B)&&W>0?this.moveDirection="up":Math.abs(W)>Math.abs(B)&&W<0&&(this.moveDirection="down")}k.globals.lastClientPosition={x:T.clientX,y:T.clientY};var ee=k.globals.isRangeBar?k.globals.minY:k.globals.minX,ce=k.globals.isRangeBar?k.globals.maxY:k.globals.maxX;k.config.xaxis.convertedCatToNumeric||T.panScrolled(ee,ce)}},{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=O.clone(k.globals.initialConfig.yaxis),W=T.xRatio,ee=k.globals.minX,ce=k.globals.maxX;k.globals.isRangeBar&&(W=T.invertedYRatio,ee=k.globals.minY,ce=k.globals.maxY),this.moveDirection==="left"?(S=ee+k.globals.gridWidth/15*W,_=ce+k.globals.gridWidth/15*W):this.moveDirection==="right"&&(S=ee-k.globals.gridWidth/15*W,_=ce-k.globals.gridWidth/15*W),k.globals.isRangeBar||(S<k.globals.initialMinX||_>k.globals.initialMaxX)&&(S=ee,_=ce);var ue={xaxis:{min:S,max:_}};k.config.chart.group||(ue.yaxis=B),this.updateScrolledChart(ue,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}})}}]),p}(),ot=function(){function Ee(h){s(this,Ee),this.w=h.w,this.ttCtx=h,this.ctx=h.ctx}return o(Ee,[{key:"getNearestValues",value:function(h){var p=h.hoverArea,S=h.elGrid,_=h.clientX,k=h.clientY,T=this.w,B=S.getBoundingClientRect(),W=B.width,ee=B.height,ce=W/(T.globals.dataPoints-1),ue=ee/T.globals.dataPoints,ge=this.hasBars();!T.globals.comboCharts&&!ge||T.config.xaxis.convertedCatToNumeric||(ce=W/T.globals.dataPoints);var Se=_-B.left-T.globals.barPadForNumericAxis,ke=k-B.top;Se<0||ke<0||Se>W||ke>ee?(p.classList.remove("hovering-zoom"),p.classList.remove("hovering-pan")):T.globals.zoomEnabled?(p.classList.remove("hovering-pan"),p.classList.add("hovering-zoom")):T.globals.panEnabled&&(p.classList.remove("hovering-zoom"),p.classList.add("hovering-pan"));var Me=Math.round(Se/ce),qe=Math.floor(ke/ue);ge&&!T.config.xaxis.convertedCatToNumeric&&(Me=Math.ceil(Se/ce),Me-=1);var Fe=null,at=null,se=T.globals.seriesXvalues.map(function(rt){return rt.filter(function(ct){return O.isNumber(ct)})}),Ce=T.globals.seriesYvalues.map(function(rt){return rt.filter(function(ct){return O.isNumber(ct)})});if(T.globals.isXNumeric){var Ue=this.ttCtx.getElGrid().getBoundingClientRect(),Be=Se*(Ue.width/W),_e=ke*(Ue.height/ee);Fe=(at=this.closestInMultiArray(Be,_e,se,Ce)).index,Me=at.j,Fe!==null&&(se=T.globals.seriesXvalues[Fe],Me=(at=this.closestInArray(Be,se)).index)}return T.globals.capturedSeriesIndex=Fe===null?-1:Fe,(!Me||Me<1)&&(Me=0),T.globals.isBarHorizontal?T.globals.capturedDataPointIndex=qe:T.globals.capturedDataPointIndex=Me,{capturedSeries:Fe,j:T.globals.isBarHorizontal?qe:Me,hoverX:Se,hoverY:ke}}},{key:"closestInMultiArray",value:function(h,p,S,_){var k=this.w,T=0,B=null,W=-1;k.globals.series.length>1?T=this.getFirstActiveXArray(S):B=0;var ee=S[T][0],ce=Math.abs(h-ee);if(S.forEach(function(Se){Se.forEach(function(ke,Me){var qe=Math.abs(h-ke);qe<=ce&&(ce=qe,W=Me)})}),W!==-1){var ue=_[T][W],ge=Math.abs(p-ue);B=T,_.forEach(function(Se,ke){var Me=Math.abs(p-Se[W]);Me<=ge&&(ge=Me,B=ke)})}return{index:B,j:W}}},{key:"getFirstActiveXArray",value:function(h){for(var p=this.w,S=0,_=h.map(function(T,B){return T.length>0?B:-1}),k=0;k<_.length;k++)if(_[k]!==-1&&p.globals.collapsedSeriesIndices.indexOf(k)===-1&&p.globals.ancillaryCollapsedSeriesIndices.indexOf(k)===-1){S=_[k];break}return S}},{key:"closestInArray",value:function(h,p){for(var S=p[0],_=null,k=Math.abs(h-S),T=0;T<p.length;T++){var B=Math.abs(h-p[T]);B<k&&(k=B,_=T)}return{index:_}}},{key:"isXoverlap",value:function(h){var p=[],S=this.w.globals.seriesX.filter(function(k){return k[0]!==void 0});if(S.length>0)for(var _=0;_<S.length-1;_++)S[_][h]!==void 0&&S[_+1][h]!==void 0&&S[_][h]!==S[_+1][h]&&p.push("unEqual");return p.length===0}},{key:"isInitialSeriesSameLen",value:function(){for(var h=!0,p=this.w.globals.initialSeries,S=0;S<p.length-1;S++)if(p[S].data.length!==p[S+1].data.length){h=!1;break}return h}},{key:"getBarsHeight",value:function(h){return N(h).reduce(function(p,S){return p+S.getBBox().height},0)}},{key:"getElMarkers",value:function(h){return typeof h=="number"?this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series[data\\:realIndex='".concat(h,"'] .apexcharts-series-markers-wrap > *")):this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series-markers-wrap > *")}},{key:"getAllMarkers",value:function(){var h=this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series-markers-wrap");(h=N(h)).sort(function(S,_){var k=Number(S.getAttribute("data:realIndex")),T=Number(_.getAttribute("data:realIndex"));return T<k?1:T>k?-1:0});var p=[];return h.forEach(function(S){p.push(S.querySelector(".apexcharts-marker"))}),p}},{key:"hasMarkers",value:function(h){return this.getElMarkers(h).length>0}},{key:"getPathFromPoint",value:function(h,p){var S=Number(h.getAttribute("cx")),_=Number(h.getAttribute("cy")),k=h.getAttribute("shape");return new z(this.ctx).getMarkerPath(S,_,k,p)}},{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(h){var p=this.w,S=p.config.markers.hover.size;return S===void 0&&(S=p.globals.markers.size[h]+p.config.markers.hover.sizeOffset),S}},{key:"toggleAllTooltipSeriesGroups",value:function(h){var p=this.w,S=this.ttCtx;S.allTooltipSeriesGroups.length===0&&(S.allTooltipSeriesGroups=p.globals.dom.baseEl.querySelectorAll(".apexcharts-tooltip-series-group"));for(var _=S.allTooltipSeriesGroups,k=0;k<_.length;k++)h==="enable"?(_[k].classList.add("apexcharts-active"),_[k].style.display=p.config.tooltip.items.display):(_[k].classList.remove("apexcharts-active"),_[k].style.display="none")}}]),Ee}(),De=function(){function Ee(h){s(this,Ee),this.w=h.w,this.ctx=h.ctx,this.ttCtx=h,this.tooltipUtil=new ot(h)}return o(Ee,[{key:"drawSeriesTexts",value:function(h){var p=h.shared,S=p===void 0||p,_=h.ttItems,k=h.i,T=k===void 0?0:k,B=h.j,W=B===void 0?null:B,ee=h.y1,ce=h.y2,ue=h.e,ge=this.w;ge.config.tooltip.custom!==void 0?this.handleCustomTooltip({i:T,j:W,y1:ee,y2:ce,w:ge}):this.toggleActiveInactiveSeries(S,T);var Se=this.getValuesToPrint({i:T,j:W});this.printLabels({i:T,j:W,values:Se,ttItems:_,shared:S,e:ue});var ke=this.ttCtx.getElTooltip();this.ttCtx.tooltipRect.ttWidth=ke.getBoundingClientRect().width,this.ttCtx.tooltipRect.ttHeight=ke.getBoundingClientRect().height}},{key:"printLabels",value:function(h){var p,S=this,_=h.i,k=h.j,T=h.values,B=h.ttItems,W=h.shared,ee=h.e,ce=this.w,ue=[],ge=function(Ue){return ce.globals.seriesGoals[Ue]&&ce.globals.seriesGoals[Ue][k]&&Array.isArray(ce.globals.seriesGoals[Ue][k])},Se=T.xVal,ke=T.zVal,Me=T.xAxisTTVal,qe="",Fe=ce.globals.colors[_];k!==null&&ce.config.plotOptions.bar.distributed&&(Fe=ce.globals.colors[k]);for(var at=function(Ue,Be){var _e=S.getFormatters(_);qe=S.getSeriesName({fn:_e.yLbTitleFormatter,index:_,seriesIndex:_,j:k}),ce.config.chart.type==="treemap"&&(qe=_e.yLbTitleFormatter(String(ce.config.series[_].data[k].x),{series:ce.globals.series,seriesIndex:_,dataPointIndex:k,w:ce}));var rt=ce.config.tooltip.inverseOrder?Be:Ue;if(ce.globals.axisCharts){var ct=function(ft){var Tt,Ge,At,Ot;return ce.globals.isRangeData?_e.yLbFormatter((Tt=ce.globals.seriesRangeStart)===null||Tt===void 0||(Ge=Tt[ft])===null||Ge===void 0?void 0:Ge[k],{series:ce.globals.seriesRangeStart,seriesIndex:ft,dataPointIndex:k,w:ce})+" - "+_e.yLbFormatter((At=ce.globals.seriesRangeEnd)===null||At===void 0||(Ot=At[ft])===null||Ot===void 0?void 0:Ot[k],{series:ce.globals.seriesRangeEnd,seriesIndex:ft,dataPointIndex:k,w:ce}):_e.yLbFormatter(ce.globals.series[ft][k],{series:ce.globals.series,seriesIndex:ft,dataPointIndex:k,w:ce})};if(W)_e=S.getFormatters(rt),qe=S.getSeriesName({fn:_e.yLbTitleFormatter,index:rt,seriesIndex:_,j:k}),Fe=ce.globals.colors[rt],p=ct(rt),ge(rt)&&(ue=ce.globals.seriesGoals[rt][k].map(function(ft){return{attrs:ft,val:_e.yLbFormatter(ft.value,{seriesIndex:rt,dataPointIndex:k,w:ce})}}));else{var yt,Lt=ee==null||(yt=ee.target)===null||yt===void 0?void 0:yt.getAttribute("fill");Lt&&(Lt.indexOf("url")!==-1?Lt.indexOf("Pattern")!==-1&&(Fe=ce.globals.dom.baseEl.querySelector(Lt.substr(4).slice(0,-1)).childNodes[0].getAttribute("stroke")):Fe=Lt),p=ct(_),ge(_)&&Array.isArray(ce.globals.seriesGoals[_][k])&&(ue=ce.globals.seriesGoals[_][k].map(function(ft){return{attrs:ft,val:_e.yLbFormatter(ft.value,{seriesIndex:_,dataPointIndex:k,w:ce})}}))}}k===null&&(p=_e.yLbFormatter(ce.globals.series[_],v(v({},ce),{},{seriesIndex:_,dataPointIndex:_}))),S.DOMHandling({i:_,t:rt,j:k,ttItems:B,values:{val:p,goalVals:ue,xVal:Se,xAxisTTVal:Me,zVal:ke},seriesName:qe,shared:W,pColor:Fe})},se=0,Ce=ce.globals.series.length-1;se<ce.globals.series.length;se++,Ce--)at(se,Ce)}},{key:"getFormatters",value:function(h){var p,S=this.w,_=S.globals.yLabelFormatters[h];return S.globals.ttVal!==void 0?Array.isArray(S.globals.ttVal)?(_=S.globals.ttVal[h]&&S.globals.ttVal[h].formatter,p=S.globals.ttVal[h]&&S.globals.ttVal[h].title&&S.globals.ttVal[h].title.formatter):(_=S.globals.ttVal.formatter,typeof S.globals.ttVal.title.formatter=="function"&&(p=S.globals.ttVal.title.formatter)):p=S.config.tooltip.y.title.formatter,typeof _!="function"&&(_=S.globals.yLabelFormatters[0]?S.globals.yLabelFormatters[0]:function(k){return k}),typeof p!="function"&&(p=function(k){return k}),{yLbFormatter:_,yLbTitleFormatter:p}}},{key:"getSeriesName",value:function(h){var p=h.fn,S=h.index,_=h.seriesIndex,k=h.j,T=this.w;return p(String(T.globals.seriesNames[S]),{series:T.globals.series,seriesIndex:_,dataPointIndex:k,w:T})}},{key:"DOMHandling",value:function(h){h.i;var p=h.t,S=h.j,_=h.ttItems,k=h.values,T=h.seriesName,B=h.shared,W=h.pColor,ee=this.w,ce=this.ttCtx,ue=k.val,ge=k.goalVals,Se=k.xVal,ke=k.xAxisTTVal,Me=k.zVal,qe=null;qe=_[p].children,ee.config.tooltip.fillSeriesColor&&(_[p].style.backgroundColor=W,qe[0].style.display="none"),ce.showTooltipTitle&&(ce.tooltipTitle===null&&(ce.tooltipTitle=ee.globals.dom.baseEl.querySelector(".apexcharts-tooltip-title")),ce.tooltipTitle.innerHTML=Se),ce.isXAxisTooltipEnabled&&(ce.xaxisTooltipText.innerHTML=ke!==""?ke:Se);var Fe=_[p].querySelector(".apexcharts-tooltip-text-y-label");Fe&&(Fe.innerHTML=T||"");var at=_[p].querySelector(".apexcharts-tooltip-text-y-value");at&&(at.innerHTML=ue!==void 0?ue:""),qe[0]&&qe[0].classList.contains("apexcharts-tooltip-marker")&&(ee.config.tooltip.marker.fillColors&&Array.isArray(ee.config.tooltip.marker.fillColors)&&(W=ee.config.tooltip.marker.fillColors[p]),qe[0].style.backgroundColor=W),ee.config.tooltip.marker.show||(qe[0].style.display="none");var se=_[p].querySelector(".apexcharts-tooltip-text-goals-label"),Ce=_[p].querySelector(".apexcharts-tooltip-text-goals-value");if(ge.length&&ee.globals.seriesGoals[p]){var Ue=function(){var rt="<div >",ct="<div>";ge.forEach(function(yt,Lt){rt+=' <div style="display: flex"><span class="apexcharts-tooltip-marker" style="background-color: '.concat(yt.attrs.strokeColor,'; height: 3px; border-radius: 0; top: 5px;"></span> ').concat(yt.attrs.name,"</div>"),ct+="<div>".concat(yt.val,"</div>")}),se.innerHTML=rt+"</div>",Ce.innerHTML=ct+"</div>"};B?ee.globals.seriesGoals[p][S]&&Array.isArray(ee.globals.seriesGoals[p][S])?Ue():(se.innerHTML="",Ce.innerHTML=""):Ue()}else se.innerHTML="",Ce.innerHTML="";if(Me!==null&&(_[p].querySelector(".apexcharts-tooltip-text-z-label").innerHTML=ee.config.tooltip.z.title,_[p].querySelector(".apexcharts-tooltip-text-z-value").innerHTML=Me!==void 0?Me:""),B&&qe[0]){if(ee.config.tooltip.hideEmptySeries){var Be=_[p].querySelector(".apexcharts-tooltip-marker"),_e=_[p].querySelector(".apexcharts-tooltip-text");parseFloat(ue)==0?(Be.style.display="none",_e.style.display="none"):(Be.style.display="block",_e.style.display="block")}ue==null||ee.globals.ancillaryCollapsedSeriesIndices.indexOf(p)>-1||ee.globals.collapsedSeriesIndices.indexOf(p)>-1||Array.isArray(ce.tConfig.enabledOnSeries)&&ce.tConfig.enabledOnSeries.indexOf(p)===-1?qe[0].parentNode.style.display="none":qe[0].parentNode.style.display=ee.config.tooltip.items.display}else Array.isArray(ce.tConfig.enabledOnSeries)&&ce.tConfig.enabledOnSeries.indexOf(p)===-1&&(qe[0].parentNode.style.display="none")}},{key:"toggleActiveInactiveSeries",value:function(h,p){var S=this.w;if(h)this.tooltipUtil.toggleAllTooltipSeriesGroups("enable");else{this.tooltipUtil.toggleAllTooltipSeriesGroups("disable");var _=S.globals.dom.baseEl.querySelector(".apexcharts-tooltip-series-group-".concat(p));_&&(_.classList.add("apexcharts-active"),_.style.display=S.config.tooltip.items.display)}}},{key:"getValuesToPrint",value:function(h){var p=h.i,S=h.j,_=this.w,k=this.ctx.series.filteredSeriesX(),T="",B="",W=null,ee=null,ce={series:_.globals.series,seriesIndex:p,dataPointIndex:S,w:_},ue=_.globals.ttZFormatter;S===null?ee=_.globals.series[p]:_.globals.isXNumeric&&_.config.chart.type!=="treemap"?(T=k[p][S],k[p].length===0&&(T=k[this.tooltipUtil.getFirstActiveXArray(k)][S])):T=new Xe(this.ctx).isFormatXY()?_.config.series[p].data[S]!==void 0?_.config.series[p].data[S].x:"":_.globals.labels[S]!==void 0?_.globals.labels[S]:"";var ge=T;return _.globals.isXNumeric&&_.config.xaxis.type==="datetime"?T=new re(this.ctx).xLabelFormat(_.globals.ttKeyFormatter,ge,ge,{i:void 0,dateFormatter:new K(this.ctx).formatDate,w:this.w}):T=_.globals.isBarHorizontal?_.globals.yLabelFormatters[0](ge,ce):_.globals.xLabelFormatter(ge,ce),_.config.tooltip.x.formatter!==void 0&&(T=_.globals.ttKeyFormatter(ge,ce)),_.globals.seriesZ.length>0&&_.globals.seriesZ[p].length>0&&(W=ue(_.globals.seriesZ[p][S],_)),B=typeof _.config.xaxis.tooltip.formatter=="function"?_.globals.xaxisTooltipFormatter(ge,ce):T,{val:Array.isArray(ee)?ee.join(" "):ee,xVal:Array.isArray(T)?T.join(" "):T,xAxisTTVal:Array.isArray(B)?B.join(" "):B,zVal:W}}},{key:"handleCustomTooltip",value:function(h){var p=h.i,S=h.j,_=h.y1,k=h.y2,T=h.w,B=this.ttCtx.getElTooltip(),W=T.config.tooltip.custom;Array.isArray(W)&&W[p]&&(W=W[p]),B.innerHTML=W({ctx:this.ctx,series:T.globals.series,seriesIndex:p,dataPointIndex:S,y1:_,y2:k,w:T})}}]),Ee}(),_t=function(){function Ee(h){s(this,Ee),this.ttCtx=h,this.ctx=h.ctx,this.w=h.w}return o(Ee,[{key:"moveXCrosshairs",value:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,S=this.ttCtx,_=this.w,k=S.getElXCrosshairs(),T=h-S.xcrosshairsWidth/2,B=_.globals.labels.slice().length;if(p!==null&&(T=_.globals.gridWidth/B*p),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 W=T;_.config.xaxis.crosshairs.width!=="tickWidth"&&_.config.xaxis.crosshairs.width!=="barWidth"||(W=T+S.xcrosshairsWidth/2),this.moveXAxisTooltip(W)}}},{key:"moveYCrosshairs",value:function(h){var p=this.ttCtx;p.ycrosshairs!==null&&z.setAttrs(p.ycrosshairs,{y1:h,y2:h}),p.ycrosshairsHidden!==null&&z.setAttrs(p.ycrosshairsHidden,{y1:h,y2:h})}},{key:"moveXAxisTooltip",value:function(h){var p=this.w,S=this.ttCtx;if(S.xaxisTooltip!==null&&S.xcrosshairsWidth!==0){S.xaxisTooltip.classList.add("apexcharts-active");var _=S.xaxisOffY+p.config.xaxis.tooltip.offsetY+p.globals.translateY+1+p.config.xaxis.offsetY;if(h-=S.xaxisTooltip.getBoundingClientRect().width/2,!isNaN(h)){h+=p.globals.translateX;var k;k=new z(this.ctx).getTextRects(S.xaxisTooltipText.innerHTML),S.xaxisTooltipText.style.minWidth=k.width+"px",S.xaxisTooltip.style.left=h+"px",S.xaxisTooltip.style.top=_+"px"}}}},{key:"moveYAxisTooltip",value:function(h){var p=this.w,S=this.ttCtx;S.yaxisTTEls===null&&(S.yaxisTTEls=p.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip"));var _=parseInt(S.ycrosshairsHidden.getAttribute("y1"),10),k=p.globals.translateY+_,T=S.yaxisTTEls[h].getBoundingClientRect().height,B=p.globals.translateYAxisX[h]-2;p.config.yaxis[h].opposite&&(B-=26),k-=T/2,p.globals.ignoreYAxisIndexes.indexOf(h)===-1?(S.yaxisTTEls[h].classList.add("apexcharts-active"),S.yaxisTTEls[h].style.top=k+"px",S.yaxisTTEls[h].style.left=B+p.config.yaxis[h].tooltip.offsetX+"px"):S.yaxisTTEls[h].classList.remove("apexcharts-active")}},{key:"moveTooltip",value:function(h,p){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,_=this.w,k=this.ttCtx,T=k.getElTooltip(),B=k.tooltipRect,W=S!==null?parseFloat(S):1,ee=parseFloat(h)+W+5,ce=parseFloat(p)+W/2;if(ee>_.globals.gridWidth/2&&(ee=ee-B.ttWidth-W-10),ee>_.globals.gridWidth-B.ttWidth-10&&(ee=_.globals.gridWidth-B.ttWidth),ee<-20&&(ee=-20),_.config.tooltip.followCursor){var ue=k.getElGrid().getBoundingClientRect();(ee=k.e.clientX-ue.left)>_.globals.gridWidth/2&&(ee-=k.tooltipRect.ttWidth),(ce=k.e.clientY+_.globals.translateY-ue.top)>_.globals.gridHeight/2&&(ce-=k.tooltipRect.ttHeight)}else _.globals.isBarHorizontal||B.ttHeight/2+ce>_.globals.gridHeight&&(ce=_.globals.gridHeight-B.ttHeight+_.globals.translateY);isNaN(ee)||(ee+=_.globals.translateX,T.style.left=ee+"px",T.style.top=ce+"px")}},{key:"moveMarkers",value:function(h,p){var S=this.w,_=this.ttCtx;if(S.globals.markers.size[h]>0)for(var k=S.globals.dom.baseEl.querySelectorAll(" .apexcharts-series[data\\:realIndex='".concat(h,"'] .apexcharts-marker")),T=0;T<k.length;T++)parseInt(k[T].getAttribute("rel"),10)===p&&(_.marker.resetPointsSize(),_.marker.enlargeCurrentPoint(p,k[T]));else _.marker.resetPointsSize(),this.moveDynamicPointOnHover(p,h)}},{key:"moveDynamicPointOnHover",value:function(h,p){var S,_,k,T,B=this.w,W=this.ttCtx,ee=new z(this.ctx),ce=B.globals.pointsArray,ue=W.tooltipUtil.getHoverMarkerSize(p),ge=B.config.series[p].type;if(!ge||ge!=="column"&&ge!=="candlestick"&&ge!=="boxPlot"){k=(S=ce[p][h])===null||S===void 0?void 0:S[0],T=((_=ce[p][h])===null||_===void 0?void 0:_[1])||0;var Se=B.globals.dom.baseEl.querySelector(".apexcharts-series[data\\:realIndex='".concat(p,"'] .apexcharts-series-markers path"));if(Se&&T<B.globals.gridHeight&&T>0){var ke=Se.getAttribute("shape"),Me=ee.getMarkerPath(k,T,ke,1.5*ue);Se.setAttribute("d",Me)}this.moveXCrosshairs(k),W.fixedTooltip||this.moveTooltip(k,T,ue)}}},{key:"moveDynamicPointsOnHover",value:function(h){var p,S=this.ttCtx,_=S.w,k=0,T=0,B=_.globals.pointsArray,W=new Re(this.ctx),ee=new z(this.ctx);p=W.getActiveConfigSeriesIndex("asc",["line","area","scatter","bubble"]);var ce=S.tooltipUtil.getHoverMarkerSize(p);B[p]&&(k=B[p][h][0],T=B[p][h][1]);var ue=S.tooltipUtil.getAllMarkers();if(ue!==null)for(var ge=0;ge<_.globals.series.length;ge++){var Se=B[ge];if(_.globals.comboCharts&&Se===void 0&&ue.splice(ge,0,null),Se&&Se.length){var ke=B[ge][h][1],Me=void 0;ue[ge].setAttribute("cx",k);var qe=ue[ge].getAttribute("shape");if(_.config.chart.type==="rangeArea"&&!_.globals.comboCharts){var Fe=h+_.globals.series[ge].length;Me=B[ge][Fe][1],ke-=Math.abs(ke-Me)/2}if(ke!==null&&!isNaN(ke)&&ke<_.globals.gridHeight+ce&&ke+ce>0){var at=ee.getMarkerPath(k,ke,qe,ce);ue[ge].setAttribute("d",at)}else ue[ge].setAttribute("d","")}}this.moveXCrosshairs(k),S.fixedTooltip||this.moveTooltip(k,T||_.globals.gridHeight,ce)}},{key:"moveStickyTooltipOverBars",value:function(h,p){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(h,"'], .apexcharts-candlestick-series .apexcharts-series[rel='").concat(T,"'] path[j='").concat(h,"'], .apexcharts-boxPlot-series .apexcharts-series[rel='").concat(T,"'] path[j='").concat(h,"'], .apexcharts-rangebar-series .apexcharts-series[rel='").concat(T,"'] path[j='").concat(h,"']"));B||typeof p!="number"||(B=S.globals.dom.baseEl.querySelector(".apexcharts-bar-series .apexcharts-series[data\\:realIndex='".concat(p,"'] path[j='").concat(h,`'],
        .apexcharts-candlestick-series .apexcharts-series[data\\:realIndex='`).concat(p,"'] path[j='").concat(h,`'],
        .apexcharts-boxPlot-series .apexcharts-series[data\\:realIndex='`).concat(p,"'] path[j='").concat(h,`'],
        .apexcharts-rangebar-series .apexcharts-series[data\\:realIndex='`).concat(p,"'] path[j='").concat(h,"']")));var W=B?parseFloat(B.getAttribute("cx")):0,ee=B?parseFloat(B.getAttribute("cy")):0,ce=B?parseFloat(B.getAttribute("barWidth")):0,ue=_.getElGrid().getBoundingClientRect(),ge=B&&(B.classList.contains("apexcharts-candlestick-area")||B.classList.contains("apexcharts-boxPlot-area"));S.globals.isXNumeric?(B&&!ge&&(W-=k%2!=0?ce/2:0),B&&ge&&S.globals.comboCharts&&(W-=ce/2)):S.globals.isBarHorizontal||(W=_.xAxisTicksPositions[h-1]+_.dataPointsDividedWidth/2,isNaN(W)&&(W=_.xAxisTicksPositions[h]-_.dataPointsDividedWidth/2)),S.globals.isBarHorizontal?ee-=_.tooltipRect.ttHeight:S.config.tooltip.followCursor?ee=_.e.clientY-ue.top-_.tooltipRect.ttHeight/2:ee+_.tooltipRect.ttHeight+15>S.globals.gridHeight&&(ee=S.globals.gridHeight),S.globals.isBarHorizontal||this.moveXCrosshairs(W),_.fixedTooltip||this.moveTooltip(W,ee||S.globals.gridHeight)}}]),Ee}(),ze=function(){function Ee(h){s(this,Ee),this.w=h.w,this.ttCtx=h,this.ctx=h.ctx,this.tooltipPosition=new _t(h)}return o(Ee,[{key:"drawDynamicPoints",value:function(){var h=this.w,p=new z(this.ctx),S=new ye(this.ctx),_=h.globals.dom.baseEl.querySelectorAll(".apexcharts-series");_=N(_),h.config.chart.stacked&&_.sort(function(ue,ge){return parseFloat(ue.getAttribute("data:realIndex"))-parseFloat(ge.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,W="apexcharts-marker w".concat((Math.random()+1).toString(36).substring(4));h.config.chart.type!=="line"&&h.config.chart.type!=="area"||h.globals.comboCharts||h.config.tooltip.intersect||(W+=" no-pointer-events");var ee=S.getMarkerConfig({cssClass:W,seriesIndex:Number(T.getAttribute("data:realIndex"))});(B=p.drawMarker(0,0,ee)).node.setAttribute("default-marker-size",0);var ce=document.createElementNS(h.globals.SVGNS,"g");ce.classList.add("apexcharts-series-markers"),ce.appendChild(B.node),T.appendChild(ce)}}}},{key:"enlargeCurrentPoint",value:function(h,p){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(h,p);var T=p.getAttribute("cx"),B=p.getAttribute("cy");if(S!==null&&_!==null&&(T=S,B=_),this.tooltipPosition.moveXCrosshairs(T),!this.fixedTooltip){if(k.config.chart.type==="radar"){var W=this.ttCtx.getElGrid().getBoundingClientRect();T=this.ttCtx.e.clientX-W.left}this.tooltipPosition.moveTooltip(T,B,k.config.markers.hover.size)}}},{key:"enlargePoints",value:function(h){for(var p=this.w,S=this,_=this.ttCtx,k=h,T=p.globals.dom.baseEl.querySelectorAll(".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker"),B=p.config.markers.hover.size,W=0;W<T.length;W++){var ee=T[W].getAttribute("rel"),ce=T[W].getAttribute("index");if(B===void 0&&(B=p.globals.markers.size[ce]+p.config.markers.hover.sizeOffset),k===parseInt(ee,10)){S.newPointSize(k,T[W]);var ue=T[W].getAttribute("cx"),ge=T[W].getAttribute("cy");S.tooltipPosition.moveXCrosshairs(ue),_.fixedTooltip||S.tooltipPosition.moveTooltip(ue,ge,B)}else S.oldPointSize(T[W])}}},{key:"newPointSize",value:function(h,p){var S=this.w,_=S.config.markers.hover.size,k=h===0?p.parentNode.firstChild:p.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(p,_);p.setAttribute("d",B)}}},{key:"oldPointSize",value:function(h){var p=parseFloat(h.getAttribute("default-marker-size")),S=this.ttCtx.tooltipUtil.getPathFromPoint(h,p);h.setAttribute("d",S)}},{key:"resetPointsSize",value:function(){for(var h=this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker"),p=0;p<h.length;p++){var S=parseFloat(h[p].getAttribute("default-marker-size"));if(O.isNumber(S)&&S>=0){var _=this.ttCtx.tooltipUtil.getPathFromPoint(h[p],S);h[p].setAttribute("d",_)}else h[p].setAttribute("d","M0,0")}}}]),Ee}(),nt=function(){function Ee(h){s(this,Ee),this.w=h.w;var p=this.w;this.ttCtx=h,this.isVerticalGroupedRangeBar=!p.globals.isBarHorizontal&&p.config.chart.type==="rangeBar"&&p.config.plotOptions.bar.rangeBarGroupRows}return o(Ee,[{key:"getAttr",value:function(h,p){return parseFloat(h.target.getAttribute(p))}},{key:"handleHeatTreeTooltip",value:function(h){var p=h.e,S=h.opt,_=h.x,k=h.y,T=h.type,B=this.ttCtx,W=this.w;if(p.target.classList.contains("apexcharts-".concat(T,"-rect"))){var ee=this.getAttr(p,"i"),ce=this.getAttr(p,"j"),ue=this.getAttr(p,"cx"),ge=this.getAttr(p,"cy"),Se=this.getAttr(p,"width"),ke=this.getAttr(p,"height");if(B.tooltipLabels.drawSeriesTexts({ttItems:S.ttItems,i:ee,j:ce,shared:!1,e:p}),W.globals.capturedSeriesIndex=ee,W.globals.capturedDataPointIndex=ce,_=ue+B.tooltipRect.ttWidth/2+Se,k=ge+B.tooltipRect.ttHeight/2-ke/2,B.tooltipPosition.moveXCrosshairs(ue+Se/2),_>W.globals.gridWidth/2&&(_=ue-B.tooltipRect.ttWidth/2+Se),B.w.config.tooltip.followCursor){var Me=W.globals.dom.elWrap.getBoundingClientRect();_=W.globals.clientX-Me.left-(_>W.globals.gridWidth/2?B.tooltipRect.ttWidth:0),k=W.globals.clientY-Me.top-(k>W.globals.gridHeight/2?B.tooltipRect.ttHeight:0)}}return{x:_,y:k}}},{key:"handleMarkerTooltip",value:function(h){var p,S,_=h.e,k=h.opt,T=h.x,B=h.y,W=this.w,ee=this.ttCtx;if(_.target.classList.contains("apexcharts-marker")){var ce=parseInt(k.paths.getAttribute("cx"),10),ue=parseInt(k.paths.getAttribute("cy"),10),ge=parseFloat(k.paths.getAttribute("val"));if(S=parseInt(k.paths.getAttribute("rel"),10),p=parseInt(k.paths.parentNode.parentNode.parentNode.getAttribute("rel"),10)-1,ee.intersect){var Se=O.findAncestor(k.paths,"apexcharts-series");Se&&(p=parseInt(Se.getAttribute("data:realIndex"),10))}if(ee.tooltipLabels.drawSeriesTexts({ttItems:k.ttItems,i:p,j:S,shared:!ee.showOnIntersect&&W.config.tooltip.shared,e:_}),_.type==="mouseup"&&ee.markerClick(_,p,S),W.globals.capturedSeriesIndex=p,W.globals.capturedDataPointIndex=S,T=ce,B=ue+W.globals.translateY-1.4*ee.tooltipRect.ttHeight,ee.w.config.tooltip.followCursor){var ke=ee.getElGrid().getBoundingClientRect();B=ee.e.clientY+W.globals.translateY-ke.top}ge<0&&(B=ue),ee.marker.enlargeCurrentPoint(S,k.paths,T,B)}return{x:T,y:B}}},{key:"handleBarTooltip",value:function(h){var p,S,_=h.e,k=h.opt,T=this.w,B=this.ttCtx,W=B.getElTooltip(),ee=0,ce=0,ue=0,ge=this.getBarTooltipXY({e:_,opt:k});p=ge.i;var Se=ge.j;T.globals.capturedSeriesIndex=p,T.globals.capturedDataPointIndex=Se,T.globals.isBarHorizontal&&B.tooltipUtil.hasBars()||!T.config.tooltip.shared?(ce=ge.x,ue=ge.y,S=Array.isArray(T.config.stroke.width)?T.config.stroke.width[p]:T.config.stroke.width,ee=ce):T.globals.comboCharts||T.config.tooltip.shared||(ee/=2),isNaN(ue)&&(ue=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,ce+B.tooltipRect.ttWidth>T.globals.gridWidth?ce-=B.tooltipRect.ttWidth:ce<0&&(ce=0),B.w.config.tooltip.followCursor){var Me=B.getElGrid().getBoundingClientRect();ue=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(ee+S/2):B.tooltipPosition.moveXCrosshairs(ee)),!B.fixedTooltip&&(!T.config.tooltip.shared||T.globals.isBarHorizontal&&B.tooltipUtil.hasBars())&&(ue=ue+T.globals.translateY-B.tooltipRect.ttHeight/2,W.style.left=ce+T.globals.translateX+"px",W.style.top=ue+"px")}},{key:"getBarTooltipXY",value:function(h){var p=this,S=h.e,_=h.opt,k=this.w,T=null,B=this.ttCtx,W=0,ee=0,ce=0,ue=0,ge=0,Se=S.target.classList;if(Se.contains("apexcharts-bar-area")||Se.contains("apexcharts-candlestick-area")||Se.contains("apexcharts-boxPlot-area")||Se.contains("apexcharts-rangebar-area")){var ke=S.target,Me=ke.getBoundingClientRect(),qe=_.elGrid.getBoundingClientRect(),Fe=Me.height;ge=Me.height;var at=Me.width,se=parseInt(ke.getAttribute("cx"),10),Ce=parseInt(ke.getAttribute("cy"),10);ue=parseFloat(ke.getAttribute("barWidth"));var Ue=S.type==="touchmove"?S.touches[0].clientX:S.clientX;T=parseInt(ke.getAttribute("j"),10),W=parseInt(ke.parentNode.getAttribute("rel"),10)-1;var Be=ke.getAttribute("data-range-y1"),_e=ke.getAttribute("data-range-y2");k.globals.comboCharts&&(W=parseInt(ke.parentNode.getAttribute("data:realIndex"),10));var rt=function(yt){return k.globals.isXNumeric?se-at/2:p.isVerticalGroupedRangeBar?se+at/2:se-B.dataPointsDividedWidth+at/2},ct=function(){return Ce-B.dataPointsDividedHeight+Fe/2-B.tooltipRect.ttHeight/2};B.tooltipLabels.drawSeriesTexts({ttItems:_.ttItems,i:W,j:T,y1:Be?parseInt(Be,10):null,y2:_e?parseInt(_e,10):null,shared:!B.showOnIntersect&&k.config.tooltip.shared,e:S}),k.config.tooltip.followCursor?k.globals.isBarHorizontal?(ee=Ue-qe.left+15,ce=ct()):(ee=rt(),ce=S.clientY-qe.top-B.tooltipRect.ttHeight/2-15):k.globals.isBarHorizontal?((ee=se)<B.xyRatios.baseLineInvertedY&&(ee=se-B.tooltipRect.ttWidth),ce=ct()):(ee=rt(),ce=Ce)}return{x:ee,y:ce,barHeight:ge,barWidth:ue,i:W,j:T}}}]),Ee}(),mt=function(){function Ee(h){s(this,Ee),this.w=h.w,this.ttCtx=h}return o(Ee,[{key:"drawXaxisTooltip",value:function(){var h=this.w,p=this.ttCtx,S=h.config.xaxis.position==="bottom";p.xaxisOffY=S?h.globals.gridHeight+1:-h.globals.xAxisHeight-h.config.xaxis.axisTicks.height+3;var _=S?"apexcharts-xaxistooltip apexcharts-xaxistooltip-bottom":"apexcharts-xaxistooltip apexcharts-xaxistooltip-top",k=h.globals.dom.elWrap;p.isXAxisTooltipEnabled&&h.globals.dom.baseEl.querySelector(".apexcharts-xaxistooltip")===null&&(p.xaxisTooltip=document.createElement("div"),p.xaxisTooltip.setAttribute("class",_+" apexcharts-theme-"+h.config.tooltip.theme),k.appendChild(p.xaxisTooltip),p.xaxisTooltipText=document.createElement("div"),p.xaxisTooltipText.classList.add("apexcharts-xaxistooltip-text"),p.xaxisTooltipText.style.fontFamily=h.config.xaxis.tooltip.style.fontFamily||h.config.chart.fontFamily,p.xaxisTooltipText.style.fontSize=h.config.xaxis.tooltip.style.fontSize,p.xaxisTooltip.appendChild(p.xaxisTooltipText))}},{key:"drawYaxisTooltip",value:function(){for(var h=this.w,p=this.ttCtx,S=0;S<h.config.yaxis.length;S++){var _=h.config.yaxis[S].opposite||h.config.yaxis[S].crosshairs.opposite;p.yaxisOffX=_?h.globals.gridWidth+1:1;var k="apexcharts-yaxistooltip apexcharts-yaxistooltip-".concat(S,_?" apexcharts-yaxistooltip-right":" apexcharts-yaxistooltip-left"),T=h.globals.dom.elWrap;h.globals.dom.baseEl.querySelector(".apexcharts-yaxistooltip apexcharts-yaxistooltip-".concat(S))===null&&(p.yaxisTooltip=document.createElement("div"),p.yaxisTooltip.setAttribute("class",k+" apexcharts-theme-"+h.config.tooltip.theme),T.appendChild(p.yaxisTooltip),S===0&&(p.yaxisTooltipText=[]),p.yaxisTooltipText[S]=document.createElement("div"),p.yaxisTooltipText[S].classList.add("apexcharts-yaxistooltip-text"),p.yaxisTooltip.appendChild(p.yaxisTooltipText[S]))}}},{key:"setXCrosshairWidth",value:function(){var h=this.w,p=this.ttCtx,S=p.getElXCrosshairs();if(p.xcrosshairsWidth=parseInt(h.config.xaxis.crosshairs.width,10),h.globals.comboCharts){var _=h.globals.dom.baseEl.querySelector(".apexcharts-bar-area");if(_!==null&&h.config.xaxis.crosshairs.width==="barWidth"){var k=parseFloat(_.getAttribute("barWidth"));p.xcrosshairsWidth=k}else if(h.config.xaxis.crosshairs.width==="tickWidth"){var T=h.globals.labels.length;p.xcrosshairsWidth=h.globals.gridWidth/T}}else if(h.config.xaxis.crosshairs.width==="tickWidth"){var B=h.globals.labels.length;p.xcrosshairsWidth=h.globals.gridWidth/B}else if(h.config.xaxis.crosshairs.width==="barWidth"){var W=h.globals.dom.baseEl.querySelector(".apexcharts-bar-area");if(W!==null){var ee=parseFloat(W.getAttribute("barWidth"));p.xcrosshairsWidth=ee}else p.xcrosshairsWidth=1}h.globals.isBarHorizontal&&(p.xcrosshairsWidth=0),S!==null&&p.xcrosshairsWidth>0&&S.setAttribute("width",p.xcrosshairsWidth)}},{key:"handleYCrosshair",value:function(){var h=this.w,p=this.ttCtx;p.ycrosshairs=h.globals.dom.baseEl.querySelector(".apexcharts-ycrosshairs"),p.ycrosshairsHidden=h.globals.dom.baseEl.querySelector(".apexcharts-ycrosshairs-hidden")}},{key:"drawYaxisTooltipText",value:function(h,p,S){var _=this.ttCtx,k=this.w,T=k.globals,B=T.seriesYAxisMap[h];if(_.yaxisTooltips[h]&&B.length>0){var W=T.yLabelFormatters[h],ee=_.getElGrid().getBoundingClientRect(),ce=B[0],ue=0;S.yRatio.length>1&&(ue=ce);var ge=(p-ee.top)*S.yRatio[ue],Se=T.maxYArr[ce]-T.minYArr[ce],ke=T.minYArr[ce]+(Se-ge);k.config.yaxis[h].reversed&&(ke=T.maxYArr[ce]-(Se-ge)),_.tooltipPosition.moveYCrosshairs(p-ee.top),_.yaxisTooltipText[h].innerHTML=W(ke),_.tooltipPosition.moveYAxisTooltip(h)}}}]),Ee}(),$t=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w;var p=this.w;this.tConfig=p.config.tooltip,this.tooltipUtil=new ot(this),this.tooltipLabels=new De(this),this.tooltipPosition=new _t(this),this.marker=new ze(this),this.intersect=new nt(this),this.axesTooltip=new mt(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=!p.globals.isBarHorizontal&&this.tConfig.shared,this.lastHoverTime=Date.now()}return o(Ee,[{key:"getElTooltip",value:function(h){return h||(h=this),h.w.globals.dom.baseEl?h.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(h){var p=this.w;this.xyRatios=h,this.isXAxisTooltipEnabled=p.config.xaxis.tooltip.enabled&&p.globals.axisCharts,this.yaxisTooltips=p.config.yaxis.map(function(T,B){return!!(T.show&&T.tooltip.enabled&&p.globals.axisCharts)}),this.allTooltipSeriesGroups=[],p.globals.axisCharts||(this.showTooltipTitle=!1);var S=document.createElement("div");if(S.classList.add("apexcharts-tooltip"),p.config.tooltip.cssClass&&S.classList.add(p.config.tooltip.cssClass),S.classList.add("apexcharts-theme-".concat(this.tConfig.theme)),p.globals.dom.elWrap.appendChild(S),p.globals.axisCharts){this.axesTooltip.drawXaxisTooltip(),this.axesTooltip.drawYaxisTooltip(),this.axesTooltip.setXCrosshairWidth(),this.axesTooltip.handleYCrosshair();var _=new ut(this.ctx);this.xAxisTicksPositions=_.getXAxisTicksPositions()}if(!p.globals.comboCharts&&!this.tConfig.intersect&&p.config.chart.type!=="rangeBar"||this.tConfig.shared||(this.showOnIntersect=!0),p.config.markers.size!==0&&p.globals.markers.largestSize!==0||this.marker.drawDynamicPoints(this),p.globals.collapsedSeries.length!==p.globals.series.length){this.dataPointsDividedHeight=p.globals.gridHeight/p.globals.dataPoints,this.dataPointsDividedWidth=p.globals.gridWidth/p.globals.dataPoints,this.showTooltipTitle&&(this.tooltipTitle=document.createElement("div"),this.tooltipTitle.classList.add("apexcharts-tooltip-title"),this.tooltipTitle.style.fontFamily=this.tConfig.style.fontFamily||p.config.chart.fontFamily,this.tooltipTitle.style.fontSize=this.tConfig.style.fontSize,S.appendChild(this.tooltipTitle));var k=p.globals.series.length;(p.globals.xyCharts||p.globals.comboCharts)&&this.tConfig.shared&&(k=this.showOnIntersect?1:p.globals.series.length),this.legendLabels=p.globals.dom.baseEl.querySelectorAll(".apexcharts-legend-text"),this.ttItems=this.createTTElements(k),this.addSVGEvents()}}},{key:"createTTElements",value:function(h){for(var p=this,S=this.w,_=[],k=this.getElTooltip(),T=function(W){var ee=document.createElement("div");ee.classList.add("apexcharts-tooltip-series-group","apexcharts-tooltip-series-group-".concat(W)),ee.style.order=S.config.tooltip.inverseOrder?h-W:W+1;var ce=document.createElement("span");ce.classList.add("apexcharts-tooltip-marker"),ce.style.backgroundColor=S.globals.colors[W],ee.appendChild(ce);var ue=document.createElement("div");ue.classList.add("apexcharts-tooltip-text"),ue.style.fontFamily=p.tConfig.style.fontFamily||S.config.chart.fontFamily,ue.style.fontSize=p.tConfig.style.fontSize,["y","goals","z"].forEach(function(ge){var Se=document.createElement("div");Se.classList.add("apexcharts-tooltip-".concat(ge,"-group"));var ke=document.createElement("span");ke.classList.add("apexcharts-tooltip-text-".concat(ge,"-label")),Se.appendChild(ke);var Me=document.createElement("span");Me.classList.add("apexcharts-tooltip-text-".concat(ge,"-value")),Se.appendChild(Me),ue.appendChild(Se)}),ee.appendChild(ue),k.appendChild(ee),_.push(ee)},B=0;B<h;B++)T(B);return _}},{key:"addSVGEvents",value:function(){var h=this.w,p=h.config.chart.type,S=this.getElTooltip(),_=!(p!=="bar"&&p!=="candlestick"&&p!=="boxPlot"&&p!=="rangeBar"),k=p==="area"||p==="line"||p==="scatter"||p==="bubble"||p==="radar",T=h.globals.dom.Paper.node,B=this.getElGrid();B&&(this.seriesBound=B.getBoundingClientRect());var W,ee=[],ce=[],ue={hoverArea:T,elGrid:B,tooltipEl:S,tooltipY:ee,tooltipX:ce,ttItems:this.ttItems};if(h.globals.axisCharts&&(k?W=h.globals.dom.baseEl.querySelectorAll(".apexcharts-series[data\\:longestSeries='true'] .apexcharts-marker"):_?W=h.globals.dom.baseEl.querySelectorAll(".apexcharts-series .apexcharts-bar-area, .apexcharts-series .apexcharts-candlestick-area, .apexcharts-series .apexcharts-boxPlot-area, .apexcharts-series .apexcharts-rangebar-area"):p!=="heatmap"&&p!=="treemap"||(W=h.globals.dom.baseEl.querySelectorAll(".apexcharts-series .apexcharts-heatmap, .apexcharts-series .apexcharts-treemap")),W&&W.length))for(var ge=0;ge<W.length;ge++)ee.push(W[ge].getAttribute("cy")),ce.push(W[ge].getAttribute("cx"));if(h.globals.xyCharts&&!this.showOnIntersect||h.globals.comboCharts&&!this.showOnIntersect||_&&this.tooltipUtil.hasBars()&&this.tConfig.shared)this.addPathsEventListeners([T],ue);else if(_&&!h.globals.comboCharts||k&&this.showOnIntersect)this.addDatapointEventsListeners(ue);else if(!h.globals.axisCharts||p==="heatmap"||p==="treemap"){var Se=h.globals.dom.baseEl.querySelectorAll(".apexcharts-series");this.addPathsEventListeners(Se,ue)}if(this.showOnIntersect){var ke=h.globals.dom.baseEl.querySelectorAll(".apexcharts-line-series .apexcharts-marker, .apexcharts-area-series .apexcharts-marker");ke.length>0&&this.addPathsEventListeners(ke,ue),this.tooltipUtil.hasBars()&&!this.tConfig.shared&&this.addDatapointEventsListeners(ue)}}},{key:"drawFixedTooltipRect",value:function(){var h=this.w,p=this.getElTooltip(),S=p.getBoundingClientRect(),_=S.width+10,k=S.height+10,T=this.tConfig.fixed.offsetX,B=this.tConfig.fixed.offsetY,W=this.tConfig.fixed.position.toLowerCase();return W.indexOf("right")>-1&&(T=T+h.globals.svgWidth-_+10),W.indexOf("bottom")>-1&&(B=B+h.globals.svgHeight-k-10),p.style.left=T+"px",p.style.top=B+"px",{x:T,y:B,ttWidth:_,ttHeight:k}}},{key:"addDatapointEventsListeners",value:function(h){var p=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(p,h)}},{key:"addPathsEventListeners",value:function(h,p){for(var S=this,_=function(T){var B={paths:h[T],tooltipEl:p.tooltipEl,tooltipY:p.tooltipY,tooltipX:p.tooltipX,elGrid:p.elGrid,hoverArea:p.hoverArea,ttItems:p.ttItems};["mousemove","mouseup","touchmove","mouseout","touchend"].map(function(W){return h[T].addEventListener(W,S.onSeriesHover.bind(S,B),{capture:!1,passive:!0})})},k=0;k<h.length;k++)_(k)}},{key:"onSeriesHover",value:function(h,p){var S=this,_=Date.now()-this.lastHoverTime;_>=100?this.seriesHover(h,p):(clearTimeout(this.seriesHoverTimeout),this.seriesHoverTimeout=setTimeout(function(){S.seriesHover(h,p)},100-_))}},{key:"seriesHover",value:function(h,p){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),W={paths:h.paths,tooltipEl:B,tooltipY:h.tooltipY,tooltipX:h.tooltipX,elGrid:h.elGrid,hoverArea:h.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:W,e:p})}):this.seriesHoverByContext({chartCtx:this.ctx,ttCtx:this.w.globals.tooltip,opt:h,e:p}))}},{key:"seriesHoverByContext",value:function(h){var p=h.chartCtx,S=h.ttCtx,_=h.opt,k=h.e,T=p.w,B=this.getElTooltip(p);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(p).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(h){var p,S,_=h.e,k=h.opt,T=this.w,B=k.elGrid.getBoundingClientRect(),W=_.type==="touchmove"?_.touches[0].clientX:_.clientX,ee=_.type==="touchmove"?_.touches[0].clientY:_.clientY;if(this.clientY=ee,this.clientX=W,T.globals.capturedSeriesIndex=-1,T.globals.capturedDataPointIndex=-1,ee<B.top||ee>B.top+B.height)this.handleMouseOut(k);else{if(Array.isArray(this.tConfig.enabledOnSeries)&&!T.config.tooltip.shared){var ce=parseInt(k.paths.getAttribute("index"),10);if(this.tConfig.enabledOnSeries.indexOf(ce)<0)return void this.handleMouseOut(k)}var ue=this.getElTooltip(),ge=this.getElXCrosshairs(),Se=[];T.config.chart.group&&(Se=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;ge!==null&&ge.classList.add("apexcharts-active");var Me=this.yaxisTooltips.filter(function(at){return at===!0});if(this.ycrosshairs!==null&&Me.length&&this.ycrosshairs.classList.add("apexcharts-active"),ke&&!this.showOnIntersect||Se.length>1)this.handleStickyTooltip(_,W,ee,k);else if(T.config.chart.type==="heatmap"||T.config.chart.type==="treemap"){var qe=this.intersect.handleHeatTreeTooltip({e:_,opt:k,x:p,y:S,type:T.config.chart.type});p=qe.x,S=qe.y,ue.style.left=p+"px",ue.style.top=S+"px"}else this.tooltipUtil.hasBars()&&this.intersect.handleBarTooltip({e:_,opt:k}),this.tooltipUtil.hasMarkers()&&this.intersect.handleMarkerTooltip({e:_,opt:k,x:p,y:S});if(this.yaxisTooltips.length)for(var Fe=0;Fe<T.config.yaxis.length;Fe++)this.axesTooltip.drawYaxisTooltipText(Fe,ee,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(h){var p=h.e,S=h.opt,_=h.tooltipRect,k=this.w,T=S.paths.getAttribute("rel"),B=this.getElTooltip(),W=k.globals.dom.elWrap.getBoundingClientRect();if(p.type==="mousemove"||p.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 ee=k.globals.clientX-W.left-_.ttWidth/2,ce=k.globals.clientY-W.top-_.ttHeight-10;if(B.style.left=ee+"px",B.style.top=ce+"px",k.config.legend.tooltipHoverFormatter){var ue=T-1,ge=(0,k.config.legend.tooltipHoverFormatter)(this.legendLabels[ue].getAttribute("data:default-text"),{seriesIndex:ue,dataPointIndex:ue,w:k});this.legendLabels[ue].innerHTML=ge}}else p.type!=="mouseout"&&p.type!=="touchend"||(B.classList.remove("apexcharts-active"),k.globals.dom.baseEl.classList.remove("apexcharts-tooltip-active"),k.config.legend.tooltipHoverFormatter&&this.legendLabels.forEach(function(Se){var ke=Se.getAttribute("data:default-text");Se.innerHTML=decodeURIComponent(ke)}))}},{key:"handleStickyTooltip",value:function(h,p,S,_){var k=this.w,T=this.tooltipUtil.getNearestValues({context:this,hoverArea:_.hoverArea,elGrid:_.elGrid,clientX:p,clientY:S}),B=T.j,W=T.capturedSeries;k.globals.collapsedSeriesIndices.includes(W)&&(W=null);var ee=_.elGrid.getBoundingClientRect();if(T.hoverX<0||T.hoverX>ee.width)this.handleMouseOut(_);else if(W!==null)this.handleStickyCapturedSeries(h,W,_,B);else if(this.tooltipUtil.isXoverlap(B)||k.globals.isBarHorizontal){var ce=k.globals.series.findIndex(function(ue,ge){return!k.globals.collapsedSeriesIndices.includes(ge)});this.create(h,this,ce,B,_.ttItems)}}},{key:"handleStickyCapturedSeries",value:function(h,p,S,_){var k=this.w;if(!this.tConfig.shared&&k.globals.series[p][_]===null)return void this.handleMouseOut(S);if(k.globals.series[p][_]!==void 0)this.tConfig.shared&&this.tooltipUtil.isXoverlap(_)&&this.tooltipUtil.isInitialSeriesSameLen()?this.create(h,this,p,_,S.ttItems):this.create(h,this,p,_,S.ttItems,!1);else if(this.tooltipUtil.isXoverlap(_)){var T=k.globals.series.findIndex(function(B,W){return!k.globals.collapsedSeriesIndices.includes(W)});this.create(h,this,T,_,S.ttItems)}}},{key:"deactivateHoverFilter",value:function(){for(var h=this.w,p=new z(this.ctx),S=h.globals.dom.Paper.select(".apexcharts-bar-area"),_=0;_<S.length;_++)p.pathMouseLeave(S[_])}},{key:"handleMouseOut",value:function(h){var p=this.w,S=this.getElXCrosshairs();if(p.globals.dom.baseEl.classList.remove("apexcharts-tooltip-active"),h.tooltipEl.classList.remove("apexcharts-active"),this.deactivateHoverFilter(),p.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=p.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip"));for(var _=0;_<this.yaxisTTEls.length;_++)this.yaxisTTEls[_].classList.remove("apexcharts-active")}p.config.legend.tooltipHoverFormatter&&this.legendLabels.forEach(function(k){var T=k.getAttribute("data:default-text");k.innerHTML=decodeURIComponent(T)})}},{key:"markerClick",value:function(h,p,S){var _=this.w;typeof _.config.chart.events.markerClick=="function"&&_.config.chart.events.markerClick(h,this.ctx,{seriesIndex:p,dataPointIndex:S,w:_}),this.ctx.events.fireEvent("markerClick",[h,this.ctx,{seriesIndex:p,dataPointIndex:S,w:_}])}},{key:"create",value:function(h,p,S,_,k){var T,B,W,ee,ce,ue,ge,Se,ke,Me,qe,Fe,at,se,Ce,Ue,Be=arguments.length>5&&arguments[5]!==void 0?arguments[5]:null,_e=this.w,rt=p;h.type==="mouseup"&&this.markerClick(h,S,_),Be===null&&(Be=this.tConfig.shared);var ct=this.tooltipUtil.hasMarkers(S),yt=this.tooltipUtil.getElBars();if(_e.config.legend.tooltipHoverFormatter){var Lt=_e.config.legend.tooltipHoverFormatter,ft=Array.from(this.legendLabels);ft.forEach(function(Sn){var Bn=Sn.getAttribute("data:default-text");Sn.innerHTML=decodeURIComponent(Bn)});for(var Tt=0;Tt<ft.length;Tt++){var Ge=ft[Tt],At=parseInt(Ge.getAttribute("i"),10),Ot=decodeURIComponent(Ge.getAttribute("data:default-text")),it=Lt(Ot,{seriesIndex:Be?At:S,dataPointIndex:_,w:_e});if(Be)Ge.innerHTML=_e.globals.collapsedSeriesIndices.indexOf(At)<0?it:Ot;else if(Ge.innerHTML=At===S?it:Ot,S===At)break}}var jt=v(v({ttItems:k,i:S,j:_},((T=_e.globals.seriesRange)===null||T===void 0||(B=T[S])===null||B===void 0||(W=B[_])===null||W===void 0||(ee=W.y[0])===null||ee===void 0?void 0:ee.y1)!==void 0&&{y1:(ce=_e.globals.seriesRange)===null||ce===void 0||(ue=ce[S])===null||ue===void 0||(ge=ue[_])===null||ge===void 0||(Se=ge.y[0])===null||Se===void 0?void 0:Se.y1}),((ke=_e.globals.seriesRange)===null||ke===void 0||(Me=ke[S])===null||Me===void 0||(qe=Me[_])===null||qe===void 0||(Fe=qe.y[0])===null||Fe===void 0?void 0:Fe.y2)!==void 0&&{y2:(at=_e.globals.seriesRange)===null||at===void 0||(se=at[S])===null||se===void 0||(Ce=se[_])===null||Ce===void 0||(Ue=Ce.y[0])===null||Ue===void 0?void 0:Ue.y2});if(Be){if(rt.tooltipLabels.drawSeriesTexts(v(v({},jt),{},{shared:!this.showOnIntersect&&this.tConfig.shared})),ct)_e.globals.markers.largestSize>0?rt.marker.enlargePoints(_):rt.tooltipPosition.moveDynamicPointsOnHover(_);else if(this.tooltipUtil.hasBars()&&(this.barSeriesHeight=this.tooltipUtil.getBarsHeight(yt),this.barSeriesHeight>0)){var Nn=new z(this.ctx),mn=_e.globals.dom.Paper.select(".apexcharts-bar-area[j='".concat(_,"']"));this.deactivateHoverFilter(),this.tooltipPosition.moveStickyTooltipOverBars(_,S);for(var ir=0;ir<mn.length;ir++)Nn.pathMouseEnter(mn[ir])}}else rt.tooltipLabels.drawSeriesTexts(v({shared:!1},jt)),this.tooltipUtil.hasBars()&&rt.tooltipPosition.moveStickyTooltipOverBars(_,S),ct&&rt.tooltipPosition.moveMarkers(S,_)}}]),Ee}(),Pt=function(){function Ee(h){s(this,Ee),this.w=h.w,this.barCtx=h,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(h){var p,S,_=h.x,k=h.y,T=h.y1,B=h.y2,W=h.i,ee=h.j,ce=h.realIndex,ue=h.columnGroupIndex,ge=h.series,Se=h.barHeight,ke=h.barWidth,Me=h.barXPosition,qe=h.barYPosition,Fe=h.visibleSeries,at=h.renderedPath,se=this.w,Ce=new z(this.barCtx.ctx),Ue=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[ce]:this.barCtx.strokeWidth;se.globals.isXNumeric&&!se.globals.isBarHorizontal?(p=_+parseFloat(ke*(Fe+1)),S=k+parseFloat(Se*(Fe+1))-Ue):(p=_+parseFloat(ke*Fe),S=k+parseFloat(Se*Fe));var Be,_e=null,rt=_,ct=k,yt={},Lt=se.config.dataLabels,ft=this.barCtx.barOptions.dataLabels,Tt=this.barCtx.barOptions.dataLabels.total;qe!==void 0&&this.barCtx.isRangeBar&&(S=qe,ct=qe),Me!==void 0&&this.barCtx.isVerticalGroupedRangeBar&&(p=Me,rt=Me);var Ge=Lt.offsetX,At=Lt.offsetY,Ot={width:0,height:0};if(se.config.dataLabels.enabled){var it=se.globals.series[W][ee];Ot=Ce.getTextRects(se.config.dataLabels.formatter?se.config.dataLabels.formatter(it,v(v({},se),{},{seriesIndex:W,dataPointIndex:ee,w:se})):se.globals.yLabelFormatters[0](it),parseFloat(Lt.style.fontSize))}var jt={x:_,y:k,i:W,j:ee,realIndex:ce,columnGroupIndex:ue,renderedPath:at,bcx:p,bcy:S,barHeight:Se,barWidth:ke,textRects:Ot,strokeWidth:Ue,dataLabelsX:rt,dataLabelsY:ct,dataLabelsConfig:Lt,barDataLabelsConfig:ft,barTotalDataLabelsConfig:Tt,offX:Ge,offY:At};return yt=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(jt):this.calculateColumnsDataLabelsPosition(jt),at.attr({cy:yt.bcy,cx:yt.bcx,j:ee,val:se.globals.series[W][ee],barHeight:Se,barWidth:ke}),Be=this.drawCalculatedDataLabels({x:yt.dataLabelsX,y:yt.dataLabelsY,val:this.barCtx.isRangeBar?[T,B]:se.config.chart.stackType==="100%"?ge[ce][ee]:se.globals.series[ce][ee],i:ce,j:ee,barWidth:ke,barHeight:Se,textRects:Ot,dataLabelsConfig:Lt}),se.config.chart.stacked&&Tt.enabled&&(_e=this.drawTotalDataLabels({x:yt.totalDataLabelsX,y:yt.totalDataLabelsY,barWidth:ke,barHeight:Se,realIndex:ce,textAnchor:yt.totalDataLabelsAnchor,val:this.getStackedTotalDataLabel({realIndex:ce,j:ee}),dataLabelsConfig:Lt,barTotalDataLabelsConfig:Tt})),{dataLabels:Be,totalDataLabels:_e}}},{key:"getStackedTotalDataLabel",value:function(h){var p=h.realIndex,S=h.j,_=this.w,k=this.barCtx.stackedSeriesTotals[S];return this.totalFormatter&&(k=this.totalFormatter(k,v(v({},_),{},{seriesIndex:p,dataPointIndex:S,w:_}))),k}},{key:"calculateColumnsDataLabelsPosition",value:function(h){var p=this.w,S=h.i,_=h.j,k=h.realIndex;h.columnGroupIndex;var T,B,W=h.y,ee=h.bcx,ce=h.barWidth,ue=h.barHeight,ge=h.textRects,Se=h.dataLabelsX,ke=h.dataLabelsY,Me=h.dataLabelsConfig,qe=h.barDataLabelsConfig,Fe=h.barTotalDataLabelsConfig,at=h.strokeWidth,se=h.offX,Ce=h.offY,Ue=ee;ue=Math.abs(ue);var Be=p.config.plotOptions.bar.dataLabels.orientation==="vertical",_e=this.barCtx.barHelpers.getZeroValueEncounters({i:S,j:_}).zeroEncounters;ee-=at/2;var rt=p.globals.gridWidth/p.globals.dataPoints;this.barCtx.isVerticalGroupedRangeBar?Se+=ce/2:(Se=p.globals.isXNumeric?ee-ce/2+se:ee-rt+ce/2+se,_e>0&&p.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(Se-=ce*_e)),Be&&(Se=Se+ge.height/2-at/2-2);var ct=p.globals.series[S][_]<0,yt=W;switch(this.barCtx.isReversed&&(yt=W+(ct?ue:-ue)),qe.position){case"center":ke=Be?ct?yt-ue/2+Ce:yt+ue/2-Ce:ct?yt-ue/2+ge.height/2+Ce:yt+ue/2+ge.height/2-Ce;break;case"bottom":ke=Be?ct?yt-ue+Ce:yt+ue-Ce:ct?yt-ue+ge.height+at+Ce:yt+ue-ge.height/2+at-Ce;break;case"top":ke=Be?ct?yt+Ce:yt-Ce:ct?yt-ge.height/2-Ce:yt+ge.height+Ce}if(this.barCtx.lastActiveBarSerieIndex===k&&Fe.enabled){var Lt=new z(this.barCtx.ctx).getTextRects(this.getStackedTotalDataLabel({realIndex:k,j:_}),Me.fontSize);T=ct?yt-Lt.height/2-Ce-Fe.offsetY+18:yt+Lt.height+Ce+Fe.offsetY-18;var ft=rt;B=Ue+(p.globals.isXNumeric?-ce*p.globals.barGroups.length/2:p.globals.barGroups.length*ce/2-(p.globals.barGroups.length-1)*ce-ft)+Fe.offsetX}return p.config.chart.stacked||(ke<0?ke=0+at:ke+ge.height/3>p.globals.gridHeight&&(ke=p.globals.gridHeight-at)),{bcx:ee,bcy:W,dataLabelsX:Se,dataLabelsY:ke,totalDataLabelsX:B,totalDataLabelsY:T,totalDataLabelsAnchor:"middle"}}},{key:"calculateBarsDataLabelsPosition",value:function(h){var p=this.w,S=h.x,_=h.i,k=h.j,T=h.realIndex,B=h.bcy,W=h.barHeight,ee=h.barWidth,ce=h.textRects,ue=h.dataLabelsX,ge=h.strokeWidth,Se=h.dataLabelsConfig,ke=h.barDataLabelsConfig,Me=h.barTotalDataLabelsConfig,qe=h.offX,Fe=h.offY,at=p.globals.gridHeight/p.globals.dataPoints;ee=Math.abs(ee);var se,Ce,Ue=B-(this.barCtx.isRangeBar?0:at)+W/2+ce.height/2+Fe-3,Be="start",_e=p.globals.series[_][k]<0,rt=S;switch(this.barCtx.isReversed&&(rt=S+(_e?-ee:ee),Be=_e?"start":"end"),ke.position){case"center":ue=_e?rt+ee/2-qe:Math.max(ce.width/2,rt-ee/2)+qe;break;case"bottom":ue=_e?rt+ee-ge-qe:rt-ee+ge+qe;break;case"top":ue=_e?rt-ge-qe:rt-ge+qe}if(this.barCtx.lastActiveBarSerieIndex===T&&Me.enabled){var ct=new z(this.barCtx.ctx).getTextRects(this.getStackedTotalDataLabel({realIndex:T,j:k}),Se.fontSize);_e?(se=rt-ge-qe-Me.offsetX,Be="end"):se=rt+qe+Me.offsetX+(this.barCtx.isReversed?-(ee+ge):ge),Ce=Ue-ce.height/2+ct.height/2+Me.offsetY+ge}return p.config.chart.stacked||(Se.textAnchor==="start"?ue-ce.width<0?ue=_e?ce.width+ge:ge:ue+ce.width>p.globals.gridWidth&&(ue=_e?p.globals.gridWidth-ge:p.globals.gridWidth-ce.width-ge):Se.textAnchor==="middle"?ue-ce.width/2<0?ue=ce.width/2+ge:ue+ce.width/2>p.globals.gridWidth&&(ue=p.globals.gridWidth-ce.width/2-ge):Se.textAnchor==="end"&&(ue<1?ue=ce.width+ge:ue+1>p.globals.gridWidth&&(ue=p.globals.gridWidth-ce.width-ge))),{bcx:S,bcy:B,dataLabelsX:ue,dataLabelsY:Ue,totalDataLabelsX:se,totalDataLabelsY:Ce,totalDataLabelsAnchor:Be}}},{key:"drawCalculatedDataLabels",value:function(h){var p=h.x,S=h.y,_=h.val,k=h.i,T=h.j,B=h.textRects,W=h.barHeight,ee=h.barWidth,ce=h.dataLabelsConfig,ue=this.w,ge="rotate(0)";ue.config.plotOptions.bar.dataLabels.orientation==="vertical"&&(ge="rotate(-90, ".concat(p,", ").concat(S,")"));var Se=new Pe(this.barCtx.ctx),ke=new z(this.barCtx.ctx),Me=ce.formatter,qe=null,Fe=ue.globals.collapsedSeriesIndices.indexOf(k)>-1;if(ce.enabled&&!Fe){qe=ke.group({class:"apexcharts-data-labels",transform:ge});var at="";_!==void 0&&(at=Me(_,v(v({},ue),{},{seriesIndex:k,dataPointIndex:T,w:ue}))),!_&&ue.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(at="");var se=ue.globals.series[k][T]<0,Ce=ue.config.plotOptions.bar.dataLabels.position;ue.config.plotOptions.bar.dataLabels.orientation==="vertical"&&(Ce==="top"&&(ce.textAnchor=se?"end":"start"),Ce==="center"&&(ce.textAnchor="middle"),Ce==="bottom"&&(ce.textAnchor=se?"end":"start")),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&ee<ke.getTextRects(at,parseFloat(ce.style.fontSize)).width&&(at=""),ue.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&(this.barCtx.isHorizontal?B.width/1.6>Math.abs(ee)&&(at=""):B.height/1.6>Math.abs(W)&&(at=""));var Ue=v({},ce);this.barCtx.isHorizontal&&_<0&&(ce.textAnchor==="start"?Ue.textAnchor="end":ce.textAnchor==="end"&&(Ue.textAnchor="start")),Se.plotDataLabelsText({x:p,y:S,text:at,i:k,j:T,parent:qe,dataLabelsConfig:Ue,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return qe}},{key:"drawTotalDataLabels",value:function(h){var p=h.x,S=h.y,_=h.val,k=h.realIndex,T=h.textAnchor,B=h.barTotalDataLabelsConfig;this.w;var W,ee=new z(this.barCtx.ctx);return B.enabled&&p!==void 0&&S!==void 0&&this.barCtx.lastActiveBarSerieIndex===k&&(W=ee.drawText({x:p,y:S,foreColor:B.style.color,text:_,textAnchor:T,fontFamily:B.style.fontFamily,fontSize:B.style.fontSize,fontWeight:B.style.fontWeight})),W}}]),Ee}(),un=function(){function Ee(h){s(this,Ee),this.w=h.w,this.barCtx=h}return o(Ee,[{key:"initVariables",value:function(h){var p=this.w;this.barCtx.series=h,this.barCtx.totalItems=0,this.barCtx.seriesLen=0,this.barCtx.visibleI=-1,this.barCtx.visibleItems=1;for(var S=0;S<h.length;S++)if(h[S].length>0&&(this.barCtx.seriesLen=this.barCtx.seriesLen+1,this.barCtx.totalItems+=h[S].length),p.globals.isXNumeric)for(var _=0;_<h[S].length;_++)p.globals.seriesX[S][_]>p.globals.minX&&p.globals.seriesX[S][_]<p.globals.maxX&&this.barCtx.visibleItems++;else this.barCtx.visibleItems=p.globals.dataPoints;this.arrBorderRadius=this.createBorderRadiusArr(p.globals.series),this.barCtx.seriesLen===0&&(this.barCtx.seriesLen=1),this.barCtx.zeroSerieses=[],p.globals.comboCharts||this.checkZeroSeries({series:h})}},{key:"initialPositions",value:function(){var h,p,S,_,k,T,B,W,ee=this.w,ce=ee.globals.dataPoints;this.barCtx.isRangeBar&&(ce=ee.globals.labels.length);var ue=this.barCtx.seriesLen;if(ee.config.plotOptions.bar.rangeBarGroupRows&&(ue=1),this.barCtx.isHorizontal)k=(S=ee.globals.gridHeight/ce)/ue,ee.globals.isXNumeric&&(k=(S=ee.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)),W=this.barCtx.baseLineInvertedY+ee.globals.padHorizontal+(this.barCtx.isReversed?ee.globals.gridWidth:0)-(this.barCtx.isReversed?2*this.barCtx.baseLineInvertedY:0),this.barCtx.isFunnel&&(W=ee.globals.gridWidth/2),p=(S-k*this.barCtx.seriesLen)/2;else{if(_=ee.globals.gridWidth/this.barCtx.visibleItems,ee.config.xaxis.convertedCatToNumeric&&(_=ee.globals.gridWidth/ee.globals.dataPoints),T=_/ue*parseInt(this.barCtx.barOptions.columnWidth,10)/100,ee.globals.isXNumeric){var ge=this.barCtx.xRatio;ee.globals.minXDiff&&ee.globals.minXDiff!==.5&&ee.globals.minXDiff/ge>0&&(_=ee.globals.minXDiff/ge),(T=_/ue*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=ee.globals.gridHeight-this.barCtx.baseLineY[this.barCtx.translationsIndex]-(this.barCtx.isReversed?ee.globals.gridHeight:0)+(this.barCtx.isReversed?2*this.barCtx.baseLineY[this.barCtx.translationsIndex]:0),h=ee.globals.padHorizontal+(_-T*this.barCtx.seriesLen)/2}return ee.globals.barHeight=k,ee.globals.barWidth=T,{x:h,y:p,yDivision:S,xDivision:_,barHeight:k,barWidth:T,zeroH:B,zeroW:W}}},{key:"initializeStackedPrevVars",value:function(h){h.w.globals.seriesGroups.forEach(function(p){h[p]||(h[p]={}),h[p].prevY=[],h[p].prevX=[],h[p].prevYF=[],h[p].prevXF=[],h[p].prevYVal=[],h[p].prevXVal=[]})}},{key:"initializeStackedXYVars",value:function(h){h.w.globals.seriesGroups.forEach(function(p){h[p]||(h[p]={}),h[p].xArrj=[],h[p].xArrjF=[],h[p].xArrjVal=[],h[p].yArrj=[],h[p].yArrjF=[],h[p].yArrjVal=[]})}},{key:"getPathFillColor",value:function(h,p,S,_){var k,T,B,W,ee,ce=this.w,ue=this.barCtx.ctx.fill,ge=null,Se=this.barCtx.barOptions.distributed?S:p;return this.barCtx.barOptions.colors.ranges.length>0&&this.barCtx.barOptions.colors.ranges.map(function(ke){h[p][S]>=ke.from&&h[p][S]<=ke.to&&(ge=ke.color)}),(k=ce.config.series[p].data[S])!==null&&k!==void 0&&k.fillColor&&(ge=ce.config.series[p].data[S].fillColor),ue.fillPath({seriesNumber:this.barCtx.barOptions.distributed?Se:_,dataPointIndex:S,color:ge,value:h[p][S],fillConfig:(T=ce.config.series[p].data[S])===null||T===void 0?void 0:T.fill,fillType:(B=ce.config.series[p].data[S])!==null&&B!==void 0&&(W=B.fill)!==null&&W!==void 0&&W.type?(ee=ce.config.series[p].data[S])===null||ee===void 0?void 0:ee.fill.type:Array.isArray(ce.config.fill.type)?ce.config.fill.type[_]:ce.config.fill.type})}},{key:"getStrokeWidth",value:function(h,p,S){var _=0,k=this.w;return this.barCtx.series[h][p]?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(h){var p=this.w,S=!this.w.config.chart.stacked||p.config.plotOptions.bar.borderRadiusWhenStacked!=="last"||p.config.plotOptions.bar.borderRadius<=0,_=h.length,k=h[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 W=[],ee=[],ce=0,ue=0;ue<_;ue++){var ge=h[ue][B];ge>0?(W.push(ue),ce++):ge<0&&(ee.push(ue),ce++)}if(W.length>0&&ee.length===0)if(W.length===1)T[W[0]][B]="both";else{var Se,ke=W[0],Me=W[W.length-1],qe=l(W);try{for(qe.s();!(Se=qe.n()).done;){var Fe=Se.value;T[Fe][B]=Fe===ke?"bottom":Fe===Me?"top":"none"}}catch(At){qe.e(At)}finally{qe.f()}}else if(ee.length>0&&W.length===0)if(ee.length===1)T[ee[0]][B]="both";else{var at,se=ee[0],Ce=ee[ee.length-1],Ue=l(ee);try{for(Ue.s();!(at=Ue.n()).done;){var Be=at.value;T[Be][B]=Be===se?"bottom":Be===Ce?"top":"none"}}catch(At){Ue.e(At)}finally{Ue.f()}}else if(W.length>0&&ee.length>0){var _e,rt=W[W.length-1],ct=l(W);try{for(ct.s();!(_e=ct.n()).done;){var yt=_e.value;T[yt][B]=yt===rt?"top":"none"}}catch(At){ct.e(At)}finally{ct.f()}var Lt,ft=ee[ee.length-1],Tt=l(ee);try{for(Tt.s();!(Lt=Tt.n()).done;){var Ge=Lt.value;T[Ge][B]=Ge===ft?"bottom":"none"}}catch(At){Tt.e(At)}finally{Tt.f()}}else ce===1&&(T[W[0]||ee[0]][B]="both")}return T}},{key:"barBackground",value:function(h){var p=h.j,S=h.i,_=h.x1,k=h.x2,T=h.y1,B=h.y2,W=h.elSeries,ee=this.w,ce=new z(this.barCtx.ctx),ue=new Re(this.barCtx.ctx).getActiveConfigSeriesIndex();if(this.barCtx.barOptions.colors.backgroundBarColors.length>0&&ue===S){p>=this.barCtx.barOptions.colors.backgroundBarColors.length&&(p%=this.barCtx.barOptions.colors.backgroundBarColors.length);var ge=this.barCtx.barOptions.colors.backgroundBarColors[p],Se=ce.drawRect(_!==void 0?_:0,T!==void 0?T:0,k!==void 0?k:ee.globals.gridWidth,B!==void 0?B:ee.globals.gridHeight,this.barCtx.barOptions.colors.backgroundBarRadius,ge,this.barCtx.barOptions.colors.backgroundBarOpacity);W.add(Se),Se.node.classList.add("apexcharts-backgroundBar")}}},{key:"getColumnPaths",value:function(h){var p,S=h.barWidth,_=h.barXPosition,k=h.y1,T=h.y2,B=h.strokeWidth,W=h.isReversed,ee=h.series,ce=h.seriesGroup,ue=h.realIndex,ge=h.i,Se=h.j,ke=h.w,Me=new z(this.barCtx.ctx);(B=Array.isArray(B)?B[ue]:B)||(B=0);var qe=S,Fe=_;(p=ke.config.series[ue].data[Se])!==null&&p!==void 0&&p.columnWidthOffset&&(Fe=_-ke.config.series[ue].data[Se].columnWidthOffset/2,qe=S+ke.config.series[ue].data[Se].columnWidthOffset);var at=B/2,se=Fe+at,Ce=Fe+qe-at,Ue=(ee[ge][Se]>=0?1:-1)*(W?-1:1);k+=.001-at*Ue,T+=.001+at*Ue;var Be=Me.move(se,k),_e=Me.move(se,k),rt=Me.line(Ce,k);if(ke.globals.previousPaths.length>0&&(_e=this.barCtx.getPreviousPath(ue,Se,!1)),Be=Be+Me.line(se,T)+Me.line(Ce,T)+rt+(ke.config.plotOptions.bar.borderRadiusApplication==="around"||this.arrBorderRadius[ue][Se]==="both"?" Z":" z"),_e=_e+Me.line(se,k)+rt+rt+rt+rt+rt+Me.line(se,k)+(ke.config.plotOptions.bar.borderRadiusApplication==="around"||this.arrBorderRadius[ue][Se]==="both"?" Z":" z"),this.arrBorderRadius[ue][Se]!=="none"&&(Be=Me.roundPathCorners(Be,ke.config.plotOptions.bar.borderRadius)),ke.config.chart.stacked){var ct=this.barCtx;(ct=this.barCtx[ce]).yArrj.push(T-at*Ue),ct.yArrjF.push(Math.abs(k-T+B*Ue)),ct.yArrjVal.push(this.barCtx.series[ge][Se])}return{pathTo:Be,pathFrom:_e}}},{key:"getBarpaths",value:function(h){var p,S=h.barYPosition,_=h.barHeight,k=h.x1,T=h.x2,B=h.strokeWidth,W=h.isReversed,ee=h.series,ce=h.seriesGroup,ue=h.realIndex,ge=h.i,Se=h.j,ke=h.w,Me=new z(this.barCtx.ctx);(B=Array.isArray(B)?B[ue]:B)||(B=0);var qe=S,Fe=_;(p=ke.config.series[ue].data[Se])!==null&&p!==void 0&&p.barHeightOffset&&(qe=S-ke.config.series[ue].data[Se].barHeightOffset/2,Fe=_+ke.config.series[ue].data[Se].barHeightOffset);var at=B/2,se=qe+at,Ce=qe+Fe-at,Ue=(ee[ge][Se]>=0?1:-1)*(W?-1:1);k+=.001+at*Ue,T+=.001-at*Ue;var Be=Me.move(k,se),_e=Me.move(k,se);ke.globals.previousPaths.length>0&&(_e=this.barCtx.getPreviousPath(ue,Se,!1));var rt=Me.line(k,Ce);if(Be=Be+Me.line(T,se)+Me.line(T,Ce)+rt+(ke.config.plotOptions.bar.borderRadiusApplication==="around"||this.arrBorderRadius[ue][Se]==="both"?" Z":" z"),_e=_e+Me.line(k,se)+rt+rt+rt+rt+rt+Me.line(k,se)+(ke.config.plotOptions.bar.borderRadiusApplication==="around"||this.arrBorderRadius[ue][Se]==="both"?" Z":" z"),this.arrBorderRadius[ue][Se]!=="none"&&(Be=Me.roundPathCorners(Be,ke.config.plotOptions.bar.borderRadius)),ke.config.chart.stacked){var ct=this.barCtx;(ct=this.barCtx[ce]).xArrj.push(T+at*Ue),ct.xArrjF.push(Math.abs(k-T-B*Ue)),ct.xArrjVal.push(this.barCtx.series[ge][Se])}return{pathTo:Be,pathFrom:_e}}},{key:"checkZeroSeries",value:function(h){for(var p=h.series,S=this.w,_=0;_<p.length;_++){for(var k=0,T=0;T<p[S.globals.maxValsInArrayIndex].length;T++)k+=p[_][T];k===0&&this.barCtx.zeroSerieses.push(_)}}},{key:"getXForValue",value:function(h,p){var S=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2]?p:null;return h!=null&&(S=p+h/this.barCtx.invertedYRatio-2*(this.barCtx.isReversed?h/this.barCtx.invertedYRatio:0)),S}},{key:"getYForValue",value:function(h,p,S){var _=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3]?p:null;return h!=null&&(_=p-h/this.barCtx.yRatio[S]+2*(this.barCtx.isReversed?h/this.barCtx.yRatio[S]:0)),_}},{key:"getGoalValues",value:function(h,p,S,_,k,T){var B=this,W=this.w,ee=[],ce=function(Se,ke){var Me;ee.push((u(Me={},h,h==="x"?B.getXForValue(Se,p,!1):B.getYForValue(Se,S,T,!1)),u(Me,"attrs",ke),Me))};if(W.globals.seriesGoals[_]&&W.globals.seriesGoals[_][k]&&Array.isArray(W.globals.seriesGoals[_][k])&&W.globals.seriesGoals[_][k].forEach(function(Se){ce(Se.value,Se)}),this.barCtx.barOptions.isDumbbell&&W.globals.seriesRange.length){var ue=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:W.globals.colors,ge={strokeHeight:h==="x"?0:W.globals.markers.size[_],strokeWidth:h==="x"?W.globals.markers.size[_]:0,strokeDashArray:0,strokeLineCap:"round",strokeColor:Array.isArray(ue[_])?ue[_][0]:ue[_]};ce(W.globals.seriesRangeStart[_][k],ge),ce(W.globals.seriesRangeEnd[_][k],v(v({},ge),{},{strokeColor:Array.isArray(ue[_])?ue[_][1]:ue[_]}))}return ee}},{key:"drawGoalLine",value:function(h){var p=h.barXPosition,S=h.barYPosition,_=h.goalX,k=h.goalY,T=h.barWidth,B=h.barHeight,W=new z(this.barCtx.ctx),ee=W.group({className:"apexcharts-bar-goals-groups"});ee.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:ee.node}),ee.attr("clip-path","url(#gridRectMarkerMask".concat(this.barCtx.w.globals.cuid,")"));var ce=null;return this.barCtx.isHorizontal?Array.isArray(_)&&_.forEach(function(ue){if(ue.x>=-1&&ue.x<=W.w.globals.gridWidth+1){var ge=ue.attrs.strokeHeight!==void 0?ue.attrs.strokeHeight:B/2,Se=S+ge+B/2;ce=W.drawLine(ue.x,Se-2*ge,ue.x,Se,ue.attrs.strokeColor?ue.attrs.strokeColor:void 0,ue.attrs.strokeDashArray,ue.attrs.strokeWidth?ue.attrs.strokeWidth:2,ue.attrs.strokeLineCap),ee.add(ce)}}):Array.isArray(k)&&k.forEach(function(ue){if(ue.y>=-1&&ue.y<=W.w.globals.gridHeight+1){var ge=ue.attrs.strokeWidth!==void 0?ue.attrs.strokeWidth:T/2,Se=p+ge+T/2;ce=W.drawLine(Se-2*ge,ue.y,Se,ue.y,ue.attrs.strokeColor?ue.attrs.strokeColor:void 0,ue.attrs.strokeDashArray,ue.attrs.strokeHeight?ue.attrs.strokeHeight:2,ue.attrs.strokeLineCap),ee.add(ce)}}),ee}},{key:"drawBarShadow",value:function(h){var p=h.prevPaths,S=h.currPaths,_=h.color,k=this.w,T=p.x,B=p.x1,W=p.barYPosition,ee=S.x,ce=S.x1,ue=S.barYPosition,ge=W+S.barHeight,Se=new z(this.barCtx.ctx),ke=new O,Me=Se.move(B,ge)+Se.line(T,ge)+Se.line(ee,ue)+Se.line(ce,ue)+Se.line(B,ge)+(k.config.plotOptions.bar.borderRadiusApplication==="around"||this.arrBorderRadius[realIndex][j]==="both"?" Z":" z");return Se.drawPath({d:Me,fill:ke.shadeColor(.5,O.rgb2hex(_)),stroke:"none",strokeWidth:0,fillOpacity:1,classes:"apexcharts-bar-shadows"})}},{key:"getZeroValueEncounters",value:function(h){var p,S=h.i,_=h.j,k=this.w,T=0,B=0;return(k.config.plotOptions.bar.horizontal?k.globals.series.map(function(W,ee){return ee}):((p=k.globals.columnSeries)===null||p===void 0?void 0:p.i.map(function(W){return W}))||[]).forEach(function(W){var ee=k.globals.seriesPercent[W][_];ee&&T++,W<S&&ee===0&&B++}),{nonZeroColumns:T,zeroEncounters:B}}},{key:"getGroupIndex",value:function(h){var p=this.w,S=p.globals.seriesGroups.findIndex(function(T){return T.indexOf(p.globals.seriesNames[h])>-1}),_=this.barCtx.columnGroupIndices,k=_.indexOf(S);return k<0&&(_.push(S),k=_.length-1),{groupIndex:S,columnGroupIndex:k}}}]),Ee}(),an=function(){function Ee(h,p){s(this,Ee),this.ctx=h,this.w=h.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=p,this.xyRatios!==null&&(this.xRatio=p.xRatio,this.yRatio=p.yRatio,this.invertedXRatio=p.invertedXRatio,this.invertedYRatio=p.invertedYRatio,this.baseLineY=p.baseLineY,this.baseLineInvertedY=p.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,W){return k.indexOf(W)===-1?W:-1}).filter(function(B){return B!==-1})),this.barHelpers=new un(this)}return o(Ee,[{key:"draw",value:function(h,p){var S=this.w,_=new z(this.ctx),k=new X(this.ctx,S);h=k.getLogSeries(h),this.series=h,this.yRatio=k.getLogYRatios(this.yRatio),this.barHelpers.initVariables(h);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,W=0;B<h.length;B++,W++){var ee,ce,ue,ge,Se=void 0,ke=void 0,Me=[],qe=[],Fe=S.globals.comboCharts?p[B]:B,at=this.barHelpers.getGroupIndex(Fe).columnGroupIndex,se=_.group({class:"apexcharts-series",rel:B+1,seriesName:O.escapeString(S.globals.seriesNames[Fe]),"data:realIndex":Fe});this.ctx.series.addCollapsedClassToSeries(se,Fe),h[B].length>0&&(this.visibleI=this.visibleI+1);var Ce=0,Ue=0;this.yRatio.length>1&&(this.yaxisIndex=S.globals.seriesYAxisReverseMap[Fe],this.translationsIndex=Fe);var Be=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,ce=_e.yDivision,ge=_e.zeroW,Se=_e.x,Ue=_e.barWidth,ee=_e.xDivision,ue=_e.zeroH,this.horizontal||qe.push(Se+Ue/2);var rt=_.group({class:"apexcharts-datalabels","data:realIndex":Fe});S.globals.delayedElements.push({el:rt.node}),rt.node.classList.add("apexcharts-element-hidden");var ct=_.group({class:"apexcharts-bar-goals-markers"}),yt=_.group({class:"apexcharts-bar-shadows"});S.globals.delayedElements.push({el:yt.node}),yt.node.classList.add("apexcharts-element-hidden");for(var Lt=0;Lt<h[B].length;Lt++){var ft=this.barHelpers.getStrokeWidth(B,Lt,Fe),Tt=null,Ge={indexes:{i:B,j:Lt,realIndex:Fe,translationsIndex:Be,bc:W},x:Se,y:ke,strokeWidth:ft,elSeries:se};this.isHorizontal?(Tt=this.drawBarPaths(v(v({},Ge),{},{barHeight:Ce,zeroW:ge,yDivision:ce})),Ue=this.series[B][Lt]/this.invertedYRatio):(Tt=this.drawColumnPaths(v(v({},Ge),{},{xDivision:ee,barWidth:Ue,zeroH:ue})),Ce=this.series[B][Lt]/this.yRatio[Be]);var At=this.barHelpers.getPathFillColor(h,B,Lt,Fe);if(this.isFunnel&&this.barOptions.isFunnel3d&&this.pathArr.length&&Lt>0){var Ot=this.barHelpers.drawBarShadow({color:typeof At=="string"&&(At==null?void 0:At.indexOf("url"))===-1?At:O.hexToRgba(S.globals.colors[B]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:Tt});Ot&&yt.add(Ot)}this.pathArr.push(Tt);var it=this.barHelpers.drawGoalLine({barXPosition:Tt.barXPosition,barYPosition:Tt.barYPosition,goalX:Tt.goalX,goalY:Tt.goalY,barHeight:Ce,barWidth:Ue});it&&ct.add(it),ke=Tt.y,Se=Tt.x,Lt>0&&qe.push(Se+Ue/2),Me.push(ke),this.renderSeries({realIndex:Fe,pathFill:At,j:Lt,i:B,columnGroupIndex:at,pathFrom:Tt.pathFrom,pathTo:Tt.pathTo,strokeWidth:ft,elSeries:se,x:Se,y:ke,series:h,barHeight:Math.abs(Tt.barHeight?Tt.barHeight:Ce),barWidth:Math.abs(Tt.barWidth?Tt.barWidth:Ue),elDataLabelsWrap:rt,elGoalsMarkers:ct,elBarShadows:yt,visibleSeries:this.visibleI,type:"bar"})}S.globals.seriesXvalues[Fe]=qe,S.globals.seriesYvalues[Fe]=Me,T.add(se)}return T}},{key:"renderSeries",value:function(h){var p=h.realIndex,S=h.pathFill,_=h.lineFill,k=h.j,T=h.i,B=h.columnGroupIndex,W=h.pathFrom,ee=h.pathTo,ce=h.strokeWidth,ue=h.elSeries,ge=h.x,Se=h.y,ke=h.y1,Me=h.y2,qe=h.series,Fe=h.barHeight,at=h.barWidth,se=h.barXPosition,Ce=h.barYPosition,Ue=h.elDataLabelsWrap,Be=h.elGoalsMarkers,_e=h.elBarShadows,rt=h.visibleSeries,ct=h.type,yt=h.classes,Lt=this.w,ft=new z(this.ctx);if(!_){var Tt=typeof Lt.globals.stroke.colors[p]=="function"?function(jt){var Nn,mn=Lt.config.stroke.colors;return Array.isArray(mn)&&mn.length>0&&((Nn=mn[jt])||(Nn=""),typeof Nn=="function")?Nn({value:Lt.globals.series[jt][k],dataPointIndex:k,w:Lt}):Nn}(p):Lt.globals.stroke.colors[p];_=this.barOptions.distributed?Lt.globals.stroke.colors[k]:Tt}Lt.config.series[T].data[k]&&Lt.config.series[T].data[k].strokeColor&&(_=Lt.config.series[T].data[k].strokeColor),this.isNullValue&&(S="none");var Ge=k/Lt.config.chart.animations.animateGradually.delay*(Lt.config.chart.animations.speed/Lt.globals.dataPoints)/2.4,At=ft.renderPaths({i:T,j:k,realIndex:p,pathFrom:W,pathTo:ee,stroke:_,strokeWidth:ce,strokeLineCap:Lt.config.stroke.lineCap,fill:S,animationDelay:Ge,initialSpeed:Lt.config.chart.animations.speed,dataChangeSpeed:Lt.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-".concat(ct,"-area ").concat(yt),chartType:ct});At.attr("clip-path","url(#gridRectBarMask".concat(Lt.globals.cuid,")"));var Ot=Lt.config.forecastDataPoints;Ot.count>0&&k>=Lt.globals.dataPoints-Ot.count&&(At.node.setAttribute("stroke-dasharray",Ot.dashArray),At.node.setAttribute("stroke-width",Ot.strokeWidth),At.node.setAttribute("fill-opacity",Ot.fillOpacity)),ke!==void 0&&Me!==void 0&&(At.attr("data-range-y1",ke),At.attr("data-range-y2",Me)),new L(this.ctx).setSelectionFilter(At,p,k),ue.add(At);var it=new Pt(this).handleBarDataLabels({x:ge,y:Se,y1:ke,y2:Me,i:T,j:k,series:qe,realIndex:p,columnGroupIndex:B,barHeight:Fe,barWidth:at,barXPosition:se,barYPosition:Ce,renderedPath:At,visibleSeries:rt});return it.dataLabels!==null&&Ue.add(it.dataLabels),it.totalDataLabels&&Ue.add(it.totalDataLabels),ue.add(Ue),Be&&ue.add(Be),_e&&ue.add(_e),ue}},{key:"drawBarPaths",value:function(h){var p,S=h.indexes,_=h.barHeight,k=h.strokeWidth,T=h.zeroW,B=h.x,W=h.y,ee=h.yDivision,ce=h.elSeries,ue=this.w,ge=S.i,Se=S.j;if(ue.globals.isXNumeric)p=(W=(ue.globals.seriesX[ge][Se]-ue.globals.minX)/this.invertedXRatio-_)+_*this.visibleI;else if(ue.config.plotOptions.bar.hideZeroBarsWhenGrouped){var ke=0,Me=0;ue.globals.seriesPercent.forEach(function(Fe,at){Fe[Se]&&ke++,at<ge&&Fe[Se]===0&&Me++}),ke>0&&(_=this.seriesLen*_/ke),p=W+_*this.visibleI,p-=_*Me}else p=W+_*this.visibleI;this.isFunnel&&(T-=(this.barHelpers.getXForValue(this.series[ge][Se],T)-T)/2),B=this.barHelpers.getXForValue(this.series[ge][Se],T);var qe=this.barHelpers.getBarpaths({barYPosition:p,barHeight:_,x1:T,x2:B,strokeWidth:k,isReversed:this.isReversed,series:this.series,realIndex:S.realIndex,i:ge,j:Se,w:ue});return ue.globals.isXNumeric||(W+=ee),this.barHelpers.barBackground({j:Se,i:ge,y1:p-_*this.visibleI,y2:_*this.seriesLen,elSeries:ce}),{pathTo:qe.pathTo,pathFrom:qe.pathFrom,x1:T,x:B,y:W,goalX:this.barHelpers.getGoalValues("x",T,null,ge,Se),barYPosition:p,barHeight:_}}},{key:"drawColumnPaths",value:function(h){var p,S=h.indexes,_=h.x,k=h.y,T=h.xDivision,B=h.barWidth,W=h.zeroH,ee=h.strokeWidth,ce=h.elSeries,ue=this.w,ge=S.realIndex,Se=S.translationsIndex,ke=S.i,Me=S.j,qe=S.bc;if(ue.globals.isXNumeric){var Fe=this.getBarXForNumericXAxis({x:_,j:Me,realIndex:ge,barWidth:B});_=Fe.x,p=Fe.barXPosition}else if(ue.config.plotOptions.bar.hideZeroBarsWhenGrouped){var at=this.barHelpers.getZeroValueEncounters({i:ke,j:Me}),se=at.nonZeroColumns,Ce=at.zeroEncounters;se>0&&(B=this.seriesLen*B/se),p=_+B*this.visibleI,p-=B*Ce}else p=_+B*this.visibleI;k=this.barHelpers.getYForValue(this.series[ke][Me],W,Se);var Ue=this.barHelpers.getColumnPaths({barXPosition:p,barWidth:B,y1:W,y2:k,strokeWidth:ee,isReversed:this.isReversed,series:this.series,realIndex:ge,i:ke,j:Me,w:ue});return ue.globals.isXNumeric||(_+=T),this.barHelpers.barBackground({bc:qe,j:Me,i:ke,x1:p-ee/2-B*this.visibleI,x2:B*this.seriesLen+ee/2,elSeries:ce}),{pathTo:Ue.pathTo,pathFrom:Ue.pathFrom,x:_,y:k,goalY:this.barHelpers.getGoalValues("y",null,W,ke,Me,Se),barXPosition:p,barWidth:B}}},{key:"getBarXForNumericXAxis",value:function(h){var p=h.x,S=h.barWidth,_=h.realIndex,k=h.j,T=this.w,B=_;return T.globals.seriesX[_].length||(B=T.globals.maxValsInArrayIndex),T.globals.seriesX[B][k]&&(p=(T.globals.seriesX[B][k]-T.globals.minX)/this.xRatio-S*this.seriesLen/2),{barXPosition:p+S*this.visibleI,x:p}}},{key:"getPreviousPath",value:function(h,p){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(h,10)&&_.globals.previousPaths[k].paths[p]!==void 0&&(S=_.globals.previousPaths[k].paths[p].d)}return S}}]),Ee}(),xn=function(Ee){f(p,an);var h=c(p);function p(){return s(this,p),h.apply(this,arguments)}return o(p,[{key:"draw",value:function(S,_){var k=this,T=this.w;this.graphics=new z(this.ctx),this.bar=new an(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 W=this.graphics.group({class:"apexcharts-bar-series apexcharts-plot-series"}),ee=0,ce=0,ue=function(ke,Me){var qe=void 0,Fe=void 0,at=void 0,se=void 0,Ce=T.globals.comboCharts?_[ke]:ke,Ue=k.barHelpers.getGroupIndex(Ce),Be=Ue.groupIndex,_e=Ue.columnGroupIndex;k.groupCtx=k[T.globals.seriesGroups[Be]];var rt=[],ct=[],yt=0;k.yRatio.length>1&&(k.yaxisIndex=T.globals.seriesYAxisReverseMap[Ce][0],yt=Ce),k.isReversed=T.config.yaxis[k.yaxisIndex]&&T.config.yaxis[k.yaxisIndex].reversed;var Lt=k.graphics.group({class:"apexcharts-series",seriesName:O.escapeString(T.globals.seriesNames[Ce]),rel:ke+1,"data:realIndex":Ce});k.ctx.series.addCollapsedClassToSeries(Lt,Ce);var ft=k.graphics.group({class:"apexcharts-datalabels","data:realIndex":Ce}),Tt=k.graphics.group({class:"apexcharts-bar-goals-markers"}),Ge=0,At=0,Ot=k.initialPositions(ee,ce,qe,Fe,at,se,yt);ce=Ot.y,Ge=Ot.barHeight,Fe=Ot.yDivision,se=Ot.zeroW,ee=Ot.x,At=Ot.barWidth,qe=Ot.xDivision,at=Ot.zeroH,T.globals.barHeight=Ge,T.globals.barWidth=At,k.barHelpers.initializeStackedXYVars(k),k.groupCtx.prevY.length===1&&k.groupCtx.prevY[0].every(function(rr){return isNaN(rr)})&&(k.groupCtx.prevY[0]=k.groupCtx.prevY[0].map(function(){return at}),k.groupCtx.prevYF[0]=k.groupCtx.prevYF[0].map(function(){return 0}));for(var it=0;it<T.globals.dataPoints;it++){var jt=k.barHelpers.getStrokeWidth(ke,it,Ce),Nn={indexes:{i:ke,j:it,realIndex:Ce,translationsIndex:yt,bc:Me},strokeWidth:jt,x:ee,y:ce,elSeries:Lt,columnGroupIndex:_e,seriesGroup:T.globals.seriesGroups[Be]},mn=null;k.isHorizontal?(mn=k.drawStackedBarPaths(v(v({},Nn),{},{zeroW:se,barHeight:Ge,yDivision:Fe})),At=k.series[ke][it]/k.invertedYRatio):(mn=k.drawStackedColumnPaths(v(v({},Nn),{},{xDivision:qe,barWidth:At,zeroH:at})),Ge=k.series[ke][it]/k.yRatio[yt]);var ir=k.barHelpers.drawGoalLine({barXPosition:mn.barXPosition,barYPosition:mn.barYPosition,goalX:mn.goalX,goalY:mn.goalY,barHeight:Ge,barWidth:At});ir&&Tt.add(ir),ce=mn.y,ee=mn.x,rt.push(ee),ct.push(ce);var Sn=k.barHelpers.getPathFillColor(S,ke,it,Ce),Bn="";T.globals.isBarHorizontal?k.barHelpers.arrBorderRadius[Ce][it]==="bottom"&&T.globals.series[Ce][it]>0&&(Bn="apexcharts-flip-x"):k.barHelpers.arrBorderRadius[Ce][it]==="bottom"&&T.globals.series[Ce][it]>0&&(Bn="apexcharts-flip-y"),Lt=k.renderSeries({realIndex:Ce,pathFill:Sn,j:it,i:ke,columnGroupIndex:_e,pathFrom:mn.pathFrom,pathTo:mn.pathTo,strokeWidth:jt,elSeries:Lt,x:ee,y:ce,series:S,barHeight:Ge,barWidth:At,elDataLabelsWrap:ft,elGoalsMarkers:Tt,type:"bar",visibleSeries:_e,classes:Bn})}T.globals.seriesXvalues[Ce]=rt,T.globals.seriesYvalues[Ce]=ct,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),W.add(Lt)},ge=0,Se=0;ge<S.length;ge++,Se++)ue(ge,Se);return W}},{key:"initialPositions",value:function(S,_,k,T,B,W,ee){var ce,ue,ge=this.w;if(this.isHorizontal){T=ge.globals.gridHeight/ge.globals.dataPoints;var Se=ge.config.plotOptions.bar.barHeight;ce=String(Se).indexOf("%")===-1?parseInt(Se,10):T*parseInt(Se,10)/100,W=ge.globals.padHorizontal+(this.isReversed?ge.globals.gridWidth-this.baseLineInvertedY:this.baseLineInvertedY),_=(T-ce)/2}else{ue=k=ge.globals.gridWidth/ge.globals.dataPoints;var ke=ge.config.plotOptions.bar.columnWidth;ge.globals.isXNumeric&&ge.globals.dataPoints>1?ue=(k=ge.globals.minXDiff/this.xRatio)*parseInt(this.barOptions.columnWidth,10)/100:String(ke).indexOf("%")===-1?ue=parseInt(ke,10):ue*=parseInt(ke,10)/100,B=this.isReversed?this.baseLineY[ee]:ge.globals.gridHeight-this.baseLineY[ee],S=ge.globals.padHorizontal+(k-ue)/2}var Me=ge.globals.barGroups.length||1;return{x:S,y:_,yDivision:T,xDivision:k,barHeight:ce/Me,barWidth:ue/Me,zeroH:B,zeroW:W}}},{key:"drawStackedBarPaths",value:function(S){for(var _,k=S.indexes,T=S.barHeight,B=S.strokeWidth,W=S.zeroW,ee=S.x,ce=S.y,ue=S.columnGroupIndex,ge=S.seriesGroup,Se=S.yDivision,ke=S.elSeries,Me=this.w,qe=ce+ue*T,Fe=k.i,at=k.j,se=k.realIndex,Ce=k.translationsIndex,Ue=0,Be=0;Be<this.groupCtx.prevXF.length;Be++)Ue+=this.groupCtx.prevXF[Be][at];var _e;if((_e=ge.indexOf(Me.config.series[se].name))>0){var rt=W;this.groupCtx.prevXVal[_e-1][at]<0?rt=this.series[Fe][at]>=0?this.groupCtx.prevX[_e-1][at]+Ue-2*(this.isReversed?Ue:0):this.groupCtx.prevX[_e-1][at]:this.groupCtx.prevXVal[_e-1][at]>=0&&(rt=this.series[Fe][at]>=0?this.groupCtx.prevX[_e-1][at]:this.groupCtx.prevX[_e-1][at]-Ue+2*(this.isReversed?Ue:0)),_=rt}else _=W;ee=this.series[Fe][at]===null?_:_+this.series[Fe][at]/this.invertedYRatio-2*(this.isReversed?this.series[Fe][at]/this.invertedYRatio:0);var ct=this.barHelpers.getBarpaths({barYPosition:qe,barHeight:T,x1:_,x2:ee,strokeWidth:B,isReversed:this.isReversed,series:this.series,realIndex:k.realIndex,seriesGroup:ge,i:Fe,j:at,w:Me});return this.barHelpers.barBackground({j:at,i:Fe,y1:qe,y2:T,elSeries:ke}),ce+=Se,{pathTo:ct.pathTo,pathFrom:ct.pathFrom,goalX:this.barHelpers.getGoalValues("x",W,null,Fe,at,Ce),barXPosition:_,barYPosition:qe,x:ee,y:ce}}},{key:"drawStackedColumnPaths",value:function(S){var _=S.indexes,k=S.x,T=S.y,B=S.xDivision,W=S.barWidth,ee=S.zeroH,ce=S.columnGroupIndex,ue=S.seriesGroup,ge=S.elSeries,Se=this.w,ke=_.i,Me=_.j,qe=_.bc,Fe=_.realIndex,at=_.translationsIndex;if(Se.globals.isXNumeric){var se=Se.globals.seriesX[Fe][Me];se||(se=0),k=(se-Se.globals.minX)/this.xRatio-W/2*Se.globals.barGroups.length}for(var Ce,Ue=k+ce*W,Be=0,_e=0;_e<this.groupCtx.prevYF.length;_e++)Be+=isNaN(this.groupCtx.prevYF[_e][Me])?0:this.groupCtx.prevYF[_e][Me];var rt=ke;if(ue&&(rt=ue.indexOf(Se.globals.seriesNames[Fe])),rt>0&&!Se.globals.isXNumeric||rt>0&&Se.globals.isXNumeric&&Se.globals.seriesX[Fe-1][Me]===Se.globals.seriesX[Fe][Me]){var ct,yt,Lt,ft=Math.min(this.yRatio.length+1,Fe+1);if(this.groupCtx.prevY[rt-1]!==void 0&&this.groupCtx.prevY[rt-1].length)for(var Tt=1;Tt<ft;Tt++){var Ge;if(!isNaN((Ge=this.groupCtx.prevY[rt-Tt])===null||Ge===void 0?void 0:Ge[Me])){Lt=this.groupCtx.prevY[rt-Tt][Me];break}}for(var At=1;At<ft;At++){var Ot,it;if(((Ot=this.groupCtx.prevYVal[rt-At])===null||Ot===void 0?void 0:Ot[Me])<0){yt=this.series[ke][Me]>=0?Lt-Be+2*(this.isReversed?Be:0):Lt;break}if(((it=this.groupCtx.prevYVal[rt-At])===null||it===void 0?void 0:it[Me])>=0){yt=this.series[ke][Me]>=0?Lt:Lt+Be-2*(this.isReversed?Be:0);break}}yt===void 0&&(yt=Se.globals.gridHeight),Ce=(ct=this.groupCtx.prevYF[0])!==null&&ct!==void 0&&ct.every(function(Nn){return Nn===0})&&this.groupCtx.prevYF.slice(1,rt).every(function(Nn){return Nn.every(function(mn){return isNaN(mn)})})?ee:yt}else Ce=ee;T=this.series[ke][Me]?Ce-this.series[ke][Me]/this.yRatio[at]+2*(this.isReversed?this.series[ke][Me]/this.yRatio[at]:0):Ce;var jt=this.barHelpers.getColumnPaths({barXPosition:Ue,barWidth:W,y1:Ce,y2:T,yRatio:this.yRatio[at],strokeWidth:this.strokeWidth,isReversed:this.isReversed,series:this.series,seriesGroup:ue,realIndex:_.realIndex,i:ke,j:Me,w:Se});return this.barHelpers.barBackground({bc:qe,j:Me,i:ke,x1:Ue,x2:W,elSeries:ge}),{pathTo:jt.pathTo,pathFrom:jt.pathFrom,goalY:this.barHelpers.getGoalValues("y",null,ee,ke,Me),barXPosition:Ue,x:Se.globals.isXNumeric?k:k+B,y:T}}}]),p}(),An=function(Ee){f(p,an);var h=c(p);function p(){return s(this,p),h.apply(this,arguments)}return o(p,[{key:"draw",value:function(S,_,k){var T=this,B=this.w,W=new z(this.ctx),ee=B.globals.comboCharts?_:B.config.chart.type,ce=new xe(this.ctx);this.candlestickOptions=this.w.config.plotOptions.candlestick,this.boxOptions=this.w.config.plotOptions.boxPlot,this.isHorizontal=B.config.plotOptions.bar.horizontal;var ue=new X(this.ctx,B);S=ue.getLogSeries(S),this.series=S,this.yRatio=ue.getLogYRatios(this.yRatio),this.barHelpers.initVariables(S);for(var ge=W.group({class:"apexcharts-".concat(ee,"-series apexcharts-plot-series")}),Se=function(Me){T.isBoxPlot=B.config.chart.type==="boxPlot"||B.config.series[Me].type==="boxPlot";var qe,Fe,at,se,Ce=void 0,Ue=void 0,Be=[],_e=[],rt=B.globals.comboCharts?k[Me]:Me,ct=T.barHelpers.getGroupIndex(rt).columnGroupIndex,yt=W.group({class:"apexcharts-series",seriesName:O.escapeString(B.globals.seriesNames[rt]),rel:Me+1,"data:realIndex":rt});T.ctx.series.addCollapsedClassToSeries(yt,rt),S[Me].length>0&&(T.visibleI=T.visibleI+1);var Lt,ft,Tt=0;T.yRatio.length>1&&(T.yaxisIndex=B.globals.seriesYAxisReverseMap[rt][0],Tt=rt);var Ge=T.barHelpers.initialPositions();Ue=Ge.y,Lt=Ge.barHeight,Fe=Ge.yDivision,se=Ge.zeroW,Ce=Ge.x,ft=Ge.barWidth,qe=Ge.xDivision,at=Ge.zeroH,_e.push(Ce+ft/2);for(var At=W.group({class:"apexcharts-datalabels","data:realIndex":rt}),Ot=function(jt){var Nn=T.barHelpers.getStrokeWidth(Me,jt,rt),mn=null,ir={indexes:{i:Me,j:jt,realIndex:rt,translationsIndex:Tt},x:Ce,y:Ue,strokeWidth:Nn,elSeries:yt};mn=T.isHorizontal?T.drawHorizontalBoxPaths(v(v({},ir),{},{yDivision:Fe,barHeight:Lt,zeroW:se})):T.drawVerticalBoxPaths(v(v({},ir),{},{xDivision:qe,barWidth:ft,zeroH:at})),Ue=mn.y,Ce=mn.x,jt>0&&_e.push(Ce+ft/2),Be.push(Ue),mn.pathTo.forEach(function(Sn,Bn){var rr=!T.isBoxPlot&&T.candlestickOptions.wick.useFillColor?mn.color[Bn]:B.globals.stroke.colors[Me],ur=ce.fillPath({seriesNumber:rt,dataPointIndex:jt,color:mn.color[Bn],value:S[Me][jt]});T.renderSeries({realIndex:rt,pathFill:ur,lineFill:rr,j:jt,i:Me,pathFrom:mn.pathFrom,pathTo:Sn,strokeWidth:Nn,elSeries:yt,x:Ce,y:Ue,series:S,columnGroupIndex:ct,barHeight:Lt,barWidth:ft,elDataLabelsWrap:At,visibleSeries:T.visibleI,type:B.config.chart.type})})},it=0;it<B.globals.dataPoints;it++)Ot(it);B.globals.seriesXvalues[rt]=_e,B.globals.seriesYvalues[rt]=Be,ge.add(yt)},ke=0;ke<S.length;ke++)Se(ke);return ge}},{key:"drawVerticalBoxPaths",value:function(S){var _=S.indexes,k=S.x;S.y;var T=S.xDivision,B=S.barWidth,W=S.zeroH,ee=S.strokeWidth,ce=this.w,ue=new z(this.ctx),ge=_.i,Se=_.j,ke=!0,Me=ce.config.plotOptions.candlestick.colors.upward,qe=ce.config.plotOptions.candlestick.colors.downward,Fe="";this.isBoxPlot&&(Fe=[this.boxOptions.colors.lower,this.boxOptions.colors.upper]);var at=this.yRatio[_.translationsIndex],se=_.realIndex,Ce=this.getOHLCValue(se,Se),Ue=W,Be=W;Ce.o>Ce.c&&(ke=!1);var _e=Math.min(Ce.o,Ce.c),rt=Math.max(Ce.o,Ce.c),ct=Ce.m;ce.globals.isXNumeric&&(k=(ce.globals.seriesX[se][Se]-ce.globals.minX)/this.xRatio-B/2);var yt=k+B*this.visibleI;this.series[ge][Se]===void 0||this.series[ge][Se]===null?(_e=W,rt=W):(_e=W-_e/at,rt=W-rt/at,Ue=W-Ce.h/at,Be=W-Ce.l/at,ct=W-Ce.m/at);var Lt=ue.move(yt,W),ft=ue.move(yt+B/2,_e);return ce.globals.previousPaths.length>0&&(ft=this.getPreviousPath(se,Se,!0)),Lt=this.isBoxPlot?[ue.move(yt,_e)+ue.line(yt+B/2,_e)+ue.line(yt+B/2,Ue)+ue.line(yt+B/4,Ue)+ue.line(yt+B-B/4,Ue)+ue.line(yt+B/2,Ue)+ue.line(yt+B/2,_e)+ue.line(yt+B,_e)+ue.line(yt+B,ct)+ue.line(yt,ct)+ue.line(yt,_e+ee/2),ue.move(yt,ct)+ue.line(yt+B,ct)+ue.line(yt+B,rt)+ue.line(yt+B/2,rt)+ue.line(yt+B/2,Be)+ue.line(yt+B-B/4,Be)+ue.line(yt+B/4,Be)+ue.line(yt+B/2,Be)+ue.line(yt+B/2,rt)+ue.line(yt,rt)+ue.line(yt,ct)+"z"]:[ue.move(yt,rt)+ue.line(yt+B/2,rt)+ue.line(yt+B/2,Ue)+ue.line(yt+B/2,rt)+ue.line(yt+B,rt)+ue.line(yt+B,_e)+ue.line(yt+B/2,_e)+ue.line(yt+B/2,Be)+ue.line(yt+B/2,_e)+ue.line(yt,_e)+ue.line(yt,rt-ee/2)],ft+=ue.move(yt,_e),ce.globals.isXNumeric||(k+=T),{pathTo:Lt,pathFrom:ft,x:k,y:rt,barXPosition:yt,color:this.isBoxPlot?Fe:ke?[Me]:[qe]}}},{key:"drawHorizontalBoxPaths",value:function(S){var _=S.indexes;S.x;var k=S.y,T=S.yDivision,B=S.barHeight,W=S.zeroW,ee=S.strokeWidth,ce=this.w,ue=new z(this.ctx),ge=_.i,Se=_.j,ke=this.boxOptions.colors.lower;this.isBoxPlot&&(ke=[this.boxOptions.colors.lower,this.boxOptions.colors.upper]);var Me=this.invertedYRatio,qe=_.realIndex,Fe=this.getOHLCValue(qe,Se),at=W,se=W,Ce=Math.min(Fe.o,Fe.c),Ue=Math.max(Fe.o,Fe.c),Be=Fe.m;ce.globals.isXNumeric&&(k=(ce.globals.seriesX[qe][Se]-ce.globals.minX)/this.invertedXRatio-B/2);var _e=k+B*this.visibleI;this.series[ge][Se]===void 0||this.series[ge][Se]===null?(Ce=W,Ue=W):(Ce=W+Ce/Me,Ue=W+Ue/Me,at=W+Fe.h/Me,se=W+Fe.l/Me,Be=W+Fe.m/Me);var rt=ue.move(W,_e),ct=ue.move(Ce,_e+B/2);return ce.globals.previousPaths.length>0&&(ct=this.getPreviousPath(qe,Se,!0)),rt=[ue.move(Ce,_e)+ue.line(Ce,_e+B/2)+ue.line(at,_e+B/2)+ue.line(at,_e+B/2-B/4)+ue.line(at,_e+B/2+B/4)+ue.line(at,_e+B/2)+ue.line(Ce,_e+B/2)+ue.line(Ce,_e+B)+ue.line(Be,_e+B)+ue.line(Be,_e)+ue.line(Ce+ee/2,_e),ue.move(Be,_e)+ue.line(Be,_e+B)+ue.line(Ue,_e+B)+ue.line(Ue,_e+B/2)+ue.line(se,_e+B/2)+ue.line(se,_e+B-B/4)+ue.line(se,_e+B/4)+ue.line(se,_e+B/2)+ue.line(Ue,_e+B/2)+ue.line(Ue,_e)+ue.line(Be,_e)+"z"],ct+=ue.move(Ce,_e),ce.globals.isXNumeric||(k+=T),{pathTo:rt,pathFrom:ct,x:Ue,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][_]}}}]),p}(),kn=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"checkColorRange",value:function(){var h=this.w,p=!1,S=h.config.plotOptions[h.config.chart.type];return S.colorScale.ranges.length>0&&S.colorScale.ranges.map(function(_,k){_.from<=0&&(p=!0)}),p}},{key:"getShadeColor",value:function(h,p,S,_){var k=this.w,T=1,B=k.config.plotOptions[h].shadeIntensity,W=this.determineColor(h,p,S);k.globals.hasNegs||_?T=k.config.plotOptions[h].reverseNegativeShade?W.percent<0?W.percent/100*(1.25*B):(1-W.percent/100)*(1.25*B):W.percent<=0?1-(1+W.percent/100)*B:(1-W.percent/100)*B:(T=1-W.percent/100,h==="treemap"&&(T=(1-W.percent/100)*(1.25*B)));var ee=W.color,ce=new O;if(k.config.plotOptions[h].enableShades)if(this.w.config.theme.mode==="dark"){var ue=ce.shadeColor(-1*T,W.color);ee=O.hexToRgba(O.isColorHex(ue)?ue:O.rgb2hex(ue),k.config.fill.opacity)}else{var ge=ce.shadeColor(T,W.color);ee=O.hexToRgba(O.isColorHex(ge)?ge:O.rgb2hex(ge),k.config.fill.opacity)}return{color:ee,colorProps:W}}},{key:"determineColor",value:function(h,p,S){var _=this.w,k=_.globals.series[p][S],T=_.config.plotOptions[h],B=T.colorScale.inverse?S:p;T.distributed&&_.config.chart.type==="treemap"&&(B=S);var W=_.globals.colors[B],ee=null,ce=Math.min.apply(Math,N(_.globals.series[p])),ue=Math.max.apply(Math,N(_.globals.series[p]));T.distributed||h!=="heatmap"||(ce=_.globals.minY,ue=_.globals.maxY),T.colorScale.min!==void 0&&(ce=T.colorScale.min<_.globals.minY?T.colorScale.min:_.globals.minY,ue=T.colorScale.max>_.globals.maxY?T.colorScale.max:_.globals.maxY);var ge=Math.abs(ue)+Math.abs(ce),Se=100*k/(ge===0?ge-1e-6:ge);return T.colorScale.ranges.length>0&&T.colorScale.ranges.map(function(ke,Me){if(k>=ke.from&&k<=ke.to){W=ke.color,ee=ke.foreColor?ke.foreColor:null,ce=ke.from,ue=ke.to;var qe=Math.abs(ue)+Math.abs(ce);Se=100*k/(qe===0?qe-1e-6:qe)}}),{color:W,foreColor:ee,percent:Se}}},{key:"calculateDataLabels",value:function(h){var p=h.text,S=h.x,_=h.y,k=h.i,T=h.j,B=h.colorProps,W=h.fontSize,ee=this.w.config.dataLabels,ce=new z(this.ctx),ue=new Pe(this.ctx),ge=null;if(ee.enabled){ge=ce.group({class:"apexcharts-data-labels"});var Se=ee.offsetX,ke=ee.offsetY,Me=S+Se,qe=_+parseFloat(ee.style.fontSize)/3+ke;ue.plotDataLabelsText({x:Me,y:qe,text:p,i:k,j:T,color:B.foreColor,parent:ge,fontSize:W,dataLabelsConfig:ee})}return ge}},{key:"addListeners",value:function(h){var p=new z(this.ctx);h.node.addEventListener("mouseenter",p.pathMouseEnter.bind(this,h)),h.node.addEventListener("mouseleave",p.pathMouseLeave.bind(this,h)),h.node.addEventListener("mousedown",p.pathMouseDown.bind(this,h))}}]),Ee}(),yn=function(){function Ee(h,p){s(this,Ee),this.ctx=h,this.w=h.w,this.xRatio=p.xRatio,this.yRatio=p.yRatio,this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.helpers=new kn(h),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(h){var p=this.w,S=new z(this.ctx),_=S.group({class:"apexcharts-heatmap"});_.attr("clip-path","url(#gridRectMask".concat(p.globals.cuid,")"));var k=p.globals.gridWidth/p.globals.dataPoints,T=p.globals.gridHeight/p.globals.series.length,B=0,W=!1;this.negRange=this.helpers.checkColorRange();var ee=h.slice();p.config.yaxis[0].reversed&&(W=!0,ee.reverse());for(var ce=W?0:ee.length-1;W?ce<ee.length:ce>=0;W?ce++:ce--){var ue=S.group({class:"apexcharts-series apexcharts-heatmap-series",seriesName:O.escapeString(p.globals.seriesNames[ce]),rel:ce+1,"data:realIndex":ce});if(this.ctx.series.addCollapsedClassToSeries(ue,ce),p.config.chart.dropShadow.enabled){var ge=p.config.chart.dropShadow;new L(this.ctx).dropShadow(ue,ge,ce)}for(var Se=0,ke=p.config.plotOptions.heatmap.shadeIntensity,Me=0;Me<ee[ce].length;Me++){var qe=this.helpers.getShadeColor(p.config.chart.type,ce,Me,this.negRange),Fe=qe.color,at=qe.colorProps;p.config.fill.type==="image"&&(Fe=new xe(this.ctx).fillPath({seriesNumber:ce,dataPointIndex:Me,opacity:p.globals.hasNegs?at.percent<0?1-(1+at.percent/100):ke+at.percent/100:at.percent/100,patternID:O.randomId(),width:p.config.fill.image.width?p.config.fill.image.width:k,height:p.config.fill.image.height?p.config.fill.image.height:T}));var se=this.rectRadius,Ce=S.drawRect(Se,B,k,T,se);if(Ce.attr({cx:Se,cy:B}),Ce.node.classList.add("apexcharts-heatmap-rect"),ue.add(Ce),Ce.attr({fill:Fe,i:ce,index:ce,j:Me,val:h[ce][Me],"stroke-width":this.strokeWidth,stroke:p.config.plotOptions.heatmap.useFillColorAsStroke?Fe:p.globals.stroke.colors[0],color:Fe}),this.helpers.addListeners(Ce),p.config.chart.animations.enabled&&!p.globals.dataChanged){var Ue=1;p.globals.resized||(Ue=p.config.chart.animations.speed),this.animateHeatMap(Ce,Se,B,k,T,Ue)}if(p.globals.dataChanged){var Be=1;if(this.dynamicAnim.enabled&&p.globals.shouldAnimate){Be=this.dynamicAnim.speed;var _e=p.globals.previousPaths[ce]&&p.globals.previousPaths[ce][Me]&&p.globals.previousPaths[ce][Me].color;_e||(_e="rgba(255, 255, 255, 0)"),this.animateHeatColor(Ce,O.isColorHex(_e)?_e:O.rgb2hex(_e),O.isColorHex(Fe)?Fe:O.rgb2hex(Fe),Be)}}var rt=(0,p.config.dataLabels.formatter)(p.globals.series[ce][Me],{value:p.globals.series[ce][Me],seriesIndex:ce,dataPointIndex:Me,w:p}),ct=this.helpers.calculateDataLabels({text:rt,x:Se+k/2,y:B+T/2,i:ce,j:Me,colorProps:at,series:ee});ct!==null&&ue.add(ct),Se+=k}B+=T,_.add(ue)}var yt=p.globals.yAxisScale[0].result.slice();return p.config.yaxis[0].reversed?yt.unshift(""):yt.push(""),p.globals.yAxisScale[0].result=yt,_}},{key:"animateHeatMap",value:function(h,p,S,_,k,T){var B=new U(this.ctx);B.animateRect(h,{x:p+_/2,y:S+k/2,width:0,height:0},{x:p,y:S,width:_,height:k},T,function(){B.animationCompleted(h)})}},{key:"animateHeatColor",value:function(h,p,S,_){h.attr({fill:p}).animate(_).attr({fill:S})}}]),Ee}(),Vn=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"drawYAxisTexts",value:function(h,p,S,_){var k=this.w,T=k.config.yaxis[0],B=k.globals.yLabelFormatters[0];return new z(this.ctx).drawText({x:h+T.labels.offsetX,y:p+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}(),Gn=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w;var p=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=p.globals.stroke.colors!==void 0?p.globals.stroke.colors:p.globals.colors,this.defaultSize=Math.min(p.globals.gridWidth,p.globals.gridHeight),this.centerY=this.defaultSize/2,this.centerX=p.globals.gridWidth/2,p.config.chart.type==="radialBar"?this.fullAngle=360:this.fullAngle=Math.abs(p.config.plotOptions.pie.endAngle-p.config.plotOptions.pie.startAngle),this.initialAngle=p.config.plotOptions.pie.startAngle%this.fullAngle,p.globals.radialSize=this.defaultSize/2.05-p.config.stroke.width-(p.config.chart.sparkline.enabled?0:p.config.chart.dropShadow.blur),this.donutSize=p.globals.radialSize*parseInt(p.config.plotOptions.pie.donut.size,10)/100;var S=p.config.plotOptions.pie.customScale,_=p.globals.gridWidth/2,k=p.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(h){var p=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<h.length;B++)T+=O.negToZero(h[B]);var W=[],ee=_.group();T===0&&(T=1e-5),h.forEach(function(se){p.maxY=Math.max(p.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 ce=0;ce<h.length;ce++){var ue=this.fullAngle*O.negToZero(h[ce])/T;W.push(ue),this.chartType==="polarArea"?(W[ce]=this.fullAngle/h.length,this.sliceSizes.push(S.globals.radialSize*h[ce]/this.maxY)):this.sliceSizes.push(S.globals.radialSize)}if(S.globals.dataChanged){for(var ge,Se=0,ke=0;ke<S.globals.previousPaths.length;ke++)Se+=O.negToZero(S.globals.previousPaths[ke]);for(var Me=0;Me<S.globals.previousPaths.length;Me++)ge=this.fullAngle*O.negToZero(S.globals.previousPaths[Me])/Se,this.prevSectorAngleArr.push(ge)}if(this.donutSize<0&&(this.donutSize=0),this.chartType==="donut"){var qe=_.drawCircle(this.donutSize);qe.attr({cx:this.centerX,cy:this.centerY,fill:S.config.plotOptions.pie.donut.background?S.config.plotOptions.pie.donut.background:"transparent"}),ee.add(qe)}var Fe=this.drawArcs(W,h);if(this.sliceLabels.forEach(function(se){Fe.add(se)}),ee.attr({transform:"translate(".concat(this.translateX,", ").concat(this.translateY,") scale(").concat(S.config.plotOptions.pie.customScale,")")}),ee.add(Fe),k.add(ee),this.donutDataLabels.show){var at=this.renderInnerDataLabels(this.dataLabelsGroup,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:this.donutDataLabels.show});k.add(at)}return S.config.grid.position==="front"&&this.chartType==="polarArea"&&this.drawPolarElements(k),k}},{key:"drawArcs",value:function(h,p){var S=this.w,_=new L(this.ctx),k=new z(this.ctx),T=new xe(this.ctx),B=k.group({class:"apexcharts-slices"}),W=this.initialAngle,ee=this.initialAngle,ce=this.initialAngle,ue=this.initialAngle;this.strokeWidth=S.config.stroke.show?S.config.stroke.width:0;for(var ge=0;ge<h.length;ge++){var Se=k.group({class:"apexcharts-series apexcharts-pie-series",seriesName:O.escapeString(S.globals.seriesNames[ge]),rel:ge+1,"data:realIndex":ge});B.add(Se),ee=ue,ce=(W=ce)+h[ge],ue=ee+this.prevSectorAngleArr[ge];var ke=ce<W?this.fullAngle+ce-W:ce-W,Me=T.fillPath({seriesNumber:ge,size:this.sliceSizes[ge],value:p[ge]}),qe=this.getChangedPath(ee,ue),Fe=k.drawPath({d:qe,stroke:Array.isArray(this.lineColorArr)?this.lineColorArr[ge]:this.lineColorArr,strokeWidth:0,fill:Me,fillOpacity:S.config.fill.opacity,classes:"apexcharts-pie-area apexcharts-".concat(this.chartType.toLowerCase(),"-slice-").concat(ge)});if(Fe.attr({index:0,j:ge}),_.setSelectionFilter(Fe,0,ge),S.config.chart.dropShadow.enabled){var at=S.config.chart.dropShadow;_.dropShadow(Fe,at,ge)}this.addListeners(Fe,this.donutDataLabels),z.setAttrs(Fe.node,{"data:angle":ke,"data:startAngle":W,"data:strokeWidth":this.strokeWidth,"data:value":p[ge]});var se={x:0,y:0};this.chartType==="pie"||this.chartType==="polarArea"?se=O.polarToCartesian(this.centerX,this.centerY,S.globals.radialSize/1.25+S.config.plotOptions.pie.dataLabels.offset,(W+ke/2)%this.fullAngle):this.chartType==="donut"&&(se=O.polarToCartesian(this.centerX,this.centerY,(S.globals.radialSize+this.donutSize)/2+S.config.plotOptions.pie.dataLabels.offset,(W+ke/2)%this.fullAngle)),Se.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[ge],endAngle:ce,startAngle:W,prevStartAngle:ee,prevEndAngle:ue,animateStartingPos:!0,i:ge,animBeginArr:this.animBeginArr,shouldSetPrevPaths:!0,dur:S.config.chart.animations.dynamicAnimation.speed}):this.animatePaths(Fe,{size:this.sliceSizes[ge],endAngle:ce,startAngle:W,i:ge,totalItems:h.length-1,animBeginArr:this.animBeginArr,dur:Ce}),S.config.plotOptions.pie.expandOnClick&&this.chartType!=="polarArea"&&Fe.node.addEventListener("mouseup",this.pieClicked.bind(this,ge)),S.globals.selectedDataPoints[0]!==void 0&&S.globals.selectedDataPoints[0].indexOf(ge)>-1&&this.pieClicked(ge),S.config.dataLabels.enabled){var Ue=se.x,Be=se.y,_e=100*ke/this.fullAngle+"%";if(ke!==0&&S.config.plotOptions.pie.dataLabels.minAngleToShowLabel<h[ge]){var rt=S.config.dataLabels.formatter;rt!==void 0&&(_e=rt(S.globals.seriesPercent[ge][0],{seriesIndex:ge,w:S}));var ct=S.globals.dataLabels.style.colors[ge],yt=k.group({class:"apexcharts-datalabels"}),Lt=k.drawText({x:Ue,y:Be,text:_e,textAnchor:"middle",fontSize:S.config.dataLabels.style.fontSize,fontFamily:S.config.dataLabels.style.fontFamily,fontWeight:S.config.dataLabels.style.fontWeight,foreColor:ct});if(yt.add(Lt),S.config.dataLabels.dropShadow.enabled){var ft=S.config.dataLabels.dropShadow;_.dropShadow(Lt,ft)}Lt.node.classList.add("apexcharts-pie-label"),S.config.chart.animations.animate&&S.globals.resized===!1&&(Lt.node.classList.add("apexcharts-pie-label-delay"),Lt.node.style.animationDelay=S.config.chart.animations.speed/940+"s"),this.sliceLabels.push(yt)}}}return B}},{key:"addListeners",value:function(h,p){var S=new z(this.ctx);h.node.addEventListener("mouseenter",S.pathMouseEnter.bind(this,h)),h.node.addEventListener("mouseleave",S.pathMouseLeave.bind(this,h)),h.node.addEventListener("mouseleave",this.revertDataLabelsInner.bind(this,h.node,p)),h.node.addEventListener("mousedown",S.pathMouseDown.bind(this,h)),this.donutDataLabels.total.showAlways||(h.node.addEventListener("mouseenter",this.printDataLabelsInner.bind(this,h.node,p)),h.node.addEventListener("mousedown",this.printDataLabelsInner.bind(this,h.node,p)))}},{key:"animatePaths",value:function(h,p){var S=this.w,_=p.endAngle<p.startAngle?this.fullAngle+p.endAngle-p.startAngle:p.endAngle-p.startAngle,k=_,T=p.startAngle,B=p.startAngle;p.prevStartAngle!==void 0&&p.prevEndAngle!==void 0&&(T=p.prevEndAngle,k=p.prevEndAngle<p.prevStartAngle?this.fullAngle+p.prevEndAngle-p.prevStartAngle:p.prevEndAngle-p.prevStartAngle),p.i===S.config.series.length-1&&(_+B>this.fullAngle?p.endAngle=p.endAngle-(_+B):_+B<this.fullAngle&&(p.endAngle=p.endAngle+(this.fullAngle-(_+B)))),_===this.fullAngle&&(_=this.fullAngle-.01),this.animateArc(h,T,B,_,k,p)}},{key:"animateArc",value:function(h,p,S,_,k,T){var B,W=this,ee=this.w,ce=new U(this.ctx),ue=T.size;(isNaN(p)||isNaN(k))&&(p=S,k=_,T.dur=0);var ge=_,Se=S,ke=p<S?this.fullAngle+p-S:p-S;ee.globals.dataChanged&&T.shouldSetPrevPaths&&T.prevEndAngle&&(B=W.getPiePath({me:W,startAngle:T.prevStartAngle,angle:T.prevEndAngle<T.prevStartAngle?this.fullAngle+T.prevEndAngle-T.prevStartAngle:T.prevEndAngle-T.prevStartAngle,size:ue}),h.attr({d:B})),T.dur!==0?h.animate(T.dur,ee.globals.easing,T.animBeginArr[T.i]).afterAll(function(){W.chartType!=="pie"&&W.chartType!=="donut"&&W.chartType!=="polarArea"||this.animate(ee.config.chart.animations.dynamicAnimation.speed).attr({"stroke-width":W.strokeWidth}),T.i===ee.config.series.length-1&&ce.animationCompleted(h)}).during(function(Me){ge=ke+(_-ke)*Me,T.animateStartingPos&&(ge=k+(_-k)*Me,Se=p-k+(S-(p-k))*Me),B=W.getPiePath({me:W,startAngle:Se,angle:ge,size:ue}),h.node.setAttribute("data:pathOrig",B),h.attr({d:B})}):(B=W.getPiePath({me:W,startAngle:Se,angle:_,size:ue}),T.isTrack||(ee.globals.animationEnded=!0),h.node.setAttribute("data:pathOrig",B),h.attr({d:B,"stroke-width":W.strokeWidth}))}},{key:"pieClicked",value:function(h){var p,S=this.w,_=this,k=_.sliceSizes[h]+(S.config.plotOptions.pie.expandOnClick?4:0),T=S.globals.dom.Paper.select(".apexcharts-".concat(_.chartType.toLowerCase(),"-slice-").concat(h)).members[0];if(T.attr("data:pieClicked")!=="true"){var B=S.globals.dom.baseEl.getElementsByClassName("apexcharts-pie-area");Array.prototype.forEach.call(B,function(ue){ue.setAttribute("data:pieClicked","false");var ge=ue.getAttribute("data:pathOrig");ge&&ue.setAttribute("d",ge)}),S.globals.capturedDataPointIndex=h,T.attr("data:pieClicked","true");var W=parseInt(T.attr("data:startAngle"),10),ee=parseInt(T.attr("data:angle"),10);p=_.getPiePath({me:_,startAngle:W,angle:ee,size:k}),ee!==360&&T.plot(p)}else{T.attr({"data:pieClicked":"false"}),this.revertDataLabelsInner(T.node,this.donutDataLabels);var ce=T.attr("data:pathOrig");T.attr({d:ce})}}},{key:"getChangedPath",value:function(h,p){var S="";return this.dynamicAnim&&this.w.globals.dataChanged&&(S=this.getPiePath({me:this,startAngle:h,angle:p-h,size:this.size})),S}},{key:"getPiePath",value:function(h){var p,S=h.me,_=h.startAngle,k=h.angle,T=h.size,B=new z(this.ctx),W=_,ee=Math.PI*(W-90)/180,ce=k+_;Math.ceil(ce)>=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle&&(ce=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle-.01),Math.ceil(ce)>this.fullAngle&&(ce-=this.fullAngle);var ue=Math.PI*(ce-90)/180,ge=S.centerX+T*Math.cos(ee),Se=S.centerY+T*Math.sin(ee),ke=S.centerX+T*Math.cos(ue),Me=S.centerY+T*Math.sin(ue),qe=O.polarToCartesian(S.centerX,S.centerY,S.donutSize,ce),Fe=O.polarToCartesian(S.centerX,S.centerY,S.donutSize,W),at=k>180?1:0,se=["M",ge,Se,"A",T,T,0,at,1,ke,Me];return p=S.chartType==="donut"?[].concat(se,["L",qe.x,qe.y,"A",S.donutSize,S.donutSize,0,at,0,Fe.x,Fe.y,"L",ge,Se,"z"]).join(" "):S.chartType==="pie"||S.chartType==="polarArea"?[].concat(se,["L",S.centerX,S.centerY,"L",ge,Se]).join(" "):[].concat(se).join(" "),B.roundPathCorners(p,2*this.strokeWidth)}},{key:"drawPolarElements",value:function(h){var p=this.w,S=new tt(this.ctx),_=new z(this.ctx),k=new Vn(this.ctx),T=_.group(),B=_.group(),W=S.niceScale(0,Math.ceil(this.maxY),0),ee=W.result.reverse(),ce=W.result.length;this.maxY=W.niceMax;for(var ue=p.globals.radialSize,ge=ue/(ce-1),Se=0;Se<ce-1;Se++){var ke=_.drawCircle(ue);if(ke.attr({cx:this.centerX,cy:this.centerY,fill:"none","stroke-width":p.config.plotOptions.polarArea.rings.strokeWidth,stroke:p.config.plotOptions.polarArea.rings.strokeColor}),p.config.yaxis[0].show){var Me=k.drawYAxisTexts(this.centerX,this.centerY-ue+parseInt(p.config.yaxis[0].labels.style.fontSize,10)/2,Se,ee[Se]);B.add(Me)}T.add(ke),ue-=ge}this.drawSpokes(h),h.add(T),h.add(B)}},{key:"renderInnerDataLabels",value:function(h,p,S){var _=this.w,k=new z(this.ctx),T=p.total.show;h.node.innerHTML="",h.node.style.opacity=S.opacity;var B,W,ee=S.centerX,ce=this.donutDataLabels.total.label?S.centerY:S.centerY-S.centerY/6;B=p.name.color===void 0?_.globals.colors[0]:p.name.color;var ue=p.name.fontSize,ge=p.name.fontFamily,Se=p.name.fontWeight;W=p.value.color===void 0?_.config.chart.foreColor:p.value.color;var ke=p.value.formatter,Me="",qe="";if(T?(B=p.total.color,ue=p.total.fontSize,ge=p.total.fontFamily,Se=p.total.fontWeight,qe=this.donutDataLabels.total.label?p.total.label:"",Me=p.total.formatter(_)):_.globals.series.length===1&&(Me=ke(_.globals.series[0],_),qe=_.globals.seriesNames[0]),qe&&(qe=p.name.formatter(qe,p.total.show,_)),p.name.show){var Fe=k.drawText({x:ee,y:ce+parseFloat(p.name.offsetY),text:qe,textAnchor:"middle",foreColor:B,fontSize:ue,fontWeight:Se,fontFamily:ge});Fe.node.classList.add("apexcharts-datalabel-label"),h.add(Fe)}if(p.value.show){var at=p.name.show?parseFloat(p.value.offsetY)+16:p.value.offsetY,se=k.drawText({x:ee,y:ce+at,text:Me,textAnchor:"middle",foreColor:W,fontWeight:p.value.fontWeight,fontSize:p.value.fontSize,fontFamily:p.value.fontFamily});se.node.classList.add("apexcharts-datalabel-value"),h.add(se)}return h}},{key:"printInnerLabels",value:function(h,p,S,_){var k,T=this.w;_?k=h.name.color===void 0?T.globals.colors[parseInt(_.parentNode.getAttribute("rel"),10)-1]:h.name.color:T.globals.series.length>1&&h.total.show&&(k=h.total.color);var B=T.globals.dom.baseEl.querySelector(".apexcharts-datalabel-label"),W=T.globals.dom.baseEl.querySelector(".apexcharts-datalabel-value");S=(0,h.value.formatter)(S,T),_||typeof h.total.formatter!="function"||(S=h.total.formatter(T));var ee=p===h.total.label;p=this.donutDataLabels.total.label?h.name.formatter(p,ee,T):"",B!==null&&(B.textContent=p),W!==null&&(W.textContent=S),B!==null&&(B.style.fill=k)}},{key:"printDataLabelsInner",value:function(h,p){var S=this.w,_=h.getAttribute("data:value"),k=S.globals.seriesNames[parseInt(h.parentNode.getAttribute("rel"),10)-1];S.globals.series.length>1&&this.printInnerLabels(p,k,_,h);var T=S.globals.dom.baseEl.querySelector(".apexcharts-datalabels-group");T!==null&&(T.style.opacity=1)}},{key:"drawSpokes",value:function(h){var p=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,W=0;W<S.globals.series.length;W++)T.push(O.polarToCartesian(this.centerX,this.centerY,S.globals.radialSize,S.config.plotOptions.pie.startAngle+B*W));T.forEach(function(ee,ce){var ue=_.drawLine(ee.x,ee.y,p.centerX,p.centerY,Array.isArray(k.connectorColors)?k.connectorColors[ce]:k.connectorColors);h.add(ue)})}}},{key:"revertDataLabelsInner",value:function(){var h=this.w;if(this.donutDataLabels.show){var p=h.globals.dom.Paper.select(".apexcharts-datalabels-group").members[0],S=this.renderInnerDataLabels(p,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:this.donutDataLabels.show});h.globals.dom.Paper.select(".apexcharts-radialbar, .apexcharts-pie").members[0].add(S)}}}]),Ee}(),Rn=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.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 p=this.w;this.graphics=new z(this.ctx),this.lineColorArr=p.globals.stroke.colors!==void 0?p.globals.stroke.colors:p.globals.colors,this.defaultSize=p.globals.svgHeight<p.globals.svgWidth?p.globals.gridHeight:p.globals.gridWidth,this.isLog=p.config.yaxis[0].logarithmic,this.logBase=p.config.yaxis[0].logBase,this.coreUtils=new X(this.ctx),this.maxValue=this.isLog?this.coreUtils.getLogVal(this.logBase,p.globals.maxY,0):p.globals.maxY,this.minValue=this.isLog?this.coreUtils.getLogVal(this.logBase,this.w.globals.minY,0):p.globals.minY,this.polygons=p.config.plotOptions.radar.polygons,this.strokeWidth=p.config.stroke.show?p.config.stroke.width:0,this.size=this.defaultSize/2.1-this.strokeWidth-p.config.chart.dropShadow.blur,p.config.xaxis.labels.show&&(this.size=this.size-p.globals.xAxisLabelsWidth/1.75),p.config.plotOptions.radar.size!==void 0&&(this.size=p.config.plotOptions.radar.size),this.dataRadiusOfPercent=[],this.dataRadius=[],this.angleArr=[],this.yaxisLabelsTextsPos=[]}return o(Ee,[{key:"draw",value:function(h){var p=this,S=this.w,_=new xe(this.ctx),k=[],T=new Pe(this.ctx);h.length&&(this.dataPointsLen=h[S.globals.maxValsInArrayIndex].length),this.disAngle=2*Math.PI/this.dataPointsLen;var B=S.globals.gridWidth/2,W=S.globals.gridHeight/2,ee=B+S.config.plotOptions.radar.offsetX,ce=W+S.config.plotOptions.radar.offsetY,ue=this.graphics.group({class:"apexcharts-radar-series apexcharts-plot-series",transform:"translate(".concat(ee||0,", ").concat(ce||0,")")}),ge=[],Se=null,ke=null;if(this.yaxisLabels=this.graphics.group({class:"apexcharts-yaxis"}),h.forEach(function(qe,Fe){var at=qe.length===S.globals.dataPoints,se=p.graphics.group().attr({class:"apexcharts-series","data:longestSeries":at,seriesName:O.escapeString(S.globals.seriesNames[Fe]),rel:Fe+1,"data:realIndex":Fe});p.dataRadiusOfPercent[Fe]=[],p.dataRadius[Fe]=[],p.angleArr[Fe]=[],qe.forEach(function(Tt,Ge){var At=Math.abs(p.maxValue-p.minValue);Tt-=p.minValue,p.isLog&&(Tt=p.coreUtils.getLogVal(p.logBase,Tt,0)),p.dataRadiusOfPercent[Fe][Ge]=Tt/At,p.dataRadius[Fe][Ge]=p.dataRadiusOfPercent[Fe][Ge]*p.size,p.angleArr[Fe][Ge]=Ge*p.disAngle}),ge=p.getDataPointsPos(p.dataRadius[Fe],p.angleArr[Fe]);var Ce=p.createPaths(ge,{x:0,y:0});Se=p.graphics.group({class:"apexcharts-series-markers-wrap apexcharts-element-hidden"}),ke=p.graphics.group({class:"apexcharts-datalabels","data:realIndex":Fe}),S.globals.delayedElements.push({el:Se.node,index:Fe});var Ue={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},Be=null;S.globals.previousPaths.length>0&&(Be=p.getPreviousPath(Fe));for(var _e=0;_e<Ce.linePathsTo.length;_e++){var rt=p.graphics.renderPaths(v(v({},Ue),{},{pathFrom:Be===null?Ce.linePathsFrom[_e]:Be,pathTo:Ce.linePathsTo[_e],strokeWidth:Array.isArray(p.strokeWidth)?p.strokeWidth[Fe]:p.strokeWidth,fill:"none",drawShadow:!1}));se.add(rt);var ct=_.fillPath({seriesNumber:Fe}),yt=p.graphics.renderPaths(v(v({},Ue),{},{pathFrom:Be===null?Ce.areaPathsFrom[_e]:Be,pathTo:Ce.areaPathsTo[_e],strokeWidth:0,fill:ct,drawShadow:!1}));if(S.config.chart.dropShadow.enabled){var Lt=new L(p.ctx),ft=S.config.chart.dropShadow;Lt.dropShadow(yt,Object.assign({},ft,{noUserSpaceOnUse:!0}),Fe)}se.add(yt)}qe.forEach(function(Tt,Ge){var At=new ye(p.ctx).getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:Fe,dataPointIndex:Ge}),Ot=p.graphics.drawMarker(ge[Ge].x,ge[Ge].y,At);Ot.attr("rel",Ge),Ot.attr("j",Ge),Ot.attr("index",Fe),Ot.node.setAttribute("default-marker-size",At.pSize);var it=p.graphics.group({class:"apexcharts-series-markers"});it&&it.add(Ot),Se.add(it),se.add(Se);var jt=S.config.dataLabels;if(jt.enabled){var Nn=jt.formatter(S.globals.series[Fe][Ge],{seriesIndex:Fe,dataPointIndex:Ge,w:S});T.plotDataLabelsText({x:ge[Ge].x,y:ge[Ge].y,text:Nn,textAnchor:"middle",i:Fe,j:Fe,parent:ke,offsetCorrection:!1,dataLabelsConfig:v({},jt)})}se.add(ke)}),k.push(se)}),this.drawPolygons({parent:ue}),S.config.xaxis.labels.show){var Me=this.drawXAxisTexts();ue.add(Me)}return k.forEach(function(qe){ue.add(qe)}),ue.add(this.yaxisLabels),ue}},{key:"drawPolygons",value:function(h){for(var p=this,S=this.w,_=h.parent,k=new Vn(this.ctx),T=S.globals.yAxisScale[0].result.reverse(),B=T.length,W=[],ee=this.size/(B-1),ce=0;ce<B;ce++)W[ce]=ee*ce;W.reverse();var ue=[],ge=[];W.forEach(function(Se,ke){var Me=O.getPolygonPos(Se,p.dataPointsLen),qe="";Me.forEach(function(Fe,at){if(ke===0){var se=p.graphics.drawLine(Fe.x,Fe.y,0,0,Array.isArray(p.polygons.connectorColors)?p.polygons.connectorColors[at]:p.polygons.connectorColors);ge.push(se)}at===0&&p.yaxisLabelsTextsPos.push({x:Fe.x,y:Fe.y}),qe+=Fe.x+","+Fe.y+" "}),ue.push(qe)}),ue.forEach(function(Se,ke){var Me=p.polygons.strokeColors,qe=p.polygons.strokeWidth,Fe=p.graphics.drawPolygon(Se,Array.isArray(Me)?Me[ke]:Me,Array.isArray(qe)?qe[ke]:qe,S.globals.radarPolygons.fill.colors[ke]);_.add(Fe)}),ge.forEach(function(Se){_.add(Se)}),S.config.yaxis[0].show&&this.yaxisLabelsTextsPos.forEach(function(Se,ke){var Me=k.drawYAxisTexts(Se.x,Se.y,ke,T[ke]);p.yaxisLabels.add(Me)})}},{key:"drawXAxisTexts",value:function(){var h=this,p=this.w,S=p.config.xaxis.labels,_=this.graphics.group({class:"apexcharts-xaxis"}),k=O.getPolygonPos(this.size,this.dataPointsLen);return p.globals.labels.forEach(function(T,B){var W=p.config.xaxis.labels.formatter,ee=new Pe(h.ctx);if(k[B]){var ce=h.getTextPos(k[B],h.size),ue=W(T,{seriesIndex:-1,dataPointIndex:B,w:p});ee.plotDataLabelsText({x:ce.newX,y:ce.newY,text:ue,textAnchor:ce.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:ce.textAnchor,dropShadow:{enabled:!1}},S),offsetCorrection:!1}).on("click",function(ge){if(typeof p.config.chart.events.xAxisLabelClick=="function"){var Se=Object.assign({},p,{labelIndex:B});p.config.chart.events.xAxisLabelClick(ge,h.ctx,Se)}})}}),_}},{key:"createPaths",value:function(h,p){var S=this,_=[],k=[],T=[],B=[];if(h.length){k=[this.graphics.move(p.x,p.y)],B=[this.graphics.move(p.x,p.y)];var W=this.graphics.move(h[0].x,h[0].y),ee=this.graphics.move(h[0].x,h[0].y);h.forEach(function(ce,ue){W+=S.graphics.line(ce.x,ce.y),ee+=S.graphics.line(ce.x,ce.y),ue===h.length-1&&(W+="Z",ee+="Z")}),_.push(W),T.push(ee)}return{linePathsFrom:k,linePathsTo:_,areaPathsFrom:B,areaPathsTo:T}}},{key:"getTextPos",value:function(h,p){var S="middle",_=h.x,k=h.y;return Math.abs(h.x)>=10?h.x>0?(S="start",_+=10):h.x<0&&(S="end",_-=10):S="middle",Math.abs(h.y)>=p-10&&(h.y<0?k-=10:h.y>0&&(k+=10)),{textAnchor:S,newX:_,newY:k}}},{key:"getPreviousPath",value:function(h){for(var p=this.w,S=null,_=0;_<p.globals.previousPaths.length;_++){var k=p.globals.previousPaths[_];k.paths.length>0&&parseInt(k.realIndex,10)===parseInt(h,10)&&p.globals.previousPaths[_].paths[0]!==void 0&&(S=p.globals.previousPaths[_].paths[0].d)}return S}},{key:"getDataPointsPos",value:function(h,p){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.dataPointsLen;h=h||[],p=p||[];for(var _=[],k=0;k<S;k++){var T={};T.x=h[k]*Math.sin(p[k]),T.y=-h[k]*Math.cos(p[k]),_.push(T)}return _}}]),Ee}(),Yn=function(Ee){f(p,Gn);var h=c(p);function p(S){var _;s(this,p),(_=h.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(p,[{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(),W=this.defaultSize/2,ee=_.globals.gridWidth/2,ce=this.defaultSize/2.05;_.config.chart.sparkline.enabled||(ce=ce-_.config.stroke.width-_.config.chart.dropShadow.blur);var ue=_.globals.fill.colors;if(_.config.plotOptions.radialBar.track.show){var ge=this.drawTracks({size:ce,centerX:ee,centerY:W,colorArr:ue,series:S});B.add(ge)}var Se=this.drawArcs({size:ce,centerX:ee,centerY:W,colorArr:ue,series:S}),ke=360;_.config.plotOptions.radialBar.startAngle<0&&(ke=this.totalAngle);var Me=(360-ke)/360;if(_.globals.radialSize=ce-ce*Me,this.radialDataLabels.value.show){var qe=Math.max(this.radialDataLabels.value.offsetY,this.radialDataLabels.name.offsetY);_.globals.radialSize+=qe*Me}return B.add(Se.g),_.config.plotOptions.radialBar.hollow.position==="front"&&(Se.g.add(Se.elHollow),Se.dataLabels&&Se.g.add(Se.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),W=new xe(this.ctx),ee=this.getStrokeWidth(S);S.size=S.size-ee/2;for(var ce=0;ce<S.series.length;ce++){var ue=k.group({class:"apexcharts-radialbar-track apexcharts-track"});T.add(ue),ue.attr({rel:ce+1}),S.size=S.size-ee-this.margin;var ge=_.config.plotOptions.radialBar.track,Se=W.fillPath({seriesNumber:0,size:S.size,fillColors:Array.isArray(ge.background)?ge.background[ce]:ge.background,solid:!0}),ke=this.trackStartAngle,Me=this.trackEndAngle;Math.abs(Me)+Math.abs(ke)>=360&&(Me=360-Math.abs(this.startAngle)-.1);var qe=k.drawPath({d:"",stroke:Se,strokeWidth:ee*parseInt(ge.strokeWidth,10)/100,fill:"none",strokeOpacity:ge.opacity,classes:"apexcharts-radialbar-area"});if(ge.dropShadow.enabled){var Fe=ge.dropShadow;B.dropShadow(qe,Fe)}ue.add(qe),qe.attr("id","apexcharts-radialbarTrack-"+ce),this.animatePaths(qe,{centerX:S.centerX,centerY:S.centerY,endAngle:Me,startAngle:ke,size:S.size,i:ce,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 xe(this.ctx),B=new L(this.ctx),W=k.group(),ee=this.getStrokeWidth(S);S.size=S.size-ee/2;var ce=_.config.plotOptions.radialBar.hollow.background,ue=S.size-ee*S.series.length-this.margin*S.series.length-ee*parseInt(_.config.plotOptions.radialBar.track.strokeWidth,10)/100/2,ge=ue-_.config.plotOptions.radialBar.hollow.margin;_.config.plotOptions.radialBar.hollow.image!==void 0&&(ce=this.drawHollowImage(S,W,ue,ce));var Se=this.drawHollow({size:ge,centerX:S.centerX,centerY:S.centerY,fill:ce||"transparent"});if(_.config.plotOptions.radialBar.hollow.dropShadow.enabled){var ke=_.config.plotOptions.radialBar.hollow.dropShadow;B.dropShadow(Se,ke)}var Me=1;!this.radialDataLabels.total.show&&_.globals.series.length>1&&(Me=0);var qe=null;if(this.radialDataLabels.show){var Fe=_.globals.dom.Paper.select(".apexcharts-datalabels-group").members[0];qe=this.renderInnerDataLabels(Fe,this.radialDataLabels,{hollowSize:ue,centerX:S.centerX,centerY:S.centerY,opacity:Me})}_.config.plotOptions.radialBar.hollow.position==="back"&&(W.add(Se),qe&&W.add(qe));var at=!1;_.config.plotOptions.radialBar.inverseOrder&&(at=!0);for(var se=at?S.series.length-1:0;at?se>=0:se<S.series.length;at?se--:se++){var Ce=k.group({class:"apexcharts-series apexcharts-radial-series",seriesName:O.escapeString(_.globals.seriesNames[se])});W.add(Ce),Ce.attr({rel:se+1,"data:realIndex":se}),this.ctx.series.addCollapsedClassToSeries(Ce,se),S.size=S.size-ee-this.margin;var Ue=T.fillPath({seriesNumber:se,size:S.size,value:S.series[se]}),Be=this.startAngle,_e=void 0,rt=O.negToZero(S.series[se]>100?100:S.series[se])/100,ct=Math.round(this.totalAngle*rt)+this.startAngle,yt=void 0;_.globals.dataChanged&&(_e=this.startAngle,yt=Math.round(this.totalAngle*O.negToZero(_.globals.previousPaths[se])/100)+_e),Math.abs(ct)+Math.abs(Be)>360&&(ct-=.01),Math.abs(yt)+Math.abs(_e)>360&&(yt-=.01);var Lt=ct-Be,ft=Array.isArray(_.config.stroke.dashArray)?_.config.stroke.dashArray[se]:_.config.stroke.dashArray,Tt=k.drawPath({d:"",stroke:Ue,strokeWidth:ee,fill:"none",fillOpacity:_.config.fill.opacity,classes:"apexcharts-radialbar-area apexcharts-radialbar-slice-"+se,strokeDashArray:ft});if(z.setAttrs(Tt.node,{"data:angle":Lt,"data:value":S.series[se]}),_.config.chart.dropShadow.enabled){var Ge=_.config.chart.dropShadow;B.dropShadow(Tt,Ge,se)}if(B.setSelectionFilter(Tt,0,se),this.addListeners(Tt,this.radialDataLabels),Ce.add(Tt),Tt.attr({index:0,j:se}),this.barLabels.enabled){var At=O.polarToCartesian(S.centerX,S.centerY,S.size,Be),Ot=this.barLabels.formatter(_.globals.seriesNames[se],{seriesIndex:se,w:_}),it=["apexcharts-radialbar-label"];this.barLabels.onClick||it.push("apexcharts-no-click");var jt=this.barLabels.useSeriesColors?_.globals.colors[se]:_.config.chart.foreColor;jt||(jt=_.config.chart.foreColor);var Nn=At.x+this.barLabels.offsetX,mn=At.y+this.barLabels.offsetY,ir=k.drawText({x:Nn,y:mn,text:Ot,textAnchor:"end",dominantBaseline:"middle",fontFamily:this.barLabels.fontFamily,fontWeight:this.barLabels.fontWeight,fontSize:this.barLabels.fontSize,foreColor:jt,cssClass:it.join(" ")});ir.on("click",this.onBarLabelClick),ir.attr({rel:se+1}),Be!==0&&ir.attr({"transform-origin":"".concat(Nn," ").concat(mn),transform:"rotate(".concat(Be," 0 0)")}),Ce.add(ir)}var Sn=0;!this.initialAnim||_.globals.resized||_.globals.dataChanged||(Sn=_.config.chart.animations.speed),_.globals.dataChanged&&(Sn=_.config.chart.animations.dynamicAnimation.speed),this.animDur=Sn/(1.2*S.series.length)+this.animDur,this.animBeginArr.push(this.animDur),this.animatePaths(Tt,{centerX:S.centerX,centerY:S.centerY,endAngle:ct,startAngle:Be,prevEndAngle:yt,prevStartAngle:_e,size:S.size,i:se,totalItems:2,animBeginArr:this.animBeginArr,dur:Sn,shouldSetPrevPaths:!0,easing:_.globals.easing})}return{g:W,elHollow:Se,dataLabels:qe}}},{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,W=new xe(this.ctx),ee=O.randomId(),ce=B.config.plotOptions.radialBar.hollow.image;if(B.config.plotOptions.radialBar.hollow.imageClipped)W.clippedImgArea({width:k,height:k,image:ce,patternID:"pattern".concat(B.globals.cuid).concat(ee)}),T="url(#pattern".concat(B.globals.cuid).concat(ee,")");else{var ue=B.config.plotOptions.radialBar.hollow.imageWidth,ge=B.config.plotOptions.radialBar.hollow.imageHeight;if(ue===void 0&&ge===void 0){var Se=B.globals.dom.Paper.image(ce).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(Se)}else{var ke=B.globals.dom.Paper.image(ce).loaded(function(Me){this.move(S.centerX-ue/2+B.config.plotOptions.radialBar.hollow.imageOffsetX,S.centerY-ge/2+B.config.plotOptions.radialBar.hollow.imageOffsetY),this.size(ue,ge)});_.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:_})}}]),p}(),Cn=function(Ee){f(p,an);var h=c(p);function p(){return s(this,p),h.apply(this,arguments)}return o(p,[{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"}),W=0;W<S.length;W++){var ee,ce,ue,ge,Se=void 0,ke=void 0,Me=k.globals.comboCharts?_[W]:W,qe=this.barHelpers.getGroupIndex(Me).columnGroupIndex,Fe=T.group({class:"apexcharts-series",seriesName:O.escapeString(k.globals.seriesNames[Me]),rel:W+1,"data:realIndex":Me});this.ctx.series.addCollapsedClassToSeries(Fe,Me),S[W].length>0&&(this.visibleI=this.visibleI+1);var at=0,se=0,Ce=0;this.yRatio.length>1&&(this.yaxisIndex=k.globals.seriesYAxisReverseMap[Me][0],Ce=Me);var Ue=this.barHelpers.initialPositions();ke=Ue.y,ge=Ue.zeroW,Se=Ue.x,se=Ue.barWidth,at=Ue.barHeight,ee=Ue.xDivision,ce=Ue.yDivision,ue=Ue.zeroH;for(var Be=T.group({class:"apexcharts-datalabels","data:realIndex":Me}),_e=T.group({class:"apexcharts-rangebar-goals-markers"}),rt=0;rt<k.globals.dataPoints;rt++){var ct=this.barHelpers.getStrokeWidth(W,rt,Me),yt=this.seriesRangeStart[W][rt],Lt=this.seriesRangeEnd[W][rt],ft=null,Tt=null,Ge=null,At={x:Se,y:ke,strokeWidth:ct,elSeries:Fe},Ot=this.seriesLen;if(k.config.plotOptions.bar.rangeBarGroupRows&&(Ot=1),k.config.series[W].data[rt]===void 0)break;if(this.isHorizontal){Ge=ke+at*this.visibleI;var it=(ce-at*Ot)/2;if(k.config.series[W].data[rt].x){var jt=this.detectOverlappingBars({i:W,j:rt,barYPosition:Ge,srty:it,barHeight:at,yDivision:ce,initPositions:Ue});at=jt.barHeight,Ge=jt.barYPosition}se=(ft=this.drawRangeBarPaths(v({indexes:{i:W,j:rt,realIndex:Me},barHeight:at,barYPosition:Ge,zeroW:ge,yDivision:ce,y1:yt,y2:Lt},At))).barWidth}else{k.globals.isXNumeric&&(Se=(k.globals.seriesX[W][rt]-k.globals.minX)/this.xRatio-se/2),Tt=Se+se*this.visibleI;var Nn=(ee-se*Ot)/2;if(k.config.series[W].data[rt].x){var mn=this.detectOverlappingBars({i:W,j:rt,barXPosition:Tt,srtx:Nn,barWidth:se,xDivision:ee,initPositions:Ue});se=mn.barWidth,Tt=mn.barXPosition}at=(ft=this.drawRangeColumnPaths(v({indexes:{i:W,j:rt,realIndex:Me,translationsIndex:Ce},barWidth:se,barXPosition:Tt,zeroH:ue,xDivision:ee},At))).barHeight}var ir=this.barHelpers.drawGoalLine({barXPosition:ft.barXPosition,barYPosition:Ge,goalX:ft.goalX,goalY:ft.goalY,barHeight:at,barWidth:se});ir&&_e.add(ir),ke=ft.y,Se=ft.x;var Sn=this.barHelpers.getPathFillColor(S,W,rt,Me),Bn=k.globals.stroke.colors[Me];this.renderSeries({realIndex:Me,pathFill:Sn,lineFill:Bn,j:rt,i:W,x:Se,y:ke,y1:yt,y2:Lt,pathFrom:ft.pathFrom,pathTo:ft.pathTo,strokeWidth:ct,elSeries:Fe,series:S,barHeight:at,barWidth:se,barXPosition:Tt,barYPosition:Ge,columnGroupIndex:qe,elDataLabelsWrap:Be,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,W=S.srty,ee=S.srtx,ce=S.barHeight,ue=S.barWidth,ge=S.yDivision,Se=S.xDivision,ke=S.initPositions,Me=this.w,qe=[],Fe=Me.config.series[_].data[k].rangeName,at=Me.config.series[_].data[k].x,se=Array.isArray(at)?at.join(" "):at,Ce=Me.globals.labels.map(function(Be){return Array.isArray(Be)?Be.join(" "):Be}).indexOf(se),Ue=Me.globals.seriesRange[_].findIndex(function(Be){return Be.x===se&&Be.overlaps.length>0});return this.isHorizontal?(T=Me.config.plotOptions.bar.rangeBarGroupRows?W+ge*Ce:W+ce*this.visibleI+ge*Ce,Ue>-1&&!Me.config.plotOptions.bar.rangeBarOverlap&&(qe=Me.globals.seriesRange[_][Ue].overlaps).indexOf(Fe)>-1&&(T=(ce=ke.barHeight/qe.length)*this.visibleI+ge*(100-parseInt(this.barOptions.barHeight,10))/100/2+ce*(this.visibleI+qe.indexOf(Fe))+ge*Ce)):(Ce>-1&&!Me.globals.timescaleLabels.length&&(B=Me.config.plotOptions.bar.rangeBarGroupRows?ee+Se*Ce:ee+ue*this.visibleI+Se*Ce),Ue>-1&&!Me.config.plotOptions.bar.rangeBarOverlap&&(qe=Me.globals.seriesRange[_][Ue].overlaps).indexOf(Fe)>-1&&(B=(ue=ke.barWidth/qe.length)*this.visibleI+Se*(100-parseInt(this.barOptions.barWidth,10))/100/2+ue*(this.visibleI+qe.indexOf(Fe))+Se*Ce)),{barYPosition:T,barXPosition:B,barHeight:ce,barWidth:ue}}},{key:"drawRangeColumnPaths",value:function(S){var _=S.indexes,k=S.x,T=S.xDivision,B=S.barWidth,W=S.barXPosition,ee=S.zeroH,ce=this.w,ue=_.i,ge=_.j,Se=_.realIndex,ke=_.translationsIndex,Me=this.yRatio[ke],qe=this.getRangeValue(Se,ge),Fe=Math.min(qe.start,qe.end),at=Math.max(qe.start,qe.end);this.series[ue][ge]===void 0||this.series[ue][ge]===null?Fe=ee:(Fe=ee-Fe/Me,at=ee-at/Me);var se=Math.abs(at-Fe),Ce=this.barHelpers.getColumnPaths({barXPosition:W,barWidth:B,y1:Fe,y2:at,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,realIndex:Se,i:Se,j:ge,w:ce});if(ce.globals.isXNumeric){var Ue=this.getBarXForNumericXAxis({x:k,j:ge,realIndex:Se,barWidth:B});k=Ue.x,W=Ue.barXPosition}else k+=T;return{pathTo:Ce.pathTo,pathFrom:Ce.pathFrom,barHeight:se,x:k,y:qe.start<0&&qe.end<0?Fe:at,goalY:this.barHelpers.getGoalValues("y",null,ee,ue,ge,ke),barXPosition:W}}},{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,W=S.yDivision,ee=S.barHeight,ce=S.barYPosition,ue=S.zeroW,ge=this.w,Se=_.realIndex,ke=_.j,Me=this.preventBarOverflow(ue+T/this.invertedYRatio),qe=this.preventBarOverflow(ue+B/this.invertedYRatio),Fe=this.getRangeValue(Se,ke),at=Math.abs(qe-Me),se=this.barHelpers.getBarpaths({barYPosition:ce,barHeight:ee,x1:Me,x2:qe,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:Se,realIndex:Se,j:ke,w:ge});return ge.globals.isXNumeric||(k+=W),{pathTo:se.pathTo,pathFrom:se.pathFrom,barWidth:at,x:Fe.start<0&&Fe.end<0?Me:qe,goalX:this.barHelpers.getGoalValues("x",ue,null,Se,ke),y:k}}},{key:"getRangeValue",value:function(S,_){var k=this.w;return{start:k.globals.seriesRangeStart[S][_],end:k.globals.seriesRangeEnd[S][_]}}}]),p}(),rn=function(){function Ee(h){s(this,Ee),this.w=h.w,this.lineCtx=h}return o(Ee,[{key:"sameValueSeriesFix",value:function(h,p){var S=this.w;if((S.config.fill.type==="gradient"||S.config.fill.type[h]==="gradient")&&new X(this.lineCtx.ctx,S).seriesHaveSameValues(h)){var _=p[h].slice();_[_.length-1]=_[_.length-1]+1e-6,p[h]=_}return p}},{key:"calculatePoints",value:function(h){var p=h.series,S=h.realIndex,_=h.x,k=h.y,T=h.i,B=h.j,W=h.prevY,ee=this.w,ce=[],ue=[];if(B===0){var ge=this.lineCtx.categoryAxisCorrection+ee.config.markers.offsetX;ee.globals.isXNumeric&&(ge=(ee.globals.seriesX[S][0]-ee.globals.minX)/this.lineCtx.xRatio+ee.config.markers.offsetX),ce.push(ge),ue.push(O.isNumber(p[T][0])?W+ee.config.markers.offsetY:null),ce.push(_+ee.config.markers.offsetX),ue.push(O.isNumber(p[T][B+1])?k+ee.config.markers.offsetY:null)}else ce.push(_+ee.config.markers.offsetX),ue.push(O.isNumber(p[T][B+1])?k+ee.config.markers.offsetY:null);return{x:ce,y:ue}}},{key:"checkPreviousPaths",value:function(h){for(var p=h.pathFromLine,S=h.pathFromArea,_=h.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,p=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]&&(p=k.globals.previousPaths[T].paths[1].d)))}return{pathFromLine:p,pathFromArea:S}}},{key:"determineFirstPrevY",value:function(h){var p,S,_,k=h.i,T=h.realIndex,B=h.series,W=h.prevY,ee=h.lineYPosition,ce=h.translationsIndex,ue=this.w,ge=ue.config.chart.stacked&&!ue.globals.comboCharts||ue.config.chart.stacked&&ue.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||((p=this.w.config.series[T])===null||p===void 0?void 0:p.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)W=(ee=ge&&k>0?this.lineCtx.prevSeriesY[k-1][0]:this.lineCtx.zeroY)-B[k][0]/this.lineCtx.yRatio[ce]+2*(this.lineCtx.isReversed?B[k][0]/this.lineCtx.yRatio[ce]:0);else if(ge&&k>0&&B[k][0]===void 0){for(var Se=k-1;Se>=0;Se--)if(B[Se][0]!==null&&B[Se][0]!==void 0){W=ee=this.lineCtx.prevSeriesY[Se][0];break}}return{prevY:W,lineYPosition:ee}}}]),Ee}(),Oe=function(Ee){for(var h,p,S,_,k=function(ce){for(var ue=[],ge=ce[0],Se=ce[1],ke=ue[0]=Et(ge,Se),Me=1,qe=ce.length-1;Me<qe;Me++)ge=Se,Se=ce[Me+1],ue[Me]=.5*(ke+(ke=Et(ge,Se)));return ue[Me]=ke,ue}(Ee),T=Ee.length-1,B=[],W=0;W<T;W++)S=Et(Ee[W],Ee[W+1]),Math.abs(S)<1e-6?k[W]=k[W+1]=0:(_=(h=k[W]/S)*h+(p=k[W+1]/S)*p)>9&&(_=3*S/Math.sqrt(_),k[W]=_*h,k[W+1]=_*p);for(var ee=0;ee<=T;ee++)_=(Ee[Math.min(T,ee+1)][0]-Ee[Math.max(0,ee-1)][0])/(6*(1+k[ee]*k[ee])),B.push([_||0,k[ee]*_||0]);return B},Jt=function(Ee){var h=Oe(Ee),p=Ee[1],S=Ee[0],_=[],k=h[1],T=h[0];_.push(S,[S[0]+T[0],S[1]+T[1],p[0]-k[0],p[1]-k[1],p[0],p[1]]);for(var B=2,W=h.length;B<W;B++){var ee=Ee[B],ce=h[B];_.push([ee[0]-ce[0],ee[1]-ce[1],ee[0],ee[1]])}return _},sn=function(Ee,h,p){var S=Ee.slice(h,p);if(h){if(p-h>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,h){return(h[1]-Ee[1])/(h[0]-Ee[0])}var Xn=function(){function Ee(h,p,S){s(this,Ee),this.ctx=h,this.w=h.w,this.xyRatios=p,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 rn(this),this.markers=new ye(this.ctx),this.prevSeriesY=[],this.categoryAxisCorrection=0,this.yaxisIndex=0}return o(Ee,[{key:"draw",value:function(h,p,S,_){var k,T=this.w,B=new z(this.ctx),W=T.globals.comboCharts?p:T.config.chart.type,ee=B.group({class:"apexcharts-".concat(W,"-series apexcharts-plot-series")}),ce=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,h=ce.getLogSeries(h),this.yRatio=ce.getLogYRatios(this.yRatio),this.prevSeriesY=[];for(var ue=[],ge=0;ge<h.length;ge++){h=this.lineHelpers.sameValueSeriesFix(ge,h);var Se=T.globals.comboCharts?S[ge]:ge,ke=this.yRatio.length>1?Se:0;this._initSerieVariables(h,ge,Se);var Me=[],qe=[],Fe=[],at=T.globals.padHorizontal+this.categoryAxisCorrection;this.ctx.series.addCollapsedClassToSeries(this.elSeries,Se),T.globals.isXNumeric&&T.globals.seriesX.length>0&&(at=(T.globals.seriesX[Se][0]-T.globals.minX)/this.xRatio),Fe.push(at);var se,Ce=at,Ue=void 0,Be=Ce,_e=this.zeroY,rt=this.zeroY;_e=this.lineHelpers.determineFirstPrevY({i:ge,realIndex:Se,series:h,prevY:_e,lineYPosition:0,translationsIndex:ke}).prevY,T.config.stroke.curve==="monotoneCubic"&&h[ge][0]===null?Me.push(null):Me.push(_e),se=_e,W==="rangeArea"&&(Ue=rt=this.lineHelpers.determineFirstPrevY({i:ge,realIndex:Se,series:_,prevY:rt,lineYPosition:0,translationsIndex:ke}).prevY,qe.push(Me[0]!==null?rt:null));var ct=this._calculatePathsFrom({type:W,series:h,i:ge,realIndex:Se,translationsIndex:ke,prevX:Be,prevY:_e,prevY2:rt}),yt=[Me[0]],Lt=[qe[0]],ft={type:W,series:h,realIndex:Se,translationsIndex:ke,i:ge,x:at,y:1,pX:Ce,pY:se,pathsFrom:ct,linePaths:[],areaPaths:[],seriesIndex:S,lineYPosition:0,xArrj:Fe,yArrj:Me,y2Arrj:qe,seriesRangeEnd:_},Tt=this._iterateOverDataPoints(v(v({},ft),{},{iterations:W==="rangeArea"?h[ge].length-1:void 0,isRangeStart:!0}));if(W==="rangeArea"){for(var Ge=this._calculatePathsFrom({series:_,i:ge,realIndex:Se,prevX:Be,prevY:rt}),At=this._iterateOverDataPoints(v(v({},ft),{},{series:_,xArrj:[at],yArrj:yt,y2Arrj:Lt,pY:Ue,areaPaths:Tt.areaPaths,pathsFrom:Ge,iterations:_[ge].length-1,isRangeStart:!1})),Ot=Tt.linePaths.length/2,it=0;it<Ot;it++)Tt.linePaths[it]=At.linePaths[it+Ot]+Tt.linePaths[it];Tt.linePaths.splice(Ot),Tt.pathFromLine=At.pathFromLine+Tt.pathFromLine}else Tt.pathFromArea+="z";this._handlePaths({type:W,realIndex:Se,i:ge,paths:Tt}),this.elSeries.add(this.elPointsMain),this.elSeries.add(this.elDataLabelsWrap),ue.push(this.elSeries)}if(((k=T.config.series[0])===null||k===void 0?void 0:k.zIndex)!==void 0&&ue.sort(function(mn,ir){return Number(mn.node.getAttribute("zIndex"))-Number(ir.node.getAttribute("zIndex"))}),T.config.chart.stacked)for(var jt=ue.length-1;jt>=0;jt--)ee.add(ue[jt]);else for(var Nn=0;Nn<ue.length;Nn++)ee.add(ue[Nn]);return ee}},{key:"_initSerieVariables",value:function(h,p,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:O.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=h[p].length===_.globals.dataPoints;this.elSeries.attr({"data:longestSeries":B,rel:p+1,"data:realIndex":S}),this.appendPathFrom=!0}},{key:"_calculatePathsFrom",value:function(h){var p,S,_,k,T=h.type,B=h.series,W=h.i,ee=h.realIndex,ce=h.translationsIndex,ue=h.prevX,ge=h.prevY,Se=h.prevY2,ke=this.w,Me=new z(this.ctx);if(B[W][0]===null){for(var qe=0;qe<B[W].length;qe++)if(B[W][qe]!==null){ue=this.xDivision*qe,ge=this.zeroY-B[W][qe]/this.yRatio[ce],p=Me.move(ue,ge),S=Me.move(ue,this.areaBottomY);break}}else p=Me.move(ue,ge),T==="rangeArea"&&(p=Me.move(ue,Se)+Me.line(ue,ge)),S=Me.move(ue,this.areaBottomY)+Me.line(ue,ge);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:ee});_=Fe.pathFromLine,k=Fe.pathFromArea}return{prevX:ue,prevY:ge,linePath:p,areaPath:S,pathFromLine:_,pathFromArea:k}}},{key:"_handlePaths",value:function(h){var p=h.type,S=h.realIndex,_=h.i,k=h.paths,T=this.w,B=new z(this.ctx),W=new xe(this.ctx);this.prevSeriesY.push(k.yArrj),T.globals.seriesXvalues[S]=k.xArrj,T.globals.seriesYvalues[S]=k.yArrj;var ee=T.config.forecastDataPoints;if(ee.count>0&&p!=="rangeArea"){var ce=T.globals.seriesXvalues[S][T.globals.seriesXvalues[S].length-ee.count-1],ue=B.drawRect(ce,0,T.globals.gridWidth,T.globals.gridHeight,0);T.globals.dom.elForecastMask.appendChild(ue.node);var ge=B.drawRect(0,0,ce,T.globals.gridHeight,0);T.globals.dom.elNonForecastMask.appendChild(ge.node)}this.pointsChart||T.globals.delayedElements.push({el:this.elPointsMain.node,index:S});var Se={i:_,realIndex:S,animationDelay:_,initialSpeed:T.config.chart.animations.speed,dataChangeSpeed:T.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-".concat(p)};if(p==="area")for(var ke=W.fillPath({seriesNumber:S}),Me=0;Me<k.areaPaths.length;Me++){var qe=B.renderPaths(v(v({},Se),{},{pathFrom:k.pathFromArea,pathTo:k.areaPaths[Me],stroke:"none",strokeWidth:0,strokeLineCap:null,fill:ke}));this.elSeries.add(qe)}if(T.config.stroke.show&&!this.pointsChart){var Fe=null;if(p==="line")Fe=W.fillPath({seriesNumber:S,i:_});else if(T.config.stroke.fill.type==="solid")Fe=T.globals.stroke.colors[S];else{var at=T.config.fill;T.config.fill=T.config.stroke.fill,Fe=W.fillPath({seriesNumber:S,i:_}),T.config.fill=at}for(var se=0;se<k.linePaths.length;se++){var Ce=Fe;p==="rangeArea"&&(Ce=W.fillPath({seriesNumber:S}));var Ue=v(v({},Se),{},{pathFrom:k.pathFromLine,pathTo:k.linePaths[se],stroke:Fe,strokeWidth:this.strokeWidth,strokeLineCap:T.config.stroke.lineCap,fill:p==="rangeArea"?Ce:"none"}),Be=B.renderPaths(Ue);if(this.elSeries.add(Be),Be.attr("fill-rule","evenodd"),ee.count>0&&p!=="rangeArea"){var _e=B.renderPaths(Ue);_e.node.setAttribute("stroke-dasharray",ee.dashArray),ee.strokeWidth&&_e.node.setAttribute("stroke-width",ee.strokeWidth),this.elSeries.add(_e),_e.attr("clip-path","url(#forecastMask".concat(T.globals.cuid,")")),Be.attr("clip-path","url(#nonForecastMask".concat(T.globals.cuid,")"))}}}}},{key:"_iterateOverDataPoints",value:function(h){var p,S,_=this,k=h.type,T=h.series,B=h.iterations,W=h.realIndex,ee=h.translationsIndex,ce=h.i,ue=h.x,ge=h.y,Se=h.pX,ke=h.pY,Me=h.pathsFrom,qe=h.linePaths,Fe=h.areaPaths,at=h.seriesIndex,se=h.lineYPosition,Ce=h.xArrj,Ue=h.yArrj,Be=h.y2Arrj,_e=h.isRangeStart,rt=h.seriesRangeEnd,ct=this.w,yt=new z(this.ctx),Lt=this.yRatio,ft=Me.prevY,Tt=Me.linePath,Ge=Me.areaPath,At=Me.pathFromLine,Ot=Me.pathFromArea,it=O.isNumber(ct.globals.minYArr[W])?ct.globals.minYArr[W]:ct.globals.minY;B||(B=ct.globals.dataPoints>1?ct.globals.dataPoints-1:ct.globals.dataPoints);var jt=function(Kn,Yr){return Yr-Kn/Lt[ee]+2*(_.isReversed?Kn/Lt[ee]:0)},Nn=ge,mn=ct.config.chart.stacked&&!ct.globals.comboCharts||ct.config.chart.stacked&&ct.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||((p=this.w.config.series[W])===null||p===void 0?void 0:p.type)==="bar"||((S=this.w.config.series[W])===null||S===void 0?void 0:S.type)==="column"),ir=ct.config.stroke.curve;Array.isArray(ir)&&(ir=Array.isArray(at)?ir[at[ce]]:ir[ce]);for(var Sn,Bn=0,rr=0;rr<B;rr++){var ur=T[ce][rr+1]===void 0||T[ce][rr+1]===null;if(ct.globals.isXNumeric){var _r=ct.globals.seriesX[W][rr+1];ct.globals.seriesX[W][rr+1]===void 0&&(_r=ct.globals.seriesX[W][B-1]),ue=(_r-ct.globals.minX)/this.xRatio}else ue+=this.xDivision;mn?ce>0&&ct.globals.collapsedSeries.length<ct.config.series.length-1?se=this.prevSeriesY[function(Kn){for(var Yr=Kn;Yr>0;Yr--){if(!(ct.globals.collapsedSeriesIndices.indexOf((at==null?void 0:at[Yr])||Yr)>-1))return Yr;Yr--}return 0}(ce-1)][rr+1]:se=this.zeroY:se=this.zeroY,ur?ge=jt(it,se):(ge=jt(T[ce][rr+1],se),k==="rangeArea"&&(Nn=jt(rt[ce][rr+1],se))),Ce.push(ue),!ur||ct.config.stroke.curve!=="smooth"&&ct.config.stroke.curve!=="monotoneCubic"?(Ue.push(ge),Be.push(Nn)):(Ue.push(null),Be.push(null));var Un=this.lineHelpers.calculatePoints({series:T,x:ue,y:ge,realIndex:W,i:ce,j:rr,prevY:ft}),Ln=this._createPaths({type:k,series:T,i:ce,realIndex:W,j:rr,x:ue,y:ge,y2:Nn,xArrj:Ce,yArrj:Ue,y2Arrj:Be,pX:Se,pY:ke,pathState:Bn,segmentStartX:Sn,linePath:Tt,areaPath:Ge,linePaths:qe,areaPaths:Fe,curve:ir,isRangeStart:_e});Fe=Ln.areaPaths,qe=Ln.linePaths,Se=Ln.pX,ke=Ln.pY,Bn=Ln.pathState,Sn=Ln.segmentStartX,Ge=Ln.areaPath,Tt=Ln.linePath,!this.appendPathFrom||ir==="monotoneCubic"&&k==="rangeArea"||(At+=yt.line(ue,this.zeroY),Ot+=yt.line(ue,this.zeroY)),this.handleNullDataPoints(T,Un,ce,rr,W),this._handleMarkersAndLabels({type:k,pointsPos:Un,i:ce,j:rr,realIndex:W,isRangeStart:_e})}return{yArrj:Ue,xArrj:Ce,pathFromArea:Ot,areaPaths:Fe,pathFromLine:At,linePaths:qe,linePath:Tt,areaPath:Ge}}},{key:"_handleMarkersAndLabels",value:function(h){var p=h.type,S=h.pointsPos,_=h.isRangeStart,k=h.i,T=h.j,B=h.realIndex,W=this.w,ee=new Pe(this.ctx);if(this.pointsChart)this.scatter.draw(this.elSeries,T,{realIndex:B,pointsPos:S,zRatio:this.zRatio,elParent:this.elPointsMain});else{W.globals.series[k].length>1&&this.elPointsMain.node.classList.add("apexcharts-element-hidden");var ce=this.markers.plotChartMarkers(S,B,T+1);ce!==null&&this.elPointsMain.add(ce)}var ue=ee.drawDataLabel({type:p,isRangeStart:_,pos:S,i:B,j:T+1});ue!==null&&this.elDataLabelsWrap.add(ue)}},{key:"_createPaths",value:function(h){var p=h.type,S=h.series,_=h.i;h.realIndex;var k,T=h.j,B=h.x,W=h.y,ee=h.xArrj,ce=h.yArrj,ue=h.y2,ge=h.y2Arrj,Se=h.pX,ke=h.pY,Me=h.pathState,qe=h.segmentStartX,Fe=h.linePath,at=h.areaPath,se=h.linePaths,Ce=h.areaPaths,Ue=h.curve,Be=h.isRangeStart,_e=new z(this.ctx),rt=this.areaBottomY,ct=p==="rangeArea",yt=p==="rangeArea"&&Be;switch(Ue){case"monotoneCubic":var Lt=Be?ce:ge;switch(Me){case 0:if(Lt[T+1]===null)break;Me=1;case 1:if(!(ct?ee.length===S[_].length:T===S[_].length-2))break;case 2:var ft=Be?ee:ee.slice().reverse(),Tt=Be?Lt:Lt.slice().reverse(),Ge=(k=Tt,ft.map(function(_r,Un){return[_r,k[Un]]}).filter(function(_r){return _r[1]!==null})),At=Ge.length>1?Jt(Ge):Ge,Ot=[];ct&&(yt?Ce=Ge:Ot=Ce.reverse());var it=0,jt=0;if(function(_r,Un){for(var Ln=function(ds){var Je=[],bt=0;return ds.forEach(function(Tn){Tn!==null?bt++:bt>0&&(Je.push(bt),bt=0)}),bt>0&&Je.push(bt),Je}(_r),Kn=[],Yr=0,os=0;Yr<Ln.length;os+=Ln[Yr++])Kn[Yr]=sn(Un,os,os+Ln[Yr]);return Kn}(Tt,At).forEach(function(_r){it++;var Un=function(Yr){for(var os="",ds=0;ds<Yr.length;ds++){var Je=Yr[ds],bt=Je.length;bt>4?(os+="C".concat(Je[0],", ").concat(Je[1]),os+=", ".concat(Je[2],", ").concat(Je[3]),os+=", ".concat(Je[4],", ").concat(Je[5])):bt>2&&(os+="S".concat(Je[0],", ").concat(Je[1]),os+=", ".concat(Je[2],", ").concat(Je[3]))}return os}(_r),Ln=jt,Kn=(jt+=_r.length)-1;yt?Fe=_e.move(Ge[Ln][0],Ge[Ln][1])+Un:ct?Fe=_e.move(Ot[Ln][0],Ot[Ln][1])+_e.line(Ge[Ln][0],Ge[Ln][1])+Un+_e.line(Ot[Kn][0],Ot[Kn][1]):(Fe=_e.move(Ge[Ln][0],Ge[Ln][1])+Un,at=Fe+_e.line(Ge[Kn][0],rt)+_e.line(Ge[Ln][0],rt)+"z",Ce.push(at)),se.push(Fe)}),ct&&it>1&&!yt){var Nn=se.slice(it).reverse();se.splice(it),Nn.forEach(function(_r){return se.push(_r)})}Me=0}break;case"smooth":var mn=.35*(B-Se);if(S[_][T]===null)Me=0;else switch(Me){case 0:if(qe=Se,Fe=yt?_e.move(Se,ge[T])+_e.line(Se,ke):_e.move(Se,ke),at=_e.move(Se,ke),S[_][T+1]===null){se.push(Fe),Ce.push(at);break}if(Me=1,T<S[_].length-2){var ir=_e.curve(Se+mn,ke,B-mn,W,B,W);Fe+=ir,at+=ir;break}case 1:if(S[_][T+1]===null)Fe+=yt?_e.line(Se,ue):_e.move(Se,ke),at+=_e.line(Se,rt)+_e.line(qe,rt)+"z",se.push(Fe),Ce.push(at),Me=-1;else{var Sn=_e.curve(Se+mn,ke,B-mn,W,B,W);Fe+=Sn,at+=Sn,T>=S[_].length-2&&(yt&&(Fe+=_e.curve(B,W,B,W,B,ue)+_e.move(B,ue)),at+=_e.curve(B,W,B,W,B,rt)+_e.line(qe,rt)+"z",se.push(Fe),Ce.push(at),Me=-1)}}Se=B,ke=W;break;default:var Bn=function(_r,Un,Ln){var Kn=[];switch(_r){case"stepline":Kn=_e.line(Un,null,"H")+_e.line(null,Ln,"V");break;case"linestep":Kn=_e.line(null,Ln,"V")+_e.line(Un,null,"H");break;case"straight":Kn=_e.line(Un,Ln)}return Kn};if(S[_][T]===null)Me=0;else switch(Me){case 0:if(qe=Se,Fe=yt?_e.move(Se,ge[T])+_e.line(Se,ke):_e.move(Se,ke),at=_e.move(Se,ke),S[_][T+1]===null){se.push(Fe),Ce.push(at);break}if(Me=1,T<S[_].length-2){var rr=Bn(Ue,B,W);Fe+=rr,at+=rr;break}case 1:if(S[_][T+1]===null)Fe+=yt?_e.line(Se,ue):_e.move(Se,ke),at+=_e.line(Se,rt)+_e.line(qe,rt)+"z",se.push(Fe),Ce.push(at),Me=-1;else{var ur=Bn(Ue,B,W);Fe+=ur,at+=ur,T>=S[_].length-2&&(yt&&(Fe+=_e.line(B,ue)),at+=_e.line(B,rt)+_e.line(qe,rt)+"z",se.push(Fe),Ce.push(at),Me=-1)}}Se=B,ke=W}return{linePaths:se,areaPaths:Ce,pX:Se,pY:ke,pathState:Me,segmentStartX:qe,linePath:Fe,areaPath:at}}},{key:"handleNullDataPoints",value:function(h,p,S,_,k){var T=this.w;if(h[S][_]===null&&T.config.markers.showNullDataPoints||h[S].length===1){var B=this.strokeWidth-T.config.markers.strokeWidth/2;B>0||(B=0);var W=this.markers.plotChartMarkers(p,k,_+1,B,!0);W!==null&&this.elPointsMain.add(W)}}}]),Ee}();window.TreemapSquared={},window.TreemapSquared.generate=function(){function Ee(B,W,ee,ce){this.xoffset=B,this.yoffset=W,this.height=ce,this.width=ee,this.shortestEdge=function(){return Math.min(this.height,this.width)},this.getCoordinates=function(ue){var ge,Se=[],ke=this.xoffset,Me=this.yoffset,qe=k(ue)/this.height,Fe=k(ue)/this.width;if(this.width>=this.height)for(ge=0;ge<ue.length;ge++)Se.push([ke,Me,ke+qe,Me+ue[ge]/qe]),Me+=ue[ge]/qe;else for(ge=0;ge<ue.length;ge++)Se.push([ke,Me,ke+ue[ge]/Fe,Me+Fe]),ke+=ue[ge]/Fe;return Se},this.cutArea=function(ue){var ge;if(this.width>=this.height){var Se=ue/this.height,ke=this.width-Se;ge=new Ee(this.xoffset+Se,this.yoffset,ke,this.height)}else{var Me=ue/this.width,qe=this.height-Me;ge=new Ee(this.xoffset,this.yoffset+Me,this.width,qe)}return ge}}function h(B,W,ee,ce,ue){ce=ce===void 0?0:ce,ue=ue===void 0?0:ue;var ge=p(function(Se,ke){var Me,qe=[],Fe=ke/k(Se);for(Me=0;Me<Se.length;Me++)qe[Me]=Se[Me]*Fe;return qe}(B,W*ee),[],new Ee(ce,ue,W,ee),[]);return function(Se){var ke,Me,qe=[];for(ke=0;ke<Se.length;ke++)for(Me=0;Me<Se[ke].length;Me++)qe.push(Se[ke][Me]);return qe}(ge)}function p(B,W,ee,ce){var ue,ge,Se;if(B.length!==0)return ue=ee.shortestEdge(),function(ke,Me,qe){var Fe;if(ke.length===0)return!0;(Fe=ke.slice()).push(Me);var at=S(ke,qe),se=S(Fe,qe);return at>=se}(W,ge=B[0],ue)?(W.push(ge),p(B.slice(1),W,ee,ce)):(Se=ee.cutArea(k(W),ce),ce.push(ee.getCoordinates(W)),p(B,[],Se,ce)),ce;ce.push(ee.getCoordinates(W))}function S(B,W){var ee=Math.min.apply(Math,B),ce=Math.max.apply(Math,B),ue=k(B);return Math.max(Math.pow(W,2)*ce/Math.pow(ue,2),Math.pow(ue,2)/(Math.pow(W,2)*ee))}function _(B){return B&&B.constructor===Array}function k(B){var W,ee=0;for(W=0;W<B.length;W++)ee+=B[W];return ee}function T(B){var W,ee=0;if(_(B[0]))for(W=0;W<B.length;W++)ee+=T(B[W]);else ee=k(B);return ee}return function B(W,ee,ce,ue,ge){ue=ue===void 0?0:ue,ge=ge===void 0?0:ge;var Se,ke,Me=[],qe=[];if(_(W[0])){for(ke=0;ke<W.length;ke++)Me[ke]=T(W[ke]);for(Se=h(Me,ee,ce,ue,ge),ke=0;ke<W.length;ke++)qe.push(B(W[ke],Se[ke][2]-Se[ke][0],Se[ke][3]-Se[ke][1],Se[ke][0],Se[ke][1]))}else qe=h(W,ee,ce,ue,ge);return qe}}();var gn,Dt,en=function(){function Ee(h,p){s(this,Ee),this.ctx=h,this.w=h.w,this.strokeWidth=this.w.config.stroke.width,this.helpers=new kn(h),this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.labels=[]}return o(Ee,[{key:"draw",value:function(h){var p=this,S=this.w,_=new z(this.ctx),k=new xe(this.ctx),T=_.group({class:"apexcharts-treemap"});if(S.globals.noData)return T;var B=[];return h.forEach(function(W){var ee=W.map(function(ce){return Math.abs(ce)});B.push(ee)}),this.negRange=this.helpers.checkColorRange(),S.config.series.forEach(function(W,ee){W.data.forEach(function(ce){Array.isArray(p.labels[ee])||(p.labels[ee]=[]),p.labels[ee].push(ce.x)})}),window.TreemapSquared.generate(B,S.globals.gridWidth,S.globals.gridHeight).forEach(function(W,ee){var ce=_.group({class:"apexcharts-series apexcharts-treemap-series",seriesName:O.escapeString(S.globals.seriesNames[ee]),rel:ee+1,"data:realIndex":ee});if(S.config.chart.dropShadow.enabled){var ue=S.config.chart.dropShadow;new L(p.ctx).dropShadow(T,ue,ee)}var ge=_.group({class:"apexcharts-data-labels"});W.forEach(function(Se,ke){var Me=Se[0],qe=Se[1],Fe=Se[2],at=Se[3],se=_.drawRect(Me,qe,Fe-Me,at-qe,S.config.plotOptions.treemap.borderRadius,"#fff",1,p.strokeWidth,S.config.plotOptions.treemap.useFillColorAsStroke?Ue:S.globals.stroke.colors[ee]);se.attr({cx:Me,cy:qe,index:ee,i:ee,j:ke,width:Fe-Me,height:at-qe});var Ce=p.helpers.getShadeColor(S.config.chart.type,ee,ke,p.negRange),Ue=Ce.color;S.config.series[ee].data[ke]!==void 0&&S.config.series[ee].data[ke].fillColor&&(Ue=S.config.series[ee].data[ke].fillColor);var Be=k.fillPath({color:Ue,seriesNumber:ee,dataPointIndex:ke});se.node.classList.add("apexcharts-treemap-rect"),se.attr({fill:Be}),p.helpers.addListeners(se);var _e={x:Me+(Fe-Me)/2,y:qe+(at-qe)/2,width:0,height:0},rt={x:Me,y:qe,width:Fe-Me,height:at-qe};if(S.config.chart.animations.enabled&&!S.globals.dataChanged){var ct=1;S.globals.resized||(ct=S.config.chart.animations.speed),p.animateTreemap(se,_e,rt,ct)}if(S.globals.dataChanged){var yt=1;p.dynamicAnim.enabled&&S.globals.shouldAnimate&&(yt=p.dynamicAnim.speed,S.globals.previousPaths[ee]&&S.globals.previousPaths[ee][ke]&&S.globals.previousPaths[ee][ke].rect&&(_e=S.globals.previousPaths[ee][ke].rect),p.animateTreemap(se,_e,rt,yt))}var Lt=p.getFontSize(Se),ft=S.config.dataLabels.formatter(p.labels[ee][ke],{value:S.globals.series[ee][ke],seriesIndex:ee,dataPointIndex:ke,w:S});S.config.plotOptions.treemap.dataLabels.format==="truncate"&&(Lt=parseInt(S.config.dataLabels.style.fontSize,10),ft=p.truncateLabels(ft,Lt,Me,qe,Fe,at));var Tt=null;S.globals.series[ee][ke]&&(Tt=p.helpers.calculateDataLabels({text:ft,x:(Me+Fe)/2,y:(qe+at)/2+p.strokeWidth/2+Lt/3,i:ee,j:ke,colorProps:Ce,fontSize:Lt,series:h})),S.config.dataLabels.enabled&&Tt&&p.rotateToFitLabel(Tt,Lt,ft,Me,qe,Fe,at),ce.add(se),Tt!==null&&ce.add(Tt)}),ce.add(ge),T.add(ce)}),T}},{key:"getFontSize",value:function(h){var p=this.w,S,_,k,T,B=function W(ee){var ce,ue=0;if(Array.isArray(ee[0]))for(ce=0;ce<ee.length;ce++)ue+=W(ee[ce]);else for(ce=0;ce<ee.length;ce++)ue+=ee[ce].length;return ue}(this.labels)/function W(ee){var ce,ue=0;if(Array.isArray(ee[0]))for(ce=0;ce<ee.length;ce++)ue+=W(ee[ce]);else for(ce=0;ce<ee.length;ce++)ue+=1;return ue}(this.labels);return S=h[2]-h[0],_=h[3]-h[1],k=S*_,T=Math.pow(k,.5),Math.min(T/B,parseInt(p.config.dataLabels.style.fontSize,10))}},{key:"rotateToFitLabel",value:function(h,p,S,_,k,T,B){var W=new z(this.ctx),ee=W.getTextRects(S,p);if(ee.width+this.w.config.stroke.width+5>T-_&&ee.width<=B-k){var ce=W.rotateAroundCenter(h.node);h.node.setAttribute("transform","rotate(-90 ".concat(ce.x," ").concat(ce.y,") translate(").concat(ee.height/3,")"))}}},{key:"truncateLabels",value:function(h,p,S,_,k,T){var B=new z(this.ctx),W=B.getTextRects(h,p).width+this.w.config.stroke.width+5>k-S&&T-_>k-S?T-_:k-S,ee=B.getTextBasedOnMaxWidth({text:h,maxWidth:W,fontSize:p});return h.length!==ee.length&&W/p<5?"":ee}},{key:"animateTreemap",value:function(h,p,S,_){var k=new U(this.ctx);k.animateRect(h,{x:p.x,y:p.y,width:p.width,height:p.height},{x:S.x,y:S.y,width:S.width,height:S.height},_,function(){k.animationCompleted(h)})}}]),Ee}(),In=86400,Qn=10/In,ar=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w,this.timeScaleArray=[],this.utc=this.w.config.xaxis.labels.datetimeUTC}return o(Ee,[{key:"calculateTimeScaleTicks",value:function(h,p){var S=this,_=this.w;if(_.globals.allSeriesCollapsed)return _.globals.labels=[],_.globals.timescaleLabels=[],[];var k=new K(this.ctx),T=(p-h)/864e5;this.determineInterval(T),_.globals.disableZoomIn=!1,_.globals.disableZoomOut=!1,T<Qn?_.globals.disableZoomIn=!0:T>5e4&&(_.globals.disableZoomOut=!0);var B=k.getTimeUnitsfromTimestamp(h,p,this.utc),W=_.globals.gridWidth/T,ee=W/24,ce=ee/60,ue=ce/60,ge=Math.floor(24*T),Se=Math.floor(1440*T),ke=Math.floor(T*In),Me=Math.floor(T),qe=Math.floor(T/30),Fe=Math.floor(T/365),at={minMillisecond:B.minMillisecond,minSecond:B.minSecond,minMinute:B.minMinute,minHour:B.minHour,minDate:B.minDate,minMonth:B.minMonth,minYear:B.minYear},se={firstVal:at,currentMillisecond:at.minMillisecond,currentSecond:at.minSecond,currentMinute:at.minMinute,currentHour:at.minHour,currentMonthDate:at.minDate,currentDate:at.minDate,currentMonth:at.minMonth,currentYear:at.minYear,daysWidthOnXAxis:W,hoursWidthOnXAxis:ee,minutesWidthOnXAxis:ce,secondsWidthOnXAxis:ue,numberOfSeconds:ke,numberOfMinutes:Se,numberOfHours:ge,numberOfDays:Me,numberOfMonths:qe,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(Ue){var Be={position:Ue.position,unit:Ue.unit,year:Ue.year,day:Ue.day?Ue.day:1,hour:Ue.hour?Ue.hour:0,month:Ue.month+1};return Ue.unit==="month"?v(v({},Be),{},{day:1,value:Ue.value+1}):Ue.unit==="day"||Ue.unit==="hour"?v(v({},Be),{},{value:Ue.value}):Ue.unit==="minute"?v(v({},Be),{},{value:Ue.value,minute:Ue.value}):Ue.unit==="second"?v(v({},Be),{},{value:Ue.value,minute:Ue.minute,second:Ue.second}):Ue});return Ce.filter(function(Ue){var Be=1,_e=Math.ceil(_.globals.gridWidth/120),rt=Ue.value;_.config.xaxis.tickAmount!==void 0&&(_e=_.config.xaxis.tickAmount),Ce.length>_e&&(Be=Math.floor(Ce.length/_e));var ct=!1,yt=!1;switch(S.tickInterval){case"years":Ue.unit==="year"&&(ct=!0);break;case"half_year":Be=7,Ue.unit==="year"&&(ct=!0);break;case"months":Be=1,Ue.unit==="year"&&(ct=!0);break;case"months_fortnight":Be=15,Ue.unit!=="year"&&Ue.unit!=="month"||(ct=!0),rt===30&&(yt=!0);break;case"months_days":Be=10,Ue.unit==="month"&&(ct=!0),rt===30&&(yt=!0);break;case"week_days":Be=8,Ue.unit==="month"&&(ct=!0);break;case"days":Be=1,Ue.unit==="month"&&(ct=!0);break;case"hours":Ue.unit==="day"&&(ct=!0);break;case"minutes_fives":case"seconds_fives":rt%5!=0&&(yt=!0);break;case"seconds_tens":rt%10!=0&&(yt=!0)}if(S.tickInterval==="hours"||S.tickInterval==="minutes_fives"||S.tickInterval==="seconds_tens"||S.tickInterval==="seconds_fives"){if(!yt)return!0}else if((rt%Be==0||ct)&&!yt)return!0})}},{key:"recalcDimensionsBasedOnFormat",value:function(h,p){var S=this.w,_=this.formatDates(h),k=this.removeOverlappingTS(_);S.globals.timescaleLabels=k.slice(),new Ze(this.ctx).plotCoords()}},{key:"determineInterval",value:function(h){var p=24*h,S=60*p;switch(!0){case h/365>5:this.tickInterval="years";break;case h>800:this.tickInterval="half_year";break;case h>180:this.tickInterval="months";break;case h>90:this.tickInterval="months_fortnight";break;case h>60:this.tickInterval="months_days";break;case h>30:this.tickInterval="week_days";break;case h>2:this.tickInterval="days";break;case p>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(h){var p=h.firstVal,S=h.currentMonth,_=h.currentYear,k=h.daysWidthOnXAxis,T=h.numberOfYears,B=p.minYear,W=0,ee=new K(this.ctx),ce="year";if(p.minDate>1||p.minMonth>0){var ue=ee.determineRemainingDaysOfYear(p.minYear,p.minMonth,p.minDate);W=(ee.determineDaysOfYear(p.minYear)-ue+1)*k,B=p.minYear+1,this.timeScaleArray.push({position:W,value:B,unit:ce,year:B,month:O.monthMod(S+1)})}else p.minDate===1&&p.minMonth===0&&this.timeScaleArray.push({position:W,value:B,unit:ce,year:_,month:O.monthMod(S+1)});for(var ge=B,Se=W,ke=0;ke<T;ke++)ge++,Se=ee.determineDaysOfYear(ge-1)*k+Se,this.timeScaleArray.push({position:Se,value:ge,unit:ce,year:ge,month:1})}},{key:"generateMonthScale",value:function(h){var p=h.firstVal,S=h.currentMonthDate,_=h.currentMonth,k=h.currentYear,T=h.daysWidthOnXAxis,B=h.numberOfMonths,W=_,ee=0,ce=new K(this.ctx),ue="month",ge=0;if(p.minDate>1){ee=(ce.determineDaysOfMonths(_+1,p.minYear)-S+1)*T,W=O.monthMod(_+1);var Se=k+ge,ke=O.monthMod(W),Me=W;W===0&&(ue="year",Me=Se,ke=1,Se+=ge+=1),this.timeScaleArray.push({position:ee,value:Me,unit:ue,year:Se,month:ke})}else this.timeScaleArray.push({position:ee,value:W,unit:ue,year:k,month:O.monthMod(_)});for(var qe=W+1,Fe=ee,at=0,se=1;at<B;at++,se++){(qe=O.monthMod(qe))===0?(ue="year",ge+=1):ue="month";var Ce=this._getYear(k,qe,ge);Fe=ce.determineDaysOfMonths(qe,Ce)*T+Fe;var Ue=qe===0?Ce:qe;this.timeScaleArray.push({position:Fe,value:Ue,unit:ue,year:Ce,month:qe===0?1:qe}),qe++}}},{key:"generateDayScale",value:function(h){var p=h.firstVal,S=h.currentMonth,_=h.currentYear,k=h.hoursWidthOnXAxis,T=h.numberOfDays,B=new K(this.ctx),W="day",ee=p.minDate+1,ce=ee,ue=function(se,Ce,Ue){return se>B.determineDaysOfMonths(Ce+1,Ue)&&(ce=1,W="month",Se=Ce+=1),Ce},ge=(24-p.minHour)*k,Se=ee,ke=ue(ce,S,_);p.minHour===0&&p.minDate===1?(ge=0,Se=O.monthMod(p.minMonth),W="month",ce=p.minDate):p.minDate!==1&&p.minHour===0&&p.minMinute===0&&(ge=0,ee=p.minDate,Se=ee,ke=ue(ce=ee,S,_)),this.timeScaleArray.push({position:ge,value:Se,unit:W,year:this._getYear(_,ke,0),month:O.monthMod(ke),day:ce});for(var Me=ge,qe=0;qe<T;qe++){W="day",ke=ue(ce+=1,ke,this._getYear(_,ke,0));var Fe=this._getYear(_,ke,0);Me=24*k+Me;var at=ce===1?O.monthMod(ke):ce;this.timeScaleArray.push({position:Me,value:at,unit:W,year:Fe,month:O.monthMod(ke),day:at})}}},{key:"generateHourScale",value:function(h){var p=h.firstVal,S=h.currentDate,_=h.currentMonth,k=h.currentYear,T=h.minutesWidthOnXAxis,B=h.numberOfHours,W=new K(this.ctx),ee="hour",ce=function(Be,_e){return Be>W.determineDaysOfMonths(_e+1,k)&&(qe=1,_e+=1),{month:_e,date:qe}},ue=function(Be,_e){return Be>W.determineDaysOfMonths(_e+1,k)?_e+=1:_e},ge=60-(p.minMinute+p.minSecond/60),Se=ge*T,ke=p.minHour+1,Me=ke;ge===60&&(Se=0,Me=ke=p.minHour);var qe=S;Me>=24&&(Me=0,qe+=1,ee="day");var Fe=ce(qe,_).month;Fe=ue(qe,Fe),this.timeScaleArray.push({position:Se,value:ke,unit:ee,day:qe,hour:Me,year:k,month:O.monthMod(Fe)}),Me++;for(var at=Se,se=0;se<B;se++){ee="hour",Me>=24&&(Me=0,ee="day",Fe=ce(qe+=1,Fe).month,Fe=ue(qe,Fe));var Ce=this._getYear(k,Fe,0);at=60*T+at;var Ue=Me===0?qe:Me;this.timeScaleArray.push({position:at,value:Ue,unit:ee,hour:Me,day:qe,year:Ce,month:O.monthMod(Fe)}),Me++}}},{key:"generateMinuteScale",value:function(h){for(var p=h.currentMillisecond,S=h.currentSecond,_=h.currentMinute,k=h.currentHour,T=h.currentDate,B=h.currentMonth,W=h.currentYear,ee=h.minutesWidthOnXAxis,ce=h.secondsWidthOnXAxis,ue=h.numberOfMinutes,ge=_+1,Se=T,ke=B,Me=W,qe=k,Fe=(60-S-p/1e3)*ce,at=0;at<ue;at++)ge>=60&&(ge=0,(qe+=1)===24&&(qe=0)),this.timeScaleArray.push({position:Fe,value:ge,unit:"minute",hour:qe,minute:ge,day:Se,year:this._getYear(Me,ke,0),month:O.monthMod(ke)}),Fe+=ee,ge++}},{key:"generateSecondScale",value:function(h){for(var p=h.currentMillisecond,S=h.currentSecond,_=h.currentMinute,k=h.currentHour,T=h.currentDate,B=h.currentMonth,W=h.currentYear,ee=h.secondsWidthOnXAxis,ce=h.numberOfSeconds,ue=S+1,ge=_,Se=T,ke=B,Me=W,qe=k,Fe=(1e3-p)/1e3*ee,at=0;at<ce;at++)ue>=60&&(ue=0,++ge>=60&&(ge=0,++qe===24&&(qe=0))),this.timeScaleArray.push({position:Fe,value:ue,unit:"second",hour:qe,minute:ge,second:ue,day:Se,year:this._getYear(Me,ke,0),month:O.monthMod(ke)}),Fe+=ee,ue++}},{key:"createRawDateString",value:function(h,p){var S=h.year;return h.month===0&&(h.month=1),S+="-"+("0"+h.month.toString()).slice(-2),h.unit==="day"?S+=h.unit==="day"?"-"+("0"+p).slice(-2):"-01":S+="-"+("0"+(h.day?h.day:"1")).slice(-2),h.unit==="hour"?S+=h.unit==="hour"?"T"+("0"+p).slice(-2):"T00":S+="T"+("0"+(h.hour?h.hour:"0")).slice(-2),h.unit==="minute"?S+=":"+("0"+p).slice(-2):S+=":"+(h.minute?("0"+h.minute).slice(-2):"00"),h.unit==="second"?S+=":"+("0"+p).slice(-2):S+=":00",this.utc&&(S+=".000Z"),S}},{key:"formatDates",value:function(h){var p=this,S=this.w;return h.map(function(_){var k=_.value.toString(),T=new K(p.ctx),B=p.createRawDateString(_,k),W=T.getDate(T.parseDate(B));if(p.utc||(W=T.getDate(T.parseDateWithTimezone(B))),S.config.xaxis.labels.format===void 0){var ee="dd MMM",ce=S.config.xaxis.labels.datetimeFormatter;_.unit==="year"&&(ee=ce.year),_.unit==="month"&&(ee=ce.month),_.unit==="day"&&(ee=ce.day),_.unit==="hour"&&(ee=ce.hour),_.unit==="minute"&&(ee=ce.minute),_.unit==="second"&&(ee=ce.second),k=T.formatDate(W,ee)}else k=T.formatDate(W,S.config.xaxis.labels.format);return{dateString:B,position:_.position,value:k,unit:_.unit,year:_.year,month:_.month}})}},{key:"removeOverlappingTS",value:function(h){var p,S=this,_=new z(this.ctx),k=!1;h.length>0&&h[0].value&&h.every(function(W){return W.value.length===h[0].value.length})&&(k=!0,p=_.getTextRects(h[0].value).width);var T=0,B=h.map(function(W,ee){if(ee>0&&S.w.config.xaxis.labels.hideOverlappingLabels){var ce=k?p:_.getTextRects(h[T].value).width,ue=h[T].position;return W.position>ue+ce+10?(T=ee,W):null}return W});return B=B.filter(function(W){return W!==null})}},{key:"_getYear",value:function(h,p,S){return h+Math.floor(p/12)+S}}]),Ee}(),hr=function(){function Ee(h,p){s(this,Ee),this.ctx=p,this.w=p.w,this.el=h}return o(Ee,[{key:"setupElements",value:function(){var h=this.w,p=h.globals,S=h.config,_=S.chart.type;p.axisCharts=["line","area","bar","rangeBar","rangeArea","candlestick","boxPlot","scatter","bubble","radar","heatmap","treemap"].includes(_),p.xyCharts=["line","area","bar","rangeBar","rangeArea","candlestick","boxPlot","scatter","bubble"].includes(_),p.isBarHorizontal=["bar","rangeBar","boxPlot"].includes(_)&&S.plotOptions.bar.horizontal,p.chartClass=".apexcharts".concat(p.chartID),p.dom.baseEl=this.el,p.dom.elWrap=document.createElement("div"),z.setAttrs(p.dom.elWrap,{id:p.chartClass.substring(1),class:"apexcharts-canvas ".concat(p.chartClass.substring(1))}),this.el.appendChild(p.dom.elWrap),p.dom.Paper=new window.SVG.Doc(p.dom.elWrap),p.dom.Paper.attr({class:"apexcharts-svg","xmlns:data":"ApexChartsNS",transform:"translate(".concat(S.chart.offsetX,", ").concat(S.chart.offsetY,")")}),p.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(),p.dom.elLegendForeign=document.createElementNS(p.SVGNS,"foreignObject"),z.setAttrs(p.dom.elLegendForeign,{x:0,y:0,width:p.svgWidth,height:p.svgHeight}),p.dom.elLegendWrap=document.createElement("div"),p.dom.elLegendWrap.classList.add("apexcharts-legend"),p.dom.elLegendWrap.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),p.dom.elLegendForeign.appendChild(p.dom.elLegendWrap),p.dom.Paper.node.appendChild(p.dom.elLegendForeign),p.dom.elGraphical=p.dom.Paper.group().attr({class:"apexcharts-inner apexcharts-graphical"}),p.dom.elDefs=p.dom.Paper.defs(),p.dom.Paper.add(p.dom.elGraphical),p.dom.elGraphical.add(p.dom.elDefs)}},{key:"plotChartType",value:function(h,p){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:[]}},W=k.chart.type||"line",ee=null,ce=0;T.series.forEach(function(Be,_e){var rt=h[_e].type||W;B[rt]?(rt==="rangeArea"?(B[rt].series.push(T.seriesRangeStart[_e]),B[rt].seriesRangeEnd.push(T.seriesRangeEnd[_e])):B[rt].series.push(Be),B[rt].i.push(_e),rt!=="column"&&rt!=="bar"||(S.globals.columnSeries=B.column)):["heatmap","treemap","pie","donut","polarArea","radialBar","radar"].includes(rt)?ee=rt:rt==="bar"?(B.column.series.push(Be),B.column.i.push(_e)):console.warn("You have specified an unrecognized series type (".concat(rt,").")),W!==rt&&rt!=="scatter"&&ce++}),ce>0&&(ee&&console.warn("Chart or series type ".concat(ee," cannot appear with other chart or series types.")),B.column.series.length>0&&k.plotOptions.bar.horizontal&&(ce-=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=ce>0);var ue=new Xn(_,p),ge=new An(_,p);_.pie=new Gn(_);var Se=new Yn(_);_.rangeBar=new Cn(_,p);var ke=new Rn(_),Me=[];if(T.comboCharts){var qe,Fe,at=new X(_);if(B.area.series.length>0&&(qe=Me).push.apply(qe,N(at.drawSeriesByGroup(B.area,T.areaGroups,"area",ue))),B.column.series.length>0)if(k.chart.stacked){var se=new xn(_,p);Me.push(se.draw(B.column.series,B.column.i))}else _.bar=new an(_,p),Me.push(_.bar.draw(B.column.series,B.column.i));if(B.rangeArea.series.length>0&&Me.push(ue.draw(B.rangeArea.series,"rangeArea",B.rangeArea.i,B.rangeArea.seriesRangeEnd)),B.line.series.length>0&&(Fe=Me).push.apply(Fe,N(at.drawSeriesByGroup(B.line,T.lineGroups,"line",ue))),B.candlestick.series.length>0&&Me.push(ge.draw(B.candlestick.series,"candlestick",B.candlestick.i)),B.boxPlot.series.length>0&&Me.push(ge.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 Xn(_,p,!0);Me.push(Ce.draw(B.scatter.series,"scatter",B.scatter.i))}if(B.bubble.series.length>0){var Ue=new Xn(_,p,!0);Me.push(Ue.draw(B.bubble.series,"bubble",B.bubble.i))}}else switch(k.chart.type){case"line":Me=ue.draw(T.series,"line");break;case"area":Me=ue.draw(T.series,"area");break;case"bar":k.chart.stacked?Me=new xn(_,p).draw(T.series):(_.bar=new an(_,p),Me=_.bar.draw(T.series));break;case"candlestick":Me=new An(_,p).draw(T.series,"candlestick");break;case"boxPlot":Me=new An(_,p).draw(T.series,k.chart.type);break;case"rangeBar":Me=_.rangeBar.draw(T.series);break;case"rangeArea":Me=ue.draw(T.seriesRangeStart,"rangeArea",void 0,T.seriesRangeEnd);break;case"heatmap":Me=new yn(_,p).draw(T.series);break;case"treemap":Me=new en(_,p).draw(T.series);break;case"pie":case"donut":case"polarArea":Me=_.pie.draw(T.series);break;case"radialBar":Me=Se.draw(T.series);break;case"radar":Me=ke.draw(T.series);break;default:Me=ue.draw(T.series)}return Me}},{key:"setSVGDimensions",value:function(){var h=this.w,p=h.globals,S=h.config;S.chart.width=S.chart.width||"100%",S.chart.height=S.chart.height||"auto",p.svgWidth=S.chart.width,p.svgHeight=S.chart.height;var _=O.getDimensions(this.el),k=S.chart.width.toString().split(/[0-9]+/g).pop();k==="%"?O.isNumber(_[0])&&(_[0].width===0&&(_=O.getDimensions(this.el.parentNode)),p.svgWidth=_[0]*parseInt(S.chart.width,10)/100):k!=="px"&&k!==""||(p.svgWidth=parseInt(S.chart.width,10));var T=String(S.chart.height).toString().split(/[0-9]+/g).pop();if(p.svgHeight!=="auto"&&p.svgHeight!=="")if(T==="%"){var B=O.getDimensions(this.el.parentNode);p.svgHeight=B[1]*parseInt(S.chart.height,10)/100}else p.svgHeight=parseInt(S.chart.height,10);else p.svgHeight=p.axisCharts?p.svgWidth/1.61:p.svgWidth/1.2;if(p.svgWidth=Math.max(p.svgWidth,0),p.svgHeight=Math.max(p.svgHeight,0),z.setAttrs(p.dom.Paper.node,{width:p.svgWidth,height:p.svgHeight}),T!=="%"){var W=S.chart.sparkline.enabled?0:p.axisCharts?S.chart.parentHeightOffset:0;p.dom.Paper.node.parentNode.parentNode.style.minHeight="".concat(p.svgHeight+W,"px")}p.dom.elWrap.style.width="".concat(p.svgWidth,"px"),p.dom.elWrap.style.height="".concat(p.svgHeight,"px")}},{key:"shiftGraphPosition",value:function(){var h=this.w.globals,p=h.translateY,S=h.translateX;z.setAttrs(h.dom.elGraphical.node,{transform:"translate(".concat(S,", ").concat(p,")")})}},{key:"resizeNonAxisCharts",value:function(){var h=this.w,p=h.globals,S=0,_=h.config.chart.sparkline.enabled?1:15;_+=h.config.grid.padding.bottom,["top","bottom"].includes(h.config.legend.position)&&h.config.legend.show&&!h.config.legend.floating&&(S=new dn(this.ctx).legendHelpers.getLegendDimensions().clwh+7);var k=h.globals.dom.baseEl.querySelector(".apexcharts-radialbar, .apexcharts-pie"),T=2.05*h.globals.radialSize;if(k&&!h.config.chart.sparkline.enabled&&h.config.plotOptions.radialBar.startAngle!==0){var B=O.getBoundingClientRect(k);T=B.bottom;var W=B.bottom-B.top;T=Math.max(2.05*h.globals.radialSize,W)}var ee=Math.ceil(T+p.translateY+S+_);p.dom.elLegendForeign&&p.dom.elLegendForeign.setAttribute("height",ee),h.config.chart.height&&String(h.config.chart.height).includes("%")||(p.dom.elWrap.style.height="".concat(ee,"px"),z.setAttrs(p.dom.Paper.node,{height:ee}),p.dom.Paper.node.parentNode.parentNode.style.minHeight="".concat(ee,"px"))}},{key:"coreCalculations",value:function(){new Le(this.ctx).init()}},{key:"resetGlobals",value:function(){var h=this,p=function(){return h.w.config.series.map(function(){return[]})},S=new me,_=this.w.globals;S.initGlobalVars(_),_.seriesXvalues=p(),_.seriesYvalues=p()}},{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 h=this.w,p=null;if(h.globals.axisCharts){if(h.config.xaxis.crosshairs.position==="back"&&new wt(this.ctx).drawXCrosshairs(),h.config.yaxis[0].crosshairs.position==="back"&&new wt(this.ctx).drawYCrosshairs(),h.config.xaxis.type==="datetime"&&h.config.xaxis.labels.formatter===void 0){this.ctx.timeScale=new ar(this.ctx);var S=[];isFinite(h.globals.minX)&&isFinite(h.globals.maxX)&&!h.globals.isBarHorizontal?S=this.ctx.timeScale.calculateTimeScaleTicks(h.globals.minX,h.globals.maxX):h.globals.isBarHorizontal&&(S=this.ctx.timeScale.calculateTimeScaleTicks(h.globals.minY,h.globals.maxY)),this.ctx.timeScale.recalcDimensionsBasedOnFormat(S)}p=new X(this.ctx).getCalculatedRatios()}return p}},{key:"updateSourceChart",value:function(h){this.ctx.w.globals.selection=void 0,this.ctx.updateHelpers._updateOptions({chart:{selection:{xaxis:{min:h.w.globals.minX,max:h.w.globals.maxX}}}},!1,!1)}},{key:"setupBrushHandler",value:function(){var h=this,p=this.w;if(p.config.chart.brush.enabled&&typeof p.config.chart.events.selection!="function"){var S=Array.isArray(p.config.chart.brush.targets)?p.config.chart.brush.targets:[p.config.chart.brush.target];S.forEach(function(_){var k=ApexCharts.getChartByID(_);k.w.globals.brushSource=h.ctx,typeof k.w.config.chart.events.zoomed!="function"&&(k.w.config.chart.events.zoomed=function(){return h.updateSourceChart(k)}),typeof k.w.config.chart.events.scrolled!="function"&&(k.w.config.chart.events.scrolled=function(){return h.updateSourceChart(k)})}),p.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}(),Gt=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"_updateOptions",value:function(h){var p=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 W=[p.ctx];k&&(W=p.ctx.getSyncedCharts()),p.ctx.w.globals.isExecCalled&&(W=[p.ctx],p.ctx.w.globals.isExecCalled=!1),W.forEach(function(ee,ce){var ue=ee.w;if(ue.globals.shouldAnimate=_,S||(ue.globals.resized=!0,ue.globals.dataChanged=!0,_&&ee.series.getPreviousPaths()),h&&I(h)==="object"&&(ee.config=new Ne(h),h=X.extendArrayProps(ee.config,h,ue),ee.w.globals.chartID!==p.ctx.w.globals.chartID&&delete h.series,ue.config=O.extend(ue.config,h),T&&(ue.globals.lastXAxis=h.xaxis?O.clone(h.xaxis):[],ue.globals.lastYAxis=h.yaxis?O.clone(h.yaxis):[],ue.globals.initialConfig=O.extend({},ue.config),ue.globals.initialSeries=O.clone(ue.config.series),h.series))){for(var ge=0;ge<ue.globals.collapsedSeriesIndices.length;ge++){var Se=ue.config.series[ue.globals.collapsedSeriesIndices[ge]];ue.globals.collapsedSeries[ge].data=ue.globals.axisCharts?Se.data.slice():Se}for(var ke=0;ke<ue.globals.ancillaryCollapsedSeriesIndices.length;ke++){var Me=ue.config.series[ue.globals.ancillaryCollapsedSeriesIndices[ke]];ue.globals.ancillaryCollapsedSeries[ke].data=ue.globals.axisCharts?Me.data.slice():Me}ee.series.emptyCollapsedSeries(ue.config.series)}return ee.update(h).then(function(){ce===W.length-1&&B(ee)})})})}},{key:"_updateSeries",value:function(h,p){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=p,B.globals.dataChanged=!0,p&&S.ctx.series.getPreviousPaths(),B.globals.axisCharts?((T=h.map(function(W,ee){return S._extendSeries(W,ee)})).length===0&&(T=[{data:[]}]),B.config.series=T):B.config.series=h.slice(),_&&(B.globals.initialConfig.series=O.clone(B.config.series),B.globals.initialSeries=O.clone(B.config.series)),S.ctx.update().then(function(){k(S.ctx)})})}},{key:"_extendSeries",value:function(h,p){var S=this.w,_=S.config.series[p];return v(v({},S.config.series[p]),{},{name:h.name?h.name:_==null?void 0:_.name,color:h.color?h.color:_==null?void 0:_.color,type:h.type?h.type:_==null?void 0:_.type,group:h.group?h.group:_==null?void 0:_.group,hidden:h.hidden!==void 0?h.hidden:_==null?void 0:_.hidden,data:h.data?h.data:_==null?void 0:_.data,zIndex:h.zIndex!==void 0?h.zIndex:p})}},{key:"toggleDataPointSelection",value:function(h,p){var S=this.w,_=null,k=".apexcharts-series[data\\:realIndex='".concat(h,"']");return S.globals.axisCharts?_=S.globals.dom.Paper.select("".concat(k," path[j='").concat(p,"'], ").concat(k," circle[j='").concat(p,"'], ").concat(k," rect[j='").concat(p,"']")).members[0]:p===void 0&&(_=S.globals.dom.Paper.select("".concat(k," path[j='").concat(h,"']")).members[0],S.config.chart.type!=="pie"&&S.config.chart.type!=="polarArea"&&S.config.chart.type!=="donut"||this.ctx.pie.pieClicked(h)),_?(new z(this.ctx).pathMouseDown(_,null),_.node?_.node:null):(console.warn("toggleDataPointSelection: Element not found"),null)}},{key:"forceXAxisUpdate",value:function(h){var p=this.w;if(["min","max"].forEach(function(_){h.xaxis[_]!==void 0&&(p.config.xaxis[_]=h.xaxis[_],p.globals.lastXAxis[_]=h.xaxis[_])}),h.xaxis.categories&&h.xaxis.categories.length&&(p.config.xaxis.categories=h.xaxis.categories),p.config.xaxis.convertedCatToNumeric){var S=new fe(h);h=S.convertCatToNumericXaxis(h,this.ctx)}return h}},{key:"forceYAxisUpdate",value:function(h){return h.chart&&h.chart.stacked&&h.chart.stackType==="100%"&&(Array.isArray(h.yaxis)?h.yaxis.forEach(function(p,S){h.yaxis[S].min=0,h.yaxis[S].max=100}):(h.yaxis.min=0,h.yaxis.max=100)),h}},{key:"revertDefaultAxisMinMax",value:function(h){var p=this,S=this.w,_=S.globals.lastXAxis,k=S.globals.lastYAxis;h&&h.xaxis&&(_=h.xaxis),h&&h.yaxis&&(k=h.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,W){S.globals.zoomed||k[W]!==void 0?T(W):p.ctx.opts.yaxis[W]!==void 0&&(B.min=p.ctx.opts.yaxis[W].min,B.max=p.ctx.opts.yaxis[W].max)})}}]),Ee}();gn=typeof window<"u"?window:void 0,Dt=function(Ee,h){var p=(this!==void 0?this:Ee).SVG=function(se){if(p.supported)return se=new p.Doc(se),p.parser.draw||p.prepare(),se};if(p.ns="http://www.w3.org/2000/svg",p.xmlns="http://www.w3.org/2000/xmlns/",p.xlink="http://www.w3.org/1999/xlink",p.svgjs="http://svgjs.dev",p.supported=!0,!p.supported)return!1;p.did=1e3,p.eid=function(se){return"Svgjs"+ce(se)+p.did++},p.create=function(se){var Ce=h.createElementNS(this.ns,se);return Ce.setAttribute("id",this.eid(se)),Ce},p.extend=function(){var se,Ce;Ce=(se=[].slice.call(arguments)).pop();for(var Ue=se.length-1;Ue>=0;Ue--)if(se[Ue])for(var Be in Ce)se[Ue].prototype[Be]=Ce[Be];p.Set&&p.Set.inherit&&p.Set.inherit()},p.invent=function(se){var Ce=typeof se.create=="function"?se.create:function(){this.constructor.call(this,p.create(se.create))};return se.inherit&&(Ce.prototype=new se.inherit),se.extend&&p.extend(Ce,se.extend),se.construct&&p.extend(se.parent||p.Container,se.construct),Ce},p.adopt=function(se){return se?se.instance?se.instance:((Ce=se.nodeName=="svg"?se.parentNode instanceof Ee.SVGElement?new p.Nested:new p.Doc:se.nodeName=="linearGradient"?new p.Gradient("linear"):se.nodeName=="radialGradient"?new p.Gradient("radial"):p[ce(se.nodeName)]?new p[ce(se.nodeName)]:new p.Element(se)).type=se.nodeName,Ce.node=se,se.instance=Ce,Ce instanceof p.Doc&&Ce.namespace().defs(),Ce.setData(JSON.parse(se.getAttribute("svgjs:data"))||{}),Ce):null;var Ce},p.prepare=function(){var se=h.getElementsByTagName("body")[0],Ce=(se?new p.Doc(se):p.adopt(h.documentElement).nested()).size(2,0);p.parser={body:se||h.documentElement,draw:Ce.style("opacity:0;position:absolute;left:-100%;top:-100%;overflow:hidden").node,poly:Ce.polyline().node,path:Ce.path().node,native:p.create("svg")}},p.parser={native:p.create("svg")},h.addEventListener("DOMContentLoaded",function(){p.parser.draw||p.prepare()},!1),p.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},p.utils={map:function(se,Ce){for(var Ue=se.length,Be=[],_e=0;_e<Ue;_e++)Be.push(Ce(se[_e]));return Be},filter:function(se,Ce){for(var Ue=se.length,Be=[],_e=0;_e<Ue;_e++)Ce(se[_e])&&Be.push(se[_e]);return Be},filterSVGElements:function(se){return this.filter(se,function(Ce){return Ce instanceof Ee.SVGElement})}},p.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"}},p.Color=function(se){var Ce,Ue;this.r=0,this.g=0,this.b=0,se&&(typeof se=="string"?p.regex.isRgb.test(se)?(Ce=p.regex.rgb.exec(se.replace(p.regex.whitespace,"")),this.r=parseInt(Ce[1]),this.g=parseInt(Ce[2]),this.b=parseInt(Ce[3])):p.regex.isHex.test(se)&&(Ce=p.regex.hex.exec((Ue=se).length==4?["#",Ue.substring(1,2),Ue.substring(1,2),Ue.substring(2,3),Ue.substring(2,3),Ue.substring(3,4),Ue.substring(3,4)].join(""):Ue),this.r=parseInt(Ce[1],16),this.g=parseInt(Ce[2],16),this.b=parseInt(Ce[3],16)):I(se)==="object"&&(this.r=se.r,this.g=se.g,this.b=se.b))},p.extend(p.Color,{toString:function(){return this.toHex()},toHex:function(){return"#"+ue(this.r)+ue(this.g)+ue(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 p.Color(se),this},at:function(se){return this.destination?(se=se<0?0:se>1?1:se,new p.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}}),p.Color.test=function(se){return se+="",p.regex.isHex.test(se)||p.regex.isRgb.test(se)},p.Color.isRgb=function(se){return se&&typeof se.r=="number"&&typeof se.g=="number"&&typeof se.b=="number"},p.Color.isColor=function(se){return p.Color.isRgb(se)||p.Color.test(se)},p.Array=function(se,Ce){(se=(se||[]).valueOf()).length==0&&Ce&&(se=Ce.valueOf()),this.value=this.parse(se)},p.extend(p.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)}}),p.PointArray=function(se,Ce){p.Array.call(this,se,Ce||[[0,0]])},p.PointArray.prototype=new p.Array,p.PointArray.prototype.constructor=p.PointArray;for(var S={M:function(se,Ce,Ue){return Ce.x=Ue.x=se[0],Ce.y=Ue.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,Ue){return Ce.x=Ue.x,Ce.y=Ue.y,["Z"]}},_="mlhvqtcsaz".split(""),k=0,T=_.length;k<T;++k)S[_[k]]=function(se){return function(Ce,Ue,Be){if(se=="H")Ce[0]=Ce[0]+Ue.x;else if(se=="V")Ce[0]=Ce[0]+Ue.y;else if(se=="A")Ce[5]=Ce[5]+Ue.x,Ce[6]=Ce[6]+Ue.y;else for(var _e=0,rt=Ce.length;_e<rt;++_e)Ce[_e]=Ce[_e]+(_e%2?Ue.y:Ue.x);if(S&&typeof S[se]=="function")return S[se](Ce,Ue,Be)}}(_[k].toUpperCase());p.PathArray=function(se,Ce){p.Array.call(this,se,Ce||[["M",0,0]])},p.PathArray.prototype=new p.Array,p.PathArray.prototype.constructor=p.PathArray,p.extend(p.PathArray,{toString:function(){return function(se){for(var Ce=0,Ue=se.length,Be="";Ce<Ue;Ce++)Be+=se[Ce][0],se[Ce][1]!=null&&(Be+=se[Ce][1],se[Ce][2]!=null&&(Be+=" ",Be+=se[Ce][2],se[Ce][3]!=null&&(Be+=" ",Be+=se[Ce][3],Be+=" ",Be+=se[Ce][4],se[Ce][5]!=null&&(Be+=" ",Be+=se[Ce][5],Be+=" ",Be+=se[Ce][6],se[Ce][7]!=null&&(Be+=" ",Be+=se[Ce][7])))));return Be+" "}(this.value)},move:function(se,Ce){var Ue=this.bbox();return Ue.x,Ue.y,this},at:function(se){if(!this.destination)return this;for(var Ce=this.value,Ue=this.destination.value,Be=[],_e=new p.PathArray,rt=0,ct=Ce.length;rt<ct;rt++){Be[rt]=[Ce[rt][0]];for(var yt=1,Lt=Ce[rt].length;yt<Lt;yt++)Be[rt][yt]=Ce[rt][yt]+(Ue[rt][yt]-Ce[rt][yt])*se;Be[rt][0]==="A"&&(Be[rt][4]=+(Be[rt][4]!=0),Be[rt][5]=+(Be[rt][5]!=0))}return _e.value=Be,_e},parse:function(se){if(se instanceof p.PathArray)return se.valueOf();var Ce,Ue={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(p.regex.numbersWithDots,W).replace(p.regex.pathLetters," $& ").replace(p.regex.hyphen,"$1 -").trim().split(p.regex.delimiter):se.reduce(function(Lt,ft){return[].concat.call(Lt,ft)},[]);var Be=[],_e=new p.Point,rt=new p.Point,ct=0,yt=se.length;do p.regex.isPathLetter.test(se[ct])?(Ce=se[ct],++ct):Ce=="M"?Ce="L":Ce=="m"&&(Ce="l"),Be.push(S[Ce].call(null,se.slice(ct,ct+=Ue[Ce.toUpperCase()]).map(parseFloat),_e,rt));while(yt>ct);return Be},bbox:function(){return p.parser.draw||p.prepare(),p.parser.path.setAttribute("d",this.toString()),p.parser.path.getBBox()}}),p.Number=p.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(p.regex.numberAndUnit))&&(this.value=parseFloat(Ce[1]),Ce[5]=="%"?this.value/=100:Ce[5]=="s"&&(this.value*=1e3),this.unit=Ce[5]):se instanceof p.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 p.Number(se),new p.Number(this+se,this.unit||se.unit)},minus:function(se){return se=new p.Number(se),new p.Number(this-se,this.unit||se.unit)},times:function(se){return se=new p.Number(se),new p.Number(this*se,this.unit||se.unit)},divide:function(se){return se=new p.Number(se),new p.Number(this/se,this.unit||se.unit)},to:function(se){var Ce=new p.Number(this);return typeof se=="string"&&(Ce.unit=se),Ce},morph:function(se){return this.destination=new p.Number(se),se.relative&&(this.destination.value+=this.value),this},at:function(se){return this.destination?new p.Number(this.destination).minus(this).times(se).plus(this):this}}}),p.Element=p.invent({create:function(se){this._stroke=p.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 Ue=ge(this,se,Ce);return this.width(new p.Number(Ue.width)).height(new p.Number(Ue.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(p.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 p.get(this.attr(se))},parent:function(se){var Ce=this;if(!Ce.node.parentNode)return null;if(Ce=p.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=p.adopt(Ce.node.parentNode)}},doc:function(){return this instanceof p.Doc?this:this.parent(p.Doc)},parents:function(se){var Ce=[],Ue=this;do{if(!(Ue=Ue.parent(se))||!Ue.node)break;Ce.push(Ue)}while(Ue.parent);return Ce},matches:function(se){return function(Ce,Ue){return(Ce.matches||Ce.matchesSelector||Ce.msMatchesSelector||Ce.mozMatchesSelector||Ce.webkitMatchesSelector||Ce.oMatchesSelector).call(Ce,Ue)}(this.node,se)},native:function(){return this.node},svg:function(se){var Ce=h.createElementNS("http://www.w3.org/2000/svg","svg");if(!(se&&this instanceof p.Parent))return Ce.appendChild(se=h.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 Ue=0,Be=Ce.firstChild.childNodes.length;Ue<Be;Ue++)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,Ue){return Ce instanceof Ue}(this,se)}}}),p.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)}},p.morph=function(se){return function(Ce,Ue){return new p.MorphObj(Ce,Ue).at(se)}},p.Situation=p.invent({create:function(se){this.init=!1,this.reversed=!1,this.reversing=!1,this.duration=new p.Number(se.duration).valueOf(),this.delay=new p.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={}}}),p.FX=p.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,Ue){I(se)==="object"&&(Ce=se.ease,Ue=se.delay,se=se.duration);var Be=new p.Situation({duration:se||1e3,delay:Ue||0,ease:p.easing[Ce||"-"]||Ce});return this.queue(Be),this},target:function(se){return se&&se instanceof p.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 p.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 p.Situation?this.start():this.situation.call(this)),this},initAnimations:function(){var se,Ce=this.situation;if(Ce.init)return this;for(var Ue in Ce.animations){se=this.target()[Ue](),Array.isArray(se)||(se=[se]),Array.isArray(Ce.animations[Ue])||(Ce.animations[Ue]=[Ce.animations[Ue]]);for(var Be=se.length;Be--;)Ce.animations[Ue][Be]instanceof p.Number&&(se[Be]=new p.Number(se[Be])),Ce.animations[Ue][Be]=se[Be].morph(Ce.animations[Ue][Be])}for(var Ue in Ce.attrs)Ce.attrs[Ue]=new p.MorphObj(this.target().attr(Ue),Ce.attrs[Ue]);for(var Ue in Ce.styles)Ce.styles[Ue]=new p.MorphObj(this.target().style(Ue),Ce.styles[Ue]);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 Ue=this.active;return this.active=!1,Ce&&this.clearQueue(),se&&this.situation&&(!Ue&&this.startCurrent(),this.atEnd()),this.stopAnimFrame(),this.clearCurrent()},after:function(se){var Ce=this.last();return this.target().on("finished.fx",function Ue(Be){Be.detail.situation==Ce&&(se.call(this,Ce),this.off("finished.fx",Ue))}),this._callStart()},during:function(se){var Ce=this.last(),Ue=function(Be){Be.detail.situation==Ce&&se.call(this,Be.detail.pos,p.morph(Be.detail.pos),Be.detail.eased,Ce)};return this.target().off("during.fx",Ue).on("during.fx",Ue),this.after(function(){this.off("during.fx",Ue)}),this._callStart()},afterAll:function(se){var Ce=function Ue(Be){se.call(this),this.off("allfinished.fx",Ue)};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,Ue){return this.last()[Ue||"animations"][se]=Ce,this._callStart()},step:function(se){var Ce,Ue,Be;se||(this.absPos=this.timeToAbsPos(+new Date)),this.situation.loops!==!1?(Ce=Math.max(this.absPos,0),Ue=Math.floor(Ce),this.situation.loops===!0||Ue<this.situation.loops?(this.pos=Ce-Ue,Be=this.situation.loop,this.situation.loop=Ue):(this.absPos=this.situation.loops,this.pos=1,Be=this.situation.loop-1,this.situation.loop=this.situation.loops),this.situation.reversing&&(this.situation.reversed=this.situation.reversed!=!!((this.situation.loop-Be)%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 rt in this.situation.once)rt>this.lastPos&&rt<=_e&&(this.situation.once[rt].call(this.target(),this.pos,_e),delete this.situation.once[rt]);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,Ue=this.target(),Be=this.situation;for(var _e in Be.animations)se=[].concat(Be.animations[_e]).map(function(yt){return typeof yt!="string"&&yt.at?yt.at(Be.ease(Ce.pos),Ce.pos):yt}),Ue[_e].apply(Ue,se);for(var _e in Be.attrs)se=[_e].concat(Be.attrs[_e]).map(function(Lt){return typeof Lt!="string"&&Lt.at?Lt.at(Be.ease(Ce.pos),Ce.pos):Lt}),Ue.attr.apply(Ue,se);for(var _e in Be.styles)se=[_e].concat(Be.styles[_e]).map(function(Lt){return typeof Lt!="string"&&Lt.at?Lt.at(Be.ease(Ce.pos),Ce.pos):Lt}),Ue.style.apply(Ue,se);if(Be.transforms.length){se=Be.initialTransformation,_e=0;for(var rt=Be.transforms.length;_e<rt;_e++){var ct=Be.transforms[_e];ct instanceof p.Matrix?se=ct.relative?se.multiply(new p.Matrix().morph(ct).at(Be.ease(this.pos))):se.morph(ct).at(Be.ease(this.pos)):(ct.relative||ct.undo(se.extract()),se=se.multiply(ct.at(Be.ease(this.pos))))}Ue.matrix(se)}return this},once:function(se,Ce,Ue){var Be=this.last();return Ue||(se=Be.ease(se)),Be.once[se]=Ce,this},_callStart:function(){return setTimeout((function(){this.start()}).bind(this),0),this}},parent:p.Element,construct:{animate:function(se,Ce,Ue){return(this.fx||(this.fx=new p.FX(this))).animate(se,Ce,Ue)},delay:function(se){return(this.fx||(this.fx=new p.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}}}),p.MorphObj=p.invent({create:function(se,Ce){return p.Color.isColor(Ce)?new p.Color(se).morph(Ce):p.regex.delimiter.test(se)?p.regex.pathLetters.test(se)?new p.PathArray(se).morph(Ce):new p.Array(se).morph(Ce):p.regex.numberAndUnit.test(Ce)?new p.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}}}),p.extend(p.FX,{attr:function(se,Ce,Ue){if(I(se)==="object")for(var Be in se)this.attr(Be,se[Be]);else this.add(se,Ce,"attrs");return this},plot:function(se,Ce,Ue,Be){return arguments.length==4?this.plot([se,Ce,Ue,Be]):this.add("plot",new(this.target()).morphArray(se))}}),p.Box=p.invent({create:function(se,Ce,Ue,Be){if(!(I(se)!=="object"||se instanceof p.Element))return p.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=Ue,this.height=Be),(_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}}),p.BBox=p.invent({create:function(se){if(p.Box.apply(this,[].slice.call(arguments)),se instanceof p.Element){var Ce;try{if(!h.documentElement.contains){for(var Ue=se.node;Ue.parentNode;)Ue=Ue.parentNode;if(Ue!=h)throw new Error("Element not in the dom")}Ce=se.node.getBBox()}catch{if(se instanceof p.Shape){p.parser.draw||p.prepare();var Be=se.clone(p.parser.draw.instance).show();Be&&Be.node&&typeof Be.node.getBBox=="function"&&(Ce=Be.node.getBBox()),Be&&typeof Be.remove=="function"&&Be.remove()}else Ce={x:se.node.clientLeft,y:se.node.clientTop,width:se.node.clientWidth,height:se.node.clientHeight}}p.Box.call(this,Ce)}},inherit:p.Box,parent:p.Element,construct:{bbox:function(){return new p.BBox(this)}}}),p.BBox.prototype.constructor=p.BBox,p.Matrix=p.invent({create:function(se){var Ce=ke([1,0,0,1,0,0]);se=se===null?Ce:se instanceof p.Element?se.matrixify():typeof se=="string"?ke(se.split(p.regex.delimiter).map(parseFloat)):arguments.length==6?ke([].slice.call(arguments)):Array.isArray(se)?ke(se):se&&I(se)==="object"?se:Ce;for(var Ue=Fe.length-1;Ue>=0;--Ue)this[Fe[Ue]]=se[Fe[Ue]]!=null?se[Fe[Ue]]:Ce[Fe[Ue]]},extend:{extract:function(){var se=Se(this,0,1);Se(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 p.Matrix(this)}},clone:function(){return new p.Matrix(this)},morph:function(se){return this.destination=new p.Matrix(se),this},multiply:function(se){return new p.Matrix(this.native().multiply(function(Ce){return Ce instanceof p.Matrix||(Ce=new p.Matrix(Ce)),Ce}(se).native()))},inverse:function(){return new p.Matrix(this.native().inverse())},translate:function(se,Ce){return new p.Matrix(this.native().translate(se||0,Ce||0))},native:function(){for(var se=p.parser.native.createSVGMatrix(),Ce=Fe.length-1;Ce>=0;Ce--)se[Fe[Ce]]=this[Fe[Ce]];return se},toString:function(){return"matrix("+qe(this.a)+","+qe(this.b)+","+qe(this.c)+","+qe(this.d)+","+qe(this.e)+","+qe(this.f)+")"}},parent:p.Element,construct:{ctm:function(){return new p.Matrix(this.node.getCTM())},screenCTM:function(){if(this instanceof p.Nested){var se=this.rect(1,1),Ce=se.node.getScreenCTM();return se.remove(),new p.Matrix(Ce)}return new p.Matrix(this.node.getScreenCTM())}}}),p.Point=p.invent({create:function(se,Ce){var Ue;Ue=Array.isArray(se)?{x:se[0],y:se[1]}:I(se)==="object"?{x:se.x,y:se.y}:se!=null?{x:se,y:Ce??se}:{x:0,y:0},this.x=Ue.x,this.y=Ue.y},extend:{clone:function(){return new p.Point(this)},morph:function(se,Ce){return this.destination=new p.Point(se,Ce),this}}}),p.extend(p.Element,{point:function(se,Ce){return new p.Point(se,Ce).transform(this.screenCTM().inverse())}}),p.extend(p.Element,{attr:function(se,Ce,Ue){if(se==null){for(se={},Ue=(Ce=this.node.attributes).length-1;Ue>=0;Ue--)se[Ce[Ue].nodeName]=p.regex.isNumber.test(Ce[Ue].nodeValue)?parseFloat(Ce[Ue].nodeValue):Ce[Ue].nodeValue;return se}if(I(se)==="object")for(var Be in se)this.attr(Be,se[Be]);else if(Ce===null)this.node.removeAttribute(se);else{if(Ce==null)return(Ce=this.node.getAttribute(se))==null?p.defaults.attrs[se]:p.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"||(p.regex.isImage.test(Ce)&&(Ce=this.doc().defs().image(Ce,0,0)),Ce instanceof p.Image&&(Ce=this.doc().defs().pattern(0,0,function(){this.add(Ce)}))),typeof Ce=="number"?Ce=new p.Number(Ce):p.Color.isColor(Ce)?Ce=new p.Color(Ce):Array.isArray(Ce)&&(Ce=new p.Array(Ce)),se=="leading"?this.leading&&this.leading(Ce):typeof Ue=="string"?this.node.setAttributeNS(Ue,se,Ce.toString()):this.node.setAttribute(se,Ce.toString()),!this.rebuild||se!="font-size"&&se!="x"||this.rebuild(se,Ce)}return this}}),p.extend(p.Element,{transform:function(se,Ce){var Ue;return I(se)!=="object"?(Ue=new p.Matrix(this).extract(),typeof se=="string"?Ue[se]:Ue):(Ue=new p.Matrix(this),Ce=!!Ce||!!se.relative,se.a!=null&&(Ue=Ce?Ue.multiply(new p.Matrix(se)):new p.Matrix(se)),this.attr("transform",Ue))}}),p.extend(p.Element,{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(p.regex.transforms).slice(0,-1).map(function(se){var Ce=se.trim().split("(");return[Ce[0],Ce[1].split(p.regex.delimiter).map(function(Ue){return parseFloat(Ue)})]}).reduce(function(se,Ce){return Ce[0]=="matrix"?se.multiply(ke(Ce[1])):se[Ce[0]].apply(se,Ce[1])},new p.Matrix)},toParent:function(se){if(this==se)return this;var Ce=this.screenCTM(),Ue=se.screenCTM().inverse();return this.addTo(se).untransform().transform(Ue.multiply(Ce)),this},toDoc:function(){return this.toParent(this.doc())}}),p.Transformation=p.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 Ue=0,Be=this.arguments.length;Ue<Be;++Ue)this[this.arguments[Ue]]=se[Ue];else if(se&&I(se)==="object")for(Ue=0,Be=this.arguments.length;Ue<Be;++Ue)this[this.arguments[Ue]]=se[this.arguments[Ue]];this.inversed=!1,Ce===!0&&(this.inversed=!0)}}),p.Translate=p.invent({parent:p.Matrix,inherit:p.Transformation,create:function(se,Ce){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["transformedX","transformedY"],method:"translate"}}),p.extend(p.Element,{style:function(se,Ce){if(arguments.length==0)return this.node.style.cssText||"";if(arguments.length<2)if(I(se)==="object")for(var Ue in se)this.style(Ue,se[Ue]);else{if(!p.regex.isCss.test(se))return this.node.style[ee(se)];for(se=se.split(/\s*;\s*/).filter(function(Be){return!!Be}).map(function(Be){return Be.split(/\s*:\s*/)});Ce=se.pop();)this.style(Ce[0],Ce[1])}else this.node.style[ee(se)]=Ce===null||p.regex.isBlank.test(Ce)?"":Ce;return this}}),p.Parent=p.invent({create:function(se){this.constructor.call(this,se)},inherit:p.Element,extend:{children:function(){return p.utils.map(p.utils.filterSVGElements(this.node.childNodes),function(se){return p.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 p.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 Ue=this.children(),Be=0,_e=Ue.length;Be<_e;Be++)Ue[Be]instanceof p.Element&&se.apply(Ue[Be],[Be,Ue]),Ce&&Ue[Be]instanceof p.Container&&Ue[Be].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()}}}),p.extend(p.Parent,{ungroup:function(se,Ce){return Ce===0||this instanceof p.Defs||this.node==p.parser.draw||(se=se||(this instanceof p.Doc?this:this.parent(p.Parent)),Ce=Ce||1/0,this.each(function(){return this instanceof p.Defs?this:this instanceof p.Parent?this.ungroup(se,Ce-1):this.toParent(se)}),this.node.firstChild||this.remove()),this},flatten:function(se,Ce){return this.ungroup(se,Ce)}}),p.Container=p.invent({create:function(se){this.constructor.call(this,se)},inherit:p.Parent}),p.ViewBox=p.invent({parent:p.Container,construct:{}}),["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","touchstart","touchmove","touchleave","touchend","touchcancel"].forEach(function(se){p.Element.prototype[se]=function(Ce){return p.on(this.node,se,Ce),this}}),p.listeners=[],p.handlerMap=[],p.listenerId=0,p.on=function(se,Ce,Ue,Be,_e){var rt=Ue.bind(Be||se.instance||se),ct=(p.handlerMap.indexOf(se)+1||p.handlerMap.push(se))-1,yt=Ce.split(".")[0],Lt=Ce.split(".")[1]||"*";p.listeners[ct]=p.listeners[ct]||{},p.listeners[ct][yt]=p.listeners[ct][yt]||{},p.listeners[ct][yt][Lt]=p.listeners[ct][yt][Lt]||{},Ue._svgjsListenerId||(Ue._svgjsListenerId=++p.listenerId),p.listeners[ct][yt][Lt][Ue._svgjsListenerId]=rt,se.addEventListener(yt,rt,_e||{passive:!1})},p.off=function(se,Ce,Ue){var Be=p.handlerMap.indexOf(se),_e=Ce&&Ce.split(".")[0],rt=Ce&&Ce.split(".")[1],ct="";if(Be!=-1)if(Ue){if(typeof Ue=="function"&&(Ue=Ue._svgjsListenerId),!Ue)return;p.listeners[Be][_e]&&p.listeners[Be][_e][rt||"*"]&&(se.removeEventListener(_e,p.listeners[Be][_e][rt||"*"][Ue],!1),delete p.listeners[Be][_e][rt||"*"][Ue])}else if(rt&&_e){if(p.listeners[Be][_e]&&p.listeners[Be][_e][rt]){for(var yt in p.listeners[Be][_e][rt])p.off(se,[_e,rt].join("."),yt);delete p.listeners[Be][_e][rt]}}else if(rt)for(var Lt in p.listeners[Be])for(var ct in p.listeners[Be][Lt])rt===ct&&p.off(se,[Lt,rt].join("."));else if(_e){if(p.listeners[Be][_e]){for(var ct in p.listeners[Be][_e])p.off(se,[_e,ct].join("."));delete p.listeners[Be][_e]}}else{for(var Lt in p.listeners[Be])p.off(se,Lt);delete p.listeners[Be],delete p.handlerMap[Be]}},p.extend(p.Element,{on:function(se,Ce,Ue,Be){return p.on(this.node,se,Ce,Ue,Be),this},off:function(se,Ce){return p.off(this.node,se,Ce),this},fire:function(se,Ce){return se instanceof Ee.Event?this.node.dispatchEvent(se):this.node.dispatchEvent(se=new p.CustomEvent(se,{detail:Ce,cancelable:!0})),this._event=se,this},event:function(){return this._event}}),p.Defs=p.invent({create:"defs",inherit:p.Container}),p.G=p.invent({create:"g",inherit:p.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 p.G)}}}),p.Doc=p.invent({create:function(se){se&&((se=typeof se=="string"?h.getElementById(se):se).nodeName=="svg"?this.constructor.call(this,se):(this.constructor.call(this,p.create("svg")),se.appendChild(this.node),this.size("100%","100%")),this.namespace().defs())},inherit:p.Container,extend:{namespace:function(){return this.attr({xmlns:p.ns,version:"1.1"}).attr("xmlns:xlink",p.xlink,p.xmlns).attr("xmlns:svgjs",p.svgjs,p.xmlns)},defs:function(){var se;return this._defs||((se=this.node.getElementsByTagName("defs")[0])?this._defs=p.adopt(se):this._defs=new p.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,p.parser.draw&&!p.parser.draw.parentNode&&this.node.appendChild(p.parser.draw),this},clone:function(se){this.writeDataToDom();var Ce=this.node,Ue=Me(Ce.cloneNode(!0));return se?(se.node||se).appendChild(Ue.node):Ce.parentNode.insertBefore(Ue.node,Ce.nextSibling),Ue}}}),p.extend(p.Element,{}),p.Gradient=p.invent({create:function(se){this.constructor.call(this,p.create(se+"Gradient")),this.type=se},inherit:p.Container,extend:{at:function(se,Ce,Ue){return this.put(new p.Stop).update(se,Ce,Ue)},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,Ue){return se=="transform"&&(se="gradientTransform"),p.Container.prototype.attr.call(this,se,Ce,Ue)}},construct:{gradient:function(se,Ce){return this.defs().gradient(se,Ce)}}}),p.extend(p.Gradient,p.FX,{from:function(se,Ce){return(this._target||this).type=="radial"?this.attr({fx:new p.Number(se),fy:new p.Number(Ce)}):this.attr({x1:new p.Number(se),y1:new p.Number(Ce)})},to:function(se,Ce){return(this._target||this).type=="radial"?this.attr({cx:new p.Number(se),cy:new p.Number(Ce)}):this.attr({x2:new p.Number(se),y2:new p.Number(Ce)})}}),p.extend(p.Defs,{gradient:function(se,Ce){return this.put(new p.Gradient(se)).update(Ce)}}),p.Stop=p.invent({create:"stop",inherit:p.Element,extend:{update:function(se){return(typeof se=="number"||se instanceof p.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 p.Number(se.offset)),this}}}),p.Pattern=p.invent({create:"pattern",inherit:p.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,Ue){return se=="transform"&&(se="patternTransform"),p.Container.prototype.attr.call(this,se,Ce,Ue)}},construct:{pattern:function(se,Ce,Ue){return this.defs().pattern(se,Ce,Ue)}}}),p.extend(p.Defs,{pattern:function(se,Ce,Ue){return this.put(new p.Pattern).update(Ue).attr({x:0,y:0,width:se,height:Ce,patternUnits:"userSpaceOnUse"})}}),p.Shape=p.invent({create:function(se){this.constructor.call(this,se)},inherit:p.Element}),p.Symbol=p.invent({create:"symbol",inherit:p.Container,construct:{symbol:function(){return this.put(new p.Symbol)}}}),p.Use=p.invent({create:"use",inherit:p.Shape,extend:{element:function(se,Ce){return this.attr("href",(Ce||"")+"#"+se,p.xlink)}},construct:{use:function(se,Ce){return this.put(new p.Use).element(se,Ce)}}}),p.Rect=p.invent({create:"rect",inherit:p.Shape,construct:{rect:function(se,Ce){return this.put(new p.Rect).size(se,Ce)}}}),p.Circle=p.invent({create:"circle",inherit:p.Shape,construct:{circle:function(se){return this.put(new p.Circle).rx(new p.Number(se).divide(2)).move(0,0)}}}),p.extend(p.Circle,p.FX,{rx:function(se){return this.attr("r",se)},ry:function(se){return this.rx(se)}}),p.Ellipse=p.invent({create:"ellipse",inherit:p.Shape,construct:{ellipse:function(se,Ce){return this.put(new p.Ellipse).size(se,Ce).move(0,0)}}}),p.extend(p.Ellipse,p.Rect,p.FX,{rx:function(se){return this.attr("rx",se)},ry:function(se){return this.attr("ry",se)}}),p.extend(p.Circle,p.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 p.Number(se).divide(2))},height:function(se){return se==null?2*this.ry():this.ry(new p.Number(se).divide(2))},size:function(se,Ce){var Ue=ge(this,se,Ce);return this.rx(new p.Number(Ue.width).divide(2)).ry(new p.Number(Ue.height).divide(2))}}),p.Line=p.invent({create:"line",inherit:p.Shape,extend:{array:function(){return new p.PointArray([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])},plot:function(se,Ce,Ue,Be){return se==null?this.array():(se=Ce!==void 0?{x1:se,y1:Ce,x2:Ue,y2:Be}:new p.PointArray(se).toLine(),this.attr(se))},move:function(se,Ce){return this.attr(this.array().move(se,Ce).toLine())},size:function(se,Ce){var Ue=ge(this,se,Ce);return this.attr(this.array().size(Ue.width,Ue.height).toLine())}},construct:{line:function(se,Ce,Ue,Be){return p.Line.prototype.plot.apply(this.put(new p.Line),se!=null?[se,Ce,Ue,Be]:[0,0,0,0])}}}),p.Polyline=p.invent({create:"polyline",inherit:p.Shape,construct:{polyline:function(se){return this.put(new p.Polyline).plot(se||new p.PointArray)}}}),p.Polygon=p.invent({create:"polygon",inherit:p.Shape,construct:{polygon:function(se){return this.put(new p.Polygon).plot(se||new p.PointArray)}}}),p.extend(p.Polyline,p.Polygon,{array:function(){return this._array||(this._array=new p.PointArray(this.attr("points")))},plot:function(se){return se==null?this.array():this.clear().attr("points",typeof se=="string"?se:this._array=new p.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 Ue=ge(this,se,Ce);return this.attr("points",this.array().size(Ue.width,Ue.height))}}),p.extend(p.Line,p.Polyline,p.Polygon,{morphArray:p.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)}}),p.Path=p.invent({create:"path",inherit:p.Shape,extend:{morphArray:p.PathArray,array:function(){return this._array||(this._array=new p.PathArray(this.attr("d")))},plot:function(se){return se==null?this.array():this.clear().attr("d",typeof se=="string"?se:this._array=new p.PathArray(se))},clear:function(){return delete this._array,this}},construct:{path:function(se){return this.put(new p.Path).plot(se||new p.PathArray)}}}),p.Image=p.invent({create:"image",inherit:p.Shape,extend:{load:function(se){if(!se)return this;var Ce=this,Ue=new Ee.Image;return p.on(Ue,"load",function(){p.off(Ue);var Be=Ce.parent(p.Pattern);Be!==null&&(Ce.width()==0&&Ce.height()==0&&Ce.size(Ue.width,Ue.height),Be&&Be.width()==0&&Be.height()==0&&Be.size(Ce.width(),Ce.height()),typeof Ce._loaded=="function"&&Ce._loaded.call(Ce,{width:Ue.width,height:Ue.height,ratio:Ue.width/Ue.height,url:se}))}),p.on(Ue,"error",function(Be){p.off(Ue),typeof Ce._error=="function"&&Ce._error.call(Ce,Be)}),this.attr("href",Ue.src=this.src=se,p.xlink)},loaded:function(se){return this._loaded=se,this},error:function(se){return this._error=se,this}},construct:{image:function(se,Ce,Ue){return this.put(new p.Image).load(se).size(Ce||0,Ue||Ce||0)}}}),p.Text=p.invent({create:function(){this.constructor.call(this,p.create("text")),this.dom.leading=new p.Number(1.3),this._rebuild=!0,this._build=!1,this.attr("font-family",p.defaults.attrs["font-family"])},inherit:p.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,Ue=0,Be=Ce.length;Ue<Be;++Ue)Ue!=0&&Ce[Ue].nodeType!=3&&p.adopt(Ce[Ue]).dom.newLined==1&&(se+=`
`),se+=Ce[Ue].textContent;return se}if(this.clear().build(!0),typeof se=="function")se.call(this,this);else{Ue=0;for(var _e=(se=se.split(`
`)).length;Ue<_e;Ue++)this.tspan(se[Ue]).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 p.Number(se),this.rebuild())},lines:function(){var se=(this.textPath&&this.textPath()||this).node,Ce=p.utils.map(p.utils.filterSVGElements(se.childNodes),function(Ue){return p.adopt(Ue)});return new p.Set(Ce)},rebuild:function(se){if(typeof se=="boolean"&&(this._rebuild=se),this._rebuild){var Ce=this,Ue=0,Be=this.dom.leading*new p.Number(this.attr("font-size"));this.lines().each(function(){this.dom.newLined&&(Ce.textPath()||this.attr("x",Ce.attr("x")),this.text()==`
`?Ue+=Be:(this.attr("dy",Be+Ue),Ue=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 p.Number(se.leading||1.3),this}},construct:{text:function(se){return this.put(new p.Text).text(se)},plain:function(se){return this.put(new p.Text).plain(se)}}}),p.Tspan=p.invent({create:"tspan",inherit:p.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(p.Text);return this.dom.newLined=!0,this.dy(se.dom.leading*se.attr("font-size")).attr("x",se.x())}}}),p.extend(p.Text,p.Tspan,{plain:function(se){return this._build===!1&&this.clear(),this.node.appendChild(h.createTextNode(se)),this},tspan:function(se){var Ce=(this.textPath&&this.textPath()||this).node,Ue=new p.Tspan;return this._build===!1&&this.clear(),Ce.appendChild(Ue.node),Ue.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()}}),p.TextPath=p.invent({create:"textPath",inherit:p.Parent,parent:p.Text,construct:{morphArray:p.PathArray,array:function(){var se=this.track();return se?se.array():null},plot:function(se){var Ce=this.track(),Ue=null;return Ce&&(Ue=Ce.plot(se)),se==null?Ue: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 p.adopt(this.node.firstChild)}}}),p.Nested=p.invent({create:function(){this.constructor.call(this,p.create("svg")),this.style("overflow","visible")},inherit:p.Container,construct:{nested:function(){return this.put(new p.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 W(se,Ce,Ue,Be){return Ue+Be.replace(p.regex.dots," .")}function ee(se){return se.toLowerCase().replace(/-(.)/g,function(Ce,Ue){return Ue.toUpperCase()})}function ce(se){return se.charAt(0).toUpperCase()+se.slice(1)}function ue(se){var Ce=se.toString(16);return Ce.length==1?"0"+Ce:Ce}function ge(se,Ce,Ue){if(Ce==null||Ue==null){var Be=se.bbox();Ce==null?Ce=Be.width/Be.height*Ue:Ue==null&&(Ue=Be.height/Be.width*Ce)}return{width:Ce,height:Ue}}function Se(se,Ce,Ue){return{x:Ce*se.a+Ue*se.c+0,y:Ce*se.b+Ue*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 p.adopt(se).id(p.eid(se.nodeName))}function qe(se){return Math.abs(se)>1e-37?se:0}["fill","stroke"].forEach(function(se){var Ce={};Ce[se]=function(Ue){if(Ue===void 0)return this;if(typeof Ue=="string"||p.Color.isRgb(Ue)||Ue&&typeof Ue.fill=="function")this.attr(se,Ue);else for(var Be=B[se].length-1;Be>=0;Be--)Ue[B[se][Be]]!=null&&this.attr(B.prefix(se,B[se][Be]),Ue[B[se][Be]]);return this},p.extend(p.Element,p.FX,Ce)}),p.extend(p.Element,p.FX,{translate:function(se,Ce){return this.transform({x:se,y:Ce})},matrix:function(se){return this.attr("transform",new p.Matrix(arguments.length==6?[].slice.call(arguments):se))},opacity:function(se){return this.attr("opacity",se)},dx:function(se){return this.x(new p.Number(se).plus(this instanceof p.FX?0:this.x()),!0)},dy:function(se){return this.y(new p.Number(se).plus(this instanceof p.FX?0:this.y()),!0)}}),p.extend(p.Path,{length:function(){return this.node.getTotalLength()},pointAt:function(se){return this.node.getPointAtLength(se)}}),p.Set=p.invent({create:function(se){Array.isArray(se)?this.members=se:this.clear()},extend:{add:function(){for(var se=[].slice.call(arguments),Ce=0,Ue=se.length;Ce<Ue;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,Ue=this.members.length;Ce<Ue;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 p.Set(se)}}}),p.FX.Set=p.invent({create:function(se){this.set=se}}),p.Set.inherit=function(){var se=[];for(var Ce in p.Shape.prototype)typeof p.Shape.prototype[Ce]=="function"&&typeof p.Set.prototype[Ce]!="function"&&se.push(Ce);for(var Ce in se.forEach(function(Be){p.Set.prototype[Be]=function(){for(var _e=0,rt=this.members.length;_e<rt;_e++)this.members[_e]&&typeof this.members[_e][Be]=="function"&&this.members[_e][Be].apply(this.members[_e],arguments);return Be=="animate"?this.fx||(this.fx=new p.FX.Set(this)):this}}),se=[],p.FX.prototype)typeof p.FX.prototype[Ce]=="function"&&typeof p.FX.Set.prototype[Ce]!="function"&&se.push(Ce);se.forEach(function(Ue){p.FX.Set.prototype[Ue]=function(){for(var Be=0,_e=this.set.members.length;Be<_e;Be++)this.set.members[Be].fx[Ue].apply(this.set.members[Be].fx,arguments);return this}})},p.extend(p.Element,{}),p.extend(p.Element,{remember:function(se,Ce){if(I(arguments[0])==="object")for(var Ue in se)this.remember(Ue,se[Ue]);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={})}}),p.get=function(se){var Ce=h.getElementById(function(Ue){var Be=(Ue||"").toString().match(p.regex.reference);if(Be)return Be[1]}(se)||se);return p.adopt(Ce)},p.select=function(se,Ce){return new p.Set(p.utils.map((Ce||h).querySelectorAll(se),function(Ue){return p.adopt(Ue)}))},p.extend(p.Parent,{select:function(se){return p.select(se,this.node)}});var Fe="abcdef".split("");if(typeof Ee.CustomEvent!="function"){var at=function(se,Ce){Ce=Ce||{bubbles:!1,cancelable:!1,detail:void 0};var Ue=h.createEvent("CustomEvent");return Ue.initCustomEvent(se,Ce.bubbles,Ce.cancelable,Ce.detail),Ue};at.prototype=Ee.Event.prototype,p.CustomEvent=at}else p.CustomEvent=Ee.CustomEvent;return p},I(t)==="object"?e.exports=gn.document?Dt(gn,gn.document):function(Ee){return Dt(Ee,Ee.document)}:gn.SVG=Dt(gn,gn.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,W){return this.put(new SVG.BlendEffect(T,B,W))},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,W){return this.put(new SVG.CompositeEffect(T,B,W))},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,W){return this.put(new SVG.DiffuseLightingEffect(T,B,W))},displacementMap:function(T,B,W,ee,ce){return this.put(new SVG.DisplacementMapEffect(T,B,W,ee,ce))},specularLighting:function(T,B,W,ee){return this.put(new SVG.SpecularLightingEffect(T,B,W,ee))},tile:function(){return this.put(new SVG.TileEffect)},turbulence:function(T,B,W,ee,ce){return this.put(new SVG.TurbulenceEffect(T,B,W,ee,ce))},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,W){return this.parent()&&this.parent().diffuseLighting(T,B,W).in(this)},displacementMap:function(T,B,W,ee){return this.parent()&&this.parent().displacementMap(this,T,B,W,ee)},specularLighting:function(T,B,W,ee){return this.parent()&&this.parent().specularLighting(T,B,W,ee).in(this)},tile:function(){return this.parent()&&this.parent().tile().in(this)},turbulence:function(T,B,W,ee,ce){return this.parent()&&this.parent().turbulence(T,B,W,ee,ce).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 h={blend:function(T,B,W){this.attr({in:T,in2:B,mode:W||"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,W){this.attr({in:T,in2:B,operator:W})},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,W,ee,ce){this.attr({in:T,in2:B,scale:W,xChannelSelector:ee,yChannelSelector:ce})},gaussianBlur:function(T,B){T!=null||B!=null?this.attr("stdDeviation",function(W){if(!Array.isArray(W))return W;for(var ee=0,ce=W.length,ue=[];ee<ce;ee++)ue.push(W[ee]);return ue.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,W,ee,ce){this.attr({numOctaves:B,seed:W,stitchTiles:ee,baseFrequency:T,type:ce})}},p={merge:function(){var T;if(arguments[0]instanceof SVG.Set){var B=this;arguments[0].each(function(ee){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 W=0;W<T.length;W++)T[W]instanceof SVG.MergeNode?this.put(T[W]):this.put(new SVG.MergeNode(T[W]))}},componentTransfer:function(T){if(this.rgb=new SVG.Set,["r","g","b","a"].forEach((function(W){this[W]=new SVG["Func"+W.toUpperCase()]("identity"),this.rgb.add(this[W]),this.node.appendChild(this[W].node)}).bind(this)),T)for(var B in T.rgb&&(["r","g","b"].forEach((function(W){this[W].attr(T.rgb)}).bind(this)),delete T.rgb),T)this[B].attr(T[B])},diffuseLighting:function(T,B,W){this.attr({surfaceScale:T,diffuseConstant:B,kernelUnitLength:W})},specularLighting:function(T,B,W,ee){this.attr({surfaceScale:T,diffuseConstant:B,specularExponent:W,kernelUnitLength:ee})}},S={distantLight:function(T,B){this.attr({azimuth:T,elevation:B})},pointLight:function(T,B,W){this.attr({x:T,y:B,z:W})},spotLight:function(T,B,W,ee,ce,ue){this.attr({x:T,y:B,z:W,pointsAtX:ee,pointsAtY:ce,pointsAtZ:ue})},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 W in arguments[B])T(arguments[B][W],W,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(h,function(T,B){var W=B.charAt(0).toUpperCase()+B.slice(1);SVG[W+"Effect"]=SVG.invent({create:function(){this.constructor.call(this,SVG.create("fe"+W)),T.apply(this,arguments),this.result(this.attr("id")+"Out")},inherit:SVG.Effect,extend:{}})}),k(p,function(T,B){var W=B.charAt(0).toUpperCase()+B.slice(1);SVG[W+"Effect"]=SVG.invent({create:function(){this.constructor.call(this,SVG.create("fe"+W)),T.apply(this,arguments),this.result(this.attr("id")+"Out")},inherit:SVG.ParentEffect,extend:{}})}),k(S,function(T,B){var W=B.charAt(0).toUpperCase()+B.slice(1);SVG[W]=SVG.invent({create:function(){this.constructor.call(this,SVG.create("fe"+W)),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,W,ee,ce,ue){for(var ge=k.slice(T,B||ue),Se=W.slice(ee,ce||ue),ke=0,Me={pos:[0,0],start:[0,0]},qe={pos:[0,0],start:[0,0]};ge[ke]=h.call(Me,ge[ke]),Se[ke]=h.call(qe,Se[ke]),ge[ke][0]!=Se[ke][0]||ge[ke][0]=="M"||ge[ke][0]=="A"&&(ge[ke][4]!=Se[ke][4]||ge[ke][5]!=Se[ke][5])?(Array.prototype.splice.apply(ge,[ke,1].concat(S.call(Me,ge[ke]))),Array.prototype.splice.apply(Se,[ke,1].concat(S.call(qe,Se[ke])))):(ge[ke]=p.call(Me,ge[ke]),Se[ke]=p.call(qe,Se[ke])),!(++ke==ge.length&&ke==Se.length);)ke==ge.length&&ge.push(["C",Me.pos[0],Me.pos[1],Me.pos[0],Me.pos[1],Me.pos[0],Me.pos[1]]),ke==Se.length&&Se.push(["C",qe.pos[0],qe.pos[1],qe.pos[0],qe.pos[1],qe.pos[0],qe.pos[1]]);return{start:ge,dest:Se}}function h(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 p(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,W){var ee,ce,ue,ge,Se,ke,Me,qe,Fe,at,se,Ce,Ue,Be,_e,rt,ct,yt,Lt,ft,Tt,Ge,At,Ot,it,jt,Nn=Math.abs(W[1]),mn=Math.abs(W[2]),ir=W[3]%360,Sn=W[4],Bn=W[5],rr=W[6],ur=W[7],_r=new SVG.Point(B),Un=new SVG.Point(rr,ur),Ln=[];if(Nn===0||mn===0||_r.x===Un.x&&_r.y===Un.y)return[["C",_r.x,_r.y,Un.x,Un.y,Un.x,Un.y]];for(ee=new SVG.Point((_r.x-Un.x)/2,(_r.y-Un.y)/2).transform(new SVG.Matrix().rotate(ir)),(ce=ee.x*ee.x/(Nn*Nn)+ee.y*ee.y/(mn*mn))>1&&(Nn*=ce=Math.sqrt(ce),mn*=ce),ue=new SVG.Matrix().rotate(ir).scale(1/Nn,1/mn).rotate(-ir),_r=_r.transform(ue),Un=Un.transform(ue),ge=[Un.x-_r.x,Un.y-_r.y],ke=ge[0]*ge[0]+ge[1]*ge[1],Se=Math.sqrt(ke),ge[0]/=Se,ge[1]/=Se,Me=ke<4?Math.sqrt(1-ke/4):0,Sn===Bn&&(Me*=-1),qe=new SVG.Point((Un.x+_r.x)/2+Me*-ge[1],(Un.y+_r.y)/2+Me*ge[0]),Fe=new SVG.Point(_r.x-qe.x,_r.y-qe.y),at=new SVG.Point(Un.x-qe.x,Un.y-qe.y),se=Math.acos(Fe.x/Math.sqrt(Fe.x*Fe.x+Fe.y*Fe.y)),Fe.y<0&&(se*=-1),Ce=Math.acos(at.x/Math.sqrt(at.x*at.x+at.y*at.y)),at.y<0&&(Ce*=-1),Bn&&se>Ce&&(Ce+=2*Math.PI),!Bn&&se<Ce&&(Ce-=2*Math.PI),Be=Math.ceil(2*Math.abs(se-Ce)/Math.PI),rt=[],ct=se,Ue=(Ce-se)/Be,_e=4*Math.tan(Ue/4)/3,Tt=0;Tt<=Be;Tt++)Lt=Math.cos(ct),yt=Math.sin(ct),ft=new SVG.Point(qe.x+Lt,qe.y+yt),rt[Tt]=[new SVG.Point(ft.x+_e*yt,ft.y-_e*Lt),ft,new SVG.Point(ft.x-_e*yt,ft.y+_e*Lt)],ct+=Ue;for(rt[0][0]=rt[0][1].clone(),rt[rt.length-1][2]=rt[rt.length-1][1].clone(),ue=new SVG.Matrix().rotate(ir).scale(Nn,mn).rotate(-ir),Tt=0,Ge=rt.length;Tt<Ge;Tt++)rt[Tt][0]=rt[Tt][0].transform(ue),rt[Tt][1]=rt[Tt][1].transform(ue),rt[Tt][2]=rt[Tt][2].transform(ue);for(Tt=1,Ge=rt.length;Tt<Ge;Tt++)At=(ft=rt[Tt-1][2]).x,Ot=ft.y,it=(ft=rt[Tt][0]).x,jt=ft.y,rr=(ft=rt[Tt][1]).x,ur=ft.y,Ln.push(["C",At,Ot,it,jt,rr,ur]);return Ln}(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,W=k.length;B<W;++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),W=0,ee=0,ce=!1,ue=!1;W!==!1||ee!==!1;){var ge;ce=_(T,W!==!1&&W+1),ue=_(B,ee!==!1&&ee+1),W===!1&&(W=(ge=new SVG.PathArray(Se.start).bbox()).height==0||ge.width==0?T.push(T[0])-1:T.push(["M",ge.x+ge.width/2,ge.y+ge.height/2])-1),ee===!1&&(ee=(ge=new SVG.PathArray(Se.dest).bbox()).height==0||ge.width==0?B.push(B[0])-1:B.push(["M",ge.x+ge.width/2,ge.y+ge.height/2])-1);var Se=Ee(T,W,ce,B,ee,ue);T=T.slice(0,W).concat(Se.start,ce===!1?[]:T.slice(ce)),B=B.slice(0,ee).concat(Se.dest,ue===!1?[]:B.slice(ue)),W=ce!==!1&&W+Se.start.length,ee=ue!==!1&&ee+Se.dest.length}return this.value=T,this.destination=new SVG.PathArray,this.destination.value=B,this}})}(),(function(){function Ee(h){h.remember("_draggable",this),this.el=h}Ee.prototype.init=function(h,p){var S=this;this.constraint=h,this.value=p,this.el.on("mousedown.drag",function(_){S.start(_)}),this.el.on("touchstart.drag",function(_){S.start(_)})},Ee.prototype.transformPoint=function(h,p){var S=(h=h||window.event).changedTouches&&h.changedTouches[0]||h;return this.p.x=S.clientX-(p||0),this.p.y=S.clientY,this.p.matrixTransform(this.m)},Ee.prototype.getBBox=function(){var h=this.el.bbox();return this.el instanceof SVG.Nested&&(h=this.el.rbox()),(this.el instanceof SVG.G||this.el instanceof SVG.Use||this.el instanceof SVG.Nested)&&(h.x=this.el.x(),h.y=this.el.y()),h},Ee.prototype.start=function(h){if(h.type!="click"&&h.type!="mousedown"&&h.type!="mousemove"||(h.which||h.buttons)==1){var p=this;if(this.el.fire("beforedrag",{event:h,handler:this}),!this.el.event().defaultPrevented){h.preventDefault(),h.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(h,S),box:_,transform:this.el.transform()},SVG.on(window,"mousemove.drag",function(k){p.drag(k)}),SVG.on(window,"touchmove.drag",function(k){p.drag(k)}),SVG.on(window,"mouseup.drag",function(k){p.end(k)}),SVG.on(window,"touchend.drag",function(k){p.end(k)}),this.el.fire("dragstart",{event:h,p:this.startPoints.point,m:this.m,handler:this})}}},Ee.prototype.drag=function(h){var p=this.getBBox(),S=this.transformPoint(h),_=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,W=S.y-this.startPoints.point.y;if(this.el.fire("dragmove",{event:h,p:S,m:this.m,handler:this}),this.el.event().defaultPrevented)return S;if(typeof T=="function"){var ee=T.call(this.el,_,k,this.m);typeof ee=="boolean"&&(ee={x:ee,y:ee}),ee.x===!0?this.el.x(_):ee.x!==!1&&this.el.x(ee.x),ee.y===!0?this.el.y(k):ee.y!==!1&&this.el.y(ee.y)}else typeof T=="object"&&(T.minX!=null&&_<T.minX?B=(_=T.minX)-this.startPoints.box.x:T.maxX!=null&&_>T.maxX-p.width&&(B=(_=T.maxX-p.width)-this.startPoints.box.x),T.minY!=null&&k<T.minY?W=(k=T.minY)-this.startPoints.box.y:T.maxY!=null&&k>T.maxY-p.height&&(W=(k=T.maxY-p.height)-this.startPoints.box.y),T.snapToGrid!=null&&(_-=_%T.snapToGrid,k-=k%T.snapToGrid,B-=B%T.snapToGrid,W-=W%T.snapToGrid),this.el instanceof SVG.G?this.el.matrix(this.startPoints.transform).transform({x:B,y:W},!0):this.el.move(_,k));return S},Ee.prototype.end=function(h){var p=this.drag(h);this.el.fire("dragend",{event:h,p,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(h,p){typeof h!="function"&&typeof h!="object"||(p=h,h=!0);var S=this.remember("_draggable")||new Ee(this);return(h=h===void 0||h)?S.init(p||{},h):(this.off("mousedown.drag"),this.off("touchstart.drag")),this}})}).call(void 0),function(){function Ee(h){this.el=h,h.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(p,S,_){var k=typeof p!="string"?p:S[p];return _?k/2:k},this.pointCoords=function(p,S){var _=this.pointsList[p];return{x:this.pointCoord(_[0],S,p==="t"||p==="b"),y:this.pointCoord(_[1],S,p==="r"||p==="l")}}}Ee.prototype.init=function(h,p){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],p[k]!==void 0&&(this.options[k]=p[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(W,ee){return W.filter(function(ce){return ee.indexOf(ce)>-1})}),this.options.points=[this.options.points,this.options.pointsExclude].reduce(function(W,ee){return W.filter(function(ce){return ee.indexOf(ce)<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(h):this.selectRect(h),this.observe(),this.cleanup()},Ee.prototype.selectPoints=function(h){return this.pointSelection.isSelected=h,this.pointSelection.set||(this.pointSelection.set=this.parent.set(),this.drawPoints()),this},Ee.prototype.getPointArray=function(){var h=this.el.bbox();return this.el.array().valueOf().map(function(p){return[p[0]-h.x,p[1]-h.y]})},Ee.prototype.drawPoints=function(){for(var h=this,p=this.getPointArray(),S=0,_=p.length;S<_;++S){var k=function(B){return function(W){(W=W||window.event).preventDefault?W.preventDefault():W.returnValue=!1,W.stopPropagation();var ee=W.pageX||W.touches[0].pageX,ce=W.pageY||W.touches[0].pageY;h.el.fire("point",{x:ee,y:ce,i:B,event:W})}}(S),T=this.drawPoint(p[S][0],p[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(h,p){var S=this.options.pointType;switch(S){case"circle":return this.drawCircle(h,p);case"rect":return this.drawRect(h,p);default:if(typeof S=="function")return S.call(this,h,p);throw new Error("Unknown "+S+" point type!")}},Ee.prototype.drawCircle=function(h,p){return this.nested.circle(this.options.pointSize).center(h,p)},Ee.prototype.drawRect=function(h,p){return this.nested.rect(this.options.pointSize,this.options.pointSize).center(h,p)},Ee.prototype.updatePointSelection=function(){var h=this.getPointArray();this.pointSelection.set.each(function(p){this.cx()===h[p][0]&&this.cy()===h[p][1]||this.center(h[p][0],h[p][1])})},Ee.prototype.updateRectSelection=function(){var h=this,p=this.el.bbox();if(this.rectSelection.set.get(0).attr({width:p.width,height:p.height}),this.options.points.length&&this.options.points.map(function(_,k){var T=h.pointCoords(_,p);h.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(p.width/2,20)}},Ee.prototype.selectRect=function(h){var p=this,S=this.el.bbox();function _(B){return function(W){(W=W||window.event).preventDefault?W.preventDefault():W.returnValue=!1,W.stopPropagation();var ee=W.pageX||W.touches[0].pageX,ce=W.pageY||W.touches[0].pageY;p.el.fire(B,{x:ee,y:ce,event:W})}}if(this.rectSelection.isSelected=h,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,W){var ee=p.pointCoords(B,S),ce=p.drawPoint(ee.x,ee.y).attr("class",p.options.classPoints+"_"+B).on("mousedown",_(B)).on("touchstart",_(B));p.rectSelection.set.add(ce)}),this.rectSelection.set.each(function(){this.addClass(p.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 W=B.pageX||B.touches[0].pageX,ee=B.pageY||B.touches[0].pageY;p.el.fire("rot",{x:W,y:ee,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 h=this.el.bbox();this.nested.matrix(new SVG.Matrix(this.el).translate(h.x,h.y)),this.rectSelection.isSelected&&this.updateRectSelection(),this.pointSelection.isSelected&&this.updatePointSelection()},Ee.prototype.observe=function(){var h=this;if(MutationObserver)if(this.rectSelection.isSelected||this.pointSelection.isSelected)this.observerInst=this.observerInst||new MutationObserver(function(){h.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(){h.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(h,p){return typeof h=="object"&&(p=h,h=!0),(this.remember("_selectHandler")||new Ee(this)).init(h===void 0||h,p||{}),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(h){h.remember("_resizeHandler",this),this.el=h,this.parameters={},this.lastUpdateCall=null,this.p=h.doc().node.createSVGPoint()}Ee.prototype.transformPoint=function(h,p,S){return this.p.x=h-(this.offset.x-window.pageXOffset),this.p.y=p-(this.offset.y-window.pageYOffset),this.p.matrixTransform(S||this.m)},Ee.prototype._extractPosition=function(h){return{x:h.clientX!=null?h.clientX:h.touches[0].clientX,y:h.clientY!=null?h.clientY:h.touches[0].clientY}},Ee.prototype.init=function(h){var p=this;if(this.stop(),h!=="stop"){for(var S in this.options={},this.el.resize.defaults)this.options[S]=this.el.resize.defaults[S],h[S]!==void 0&&(this.options[S]=h[S]);this.el.on("lt.resize",function(_){p.resize(_||window.event)}),this.el.on("rt.resize",function(_){p.resize(_||window.event)}),this.el.on("rb.resize",function(_){p.resize(_||window.event)}),this.el.on("lb.resize",function(_){p.resize(_||window.event)}),this.el.on("t.resize",function(_){p.resize(_||window.event)}),this.el.on("r.resize",function(_){p.resize(_||window.event)}),this.el.on("b.resize",function(_){p.resize(_||window.event)}),this.el.on("l.resize",function(_){p.resize(_||window.event)}),this.el.on("rot.resize",function(_){p.resize(_||window.event)}),this.el.on("point.resize",function(_){p.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(h){var p=this;this.m=this.el.node.getScreenCTM().inverse(),this.offset={x:window.pageXOffset,y:window.pageYOffset};var S=this._extractPosition(h.detail.event);if(this.parameters={type:this.el.type,p:this.transformPoint(S.x,S.y),x:h.detail.x,y:h.detail.y,box:this.el.bbox(),rotation:this.el.transform().rotation},this.el.type==="text"&&(this.parameters.fontSize=this.el.attr()["font-size"]),h.detail.i!==void 0){var _=this.el.array().valueOf();this.parameters.i=h.detail.i,this.parameters.pointCoords=[_[h.detail.i][0],_[h.detail.i][1]]}switch(h.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,W=T+this.parameters.p.y,ee=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),ce=Math.atan2(W-this.parameters.box.y-this.parameters.box.height/2,B-this.parameters.box.x-this.parameters.box.width/2),ue=this.parameters.rotation+180*(ce-ee)/Math.PI+this.options.snapToAngle/2;this.el.center(this.parameters.box.cx,this.parameters.box.cy).rotate(ue-ue%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]),W=this.el.array().valueOf();W[this.parameters.i][0]=this.parameters.pointCoords[0]+B[0],W[this.parameters.i][1]=this.parameters.pointCoords[1]+B[1],this.el.plot(W)}}this.el.fire("resizestart",{dx:this.parameters.x,dy:this.parameters.y,event:h}),SVG.on(window,"touchmove.resize",function(k){p.update(k||window.event)}),SVG.on(window,"touchend.resize",function(){p.done()}),SVG.on(window,"mousemove.resize",function(k){p.update(k||window.event)}),SVG.on(window,"mouseup.resize",function(){p.done()})},Ee.prototype.update=function(h){if(h){var p=this._extractPosition(h),S=this.transformPoint(p.x,p.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:h})}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(h,p,S,_){var k;return _!==void 0?k=[(S+h)%this.options.snapToGrid,(_+p)%this.options.snapToGrid]:(S=S??3,k=[(this.parameters.box.x+h+(1&S?0:this.parameters.box.width))%this.options.snapToGrid,(this.parameters.box.y+p+(2&S?0:this.parameters.box.height))%this.options.snapToGrid]),h<0&&(k[0]-=this.options.snapToGrid),p<0&&(k[1]-=this.options.snapToGrid),h-=Math.abs(k[0])<this.options.snapToGrid/2?k[0]:k[0]-(h<0?-this.options.snapToGrid:this.options.snapToGrid),p-=Math.abs(k[1])<this.options.snapToGrid/2?k[1]:k[1]-(p<0?-this.options.snapToGrid:this.options.snapToGrid),this.constraintToBox(h,p,S,_)},Ee.prototype.constraintToBox=function(h,p,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+h<B.minX&&(h=B.minX-k),B.maxX!==void 0&&k+h>B.maxX&&(h=B.maxX-k),B.minY!==void 0&&T+p<B.minY&&(p=B.minY-T),B.maxY!==void 0&&T+p>B.maxY&&(p=B.maxY-T),[h,p]},Ee.prototype.checkAspectRatio=function(h,p){if(!this.options.saveAspectRatio)return h;var S=h.slice(),_=this.parameters.box.width/this.parameters.box.height,k=this.parameters.box.width+h[0],T=this.parameters.box.height-h[1],B=k/T;return B<_?(S[1]=k/_-this.parameters.box.height,p&&(S[1]=-S[1])):B>_&&(S[0]=this.parameters.box.width-T*_,p&&(S[0]=-S[0])),S},SVG.extend(SVG.Element,{resize:function(h){return(this.remember("_resizeHandler")||new Ee(this)).init(h||{}),this}}),SVG.Element.prototype.resize.defaults={snapToAngle:.1,snapToGrid:1,constraint:{},saveAspectRatio:!1}}).call(this)}(),window.Apex===void 0&&(window.Apex={});var $n=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.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 Kt(this.ctx),this.ctx.core=new hr(this.ctx.el,this.ctx),this.ctx.config=new Ne({}),this.ctx.data=new Xe(this.ctx),this.ctx.grid=new et(this.ctx),this.ctx.graphics=new z(this.ctx),this.ctx.coreUtils=new X(this.ctx),this.ctx.crosshairs=new wt(this.ctx),this.ctx.events=new ht(this.ctx),this.ctx.exports=new Ke(this.ctx),this.ctx.fill=new xe(this.ctx),this.ctx.localization=new pt(this.ctx),this.ctx.options=new G,this.ctx.responsive=new nn(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 zn(this.ctx),this.ctx.legend=new dn(this.ctx),this.ctx.toolbar=new Yt(this.ctx),this.ctx.tooltip=new $t(this.ctx),this.ctx.dimensions=new Ze(this.ctx),this.ctx.updateHelpers=new Gt(this.ctx),this.ctx.zoomPanSelection=new Bt(this.ctx),this.ctx.w.globals.tooltip=new $t(this.ctx)}}]),Ee}(),nr=function(){function Ee(h){s(this,Ee),this.ctx=h,this.w=h.w}return o(Ee,[{key:"clear",value:function(h){var p=h.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:p})}},{key:"killSVG",value:function(h){h.each(function(){this.removeClass("*"),this.off(),this.stop()},!0),h.ungroup(),h.clear()}},{key:"clearDomElements",value:function(h){var p=this,S=h.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,p.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}(),Rt=new WeakMap,En=function(){function Ee(h,p){s(this,Ee),this.opts=p,this.ctx=this,this.w=new we(p).init(),this.el=h,this.w.globals.cuid=O.randomId(),this.w.globals.chartID=this.w.config.chart.id?O.escapeString(this.w.config.chart.id):this.w.globals.cuid,new $n(this).initModules(),this.create=O.bind(this.create,this),this.windowResizeHandler=this._windowResizeHandler.bind(this),this.parentResizeHandler=this._parentResizeCallback.bind(this)}return o(Ee,[{key:"render",value:function(){var h=this;return new Promise(function(p,S){if(h.el!==null){Apex._chartInstances===void 0&&(Apex._chartInstances=[]),h.w.config.chart.id&&Apex._chartInstances.push({id:h.w.globals.chartID,group:h.w.config.chart.group,chart:h}),h.setLocale(h.w.config.chart.defaultLocale);var _=h.w.config.chart.events.beforeMount;typeof _=="function"&&_(h,h.w),h.events.fireEvent("beforeMount",[h,h.w]),window.addEventListener("resize",h.windowResizeHandler),function(ge,Se){var ke=!1;if(ge.nodeType!==Node.DOCUMENT_FRAGMENT_NODE){var Me=ge.getBoundingClientRect();ge.style.display!=="none"&&Me.width!==0||(ke=!0)}var qe=new ResizeObserver(function(Fe){ke&&Se.call(ge,Fe),ke=!0});ge.nodeType===Node.DOCUMENT_FRAGMENT_NODE?Array.from(ge.children).forEach(function(Fe){return qe.observe(Fe)}):qe.observe(ge),Rt.set(Se,qe)}(h.el.parentNode,h.parentResizeHandler);var k=h.el.getRootNode&&h.el.getRootNode(),T=O.is("ShadowRoot",k),B=h.el.ownerDocument,W=T?k.getElementById("apexcharts-css"):B.getElementById("apexcharts-css");if(!W){var ee;(W=document.createElement("style")).id="apexcharts-css",W.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 ce=((ee=h.opts.chart)===null||ee===void 0?void 0:ee.nonce)||h.w.config.chart.nonce;ce&&W.setAttribute("nonce",ce),T?k.prepend(W):B.head.appendChild(W)}var ue=h.create(h.w.config.series,{});if(!ue)return p(h);h.mount(ue).then(function(){typeof h.w.config.chart.events.mounted=="function"&&h.w.config.chart.events.mounted(h,h.w),h.events.fireEvent("mounted",[h,h.w]),p(ue)}).catch(function(ge){S(ge)})}else S(new Error("Element not found"))})}},{key:"create",value:function(h,p){var S=this,_=this.w;new $n(this).initModules();var k=this.w.globals;if(k.noData=!1,k.animationEnded=!1,this.responsive.checkResponsiveConfig(p),_.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=h;h.forEach(function(ge,Se){ge.hidden&&(T=S.legend.legendHelpers.getSeriesAfterCollapsing({realIndex:Se}))});var B=X.checkComboSeries(T,_.config.chart.type);k.comboCharts=B.comboCharts,k.comboBarCount=B.comboBarCount;var W=T.every(function(ge){return ge.data&&ge.data.length===0});(T.length===0||W&&k.collapsedSeries.length<1)&&this.series.handleNoData(),this.events.setupEventHandlers(),this.data.parseData(T),this.theme.init(),new ye(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 ee=this.core.xySettings();this.grid.createGridMask();var ce=this.core.plotChartType(T,ee),ue=new Pe(this);return ue.bringForward(),_.config.dataLabels.background.enabled&&ue.dataLabelsBackground(),this.core.shiftGraphPosition(),{elGraph:ce,xyRatios:ee,dimensions:{plot:{left:_.globals.translateX,top:_.globals.translateY,width:_.globals.gridWidth,height:_.globals.gridHeight}}}}},{key:"mount",value:function(){var h=this,p=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"));(p===null||_.globals.allSeriesCollapsed)&&S.series.handleNoData(),S.grid=new et(S);var B,W,ee=S.grid.drawGrid();if(S.annotations=new V(S),S.annotations.drawImageAnnos(),S.annotations.drawTextAnnos(),_.config.grid.position==="back"&&(ee&&_.globals.dom.elGraphical.add(ee.el),ee!=null&&(B=ee.elGridBorders)!==null&&B!==void 0&&B.node&&_.globals.dom.elGraphical.add(ee.elGridBorders)),Array.isArray(p.elGraph))for(var ce=0;ce<p.elGraph.length;ce++)_.globals.dom.elGraphical.add(p.elGraph[ce]);else _.globals.dom.elGraphical.add(p.elGraph);_.config.grid.position==="front"&&(ee&&_.globals.dom.elGraphical.add(ee.el),ee!=null&&(W=ee.elGridBorders)!==null&&W!==void 0&&W.node&&_.globals.dom.elGraphical.add(ee.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,ee);var ue=new ut(h.ctx,ee),ge=new $e(h.ctx,ee);if(ee!==null&&(ue.xAxisLabelCorrections(ee.xAxisTickWidth),ge.setYAxisTextAlignments(),_.config.yaxis.map(function(ke,Me){_.globals.ignoreYAxisIndexes.indexOf(Me)===-1&&ge.yAxisTitleRotate(Me,ke.opposite)})),S.annotations.drawAxesAnnotations(),!_.globals.noData){if(_.config.tooltip.enabled&&!_.globals.noData&&S.w.globals.tooltip.drawTooltip(p.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:p.xyRatios});else{var Se=_.config.chart.toolbar.tools;["zoom","zoomin","zoomout","selection","pan","reset"].forEach(function(ke){Se[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 h,p;window.removeEventListener("resize",this.windowResizeHandler),this.el.parentNode,h=this.parentResizeHandler,(p=Rt.get(h))&&(p.disconnect(),Rt.delete(h));var S=this.w.config.chart.id;S&&Apex._chartInstances.forEach(function(_,k){_.id===O.escapeString(S)&&Apex._chartInstances.splice(k,1)}),new nr(this.ctx).clear({isUpdating:!1})}},{key:"updateOptions",value:function(h){var p=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,h.series&&(this.series.resetSeries(!1,!0,!1),h.series.length&&h.series[0].data&&(h.series=h.series.map(function(W,ee){return p.updateHelpers._extendSeries(W,ee)})),this.updateHelpers.revertDefaultAxisMinMax()),h.xaxis&&(h=this.updateHelpers.forceXAxisUpdate(h)),h.yaxis&&(h=this.updateHelpers.forceYAxisUpdate(h)),B.globals.collapsedSeriesIndices.length>0&&this.series.clearPreviousPaths(),h.theme&&(h=this.theme.updateThemeOptions(h)),this.updateHelpers._updateOptions(h,S,_,k,T)}},{key:"updateSeries",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],p=!(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(h,p,S)}},{key:"appendSeries",value:function(h){var p=!(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(h),this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(_,p,S)}},{key:"appendData",value:function(h){var p=!(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(h[k]!==null&&h[k]!==void 0)for(var T=0;T<h[k].data.length;T++)_[k].data.push(h[k].data[T]);return S.w.config.series=_,p&&(S.w.globals.initialSeries=O.clone(S.w.config.series)),this.update()}},{key:"update",value:function(h){var p=this;return new Promise(function(S,_){new nr(p.ctx).clear({isUpdating:!0});var k=p.create(p.w.config.series,h);if(!k)return S(p);p.mount(k).then(function(){typeof p.w.config.chart.events.updated=="function"&&p.w.config.chart.events.updated(p,p.w),p.events.fireEvent("updated",[p,p.w]),p.w.globals.isDirty=!0,S(p)}).catch(function(T){_(T)})})}},{key:"getSyncedCharts",value:function(){var h=this.getGroupedCharts(),p=[this];return h.length&&(p=[],h.forEach(function(S){p.push(S)})),p}},{key:"getGroupedCharts",value:function(){var h=this;return Apex._chartInstances.filter(function(p){if(p.group)return!0}).map(function(p){return h.w.config.chart.group===p.group?p.chart:h})}},{key:"toggleSeries",value:function(h){return this.series.toggleSeries(h)}},{key:"highlightSeriesOnLegendHover",value:function(h,p){return this.series.toggleSeriesOnHover(h,p)}},{key:"showSeries",value:function(h){this.series.showSeries(h)}},{key:"hideSeries",value:function(h){this.series.hideSeries(h)}},{key:"highlightSeries",value:function(h){this.series.highlightSeries(h)}},{key:"isSeriesHidden",value:function(h){this.series.isSeriesHidden(h)}},{key:"resetSeries",value:function(){var h=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],p=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.series.resetSeries(h,p)}},{key:"addEventListener",value:function(h,p){this.events.addEventListener(h,p)}},{key:"removeEventListener",value:function(h,p){this.events.removeEventListener(h,p)}},{key:"addXaxisAnnotation",value:function(h){var p=!(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(h,p,_)}},{key:"addYaxisAnnotation",value:function(h){var p=!(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(h,p,_)}},{key:"addPointAnnotation",value:function(h){var p=!(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(h,p,_)}},{key:"clearAnnotations",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,p=this;h&&(p=h),p.annotations.clearAnnotations(p)}},{key:"removeAnnotation",value:function(h){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,S=this;p&&(S=p),S.annotations.removeAnnotation(S,h)}},{key:"getChartArea",value:function(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-inner")}},{key:"getSeriesTotalXRange",value:function(h,p){return this.coreUtils.getSeriesTotalsXRange(h,p)}},{key:"getHighestValueInSeries",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return new Le(this.ctx).getMinYMaxY(h).highestY}},{key:"getLowestValueInSeries",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return new Le(this.ctx).getMinYMaxY(h).lowestY}},{key:"getSeriesTotal",value:function(){return this.w.globals.seriesTotals}},{key:"toggleDataPointSelection",value:function(h,p){return this.updateHelpers.toggleDataPointSelection(h,p)}},{key:"zoomX",value:function(h,p){this.ctx.toolbar.zoomUpdateOptions(h,p)}},{key:"setLocale",value:function(h){this.localization.setCurrentLocaleValues(h)}},{key:"dataURI",value:function(h){return new Ke(this.ctx).dataURI(h)}},{key:"exportToCSV",value:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new Ke(this.ctx).exportToCSV(h)}},{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 h=this;clearTimeout(this.w.globals.resizeTimer),this.w.globals.resizeTimer=window.setTimeout(function(){h.w.globals.resized=!0,h.w.globals.dataChanged=!1,h.ctx.update()},150)}},{key:"_windowResizeHandler",value:function(){var h=this.w.config.chart.redrawOnWindowResize;typeof h=="function"&&(h=h()),h&&this._windowResize()}}],[{key:"getChartByID",value:function(h){var p=O.escapeString(h);if(Apex._chartInstances){var S=Apex._chartInstances.filter(function(_){return _.id===p})[0];return S&&S.chart}}},{key:"initOnLoad",value:function(){for(var h=document.querySelectorAll("[data-apexcharts]"),p=0;p<h.length;p++)new Ee(h[p],JSON.parse(h[p].getAttribute("data-options"))).render()}},{key:"exec",value:function(h,p){var S=this.getChartByID(h);if(S){S.w.globals.isExecCalled=!0;var _=null;if(S.publicMethods.indexOf(p)!==-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[p].apply(S,T)}return _}}},{key:"merge",value:function(h,p){return O.extend(h,p)}}]),Ee}();e.exports=En}(BP,BP.exports)),BP.exports}var uCe;function Xsn(){if(uCe)return DP;uCe=1,Object.defineProperty(DP,"__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 P,I=arguments[N];for(P in I)Object.prototype.hasOwnProperty.call(I,P)&&(C[P]=I[P])}return C},n=function(){function C(N,P){for(var I=0;I<P.length;I++){var R=P[I];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(N,R.key,R)}}return function(N,P,I){return P&&C(N.prototype,P),I&&C(N,I),N}}(),r=Ysn(),s=u(r),a=ox(),o=u(a),l=_$(),c=u(l);function u(C){return C&&C.__esModule?C:{default:C}}function d(C,N,P){return N in C?Object.defineProperty(C,N,{value:P,enumerable:!0,configurable:!0,writable:!0}):C[N]=P,C}function f(C,N){var P,I={};for(P in C)0<=N.indexOf(P)||Object.prototype.hasOwnProperty.call(C,P)&&(I[P]=C[P]);return I}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 P=g(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,N));return o.default.createRef?P.chartRef=o.default.createRef():P.setRef=function(I){return P.chartRef=I},P.chart=null,P}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 O=this.props,N=O.type,P=O.height,I=O.width,R=O.series,O=O.options;return this.extend(O,{chart:{type:N,height:P,width:I},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,P){var I=this,R=(typeof Object.assign!="function"&&(Object.assign=function(O){if(O==null)throw new TypeError("Cannot convert undefined or null to object");for(var U=Object(O),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(P)&&Object.keys(P).forEach(function(O){I.isObject(P[O])&&O in N?R[O]=I.extend(N[O],P[O]):Object.assign(R,d({},O,P[O]))}),R}},{key:"componentDidUpdate",value:function(N){if(!this.chart)return null;var R=this.props,L=R.options,P=R.series,I=R.height,R=R.width,O=JSON.stringify(N.options),U=JSON.stringify(N.series),L=JSON.stringify(L),z=JSON.stringify(P);O===L&&U===z&&I===N.height&&R===N.width||(U!==z&&O===L&&I===N.height&&R===N.width?this.chart.updateSeries(P):this.chart.updateOptions(this.getConfig()))}},{key:"componentWillUnmount",value:function(){this.chart&&typeof this.chart.destroy=="function"&&this.chart.destroy()}}]),C}();return(DP.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"},DP}var Qsn=Xsn();const VL=Ii(Qsn),Zsn=()=>{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=t5(),u=(c==null?void 0:c.walletAddress)||"",d=n==="day",{setLatestPnL:f}=m.useContext(Qr);m.useEffect(()=>{const v=async()=>{var N,P,I,R,O,U,L,z,X,ne,J,K,re,he,Q,ie,oe,G,V,te,ae,fe,Ne;const C=o==="combined"?n:`perp${n.charAt(0).toUpperCase()+n.slice(1)}`;try{const we=(await hs.post("https://api-ui.hyperliquid.xyz/info",{type:"portfolio",user:u},{headers:{Accept:"*/*","Content-Type":"application/json"}})).data,ye=Date.now()-90*24*60*60*1e3,je=(Ft,dn=!1)=>{const Yt=(Ft==null?void 0:Ft.filter(([Bt])=>Number(Bt)>=ye))||[];if(dn&&Yt.length>0){const Bt=parseFloat(Yt[0][1]);return Yt.map(([ot,De])=>[ot,(parseFloat(De)-Bt).toString()])}return Yt},Pe=we.find(Ft=>Ft[0]==="allTime"),Re=we.find(Ft=>Ft[0]==="perpAllTime"),Xe={accountValueHistory:je((N=Pe==null?void 0:Pe[1])==null?void 0:N.accountValueHistory,!1),pnlHistory:je((P=Pe==null?void 0:Pe[1])==null?void 0:P.pnlHistory,!0),vlm:(I=Pe==null?void 0:Pe[1])==null?void 0:I.vlm},Ke={accountValueHistory:je((R=Re==null?void 0:Re[1])==null?void 0:R.accountValueHistory,!1),pnlHistory:je((O=Re==null?void 0:Re[1])==null?void 0:O.pnlHistory,!0),vlm:(U=Re==null?void 0:Re[1])==null?void 0:U.vlm},ut=[...we,["threeMonth",Xe],["perpThreeMonth",Ke]],et=((z=(L=ut.find(Ft=>Ft[0]===C))==null?void 0:L[1])==null?void 0:z[s])||[];t(et);const tt=o==="combined"?"day":"perpDay",Le=o==="combined"?"week":"perpWeek",$e=o==="combined"?"month":"perpMonth",ht=o==="combined"?"allTime":"perpAllTime",pt=o==="combined"?"threeMonth":"perpThreeMonth",Kt=((ne=(X=ut.find(Ft=>Ft[0]===tt))==null?void 0:X[1])==null?void 0:ne.pnlHistory)||[],wt=((K=(J=ut.find(Ft=>Ft[0]===Le))==null?void 0:J[1])==null?void 0:K.pnlHistory)||[],nn=((he=(re=ut.find(Ft=>Ft[0]===$e))==null?void 0:re[1])==null?void 0:he.pnlHistory)||[],cn=((ie=(Q=ut.find(Ft=>Ft[0]===ht))==null?void 0:Q[1])==null?void 0:ie.pnlHistory)||[],zn=((G=(oe=ut.find(Ft=>Ft[0]===pt))==null?void 0:oe[1])==null?void 0:G.pnlHistory)||[],Xt=((V=Kt[Kt.length-1])==null?void 0:V[1])??0,on=((te=wt[wt.length-1])==null?void 0:te[1])??0,Zt=((ae=nn[nn.length-1])==null?void 0:ae[1])??0,Ye=((fe=zn[zn.length-1])==null?void 0:fe[1])??0,Ze=((Ne=cn[cn.length-1])==null?void 0:Ne[1])??0;f({activeRange:n,day:Xt,week:on,month:Zt,threeMonth:Ye,all:Ze})}catch(me){console.error("Error fetching data:",me)}};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 P=v[w][C],I=(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]">${I?new Date(I).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(P)}</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(VL,{options:x,series:g,type:"area",height:410})]})]})};var Kx={},W7={},dCe;function VUe(){if(dCe)return W7;dCe=1,Object.defineProperty(W7,"__esModule",{value:!0}),W7.parseLengthAndUnit=t,W7.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 W7}var q7={},fCe;function WUe(){if(fCe)return q7;fCe=1,Object.defineProperty(q7,"__esModule",{value:!0}),q7.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 q7.createAnimation=e,q7}var hCe;function Jsn(){if(hCe)return Kx;hCe=1;var e=Kx.__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=Kx.__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=Kx.__setModuleDefault||(Object.create?function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}:function(d,f){d.default=f}),r=Kx.__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=Kx.__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(Kx,"__esModule",{value:!0});var a=r(ox()),o=VUe(),l=WUe(),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,P=N===void 0?{}:N,I=d.size,R=I===void 0?35:I,O=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"},P);return x?a.createElement("span",e({style:U},O)):null}return Kx.default=u,Kx}var ein=Jsn();const Yy=Ii(ein),Ig=e=>Number(e).toLocaleString("en-US",{maximumFractionDigits:2}),Tj=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}`}),tin=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 nin({trades:e}){const[t,n]=m.useState(!1),r=m.useMemo(()=>e?tin(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(dp,{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(Yy,{color:"#fff",size:20})]}),i.jsxs("div",{className:"mb-4 text-xs text-white",children:[o," – ",l]}),!a&&(!r||r.totalTrades===0)?i.jsx(rin,{}):i.jsx(sin,{stats:r,maxCoinPnl:s,loading:a})]})]})}function rin(){return i.jsxs("div",{className:"w-full h-[60vh] flex flex-col items-center justify-center text-white text-sm",children:[i.jsx(A6t,{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 sin({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(G7,{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:["$",Ig(e.totalPnL-e.totalFees)]}),i.jsx(xb,{label:"Gross:",value:`$${Ig(e.grossPnL+e.totalFees)}`}),i.jsx(xb,{label:"Fees:",value:`$${Ig(e.totalFees)}`,red:!0})]})}),i.jsx(G7,{title:"Position Split",loading:n,children:e&&i.jsxs(i.Fragment,{children:[i.jsx(xb,{label:"Long PnL",value:`$${Ig(Math.abs(e.longPnL))}`,green:!0}),i.jsx(xb,{label:"Short PnL",value:`$${Ig(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(G7,{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(xb,{label:"Winning:",value:e.wins}),i.jsx(xb,{label:"Total:",value:e.totalTrades})]})}),i.jsx(G7,{title:"Trade Duration",loading:n,children:e&&i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"text-xl font-semibold text-white",children:Tj(e.avgDur)}),i.jsx(xb,{label:"Range:",value:`${Tj(e.minDur)} – ${Tj(e.maxDur)}`}),i.jsx(xb,{label:"Median:",value:Tj(e.medianDur)})]})})]}),i.jsx(ain,{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(oin,{stats:e,loading:n,maxCoinPnl:t}),i.jsx(G7,{title:"Liquidations",loading:n,children:e&&e.liquidations.length>0?i.jsx(iin,{data:e.liquidations}):i.jsx("p",{className:"text-white text-lg text-center font-bold",children:"No liquidations"})})]})]})}function G7({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 iin({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:["$",Ig(Math.abs(t.totalPnL))]}),i.jsx("td",{className:"py-1 text-right",children:t.count})]},t.coin))})]})})}function xb({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 ain({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:["$",Ig(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: ",Tj(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 oin({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:["$",Ig(Math.abs(r.pnl))]})]}),i.jsxs("div",{className:"text-[11px] text-white font-semibold",children:["Fees: $",Ig(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 qUe="https://api.hyperliquid.xyz/info",_ne=2e3,GUe=365*24*60*60*1e3*2;async function KUe(e,t){const{data:n}=await hs.post(qUe,{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()-GUe;const n=[],r=new Set;for(;;){const s=await KUe(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<_ne)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 hs.post(qUe,{type:"userTwapSliceFills",user:e},{headers:{"Content-Type":"application/json"},timeout:1e4});return t}async function lin(e,t){let n=Date.now()-GUe;const r=[],s=new Set;let a=0;for(;;){const c=await KUe(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>=_ne,fills:r.slice(0,10),isComplete:!1}),c.length<_ne)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(">"),P=!!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 I=n[a]??(n[a]={}),R=(I.total_size||0)+l;I.oids=(I.oids||[]).concat(s.oid),I.entry_price_wma=((I.entry_price_wma||0)*(I.total_size||0)+c*l)/R,I.total_size=R,I.last_fill_time=g,I.transaction_count=(I.transaction_count||0)+1,I.total_fee=(I.total_fee||0)+f,I.has_builder_fee=I.has_builder_fee||d!==0,I.builder_fee=(I.builder_fee||0)+d,I.twapId=v}continue}if(N){const I=n[a];I&&(I.close_size+=l,I.total_pnl+=x,I.total_fee+=f,I.last_fill_time=g,I.close_px=c,I.transaction_count++,I.oids.push(s.oid),I.has_builder_fee=I.has_builder_fee||d!==0,I.builder_fee=(I.builder_fee||0)+d,I.twapId=v,I.isClosed=!0,I.close_time=g,I.duration_hours=(g-I.open_time)/36e5,t.push(I),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||P){const I=n[a];if(!I)continue;I.close_size+=l,I.total_pnl+=x,I.total_fee+=f,I.last_fill_time=g,I.close_px=c,I.transaction_count++,I.oids.push(s.oid),I.has_builder_fee=I.has_builder_fee||d!==0,I.builder_fee=(I.builder_fee||0)+d,I.twapId=v,P&&(I.isLiquidated=!0,I.liquidation_px_sum=(I.liquidation_px_sum||0)+c,I.liquidationCount=(I.liquidationCount||0)+1),pCe(Math.abs(l),Math.abs(u),1e-6)&&(I.isClosed=!0,I.close_time=g,I.duration_hours=(g-I.open_time)/36e5,t.push(I),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 zf=({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 pT({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 P1(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),tn.success("PNG successfully downloaded!")}catch(v){console.error("Error generating PNG:",v),tn.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,P)=>{const I=new FileReader;I.onloadend=()=>N(I.result),I.onerror=P,I.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(Wa))},[n==null?void 0:n.coin]),i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{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(ga,{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:$a})})}),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:EA,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||Wa,alt:"",className:"rounded-full w-8 h-8",loading:"lazy",onError:v=>sa(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?"+":"-",oo(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?`$${oo(Math.abs(n==null?void 0:n.pnl).toFixed(2))}`:oo(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:AA,alt:"",className:"h-full"}):i.jsx("img",{src:jA,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"),tn.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 cin({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 P1(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),tn.success("PNG successfully downloaded!")}catch(c){console.error("Error generating PNG:",c),tn.error("Failed to download PNG.")}};return i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{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(ga,{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:$a})})}),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:EA,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))?"":Os(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:AA,alt:"",className:"h-full"}):i.jsx("img",{src:jA,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"),tn.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 uin({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 P1(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),tn.success("PNG successfully downloaded!")}catch(g){console.error("Error generating PNG:",g),tn.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 P=new FileReader;P.onloadend=()=>C(P.result),P.onerror=N,P.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(Wa))},[n==null?void 0:n.coin]),i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{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(ga,{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:$a})})}),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:EA,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||Wa,alt:"",className:"rounded-full w-8 h-8",loading:"lazy",onError:g=>sa(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?"+":"-","$",oo(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?`$${fy(n==null?void 0:n.entryPrice)}`:fy(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?`$${fy(n==null?void 0:n.markPrice)}`:fy(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:AA,alt:"",className:"h-full"}):i.jsx("img",{src:jA,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"),tn.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 din=({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(Qr);const[P,I]=m.useState({key:null,direction:null});m.useEffect(()=>{function he(Q){g.current&&!g.current.contains(Q.target)&&setIsDropdownOpen(!1),x.current&&!x.current.contains(Q.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 Q=!0;return(async()=>{try{const ie=(await Promise.all(he.map(G=>hs.post("https://api-ui.hyperliquid.xyz/info",{aggregateByTime:!0,type:"userFills",user:G})))).flatMap(G=>G.data??[]);if(!Q)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{Q&&a(!1)}})(),()=>{Q=!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=Q=>{const ie=JSON.parse(Q.data);ie&&ie.data&&Array.isArray(ie.data.fills)&&r(oe=>{const G=[...oe];return ie.data.fills.forEach(V=>{const te=R(V);G.some(ae=>R(ae)===te)||G.push(V)}),G.sort((V,te)=>te.time-V.time)})},()=>he.close()},[]),m.useEffect(()=>{(async()=>{try{const Q=await hs.post("https://api-ui.hyperliquid.xyz/info",{aggregateByTime:!0,type:"userFills",user:e});r(Q.data||[])}catch(Q){console.error("Error fetching trade data:",Q)}finally{a(!1)}})()},[e]);const O=he=>{let Q="asc";P.key===he&&(P.direction==="asc"?Q="desc":P.direction==="desc"&&(Q=null)),I({key:he,direction:Q})};let U=[...n];c&&(U=U.filter(he=>String(he.oid).includes(c)));const L=U.sort((he,Q)=>{if(!P.key||!P.direction)return 0;const ie=(V,te)=>{switch(te){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[te]}},oe=ie(he,P.key),G=ie(Q,P.key);return oe<G?P.direction==="asc"?-1:1:oe>G?P.direction==="asc"?1:-1:0}),z=he=>{if(P.key===he){if(P.direction==="asc")return i.jsx(P3,{className:"inline ml-2 text-white"});if(P.direction==="desc")return i.jsx(I3,{className:"inline ml-2 text-white"})}return i.jsx(F3,{className:"inline ml-2 text-white"})},ne=localStorage.getItem("isDateTradeHistoryFormat")||"date",[J,K]=m.useState(ne);m.useEffect(()=>{localStorage.setItem("isDateTradeHistoryFormat",J)},[J]);function re({date:he}){const[Q,ie]=m.useState(Ro(he));return m.useEffect(()=>{const oe=setInterval(()=>{ie(Ro(he))},1e3);return()=>clearInterval(oe)},[he]),i.jsx("span",{className:"text-white leading-[13px] tracking-[0.26px] text-[13px] font-semibold font-manrope",children:Q.dateTime})}return i.jsxs("div",{className:"relative w-full text-white text-sm font-semibold font-manrope leading-[13px] tracking-tight",children:[i.jsx(uin,{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:()=>O("time"),children:["Time ",z("time")]}),i.jsxs("th",{className:" text-left cursor-pointer",onClick:()=>O("coin"),children:["Coin ",z("coin")]}),i.jsxs("th",{className:" text-left cursor-pointer",onClick:()=>O("dir"),children:["Direction ",z("dir")]}),i.jsxs("th",{className:" text-left cursor-pointer",onClick:()=>O("px"),children:["Price ",z("px")]}),i.jsxs("th",{className:" text-left cursor-pointer",onClick:()=>O("sz"),children:["Size ",z("sz")]}),i.jsxs("th",{className:" text-left cursor-pointer",onClick:()=>O("tradeValue"),children:["Trade Value ",z("tradeValue")]}),i.jsxs("th",{className:" text-left cursor-pointer",onClick:()=>O("fee"),children:["Fee (USDC) ",z("fee")]}),i.jsxs("th",{className:" text-left cursor-pointer",onClick:()=>O("closedPnl"),children:["Closed PNL ",z("closedPnl")]}),i.jsx("th",{children:i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx(pi,{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(zf,{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,Q)=>{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:()=>{K(J=="time"?"date":"time")},className:"text-left rounded-l-2xl cursor-pointer",children:J=="time"?i.jsx(re,{date:he.time}):iu(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})]},Q)})})]})})]})};var Ij={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 fin=Ij.exports,mCe;function hin(){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,P=4,I=8,R=16,O=32,U=64,L=128,z=256,X=512,ne=30,J="...",K=800,re=16,he=1,Q=2,ie=3,oe=1/0,G=9007199254740991,V=17976931348623157e292,te=NaN,ae=4294967295,fe=ae-1,Ne=ae>>>1,me=[["ary",L],["bind",C],["bindKey",N],["curry",I],["curryRight",R],["flip",X],["partial",O],["partialRight",U],["rearg",z]],we="[object Arguments]",xe="[object Array]",ye="[object AsyncFunction]",je="[object Boolean]",Pe="[object Date]",Re="[object DOMException]",Xe="[object Error]",Ke="[object Function]",ut="[object GeneratorFunction]",et="[object Map]",tt="[object Number]",Le="[object Null]",$e="[object Object]",ht="[object Promise]",pt="[object Proxy]",Kt="[object RegExp]",wt="[object Set]",nn="[object String]",cn="[object Symbol]",zn="[object Undefined]",Xt="[object WeakMap]",on="[object WeakSet]",Zt="[object ArrayBuffer]",Ye="[object DataView]",Ze="[object Float32Array]",Ft="[object Float64Array]",dn="[object Int8Array]",Yt="[object Int16Array]",Bt="[object Int32Array]",ot="[object Uint8Array]",De="[object Uint8ClampedArray]",_t="[object Uint16Array]",ze="[object Uint32Array]",nt=/\b__p \+= '';/g,mt=/\b(__p \+=) '' \+/g,$t=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Pt=/&(?:amp|lt|gt|quot|#39);/g,un=/[&<>"']/g,an=RegExp(Pt.source),xn=RegExp(un.source),An=/<%-([\s\S]+?)%>/g,kn=/<%([\s\S]+?)%>/g,yn=/<%=([\s\S]+?)%>/g,Vn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Gn=/^\w*$/,Rn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Yn=/[\\^$.*+?()[\]{}|]/g,Cn=RegExp(Yn.source),rn=/^\s+/,Oe=/\s/,Jt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,sn=/\{\n\/\* \[wrapped with (.+)\] \*/,Et=/,? & /,Xn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,gn=/[()=,{}\[\]\/\s]/,Dt=/\\(\\)?/g,en=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,In=/\w*$/,Qn=/^[-+]0x[0-9a-f]+$/i,ar=/^0b[01]+$/i,hr=/^\[object .+?Constructor\]$/,Gt=/^0o[0-7]+$/i,$n=/^(?:0|[1-9]\d*)$/,nr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Rt=/($^)/,En=/['\n\r\u2028\u2029\\]/g,Ee="\\ud800-\\udfff",h="\\u0300-\\u036f",p="\\ufe20-\\ufe2f",S="\\u20d0-\\u20ff",_=h+p+S,k="\\u2700-\\u27bf",T="a-z\\xdf-\\xf6\\xf8-\\xff",B="\\xac\\xb1\\xd7\\xf7",W="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ee="\\u2000-\\u206f",ce=" \\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",ue="A-Z\\xc0-\\xd6\\xd8-\\xde",ge="\\ufe0e\\ufe0f",Se=B+W+ee+ce,ke="['’]",Me="["+Ee+"]",qe="["+Se+"]",Fe="["+_+"]",at="\\d+",se="["+k+"]",Ce="["+T+"]",Ue="[^"+Ee+Se+at+k+T+ue+"]",Be="\\ud83c[\\udffb-\\udfff]",_e="(?:"+Fe+"|"+Be+")",rt="[^"+Ee+"]",ct="(?:\\ud83c[\\udde6-\\uddff]){2}",yt="[\\ud800-\\udbff][\\udc00-\\udfff]",Lt="["+ue+"]",ft="\\u200d",Tt="(?:"+Ce+"|"+Ue+")",Ge="(?:"+Lt+"|"+Ue+")",At="(?:"+ke+"(?:d|ll|m|re|s|t|ve))?",Ot="(?:"+ke+"(?:D|LL|M|RE|S|T|VE))?",it=_e+"?",jt="["+ge+"]?",Nn="(?:"+ft+"(?:"+[rt,ct,yt].join("|")+")"+jt+it+")*",mn="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ir="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Sn=jt+it+Nn,Bn="(?:"+[se,ct,yt].join("|")+")"+Sn,rr="(?:"+[rt+Fe+"?",Fe,ct,yt,Me].join("|")+")",ur=RegExp(ke,"g"),_r=RegExp(Fe,"g"),Un=RegExp(Be+"(?="+Be+")|"+rr+Sn,"g"),Ln=RegExp([Lt+"?"+Ce+"+"+At+"(?="+[qe,Lt,"$"].join("|")+")",Ge+"+"+Ot+"(?="+[qe,Lt+Tt,"$"].join("|")+")",Lt+"?"+Tt+"+"+At,Lt+"+"+Ot,ir,mn,at,Bn].join("|"),"g"),Kn=RegExp("["+ft+Ee+_+ge+"]"),Yr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,os=["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"],ds=-1,Je={};Je[Ze]=Je[Ft]=Je[dn]=Je[Yt]=Je[Bt]=Je[ot]=Je[De]=Je[_t]=Je[ze]=!0,Je[we]=Je[xe]=Je[Zt]=Je[je]=Je[Ye]=Je[Pe]=Je[Xe]=Je[Ke]=Je[et]=Je[tt]=Je[$e]=Je[Kt]=Je[wt]=Je[nn]=Je[Xt]=!1;var bt={};bt[we]=bt[xe]=bt[Zt]=bt[Ye]=bt[je]=bt[Pe]=bt[Ze]=bt[Ft]=bt[dn]=bt[Yt]=bt[Bt]=bt[et]=bt[tt]=bt[$e]=bt[Kt]=bt[wt]=bt[nn]=bt[cn]=bt[ot]=bt[De]=bt[_t]=bt[ze]=!0,bt[Xe]=bt[Ke]=bt[Xt]=!1;var Tn={À:"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"},er={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},kr={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Dr={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ur=parseFloat,cr=parseInt,Cr=typeof Iu=="object"&&Iu&&Iu.Object===Object&&Iu,ls=typeof self=="object"&&self&&self.Object===Object&&self,yr=Cr||ls||Function("return this")(),Jr=t&&!t.nodeType&&t,Ks=Jr&&!0&&e&&!e.nodeType&&e,Es=Ks&&Ks.exports===Jr,gr=Es&&Cr.process,Vt=function(){try{var St=Ks&&Ks.require&&Ks.require("util").types;return St||gr&&gr.binding&&gr.binding("util")}catch{}}(),de=Vt&&Vt.isArrayBuffer,st=Vt&&Vt.isDate,Ct=Vt&&Vt.isMap,vt=Vt&&Vt.isRegExp,ln=Vt&&Vt.isSet,pn=Vt&&Vt.isTypedArray;function dr(St,zt,Wt){switch(Wt.length){case 0:return St.call(zt);case 1:return St.call(zt,Wt[0]);case 2:return St.call(zt,Wt[0],Wt[1]);case 3:return St.call(zt,Wt[0],Wt[1],Wt[2])}return St.apply(zt,Wt)}function jr(St,zt,Wt,jn){for(var mr=-1,Sr=St==null?0:St.length;++mr<Sr;){var Ar=St[mr];zt(jn,Ar,Wt(Ar),St)}return jn}function pr(St,zt){for(var Wt=-1,jn=St==null?0:St.length;++Wt<jn&&zt(St[Wt],Wt,St)!==!1;);return St}function fr(St,zt){for(var Wt=St==null?0:St.length;Wt--&&zt(St[Wt],Wt,St)!==!1;);return St}function Kr(St,zt){for(var Wt=-1,jn=St==null?0:St.length;++Wt<jn;)if(!zt(St[Wt],Wt,St))return!1;return!0}function rs(St,zt){for(var Wt=-1,jn=St==null?0:St.length,mr=0,Sr=[];++Wt<jn;){var Ar=St[Wt];zt(Ar,Wt,St)&&(Sr[mr++]=Ar)}return Sr}function Ir(St,zt){var Wt=St==null?0:St.length;return!!Wt&&Wn(St,zt,0)>-1}function br(St,zt,Wt){for(var jn=-1,mr=St==null?0:St.length;++jn<mr;)if(Wt(zt,St[jn]))return!0;return!1}function Zn(St,zt){for(var Wt=-1,jn=St==null?0:St.length,mr=Array(jn);++Wt<jn;)mr[Wt]=zt(St[Wt],Wt,St);return mr}function xs(St,zt){for(var Wt=-1,jn=zt.length,mr=St.length;++Wt<jn;)St[mr+Wt]=zt[Wt];return St}function Qs(St,zt,Wt,jn){var mr=-1,Sr=St==null?0:St.length;for(jn&&Sr&&(Wt=St[++mr]);++mr<Sr;)Wt=zt(Wt,St[mr],mr,St);return Wt}function ai(St,zt,Wt,jn){var mr=St==null?0:St.length;for(jn&&mr&&(Wt=St[--mr]);mr--;)Wt=zt(Wt,St[mr],mr,St);return Wt}function Pr(St,zt){for(var Wt=-1,jn=St==null?0:St.length;++Wt<jn;)if(zt(St[Wt],Wt,St))return!0;return!1}var vn=Rs("length");function Fn(St){return St.split("")}function lt(St){return St.match(Xn)||[]}function Ut(St,zt,Wt){var jn;return Wt(St,function(mr,Sr,Ar){if(zt(mr,Sr,Ar))return jn=Sr,!1}),jn}function tr(St,zt,Wt,jn){for(var mr=St.length,Sr=Wt+(jn?1:-1);jn?Sr--:++Sr<mr;)if(zt(St[Sr],Sr,St))return Sr;return-1}function Wn(St,zt,Wt){return zt===zt?F(St,zt,Wt):tr(St,Tr,Wt)}function Fr(St,zt,Wt,jn){for(var mr=Wt-1,Sr=St.length;++mr<Sr;)if(jn(St[mr],zt))return mr;return-1}function Tr(St){return St!==St}function es(St,zt){var Wt=St==null?0:St.length;return Wt?Hr(St,zt)/Wt:te}function Rs(St){return function(zt){return zt==null?n:zt[St]}}function kt(St){return function(zt){return St==null?n:St[zt]}}function or(St,zt,Wt,jn,mr){return mr(St,function(Sr,Ar,Ss){Wt=jn?(jn=!1,Sr):zt(Wt,Sr,Ar,Ss)}),Wt}function Hn(St,zt){var Wt=St.length;for(St.sort(zt);Wt--;)St[Wt]=St[Wt].value;return St}function Hr(St,zt){for(var Wt,jn=-1,mr=St.length;++jn<mr;){var Sr=zt(St[jn]);Sr!==n&&(Wt=Wt===n?Sr:Wt+Sr)}return Wt}function as(St,zt){for(var Wt=-1,jn=Array(St);++Wt<St;)jn[Wt]=zt(Wt);return jn}function ss(St,zt){return Zn(zt,function(Wt){return[Wt,St[Wt]]})}function ms(St){return St&&St.slice(0,le(St)+1).replace(rn,"")}function gs(St){return function(zt){return St(zt)}}function Ui(St,zt){return Zn(zt,function(Wt){return St[Wt]})}function $s(St,zt){return St.has(zt)}function bs(St,zt){for(var Wt=-1,jn=St.length;++Wt<jn&&Wn(zt,St[Wt],0)>-1;);return Wt}function Cs(St,zt){for(var Wt=St.length;Wt--&&Wn(zt,St[Wt],0)>-1;);return Wt}function dc(St,zt){for(var Wt=St.length,jn=0;Wt--;)St[Wt]===zt&&++jn;return jn}var _s=kt(Tn),_a=kt(er);function $u(St){return"\\"+Dr[St]}function ba(St,zt){return St==null?n:St[zt]}function qo(St){return Kn.test(St)}function Uu(St){return Yr.test(St)}function Wl(St){for(var zt,Wt=[];!(zt=St.next()).done;)Wt.push(zt.value);return Wt}function bi(St){var zt=-1,Wt=Array(St.size);return St.forEach(function(jn,mr){Wt[++zt]=[mr,jn]}),Wt}function wd(St,zt){return function(Wt){return St(zt(Wt))}}function dt(St,zt){for(var Wt=-1,jn=St.length,mr=0,Sr=[];++Wt<jn;){var Ar=St[Wt];(Ar===zt||Ar===d)&&(St[Wt]=d,Sr[mr++]=Wt)}return Sr}function y(St){var zt=-1,Wt=Array(St.size);return St.forEach(function(jn){Wt[++zt]=jn}),Wt}function E(St){var zt=-1,Wt=Array(St.size);return St.forEach(function(jn){Wt[++zt]=[jn,jn]}),Wt}function F(St,zt,Wt){for(var jn=Wt-1,mr=St.length;++jn<mr;)if(St[jn]===zt)return jn;return-1}function $(St,zt,Wt){for(var jn=Wt+1;jn--;)if(St[jn]===zt)return jn;return jn}function H(St){return qo(St)?Te(St):vn(St)}function Y(St){return qo(St)?Qe(St):Fn(St)}function le(St){for(var zt=St.length;zt--&&Oe.test(St.charAt(zt)););return zt}var ve=kt(kr);function Te(St){for(var zt=Un.lastIndex=0;Un.test(St);)++zt;return zt}function Qe(St){return St.match(Un)||[]}function xt(St){return St.match(Ln)||[]}var It=function St(zt){zt=zt==null?yr:Qt.defaults(yr.Object(),zt,Qt.pick(yr,os));var Wt=zt.Array,jn=zt.Date,mr=zt.Error,Sr=zt.Function,Ar=zt.Math,Ss=zt.Object,Zs=zt.RegExp,fc=zt.String,Ja=zt.TypeError,eo=Wt.prototype,fa=Sr.prototype,ka=Ss.prototype,Go=zt["__core-js_shared__"],Cd=fa.toString,Fi=ka.hasOwnProperty,km=0,F1=function(){var D=/[^.]+$/.exec(Go&&Go.keys&&Go.keys.IE_PROTO||"");return D?"Symbol(src)_1."+D:""}(),N2=ka.toString,T5=Cd.call(Ss),AT=yr._,jT=Zs("^"+Cd.call(Fi).replace(Yn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),A2=Es?zt.Buffer:n,xp=zt.Symbol,j2=zt.Uint8Array,d8=A2?A2.allocUnsafe:n,mf=wd(Ss.getPrototypeOf,Ss),I5=Ss.create,P5=ka.propertyIsEnumerable,F5=eo.splice,ET=xp?xp.isConcatSpreadable:n,gp=xp?xp.iterator:n,px=xp?xp.toStringTag:n,E2=function(){try{var D=$m(Ss,"defineProperty");return D({},"",{}),D}catch{}}(),_T=zt.clearTimeout!==yr.clearTimeout&&zt.clearTimeout,qa=jn&&jn.now!==yr.Date.now&&jn.now,f8=zt.setTimeout!==yr.setTimeout&&zt.setTimeout,mx=Ar.ceil,Tm=Ar.floor,O5=Ss.getOwnPropertySymbols,h8=A2?A2.isBuffer:n,O1=zt.isFinite,M5=eo.join,M1=wd(Ss.keys,Ss),Ko=Ar.max,hc=Ar.min,TU=jn.now,kT=zt.parseInt,_2=Ar.random,R5=eo.reverse,k2=$m(zt,"DataView"),xx=$m(zt,"Map"),T2=$m(zt,"Promise"),Im=$m(zt,"Set"),I2=$m(zt,"WeakMap"),R1=$m(Ss,"create"),L5=I2&&new I2,L1={},p8=Um(k2),Pm=Um(xx),TT=Um(T2),D1=Um(Im),th=Um(I2),Fm=xp?xp.prototype:n,zu=Fm?Fm.valueOf:n,D5=Fm?Fm.toString:n;function Mt(D){if(Xo(D)&&!Ni(D)&&!(D instanceof Si)){if(D instanceof pc)return D;if(Fi.call(D,"__wrapped__"))return sI(D)}return new pc(D)}var B1=function(){function D(){}return function(q){if(!Bo(q))return{};if(I5)return I5(q);D.prototype=q;var be=new D;return D.prototype=n,be}}();function nh(){}function pc(D,q){this.__wrapped__=D,this.__actions__=[],this.__chain__=!!q,this.__index__=0,this.__values__=n}Mt.templateSettings={escape:An,evaluate:kn,interpolate:yn,variable:"",imports:{_:Mt}},Mt.prototype=nh.prototype,Mt.prototype.constructor=Mt,pc.prototype=B1(nh.prototype),pc.prototype.constructor=pc;function Si(D){this.__wrapped__=D,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ae,this.__views__=[]}function B5(){var D=new Si(this.__wrapped__);return D.__actions__=$c(this.__actions__),D.__dir__=this.__dir__,D.__filtered__=this.__filtered__,D.__iteratees__=$c(this.__iteratees__),D.__takeCount__=this.__takeCount__,D.__views__=$c(this.__views__),D}function m8(){if(this.__filtered__){var D=new Si(this);D.__dir__=-1,D.__filtered__=!0}else D=this.clone(),D.__dir__*=-1;return D}function $1(){var D=this.__wrapped__.value(),q=this.__dir__,be=Ni(D),We=q<0,gt=be?D.length:0,qt=H8(0,gt,this.__views__),hn=qt.start,Pn=qt.end,qn=Pn-hn,Or=We?Pn:hn-1,Mr=this.__iteratees__,zr=Mr.length,cs=0,Ls=hc(qn,this.__takeCount__);if(!be||!We&&gt==qn&&Ls==qn)return K1(D,this.__actions__);var Js=[];e:for(;qn--&&cs<Ls;){Or+=q;for(var Ri=-1,ei=D[Or];++Ri<zr;){var Gi=Mr[Ri],Qi=Gi.iteratee,Af=Gi.type,Gu=Qi(ei);if(Af==Q)ei=Gu;else if(!Gu){if(Af==he)continue e;break e}}Js[cs++]=ei}return Js}Si.prototype=B1(nh.prototype),Si.prototype.constructor=Si;function cu(D){var q=-1,be=D==null?0:D.length;for(this.clear();++q<be;){var We=D[q];this.set(We[0],We[1])}}function Ga(){this.__data__=R1?R1(null):{},this.size=0}function Ua(D){var q=this.has(D)&&delete this.__data__[D];return this.size-=q?1:0,q}function Om(D){var q=this.__data__;if(R1){var be=q[D];return be===c?n:be}return Fi.call(q,D)?q[D]:n}function mc(D){var q=this.__data__;return R1?q[D]!==n:Fi.call(q,D)}function uu(D,q){var be=this.__data__;return this.size+=this.has(D)?0:1,be[D]=R1&&q===n?c:q,this}cu.prototype.clear=Ga,cu.prototype.delete=Ua,cu.prototype.get=Om,cu.prototype.has=mc,cu.prototype.set=uu;function Bc(D){var q=-1,be=D==null?0:D.length;for(this.clear();++q<be;){var We=D[q];this.set(We[0],We[1])}}function U1(){this.__data__=[],this.size=0}function du(D){var q=this.__data__,be=gc(q,D);if(be<0)return!1;var We=q.length-1;return be==We?q.pop():F5.call(q,be,1),--this.size,!0}function $5(D){var q=this.__data__,be=gc(q,D);return be<0?n:q[be][1]}function IT(D){return gc(this.__data__,D)>-1}function PT(D,q){var be=this.__data__,We=gc(be,D);return We<0?(++this.size,be.push([D,q])):be[We][1]=q,this}Bc.prototype.clear=U1,Bc.prototype.delete=du,Bc.prototype.get=$5,Bc.prototype.has=IT,Bc.prototype.set=PT;function Sd(D){var q=-1,be=D==null?0:D.length;for(this.clear();++q<be;){var We=D[q];this.set(We[0],We[1])}}function FT(){this.size=0,this.__data__={hash:new cu,map:new(xx||Bc),string:new cu}}function bp(D){var q=G2(this,D).delete(D);return this.size-=q?1:0,q}function U5(D){return G2(this,D).get(D)}function x8(D){return G2(this,D).has(D)}function OT(D,q){var be=G2(this,D),We=be.size;return be.set(D,q),this.size+=be.size==We?0:1,this}Sd.prototype.clear=FT,Sd.prototype.delete=bp,Sd.prototype.get=U5,Sd.prototype.has=x8,Sd.prototype.set=OT;function gx(D){var q=-1,be=D==null?0:D.length;for(this.__data__=new Sd;++q<be;)this.add(D[q])}function Mm(D){return this.__data__.set(D,c),this}function z1(D){return this.__data__.has(D)}gx.prototype.add=gx.prototype.push=Mm,gx.prototype.has=z1;function xc(D){var q=this.__data__=new Bc(D);this.size=q.size}function z5(){this.__data__=new Bc,this.size=0}function H5(D){var q=this.__data__,be=q.delete(D);return this.size=q.size,be}function Nd(D){return this.__data__.get(D)}function Ad(D){return this.__data__.has(D)}function bx(D,q){var be=this.__data__;if(be instanceof Bc){var We=be.__data__;if(!xx||We.length<s-1)return We.push([D,q]),this.size=++be.size,this;be=this.__data__=new Sd(We)}return be.set(D,q),this.size=be.size,this}xc.prototype.clear=z5,xc.prototype.delete=H5,xc.prototype.get=Nd,xc.prototype.has=Ad,xc.prototype.set=bx;function rh(D,q){var be=Ni(D),We=!be&&iv(D),gt=!be&&!We&&sb(D),qt=!be&&!We&&!gt&&O6(D),hn=be||We||gt||qt,Pn=hn?as(D.length,fc):[],qn=Pn.length;for(var Or in D)(q||Fi.call(D,Or))&&!(hn&&(Or=="length"||gt&&(Or=="offset"||Or=="parent")||qt&&(Or=="buffer"||Or=="byteLength"||Or=="byteOffset")||no(Or,qn)))&&Pn.push(Or);return Pn}function sh(D){var q=D.length;return q?D[q1(0,q-1)]:n}function yx(D,q){return m6($c(D),yp(q,0,D.length))}function MT(D){return m6($c(D))}function P2(D,q,be){(be!==n&&!kp(D[q],be)||be===n&&!(q in D))&&ih(D,q,be)}function vx(D,q,be){var We=D[q];(!(Fi.call(D,q)&&kp(We,be))||be===n&&!(q in D))&&ih(D,q,be)}function gc(D,q){for(var be=D.length;be--;)if(kp(D[be][0],q))return be;return-1}function Hu(D,q,be,We){return oh(D,function(gt,qt,hn){q(We,gt,be(gt),hn)}),We}function Ka(D,q){return D&&gf(q,vc(q),D)}function xf(D,q){return D&&gf(q,Od(q),D)}function ih(D,q,be){q=="__proto__"&&E2?E2(D,q,{configurable:!0,enumerable:!0,value:be,writable:!0}):D[q]=be}function V5(D,q){for(var be=-1,We=q.length,gt=Wt(We),qt=D==null;++be<We;)gt[be]=qt?n:ZU(D,q[be]);return gt}function yp(D,q,be){return D===D&&(be!==n&&(D=D<=be?D:be),q!==n&&(D=D>=q?D:q)),D}function fu(D,q,be,We,gt,qt){var hn,Pn=q&f,qn=q&x,Or=q&g;if(be&&(hn=gt?be(D,We,gt,qt):be(D)),hn!==n)return hn;if(!Bo(D))return D;var Mr=Ni(D);if(Mr){if(hn=Y2(D),!Pn)return $c(D,hn)}else{var zr=Kl(D),cs=zr==Ke||zr==ut;if(sb(D))return I8(D,Pn);if(zr==$e||zr==we||cs&&!gt){if(hn=qn||cs?{}:Yl(D),!Pn)return qn?PU(D,xf(hn,D)):r6(D,Ka(hn,D))}else{if(!bt[zr])return gt?D:{};hn=FU(D,zr,Pn)}}qt||(qt=new xc);var Ls=qt.get(D);if(Ls)return Ls;qt.set(D,hn),Que(D)?D.forEach(function(ei){hn.add(fu(ei,q,be,ei,D,qt))}):Yue(D)&&D.forEach(function(ei,Gi){hn.set(Gi,fu(ei,q,be,Gi,D,qt))});var Js=Or?qn?q2:W2:qn?Od:vc,Ri=Mr?n:Js(D);return pr(Ri||D,function(ei,Gi){Ri&&(Gi=ei,ei=D[Gi]),vx(hn,Gi,fu(ei,q,be,Gi,D,qt))}),hn}function RT(D){var q=vc(D);return function(be){return F2(be,D,q)}}function F2(D,q,be){var We=be.length;if(D==null)return!We;for(D=Ss(D);We--;){var gt=be[We],qt=q[gt],hn=D[gt];if(hn===n&&!(gt in D)||!qt(hn))return!1}return!0}function g8(D,q,be){if(typeof D!="function")throw new Ja(o);return tb(function(){D.apply(n,be)},q)}function ah(D,q,be,We){var gt=-1,qt=Ir,hn=!0,Pn=D.length,qn=[],Or=q.length;if(!Pn)return qn;be&&(q=Zn(q,gs(be))),We?(qt=br,hn=!1):q.length>=s&&(qt=$s,hn=!1,q=new gx(q));e:for(;++gt<Pn;){var Mr=D[gt],zr=be==null?Mr:be(Mr);if(Mr=We||Mr!==0?Mr:0,hn&&zr===zr){for(var cs=Or;cs--;)if(q[cs]===zr)continue e;qn.push(Mr)}else qt(q,zr,We)||qn.push(Mr)}return qn}var oh=Td(Vu),LT=Td(Rm,!0);function O2(D,q){var be=!0;return oh(D,function(We,gt,qt){return be=!!q(We,gt,qt),be}),be}function wx(D,q,be){for(var We=-1,gt=D.length;++We<gt;){var qt=D[We],hn=q(qt);if(hn!=null&&(Pn===n?hn===hn&&!Nf(hn):be(hn,Pn)))var Pn=hn,qn=qt}return qn}function DT(D,q,be,We){var gt=D.length;for(be=Mi(be),be<0&&(be=-be>gt?0:gt+be),We=We===n||We>gt?gt:Mi(We),We<0&&(We+=gt),We=be>We?0:Jue(We);be<We;)D[be++]=q;return D}function b8(D,q){var be=[];return oh(D,function(We,gt,qt){q(We,gt,qt)&&be.push(We)}),be}function Ao(D,q,be,We,gt){var qt=-1,hn=D.length;for(be||(be=f6),gt||(gt=[]);++qt<hn;){var Pn=D[qt];q>0&&be(Pn)?q>1?Ao(Pn,q-1,be,We,gt):xs(gt,Pn):We||(gt[gt.length]=Pn)}return gt}var W5=i6(),M2=i6(!0);function Vu(D,q){return D&&W5(D,q,vc)}function Rm(D,q){return D&&M2(D,q,vc)}function H1(D,q){return rs(q,function(be){return Fx(D[be])})}function vp(D,q){q=uh(q,D);for(var be=0,We=q.length;D!=null&&be<We;)D=D[wf(q[be++])];return be&&be==We?D:n}function q5(D,q,be){var We=q(D);return Ni(D)?We:xs(We,be(D))}function ql(D){return D==null?D===n?zn:Le:px&&px in Ss(D)?d6(D):W8(D)}function Lm(D,q){return D>q}function jd(D,q){return D!=null&&Fi.call(D,q)}function Cx(D,q){return D!=null&&q in Ss(D)}function y8(D,q,be){return D>=hc(q,be)&&D<Ko(q,be)}function G5(D,q,be){for(var We=be?br:Ir,gt=D[0].length,qt=D.length,hn=qt,Pn=Wt(qt),qn=1/0,Or=[];hn--;){var Mr=D[hn];hn&&q&&(Mr=Zn(Mr,gs(q))),qn=hc(Mr.length,qn),Pn[hn]=!be&&(q||gt>=120&&Mr.length>=120)?new gx(hn&&Mr):n}Mr=D[0];var zr=-1,cs=Pn[0];e:for(;++zr<gt&&Or.length<qn;){var Ls=Mr[zr],Js=q?q(Ls):Ls;if(Ls=be||Ls!==0?Ls:0,!(cs?$s(cs,Js):We(Or,Js,be))){for(hn=qt;--hn;){var Ri=Pn[hn];if(!(Ri?$s(Ri,Js):We(D[hn],Js,be)))continue e}cs&&cs.push(Js),Or.push(Ls)}}return Or}function wp(D,q,be,We){return Vu(D,function(gt,qt,hn){q(We,be(gt),qt,hn)}),We}function Ed(D,q,be){q=uh(q,D),D=kl(D,q);var We=D==null?D:D[wf(Hc(q))];return We==null?n:dr(We,D,be)}function K5(D){return Xo(D)&&ql(D)==we}function BT(D){return Xo(D)&&ql(D)==Zt}function Cp(D){return Xo(D)&&ql(D)==Pe}function _d(D,q,be,We,gt){return D===q?!0:D==null||q==null||!Xo(D)&&!Xo(q)?D!==D&&q!==q:Y5(D,q,be,We,_d,gt)}function Y5(D,q,be,We,gt,qt){var hn=Ni(D),Pn=Ni(q),qn=hn?xe:Kl(D),Or=Pn?xe:Kl(q);qn=qn==we?$e:qn,Or=Or==we?$e:Or;var Mr=qn==$e,zr=Or==$e,cs=qn==Or;if(cs&&sb(D)){if(!sb(q))return!1;hn=!0,Mr=!1}if(cs&&!Mr)return qt||(qt=new xc),hn||O6(D)?U8(D,q,be,We,gt,qt):z8(D,q,qn,be,We,gt,qt);if(!(be&v)){var Ls=Mr&&Fi.call(D,"__wrapped__"),Js=zr&&Fi.call(q,"__wrapped__");if(Ls||Js){var Ri=Ls?D.value():D,ei=Js?q.value():q;return qt||(qt=new xc),gt(Ri,ei,be,We,qt)}}return cs?(qt||(qt=new xc),XT(D,q,be,We,gt,qt)):!1}function $T(D){return Xo(D)&&Kl(D)==et}function V1(D,q,be,We){var gt=be.length,qt=gt,hn=!We;if(D==null)return!qt;for(D=Ss(D);gt--;){var Pn=be[gt];if(hn&&Pn[2]?Pn[1]!==D[Pn[0]]:!(Pn[0]in D))return!1}for(;++gt<qt;){Pn=be[gt];var qn=Pn[0],Or=D[qn],Mr=Pn[1];if(hn&&Pn[2]){if(Or===n&&!(qn in D))return!1}else{var zr=new xc;if(We)var cs=We(Or,Mr,qn,D,q,zr);if(!(cs===n?_d(Mr,Or,v|w,We,zr):cs))return!1}}return!0}function v8(D){if(!Bo(D)||JT(D))return!1;var q=Fx(D)?jT:hr;return q.test(Um(D))}function R2(D){return Xo(D)&&ql(D)==Kt}function lh(D){return Xo(D)&&Kl(D)==wt}function L2(D){return Xo(D)&&bI(D.length)&&!!Je[ql(D)]}function W1(D){return typeof D=="function"?D:D==null?Md:typeof D=="object"?Ni(D)?to(D[0],D[1]):X5(D):ude(D)}function Sp(D){if(!Ep(D))return M1(D);var q=[];for(var be in Ss(D))Fi.call(D,be)&&be!="constructor"&&q.push(be);return q}function w8(D){if(!Bo(D))return nI(D);var q=Ep(D),be=[];for(var We in D)We=="constructor"&&(q||!Fi.call(D,We))||be.push(We);return be}function Dm(D,q){return D<q}function C8(D,q){var be=-1,We=Fd(D)?Wt(D.length):[];return oh(D,function(gt,qt,hn){We[++be]=q(gt,qt,hn)}),We}function X5(D){var q=K2(D);return q.length==1&&q[0][2]?h6(q[0][0],q[0][1]):function(be){return be===D||V1(be,D,q)}}function to(D,q){return ys(D)&&Q2(q)?h6(wf(D),q):function(be){var We=ZU(be,D);return We===n&&We===q?JU(be,D):_d(q,We,v|w)}}function Sx(D,q,be,We,gt){D!==q&&W5(q,function(qt,hn){if(gt||(gt=new xc),Bo(qt))S8(D,q,hn,be,Sx,We,gt);else{var Pn=We?We(hh(D,hn),qt,hn+"",D,q,gt):n;Pn===n&&(Pn=qt),P2(D,hn,Pn)}},Od)}function S8(D,q,be,We,gt,qt,hn){var Pn=hh(D,be),qn=hh(q,be),Or=hn.get(qn);if(Or){P2(D,be,Or);return}var Mr=qt?qt(Pn,qn,be+"",D,q,hn):n,zr=Mr===n;if(zr){var cs=Ni(qn),Ls=!cs&&sb(qn),Js=!cs&&!Ls&&O6(qn);Mr=qn,cs||Ls||Js?Ni(Pn)?Mr=Pn:hl(Pn)?Mr=$c(Pn):Ls?(zr=!1,Mr=I8(qn,!0)):Js?(zr=!1,Mr=WT(qn,!0)):Mr=[]:c7(qn)||iv(qn)?(Mr=Pn,iv(Pn)?Mr=ede(Pn):(!Bo(Pn)||Fx(Pn))&&(Mr=Yl(qn))):zr=!1}zr&&(hn.set(qn,Mr),gt(Mr,qn,We,qt,hn),hn.delete(qn)),P2(D,be,Mr)}function Q5(D,q){var be=D.length;if(be)return q+=q<0?be:0,no(q,be)?D[q]:n}function D2(D,q,be){q.length?q=Zn(q,function(qt){return Ni(qt)?function(hn){return vp(hn,qt.length===1?qt[0]:qt)}:qt}):q=[Md];var We=-1;q=Zn(q,gs(qs()));var gt=C8(D,function(qt,hn,Pn){var qn=Zn(q,function(Or){return Or(qt)});return{criteria:qn,index:++We,value:qt}});return Hn(gt,function(qt,hn){return IU(qt,hn,be)})}function N8(D,q){return Bm(D,q,function(be,We){return JU(D,We)})}function Bm(D,q,be){for(var We=-1,gt=q.length,qt={};++We<gt;){var hn=q[We],Pn=vp(D,hn);be(Pn,hn)&&Ax(qt,uh(hn,D),Pn)}return qt}function ho(D){return function(q){return vp(q,D)}}function Do(D,q,be,We){var gt=We?Fr:Wn,qt=-1,hn=q.length,Pn=D;for(D===q&&(q=$c(q)),be&&(Pn=Zn(D,gs(be)));++qt<hn;)for(var qn=0,Or=q[qt],Mr=be?be(Or):Or;(qn=gt(Pn,Mr,qn,We))>-1;)Pn!==D&&F5.call(Pn,qn,1),F5.call(D,qn,1);return D}function ul(D,q){for(var be=D?q.length:0,We=be-1;be--;){var gt=q[be];if(be==We||gt!==qt){var qt=gt;no(gt)?F5.call(D,gt,1):e6(D,gt)}}return D}function q1(D,q){return D+Tm(_2()*(q-D+1))}function B2(D,q,be,We){for(var gt=-1,qt=Ko(mx((q-D)/(be||1)),0),hn=Wt(qt);qt--;)hn[We?qt:++gt]=D,D+=be;return hn}function Nx(D,q){var be="";if(!D||q<1||q>G)return be;do q%2&&(be+=D),q=Tm(q/2),q&&(D+=D);while(q);return be}function Oi(D,q){return Wu(p6(D,q,Md),D+"")}function bc(D){return sh(M6(D))}function A8(D,q){var be=M6(D);return m6(be,yp(q,0,be.length))}function Ax(D,q,be,We){if(!Bo(D))return D;q=uh(q,D);for(var gt=-1,qt=q.length,hn=qt-1,Pn=D;Pn!=null&&++gt<qt;){var qn=wf(q[gt]),Or=be;if(qn==="__proto__"||qn==="constructor"||qn==="prototype")return D;if(gt!=hn){var Mr=Pn[qn];Or=We?We(Mr,qn,Pn):n,Or===n&&(Or=Bo(Mr)?Mr:no(q[gt+1])?[]:{})}vx(Pn,qn,Or),Pn=Pn[qn]}return D}var Z5=L5?function(D,q){return L5.set(D,q),D}:Md,ch=E2?function(D,q){return E2(D,"toString",{configurable:!0,enumerable:!1,value:tz(q),writable:!0})}:Md;function kd(D){return m6(M6(D))}function yc(D,q,be){var We=-1,gt=D.length;q<0&&(q=-q>gt?0:gt+q),be=be>gt?gt:be,be<0&&(be+=gt),gt=q>be?0:be-q>>>0,q>>>=0;for(var qt=Wt(gt);++We<gt;)qt[We]=D[We+q];return qt}function j8(D,q){var be;return oh(D,function(We,gt,qt){return be=q(We,gt,qt),!be}),!!be}function G1(D,q,be){var We=0,gt=D==null?We:D.length;if(typeof q=="number"&&q===q&&gt<=Ne){for(;We<gt;){var qt=We+gt>>>1,hn=D[qt];hn!==null&&!Nf(hn)&&(be?hn<=q:hn<q)?We=qt+1:gt=qt}return gt}return J5(D,q,Md,be)}function J5(D,q,be,We){var gt=0,qt=D==null?0:D.length;if(qt===0)return 0;q=be(q);for(var hn=q!==q,Pn=q===null,qn=Nf(q),Or=q===n;gt<qt;){var Mr=Tm((gt+qt)/2),zr=be(D[Mr]),cs=zr!==n,Ls=zr===null,Js=zr===zr,Ri=Nf(zr);if(hn)var ei=We||Js;else Or?ei=Js&&(We||cs):Pn?ei=Js&&cs&&(We||!Ls):qn?ei=Js&&cs&&!Ls&&(We||!Ri):Ls||Ri?ei=!1:ei=We?zr<=q:zr<q;ei?gt=Mr+1:qt=Mr}return hc(qt,fe)}function E8(D,q){for(var be=-1,We=D.length,gt=0,qt=[];++be<We;){var hn=D[be],Pn=q?q(hn):hn;if(!be||!kp(Pn,qn)){var qn=Pn;qt[gt++]=hn===0?0:hn}}return qt}function _8(D){return typeof D=="number"?D:Nf(D)?te:+D}function hu(D){if(typeof D=="string")return D;if(Ni(D))return Zn(D,hu)+"";if(Nf(D))return D5?D5.call(D):"";var q=D+"";return q=="0"&&1/D==-1/0?"-0":q}function Np(D,q,be){var We=-1,gt=Ir,qt=D.length,hn=!0,Pn=[],qn=Pn;if(be)hn=!1,gt=br;else if(qt>=s){var Or=q?null:YT(D);if(Or)return y(Or);hn=!1,gt=$s,qn=new gx}else qn=q?[]:Pn;e:for(;++We<qt;){var Mr=D[We],zr=q?q(Mr):Mr;if(Mr=be||Mr!==0?Mr:0,hn&&zr===zr){for(var cs=qn.length;cs--;)if(qn[cs]===zr)continue e;q&&qn.push(zr),Pn.push(Mr)}else gt(qn,zr,be)||(qn!==Pn&&qn.push(zr),Pn.push(Mr))}return Pn}function e6(D,q){return q=uh(q,D),D=kl(D,q),D==null||delete D[wf(Hc(q))]}function k8(D,q,be,We){return Ax(D,q,be(vp(D,q)),We)}function $2(D,q,be,We){for(var gt=D.length,qt=We?gt:-1;(We?qt--:++qt<gt)&&q(D[qt],qt,D););return be?yc(D,We?0:qt,We?qt+1:gt):yc(D,We?qt+1:0,We?gt:qt)}function K1(D,q){var be=D;return be instanceof Si&&(be=be.value()),Qs(q,function(We,gt){return gt.func.apply(gt.thisArg,xs([We],gt.args))},be)}function t6(D,q,be){var We=D.length;if(We<2)return We?Np(D[0]):[];for(var gt=-1,qt=Wt(We);++gt<We;)for(var hn=D[gt],Pn=-1;++Pn<We;)Pn!=gt&&(qt[gt]=ah(qt[gt]||hn,D[Pn],q,be));return Np(Ao(qt,1),q,be)}function U2(D,q,be){for(var We=-1,gt=D.length,qt=q.length,hn={};++We<gt;){var Pn=We<qt?q[We]:n;be(hn,D[We],Pn)}return hn}function Y1(D){return hl(D)?D:[]}function n6(D){return typeof D=="function"?D:Md}function uh(D,q){return Ni(D)?D:ys(D,q)?[D]:K8(Ta(D))}var UT=Oi;function Ap(D,q,be){var We=D.length;return be=be===n?We:be,!q&&be>=We?D:yc(D,q,be)}var T8=_T||function(D){return yr.clearTimeout(D)};function I8(D,q){if(q)return D.slice();var be=D.length,We=d8?d8(be):new D.constructor(be);return D.copy(We),We}function z2(D){var q=new D.constructor(D.byteLength);return new j2(q).set(new j2(D)),q}function zT(D,q){var be=q?z2(D.buffer):D.buffer;return new D.constructor(be,D.byteOffset,D.byteLength)}function HT(D){var q=new D.constructor(D.source,In.exec(D));return q.lastIndex=D.lastIndex,q}function VT(D){return zu?Ss(zu.call(D)):{}}function WT(D,q){var be=q?z2(D.buffer):D.buffer;return new D.constructor(be,D.byteOffset,D.length)}function P8(D,q){if(D!==q){var be=D!==n,We=D===null,gt=D===D,qt=Nf(D),hn=q!==n,Pn=q===null,qn=q===q,Or=Nf(q);if(!Pn&&!Or&&!qt&&D>q||qt&&hn&&qn&&!Pn&&!Or||We&&hn&&qn||!be&&qn||!gt)return 1;if(!We&&!qt&&!Or&&D<q||Or&&be&&gt&&!We&&!qt||Pn&&be&&gt||!hn&&gt||!qn)return-1}return 0}function IU(D,q,be){for(var We=-1,gt=D.criteria,qt=q.criteria,hn=gt.length,Pn=be.length;++We<hn;){var qn=P8(gt[We],qt[We]);if(qn){if(We>=Pn)return qn;var Or=be[We];return qn*(Or=="desc"?-1:1)}}return D.index-q.index}function qT(D,q,be,We){for(var gt=-1,qt=D.length,hn=be.length,Pn=-1,qn=q.length,Or=Ko(qt-hn,0),Mr=Wt(qn+Or),zr=!We;++Pn<qn;)Mr[Pn]=q[Pn];for(;++gt<hn;)(zr||gt<qt)&&(Mr[be[gt]]=D[gt]);for(;Or--;)Mr[Pn++]=D[gt++];return Mr}function F8(D,q,be,We){for(var gt=-1,qt=D.length,hn=-1,Pn=be.length,qn=-1,Or=q.length,Mr=Ko(qt-Pn,0),zr=Wt(Mr+Or),cs=!We;++gt<Mr;)zr[gt]=D[gt];for(var Ls=gt;++qn<Or;)zr[Ls+qn]=q[qn];for(;++hn<Pn;)(cs||gt<qt)&&(zr[Ls+be[hn]]=D[gt++]);return zr}function $c(D,q){var be=-1,We=D.length;for(q||(q=Wt(We));++be<We;)q[be]=D[be];return q}function gf(D,q,be,We){var gt=!be;be||(be={});for(var qt=-1,hn=q.length;++qt<hn;){var Pn=q[qt],qn=We?We(be[Pn],D[Pn],Pn,be,D):n;qn===n&&(qn=D[Pn]),gt?ih(be,Pn,qn):vx(be,Pn,qn)}return be}function r6(D,q){return gf(D,bf(D),q)}function PU(D,q){return gf(D,QT(D),q)}function s6(D,q){return function(be,We){var gt=Ni(be)?jr:Hu,qt=q?q():{};return gt(be,D,qs(We,2),qt)}}function X1(D){return Oi(function(q,be){var We=-1,gt=be.length,qt=gt>1?be[gt-1]:n,hn=gt>2?be[2]:n;for(qt=D.length>3&&typeof qt=="function"?(gt--,qt):n,hn&&zc(be[0],be[1],hn)&&(qt=gt<3?n:qt,gt=1),q=Ss(q);++We<gt;){var Pn=be[We];Pn&&D(q,Pn,We,qt)}return q})}function Td(D,q){return function(be,We){if(be==null)return be;if(!Fd(be))return D(be,We);for(var gt=be.length,qt=q?gt:-1,hn=Ss(be);(q?qt--:++qt<gt)&&We(hn[qt],qt,hn)!==!1;);return be}}function i6(D){return function(q,be,We){for(var gt=-1,qt=Ss(q),hn=We(q),Pn=hn.length;Pn--;){var qn=hn[D?Pn:++gt];if(be(qt[qn],qn,qt)===!1)break}return q}}function a6(D,q,be){var We=q&C,gt=Q1(D);function qt(){var hn=this&&this!==yr&&this instanceof qt?gt:D;return hn.apply(We?be:this,arguments)}return qt}function O8(D){return function(q){q=Ta(q);var be=qo(q)?Y(q):n,We=be?be[0]:q.charAt(0),gt=be?Ap(be,1).join(""):q.slice(1);return We[D]()+gt}}function jx(D){return function(q){return Qs(lde(ode(q).replace(ur,"")),D,"")}}function Q1(D){return function(){var q=arguments;switch(q.length){case 0:return new D;case 1:return new D(q[0]);case 2:return new D(q[0],q[1]);case 3:return new D(q[0],q[1],q[2]);case 4:return new D(q[0],q[1],q[2],q[3]);case 5:return new D(q[0],q[1],q[2],q[3],q[4]);case 6:return new D(q[0],q[1],q[2],q[3],q[4],q[5]);case 7:return new D(q[0],q[1],q[2],q[3],q[4],q[5],q[6])}var be=B1(D.prototype),We=D.apply(be,q);return Bo(We)?We:be}}function M8(D,q,be){var We=Q1(D);function gt(){for(var qt=arguments.length,hn=Wt(qt),Pn=qt,qn=jp(gt);Pn--;)hn[Pn]=arguments[Pn];var Or=qt<3&&hn[0]!==qn&&hn[qt-1]!==qn?[]:dt(hn,qn);if(qt-=Or.length,qt<be)return Uc(D,q,Z1,gt.placeholder,n,hn,Or,n,n,be-qt);var Mr=this&&this!==yr&&this instanceof gt?We:D;return dr(Mr,this,hn)}return gt}function Ex(D){return function(q,be,We){var gt=Ss(q);if(!Fd(q)){var qt=qs(be,3);q=vc(q),be=function(Pn){return qt(gt[Pn],Pn,gt)}}var hn=D(q,be,We);return hn>-1?gt[qt?q[hn]:hn]:n}}function o6(D){return fh(function(q){var be=q.length,We=be,gt=pc.prototype.thru;for(D&&q.reverse();We--;){var qt=q[We];if(typeof qt!="function")throw new Ja(o);if(gt&&!hn&&J1(qt)=="wrapper")var hn=new pc([],!0)}for(We=hn?We:be;++We<be;){qt=q[We];var Pn=J1(qt),qn=Pn=="wrapper"?u6(qt):n;qn&&X2(qn[0])&&qn[1]==(L|I|O|z)&&!qn[4].length&&qn[9]==1?hn=hn[J1(qn[0])].apply(hn,qn[3]):hn=qt.length==1&&X2(qt)?hn[Pn]():hn.thru(qt)}return function(){var Or=arguments,Mr=Or[0];if(hn&&Or.length==1&&Ni(Mr))return hn.plant(Mr).value();for(var zr=0,cs=be?q[zr].apply(this,Or):Mr;++zr<be;)cs=q[zr].call(this,cs);return cs}})}function Z1(D,q,be,We,gt,qt,hn,Pn,qn,Or){var Mr=q&L,zr=q&C,cs=q&N,Ls=q&(I|R),Js=q&X,Ri=cs?n:Q1(D);function ei(){for(var Gi=arguments.length,Qi=Wt(Gi),Af=Gi;Af--;)Qi[Af]=arguments[Af];if(Ls)var Gu=jp(ei),jf=dc(Qi,Gu);if(We&&(Qi=qT(Qi,We,gt,Ls)),qt&&(Qi=F8(Qi,qt,hn,Ls)),Gi-=jf,Ls&&Gi<Or){var pl=dt(Qi,Gu);return Uc(D,q,Z1,ei.placeholder,be,Qi,pl,Pn,qn,Or-Gi)}var Tp=zr?be:this,Mx=cs?Tp[D]:D;return Gi=Qi.length,Pn?Qi=yf(Qi,Pn):Js&&Gi>1&&Qi.reverse(),Mr&&qn<Gi&&(Qi.length=qn),this&&this!==yr&&this instanceof ei&&(Mx=Ri||Q1(Mx)),Mx.apply(Tp,Qi)}return ei}function GT(D,q){return function(be,We){return wp(be,D,q(We),{})}}function H2(D,q){return function(be,We){var gt;if(be===n&&We===n)return q;if(be!==n&&(gt=be),We!==n){if(gt===n)return We;typeof be=="string"||typeof We=="string"?(be=hu(be),We=hu(We)):(be=_8(be),We=_8(We)),gt=D(be,We)}return gt}}function l6(D){return fh(function(q){return q=Zn(q,gs(qs())),Oi(function(be){var We=this;return D(q,function(gt){return dr(gt,We,be)})})})}function V2(D,q){q=q===n?" ":hu(q);var be=q.length;if(be<2)return be?Nx(q,D):q;var We=Nx(q,mx(D/H(q)));return qo(q)?Ap(Y(We),0,D).join(""):We.slice(0,D)}function KT(D,q,be,We){var gt=q&C,qt=Q1(D);function hn(){for(var Pn=-1,qn=arguments.length,Or=-1,Mr=We.length,zr=Wt(Mr+qn),cs=this&&this!==yr&&this instanceof hn?qt:D;++Or<Mr;)zr[Or]=We[Or];for(;qn--;)zr[Or++]=arguments[++Pn];return dr(cs,gt?be:this,zr)}return hn}function R8(D){return function(q,be,We){return We&&typeof We!="number"&&zc(q,be,We)&&(be=We=n),q=Ox(q),be===n?(be=q,q=0):be=Ox(be),We=We===n?q<be?1:-1:Ox(We),B2(q,be,We,D)}}function c6(D){return function(q,be){return typeof q=="string"&&typeof be=="string"||(q=ph(q),be=ph(be)),D(q,be)}}function Uc(D,q,be,We,gt,qt,hn,Pn,qn,Or){var Mr=q&I,zr=Mr?hn:n,cs=Mr?n:hn,Ls=Mr?qt:n,Js=Mr?n:qt;q|=Mr?O:U,q&=~(Mr?U:O),q&P||(q&=-4);var Ri=[D,q,gt,Ls,zr,Js,cs,Pn,qn,Or],ei=be.apply(n,Ri);return X2(D)&&q8(ei,Ri),ei.placeholder=We,G8(ei,D,q)}function Gl(D){var q=Ar[D];return function(be,We){if(be=ph(be),We=We==null?0:hc(Mi(We),292),We&&O1(be)){var gt=(Ta(be)+"e").split("e"),qt=q(gt[0]+"e"+(+gt[1]+We));return gt=(Ta(qt)+"e").split("e"),+(gt[0]+"e"+(+gt[1]-We))}return q(be)}}var YT=Im&&1/y(new Im([,-0]))[1]==oe?function(D){return new Im(D)}:sz;function L8(D){return function(q){var be=Kl(q);return be==et?bi(q):be==wt?E(q):ss(q,D(q))}}function dh(D,q,be,We,gt,qt,hn,Pn){var qn=q&N;if(!qn&&typeof D!="function")throw new Ja(o);var Or=We?We.length:0;if(Or||(q&=-97,We=gt=n),hn=hn===n?hn:Ko(Mi(hn),0),Pn=Pn===n?Pn:Mi(Pn),Or-=gt?gt.length:0,q&U){var Mr=We,zr=gt;We=gt=n}var cs=qn?n:u6(D),Ls=[D,q,be,We,gt,Mr,zr,qt,hn,Pn];if(cs&&tI(Ls,cs),D=Ls[0],q=Ls[1],be=Ls[2],We=Ls[3],gt=Ls[4],Pn=Ls[9]=Ls[9]===n?qn?0:D.length:Ko(Ls[9]-Or,0),!Pn&&q&(I|R)&&(q&=-25),!q||q==C)var Js=a6(D,q,be);else q==I||q==R?Js=M8(D,q,Pn):(q==O||q==(C|O))&&!gt.length?Js=KT(D,q,be,We):Js=Z1.apply(n,Ls);var Ri=cs?Z5:q8;return G8(Ri(Js,Ls),D,q)}function D8(D,q,be,We){return D===n||kp(D,ka[be])&&!Fi.call(We,be)?q:D}function B8(D,q,be,We,gt,qt){return Bo(D)&&Bo(q)&&(qt.set(q,D),Sx(D,q,n,B8,qt),qt.delete(q)),D}function $8(D){return c7(D)?n:D}function U8(D,q,be,We,gt,qt){var hn=be&v,Pn=D.length,qn=q.length;if(Pn!=qn&&!(hn&&qn>Pn))return!1;var Or=qt.get(D),Mr=qt.get(q);if(Or&&Mr)return Or==q&&Mr==D;var zr=-1,cs=!0,Ls=be&w?new gx:n;for(qt.set(D,q),qt.set(q,D);++zr<Pn;){var Js=D[zr],Ri=q[zr];if(We)var ei=hn?We(Ri,Js,zr,q,D,qt):We(Js,Ri,zr,D,q,qt);if(ei!==n){if(ei)continue;cs=!1;break}if(Ls){if(!Pr(q,function(Gi,Qi){if(!$s(Ls,Qi)&&(Js===Gi||gt(Js,Gi,be,We,qt)))return Ls.push(Qi)})){cs=!1;break}}else if(!(Js===Ri||gt(Js,Ri,be,We,qt))){cs=!1;break}}return qt.delete(D),qt.delete(q),cs}function z8(D,q,be,We,gt,qt,hn){switch(be){case Ye:if(D.byteLength!=q.byteLength||D.byteOffset!=q.byteOffset)return!1;D=D.buffer,q=q.buffer;case Zt:return!(D.byteLength!=q.byteLength||!qt(new j2(D),new j2(q)));case je:case Pe:case tt:return kp(+D,+q);case Xe:return D.name==q.name&&D.message==q.message;case Kt:case nn:return D==q+"";case et:var Pn=bi;case wt:var qn=We&v;if(Pn||(Pn=y),D.size!=q.size&&!qn)return!1;var Or=hn.get(D);if(Or)return Or==q;We|=w,hn.set(D,q);var Mr=U8(Pn(D),Pn(q),We,gt,qt,hn);return hn.delete(D),Mr;case cn:if(zu)return zu.call(D)==zu.call(q)}return!1}function XT(D,q,be,We,gt,qt){var hn=be&v,Pn=W2(D),qn=Pn.length,Or=W2(q),Mr=Or.length;if(qn!=Mr&&!hn)return!1;for(var zr=qn;zr--;){var cs=Pn[zr];if(!(hn?cs in q:Fi.call(q,cs)))return!1}var Ls=qt.get(D),Js=qt.get(q);if(Ls&&Js)return Ls==q&&Js==D;var Ri=!0;qt.set(D,q),qt.set(q,D);for(var ei=hn;++zr<qn;){cs=Pn[zr];var Gi=D[cs],Qi=q[cs];if(We)var Af=hn?We(Qi,Gi,cs,q,D,qt):We(Gi,Qi,cs,D,q,qt);if(!(Af===n?Gi===Qi||gt(Gi,Qi,be,We,qt):Af)){Ri=!1;break}ei||(ei=cs=="constructor")}if(Ri&&!ei){var Gu=D.constructor,jf=q.constructor;Gu!=jf&&"constructor"in D&&"constructor"in q&&!(typeof Gu=="function"&&Gu instanceof Gu&&typeof jf=="function"&&jf instanceof jf)&&(Ri=!1)}return qt.delete(D),qt.delete(q),Ri}function fh(D){return Wu(p6(D,n,g6),D+"")}function W2(D){return q5(D,vc,bf)}function q2(D){return q5(D,Od,QT)}var u6=L5?function(D){return L5.get(D)}:sz;function J1(D){for(var q=D.name+"",be=L1[q],We=Fi.call(L1,q)?be.length:0;We--;){var gt=be[We],qt=gt.func;if(qt==null||qt==D)return gt.name}return q}function jp(D){var q=Fi.call(Mt,"placeholder")?Mt:D;return q.placeholder}function qs(){var D=Mt.iteratee||nz;return D=D===nz?W1:D,arguments.length?D(arguments[0],arguments[1]):D}function G2(D,q){var be=D.__data__;return eb(q)?be[typeof q=="string"?"string":"hash"]:be.map}function K2(D){for(var q=vc(D),be=q.length;be--;){var We=q[be],gt=D[We];q[be]=[We,gt,Q2(gt)]}return q}function $m(D,q){var be=ba(D,q);return v8(be)?be:n}function d6(D){var q=Fi.call(D,px),be=D[px];try{D[px]=n;var We=!0}catch{}var gt=N2.call(D);return We&&(q?D[px]=be:delete D[px]),gt}var bf=O5?function(D){return D==null?[]:(D=Ss(D),rs(O5(D),function(q){return P5.call(D,q)}))}:iz,QT=O5?function(D){for(var q=[];D;)xs(q,bf(D)),D=mf(D);return q}:iz,Kl=ql;(k2&&Kl(new k2(new ArrayBuffer(1)))!=Ye||xx&&Kl(new xx)!=et||T2&&Kl(T2.resolve())!=ht||Im&&Kl(new Im)!=wt||I2&&Kl(new I2)!=Xt)&&(Kl=function(D){var q=ql(D),be=q==$e?D.constructor:n,We=be?Um(be):"";if(We)switch(We){case p8:return Ye;case Pm:return et;case TT:return ht;case D1:return wt;case th:return Xt}return q});function H8(D,q,be){for(var We=-1,gt=be.length;++We<gt;){var qt=be[We],hn=qt.size;switch(qt.type){case"drop":D+=hn;break;case"dropRight":q-=hn;break;case"take":q=hc(q,D+hn);break;case"takeRight":D=Ko(D,q-hn);break}}return{start:D,end:q}}function ZT(D){var q=D.match(sn);return q?q[1].split(Et):[]}function V8(D,q,be){q=uh(q,D);for(var We=-1,gt=q.length,qt=!1;++We<gt;){var hn=wf(q[We]);if(!(qt=D!=null&&be(D,hn)))break;D=D[hn]}return qt||++We!=gt?qt:(gt=D==null?0:D.length,!!gt&&bI(gt)&&no(hn,gt)&&(Ni(D)||iv(D)))}function Y2(D){var q=D.length,be=new D.constructor(q);return q&&typeof D[0]=="string"&&Fi.call(D,"index")&&(be.index=D.index,be.input=D.input),be}function Yl(D){return typeof D.constructor=="function"&&!Ep(D)?B1(mf(D)):{}}function FU(D,q,be){var We=D.constructor;switch(q){case Zt:return z2(D);case je:case Pe:return new We(+D);case Ye:return zT(D,be);case Ze:case Ft:case dn:case Yt:case Bt:case ot:case De:case _t:case ze:return WT(D,be);case et:return new We;case tt:case nn:return new We(D);case Kt:return HT(D);case wt:return new We;case cn:return VT(D)}}function OU(D,q){var be=q.length;if(!be)return D;var We=be-1;return q[We]=(be>1?"& ":"")+q[We],q=q.join(be>2?", ":" "),D.replace(Jt,`{
/* [wrapped with `+q+`] */
`)}function f6(D){return Ni(D)||iv(D)||!!(ET&&D&&D[ET])}function no(D,q){var be=typeof D;return q=q??G,!!q&&(be=="number"||be!="symbol"&&$n.test(D))&&D>-1&&D%1==0&&D<q}function zc(D,q,be){if(!Bo(be))return!1;var We=typeof q;return(We=="number"?Fd(be)&&no(q,be.length):We=="string"&&q in be)?kp(be[q],D):!1}function ys(D,q){if(Ni(D))return!1;var be=typeof D;return be=="number"||be=="symbol"||be=="boolean"||D==null||Nf(D)?!0:Gn.test(D)||!Vn.test(D)||q!=null&&D in Ss(q)}function eb(D){var q=typeof D;return q=="string"||q=="number"||q=="symbol"||q=="boolean"?D!=="__proto__":D===null}function X2(D){var q=J1(D),be=Mt[q];if(typeof be!="function"||!(q in Si.prototype))return!1;if(D===be)return!0;var We=u6(be);return!!We&&D===We[0]}function JT(D){return!!F1&&F1 in D}var MU=Go?Fx:az;function Ep(D){var q=D&&D.constructor,be=typeof q=="function"&&q.prototype||ka;return D===be}function Q2(D){return D===D&&!Bo(D)}function h6(D,q){return function(be){return be==null?!1:be[D]===q&&(q!==n||D in Ss(be))}}function eI(D){var q=Xr(D,function(We){return be.size===u&&be.clear(),We}),be=q.cache;return q}function tI(D,q){var be=D[1],We=q[1],gt=be|We,qt=gt<(C|N|L),hn=We==L&&be==I||We==L&&be==z&&D[7].length<=q[8]||We==(L|z)&&q[7].length<=q[8]&&be==I;if(!(qt||hn))return D;We&C&&(D[2]=q[2],gt|=be&C?0:P);var Pn=q[3];if(Pn){var qn=D[3];D[3]=qn?qT(qn,Pn,q[4]):Pn,D[4]=qn?dt(D[3],d):q[4]}return Pn=q[5],Pn&&(qn=D[5],D[5]=qn?F8(qn,Pn,q[6]):Pn,D[6]=qn?dt(D[5],d):q[6]),Pn=q[7],Pn&&(D[7]=Pn),We&L&&(D[8]=D[8]==null?q[8]:hc(D[8],q[8])),D[9]==null&&(D[9]=q[9]),D[0]=q[0],D[1]=gt,D}function nI(D){var q=[];if(D!=null)for(var be in Ss(D))q.push(be);return q}function W8(D){return N2.call(D)}function p6(D,q,be){return q=Ko(q===n?D.length-1:q,0),function(){for(var We=arguments,gt=-1,qt=Ko(We.length-q,0),hn=Wt(qt);++gt<qt;)hn[gt]=We[q+gt];gt=-1;for(var Pn=Wt(q+1);++gt<q;)Pn[gt]=We[gt];return Pn[q]=be(hn),dr(D,this,Pn)}}function kl(D,q){return q.length<2?D:vp(D,yc(q,0,-1))}function yf(D,q){for(var be=D.length,We=hc(q.length,be),gt=$c(D);We--;){var qt=q[We];D[We]=no(qt,be)?gt[qt]:n}return D}function hh(D,q){if(!(q==="constructor"&&typeof D[q]=="function")&&q!="__proto__")return D[q]}var q8=vf(Z5),tb=f8||function(D,q){return yr.setTimeout(D,q)},Wu=vf(ch);function G8(D,q,be){var We=q+"";return Wu(D,OU(We,rI(ZT(We),be)))}function vf(D){var q=0,be=0;return function(){var We=TU(),gt=re-(We-be);if(be=We,gt>0){if(++q>=K)return arguments[0]}else q=0;return D.apply(n,arguments)}}function m6(D,q){var be=-1,We=D.length,gt=We-1;for(q=q===n?We:q;++be<q;){var qt=q1(be,gt),hn=D[qt];D[qt]=D[be],D[be]=hn}return D.length=q,D}var K8=eI(function(D){var q=[];return D.charCodeAt(0)===46&&q.push(""),D.replace(Rn,function(be,We,gt,qt){q.push(gt?qt.replace(Dt,"$1"):We||be)}),q});function wf(D){if(typeof D=="string"||Nf(D))return D;var q=D+"";return q=="0"&&1/D==-1/0?"-0":q}function Um(D){if(D!=null){try{return Cd.call(D)}catch{}try{return D+""}catch{}}return""}function rI(D,q){return pr(me,function(be){var We="_."+be[0];q&be[1]&&!Ir(D,We)&&D.push(We)}),D.sort()}function sI(D){if(D instanceof Si)return D.clone();var q=new pc(D.__wrapped__,D.__chain__);return q.__actions__=$c(D.__actions__),q.__index__=D.__index__,q.__values__=D.__values__,q}function x6(D,q,be){(be?zc(D,q,be):q===n)?q=1:q=Ko(Mi(q),0);var We=D==null?0:D.length;if(!We||q<1)return[];for(var gt=0,qt=0,hn=Wt(mx(We/q));gt<We;)hn[qt++]=yc(D,gt,gt+=q);return hn}function Y8(D){for(var q=-1,be=D==null?0:D.length,We=0,gt=[];++q<be;){var qt=D[q];qt&&(gt[We++]=qt)}return gt}function Id(){var D=arguments.length;if(!D)return[];for(var q=Wt(D-1),be=arguments[0],We=D;We--;)q[We-1]=arguments[We];return xs(Ni(be)?$c(be):[be],Ao(q,1))}var Xi=Oi(function(D,q){return hl(D)?ah(D,Ao(q,1,hl,!0)):[]}),Tl=Oi(function(D,q){var be=Hc(q);return hl(be)&&(be=n),hl(D)?ah(D,Ao(q,1,hl,!0),qs(be,2)):[]}),Yo=Oi(function(D,q){var be=Hc(q);return hl(be)&&(be=n),hl(D)?ah(D,Ao(q,1,hl,!0),n,be):[]});function Xl(D,q,be){var We=D==null?0:D.length;return We?(q=be||q===n?1:Mi(q),yc(D,q<0?0:q,We)):[]}function qu(D,q,be){var We=D==null?0:D.length;return We?(q=be||q===n?1:Mi(q),q=We-q,yc(D,0,q<0?0:q)):[]}function nb(D,q){return D&&D.length?$2(D,qs(q,3),!0,!0):[]}function dl(D,q){return D&&D.length?$2(D,qs(q,3),!0):[]}function Z2(D,q,be,We){var gt=D==null?0:D.length;return gt?(be&&typeof be!="number"&&zc(D,q,be)&&(be=0,We=gt),DT(D,q,be,We)):[]}function zm(D,q,be){var We=D==null?0:D.length;if(!We)return-1;var gt=be==null?0:Mi(be);return gt<0&&(gt=Ko(We+gt,0)),tr(D,qs(q,3),gt)}function J2(D,q,be){var We=D==null?0:D.length;if(!We)return-1;var gt=We-1;return be!==n&&(gt=Mi(be),gt=be<0?Ko(We+gt,0):hc(gt,We-1)),tr(D,qs(q,3),gt,!0)}function g6(D){var q=D==null?0:D.length;return q?Ao(D,1):[]}function ev(D){var q=D==null?0:D.length;return q?Ao(D,oe):[]}function pu(D,q){var be=D==null?0:D.length;return be?(q=q===n?1:Mi(q),Ao(D,q)):[]}function X8(D){for(var q=-1,be=D==null?0:D.length,We={};++q<be;){var gt=D[q];We[gt[0]]=gt[1]}return We}function _x(D){return D&&D.length?D[0]:n}function _p(D,q,be){var We=D==null?0:D.length;if(!We)return-1;var gt=be==null?0:Mi(be);return gt<0&&(gt=Ko(We+gt,0)),Wn(D,q,gt)}function b6(D){var q=D==null?0:D.length;return q?yc(D,0,-1):[]}var Q8=Oi(function(D){var q=Zn(D,Y1);return q.length&&q[0]===D[0]?G5(q):[]}),Hm=Oi(function(D){var q=Hc(D),be=Zn(D,Y1);return q===Hc(be)?q=n:be.pop(),be.length&&be[0]===D[0]?G5(be,qs(q,2)):[]}),y6=Oi(function(D){var q=Hc(D),be=Zn(D,Y1);return q=typeof q=="function"?q:n,q&&be.pop(),be.length&&be[0]===D[0]?G5(be,n,q):[]});function Vm(D,q){return D==null?"":M5.call(D,q)}function Hc(D){var q=D==null?0:D.length;return q?D[q-1]:n}function tv(D,q,be){var We=D==null?0:D.length;if(!We)return-1;var gt=We;return be!==n&&(gt=Mi(be),gt=gt<0?Ko(We+gt,0):hc(gt,We-1)),q===q?$(D,q,gt):tr(D,Tr,gt,!0)}function Z8(D,q){return D&&D.length?Q5(D,Mi(q)):n}var v6=Oi(nv);function nv(D,q){return D&&D.length&&q&&q.length?Do(D,q):D}function Vc(D,q,be){return D&&D.length&&q&&q.length?Do(D,q,qs(be,2)):D}function Wm(D,q,be){return D&&D.length&&q&&q.length?Do(D,q,n,be):D}var Cf=fh(function(D,q){var be=D==null?0:D.length,We=V5(D,q);return ul(D,Zn(q,function(gt){return no(gt,be)?+gt:gt}).sort(P8)),We});function mu(D,q){var be=[];if(!(D&&D.length))return be;var We=-1,gt=[],qt=D.length;for(q=qs(q,3);++We<qt;){var hn=D[We];q(hn,We,D)&&(be.push(hn),gt.push(We))}return ul(D,gt),be}function w6(D){return D==null?D:R5.call(D)}function J8(D,q,be){var We=D==null?0:D.length;return We?(be&&typeof be!="number"&&zc(D,q,be)?(q=0,be=We):(q=q==null?0:Mi(q),be=be===n?We:Mi(be)),yc(D,q,be)):[]}function e7(D,q){return G1(D,q)}function RU(D,q,be){return J5(D,q,qs(be,2))}function qm(D,q){var be=D==null?0:D.length;if(be){var We=G1(D,q);if(We<be&&kp(D[We],q))return We}return-1}function iI(D,q){return G1(D,q,!0)}function t7(D,q,be){return J5(D,q,qs(be,2),!0)}function kx(D,q){var be=D==null?0:D.length;if(be){var We=G1(D,q,!0)-1;if(kp(D[We],q))return We}return-1}function n7(D){return D&&D.length?E8(D):[]}function Tx(D,q){return D&&D.length?E8(D,qs(q,2)):[]}function aI(D){var q=D==null?0:D.length;return q?yc(D,1,q):[]}function oI(D,q,be){return D&&D.length?(q=be||q===n?1:Mi(q),yc(D,0,q<0?0:q)):[]}function r7(D,q,be){var We=D==null?0:D.length;return We?(q=be||q===n?1:Mi(q),q=We-q,yc(D,q<0?0:q,We)):[]}function C6(D,q){return D&&D.length?$2(D,qs(q,3),!1,!0):[]}function LU(D,q){return D&&D.length?$2(D,qs(q,3)):[]}var DU=Oi(function(D){return Np(Ao(D,1,hl,!0))}),lI=Oi(function(D){var q=Hc(D);return hl(q)&&(q=n),Np(Ao(D,1,hl,!0),qs(q,2))}),cI=Oi(function(D){var q=Hc(D);return q=typeof q=="function"?q:n,Np(Ao(D,1,hl,!0),n,q)});function Ix(D){return D&&D.length?Np(D):[]}function BU(D,q){return D&&D.length?Np(D,qs(q,2)):[]}function rb(D,q){return q=typeof q=="function"?q:n,D&&D.length?Np(D,n,q):[]}function S6(D){if(!(D&&D.length))return[];var q=0;return D=rs(D,function(be){if(hl(be))return q=Ko(be.length,q),!0}),as(q,function(be){return Zn(D,Rs(be))})}function po(D,q){if(!(D&&D.length))return[];var be=S6(D);return q==null?be:Zn(be,function(We){return dr(q,n,We)})}var $U=Oi(function(D,q){return hl(D)?ah(D,q):[]}),uI=Oi(function(D){return t6(rs(D,hl))}),UU=Oi(function(D){var q=Hc(D);return hl(q)&&(q=n),t6(rs(D,hl),qs(q,2))}),zU=Oi(function(D){var q=Hc(D);return q=typeof q=="function"?q:n,t6(rs(D,hl),n,q)}),dI=Oi(S6);function fI(D,q){return U2(D||[],q||[],vx)}function HU(D,q){return U2(D||[],q||[],Ax)}var Pd=Oi(function(D){var q=D.length,be=q>1?D[q-1]:n;return be=typeof be=="function"?(D.pop(),be):n,po(D,be)});function N6(D){var q=Mt(D);return q.__chain__=!0,q}function VU(D,q){return q(D),D}function Sf(D,q){return q(D)}var A6=fh(function(D){var q=D.length,be=q?D[0]:0,We=this.__wrapped__,gt=function(qt){return V5(qt,D)};return q>1||this.__actions__.length||!(We instanceof Si)||!no(be)?this.thru(gt):(We=We.slice(be,+be+(q?1:0)),We.__actions__.push({func:Sf,args:[gt],thisArg:n}),new pc(We,this.__chain__).thru(function(qt){return q&&!qt.length&&qt.push(n),qt}))});function Px(){return N6(this)}function j6(){return new pc(this.value(),this.__chain__)}function s7(){this.__values__===n&&(this.__values__=Zue(this.value()));var D=this.__index__>=this.__values__.length,q=D?n:this.__values__[this.__index__++];return{done:D,value:q}}function i7(){return this}function WU(D){for(var q,be=this;be instanceof nh;){var We=sI(be);We.__index__=0,We.__values__=n,q?gt.__wrapped__=We:q=We;var gt=We;be=be.__wrapped__}return gt.__wrapped__=D,q}function a7(){var D=this.__wrapped__;if(D instanceof Si){var q=D;return this.__actions__.length&&(q=new Si(this)),q=q.reverse(),q.__actions__.push({func:Sf,args:[w6],thisArg:n}),new pc(q,this.__chain__)}return this.thru(w6)}function qU(){return K1(this.__wrapped__,this.__actions__)}var hI=s6(function(D,q,be){Fi.call(D,be)?++D[be]:ih(D,be,1)});function pI(D,q,be){var We=Ni(D)?Kr:O2;return be&&zc(D,q,be)&&(q=n),We(D,qs(q,3))}function E6(D,q){var be=Ni(D)?rs:b8;return be(D,qs(q,3))}var _6=Ex(zm),mI=Ex(J2);function o7(D,q){return Ao(P6(D,q),1)}function xI(D,q){return Ao(P6(D,q),oe)}function l7(D,q,be){return be=be===n?1:Mi(be),Ao(P6(D,q),be)}function rv(D,q){var be=Ni(D)?pr:oh;return be(D,qs(q,3))}function k6(D,q){var be=Ni(D)?fr:LT;return be(D,qs(q,3))}var T6=s6(function(D,q,be){Fi.call(D,be)?D[be].push(q):ih(D,be,[q])});function gI(D,q,be,We){D=Fd(D)?D:M6(D),be=be&&!We?Mi(be):0;var gt=D.length;return be<0&&(be=Ko(gt+be,0)),yI(D)?be<=gt&&D.indexOf(q,be)>-1:!!gt&&Wn(D,q,be)>-1}var GU=Oi(function(D,q,be){var We=-1,gt=typeof q=="function",qt=Fd(D)?Wt(D.length):[];return oh(D,function(hn){qt[++We]=gt?dr(q,hn,be):Ed(hn,q,be)}),qt}),I6=s6(function(D,q,be){ih(D,be,q)});function P6(D,q){var be=Ni(D)?Zn:C8;return be(D,qs(q,3))}function sv(D,q,be,We){return D==null?[]:(Ni(q)||(q=q==null?[]:[q]),be=We?n:be,Ni(be)||(be=be==null?[]:[be]),D2(D,q,be))}var KU=s6(function(D,q,be){D[be?0:1].push(q)},function(){return[[],[]]});function F6(D,q,be){var We=Ni(D)?Qs:or,gt=arguments.length<3;return We(D,qs(q,4),be,gt,oh)}function A(D,q,be){var We=Ni(D)?ai:or,gt=arguments.length<3;return We(D,qs(q,4),be,gt,LT)}function M(D,q){var be=Ni(D)?rs:b8;return be(D,Ps(qs(q,3)))}function Z(D){var q=Ni(D)?sh:bc;return q(D)}function pe(D,q,be){(be?zc(D,q,be):q===n)?q=1:q=Mi(q);var We=Ni(D)?yx:A8;return We(D,q)}function Ie(D){var q=Ni(D)?MT:kd;return q(D)}function Ve(D){if(D==null)return 0;if(Fd(D))return yI(D)?H(D):D.length;var q=Kl(D);return q==et||q==wt?D.size:Sp(D).length}function Nt(D,q,be){var We=Ni(D)?Pr:j8;return be&&zc(D,q,be)&&(q=n),We(D,qs(q,3))}var fn=Oi(function(D,q){if(D==null)return[];var be=q.length;return be>1&&zc(D,q[0],q[1])?q=[]:be>2&&zc(q[0],q[1],q[2])&&(q=[q[0]]),D2(D,Ao(q,1),[])}),_n=qa||function(){return yr.Date.now()};function lr(D,q){if(typeof q!="function")throw new Ja(o);return D=Mi(D),function(){if(--D<1)return q.apply(this,arguments)}}function $r(D,q,be){return q=be?n:q,q=D&&q==null?D.length:q,dh(D,L,n,n,n,n,q)}function Vr(D,q){var be;if(typeof q!="function")throw new Ja(o);return D=Mi(D),function(){return--D>0&&(be=q.apply(this,arguments)),D<=1&&(q=n),be}}var Br=Oi(function(D,q,be){var We=C;if(be.length){var gt=dt(be,jp(Br));We|=O}return dh(D,We,q,be,gt)}),fs=Oi(function(D,q,be){var We=C|N;if(be.length){var gt=dt(be,jp(fs));We|=O}return dh(q,We,D,be,gt)});function Ns(D,q,be){q=be?n:q;var We=dh(D,I,n,n,n,n,n,q);return We.placeholder=Ns.placeholder,We}function Is(D,q,be){q=be?n:q;var We=dh(D,R,n,n,n,n,n,q);return We.placeholder=Is.placeholder,We}function jo(D,q,be){var We,gt,qt,hn,Pn,qn,Or=0,Mr=!1,zr=!1,cs=!0;if(typeof D!="function")throw new Ja(o);q=ph(q)||0,Bo(be)&&(Mr=!!be.leading,zr="maxWait"in be,qt=zr?Ko(ph(be.maxWait)||0,q):qt,cs="trailing"in be?!!be.trailing:cs);function Ls(pl){var Tp=We,Mx=gt;return We=gt=n,Or=pl,hn=D.apply(Mx,Tp),hn}function Js(pl){return Or=pl,Pn=tb(Gi,q),Mr?Ls(pl):hn}function Ri(pl){var Tp=pl-qn,Mx=pl-Or,dde=q-Tp;return zr?hc(dde,qt-Mx):dde}function ei(pl){var Tp=pl-qn,Mx=pl-Or;return qn===n||Tp>=q||Tp<0||zr&&Mx>=qt}function Gi(){var pl=_n();if(ei(pl))return Qi(pl);Pn=tb(Gi,Ri(pl))}function Qi(pl){return Pn=n,cs&&We?Ls(pl):(We=gt=n,hn)}function Af(){Pn!==n&&T8(Pn),Or=0,We=qn=gt=Pn=n}function Gu(){return Pn===n?hn:Qi(_n())}function jf(){var pl=_n(),Tp=ei(pl);if(We=arguments,gt=this,qn=pl,Tp){if(Pn===n)return Js(qn);if(zr)return T8(Pn),Pn=tb(Gi,q),Ls(qn)}return Pn===n&&(Pn=tb(Gi,q)),hn}return jf.cancel=Af,jf.flush=Gu,jf}var Jn=Oi(function(D,q){return g8(D,1,q)}),Mn=Oi(function(D,q,be){return g8(D,ph(q)||0,be)});function sr(D){return dh(D,X)}function Xr(D,q){if(typeof D!="function"||q!=null&&typeof q!="function")throw new Ja(o);var be=function(){var We=arguments,gt=q?q.apply(this,We):We[0],qt=be.cache;if(qt.has(gt))return qt.get(gt);var hn=D.apply(this,We);return be.cache=qt.set(gt,hn)||qt,hn};return be.cache=new(Xr.Cache||Sd),be}Xr.Cache=Sd;function Ps(D){if(typeof D!="function")throw new Ja(o);return function(){var q=arguments;switch(q.length){case 0:return!D.call(this);case 1:return!D.call(this,q[0]);case 2:return!D.call(this,q[0],q[1]);case 3:return!D.call(this,q[0],q[1],q[2])}return!D.apply(this,q)}}function Hs(D){return Vr(2,D)}var Vs=UT(function(D,q){q=q.length==1&&Ni(q[0])?Zn(q[0],gs(qs())):Zn(Ao(q,1),gs(qs()));var be=q.length;return Oi(function(We){for(var gt=-1,qt=hc(We.length,be);++gt<qt;)We[gt]=q[gt].call(this,We[gt]);return dr(D,this,We)})}),Xs=Oi(function(D,q){var be=dt(q,jp(Xs));return dh(D,O,n,q,be)}),fl=Oi(function(D,q){var be=dt(q,jp(fl));return dh(D,U,n,q,be)}),aa=fh(function(D,q){return dh(D,z,n,n,n,q)});function Gm(D,q){if(typeof D!="function")throw new Ja(o);return q=q===n?q:Mi(q),Oi(D,q)}function YU(D,q){if(typeof D!="function")throw new Ja(o);return q=q==null?0:Ko(Mi(q),0),Oi(function(be){var We=be[q],gt=Ap(be,0,q);return We&&xs(gt,We),dr(D,this,gt)})}function NWe(D,q,be){var We=!0,gt=!0;if(typeof D!="function")throw new Ja(o);return Bo(be)&&(We="leading"in be?!!be.leading:We,gt="trailing"in be?!!be.trailing:gt),jo(D,q,{leading:We,maxWait:q,trailing:gt})}function AWe(D){return $r(D,1)}function jWe(D,q){return Xs(n6(q),D)}function EWe(){if(!arguments.length)return[];var D=arguments[0];return Ni(D)?D:[D]}function _We(D){return fu(D,g)}function kWe(D,q){return q=typeof q=="function"?q:n,fu(D,g,q)}function TWe(D){return fu(D,f|g)}function IWe(D,q){return q=typeof q=="function"?q:n,fu(D,f|g,q)}function PWe(D,q){return q==null||F2(D,q,vc(q))}function kp(D,q){return D===q||D!==D&&q!==q}var FWe=c6(Lm),OWe=c6(function(D,q){return D>=q}),iv=K5(function(){return arguments}())?K5:function(D){return Xo(D)&&Fi.call(D,"callee")&&!P5.call(D,"callee")},Ni=Wt.isArray,MWe=de?gs(de):BT;function Fd(D){return D!=null&&bI(D.length)&&!Fx(D)}function hl(D){return Xo(D)&&Fd(D)}function RWe(D){return D===!0||D===!1||Xo(D)&&ql(D)==je}var sb=h8||az,LWe=st?gs(st):Cp;function DWe(D){return Xo(D)&&D.nodeType===1&&!c7(D)}function BWe(D){if(D==null)return!0;if(Fd(D)&&(Ni(D)||typeof D=="string"||typeof D.splice=="function"||sb(D)||O6(D)||iv(D)))return!D.length;var q=Kl(D);if(q==et||q==wt)return!D.size;if(Ep(D))return!Sp(D).length;for(var be in D)if(Fi.call(D,be))return!1;return!0}function $We(D,q){return _d(D,q)}function UWe(D,q,be){be=typeof be=="function"?be:n;var We=be?be(D,q):n;return We===n?_d(D,q,n,be):!!We}function XU(D){if(!Xo(D))return!1;var q=ql(D);return q==Xe||q==Re||typeof D.message=="string"&&typeof D.name=="string"&&!c7(D)}function zWe(D){return typeof D=="number"&&O1(D)}function Fx(D){if(!Bo(D))return!1;var q=ql(D);return q==Ke||q==ut||q==ye||q==pt}function Kue(D){return typeof D=="number"&&D==Mi(D)}function bI(D){return typeof D=="number"&&D>-1&&D%1==0&&D<=G}function Bo(D){var q=typeof D;return D!=null&&(q=="object"||q=="function")}function Xo(D){return D!=null&&typeof D=="object"}var Yue=Ct?gs(Ct):$T;function HWe(D,q){return D===q||V1(D,q,K2(q))}function VWe(D,q,be){return be=typeof be=="function"?be:n,V1(D,q,K2(q),be)}function WWe(D){return Xue(D)&&D!=+D}function qWe(D){if(MU(D))throw new mr(a);return v8(D)}function GWe(D){return D===null}function KWe(D){return D==null}function Xue(D){return typeof D=="number"||Xo(D)&&ql(D)==tt}function c7(D){if(!Xo(D)||ql(D)!=$e)return!1;var q=mf(D);if(q===null)return!0;var be=Fi.call(q,"constructor")&&q.constructor;return typeof be=="function"&&be instanceof be&&Cd.call(be)==T5}var QU=vt?gs(vt):R2;function YWe(D){return Kue(D)&&D>=-9007199254740991&&D<=G}var Que=ln?gs(ln):lh;function yI(D){return typeof D=="string"||!Ni(D)&&Xo(D)&&ql(D)==nn}function Nf(D){return typeof D=="symbol"||Xo(D)&&ql(D)==cn}var O6=pn?gs(pn):L2;function XWe(D){return D===n}function QWe(D){return Xo(D)&&Kl(D)==Xt}function ZWe(D){return Xo(D)&&ql(D)==on}var JWe=c6(Dm),eqe=c6(function(D,q){return D<=q});function Zue(D){if(!D)return[];if(Fd(D))return yI(D)?Y(D):$c(D);if(gp&&D[gp])return Wl(D[gp]());var q=Kl(D),be=q==et?bi:q==wt?y:M6;return be(D)}function Ox(D){if(!D)return D===0?D:0;if(D=ph(D),D===oe||D===-1/0){var q=D<0?-1:1;return q*V}return D===D?D:0}function Mi(D){var q=Ox(D),be=q%1;return q===q?be?q-be:q:0}function Jue(D){return D?yp(Mi(D),0,ae):0}function ph(D){if(typeof D=="number")return D;if(Nf(D))return te;if(Bo(D)){var q=typeof D.valueOf=="function"?D.valueOf():D;D=Bo(q)?q+"":q}if(typeof D!="string")return D===0?D:+D;D=ms(D);var be=ar.test(D);return be||Gt.test(D)?cr(D.slice(2),be?2:8):Qn.test(D)?te:+D}function ede(D){return gf(D,Od(D))}function tqe(D){return D?yp(Mi(D),-9007199254740991,G):D===0?D:0}function Ta(D){return D==null?"":hu(D)}var nqe=X1(function(D,q){if(Ep(q)||Fd(q)){gf(q,vc(q),D);return}for(var be in q)Fi.call(q,be)&&vx(D,be,q[be])}),tde=X1(function(D,q){gf(q,Od(q),D)}),vI=X1(function(D,q,be,We){gf(q,Od(q),D,We)}),rqe=X1(function(D,q,be,We){gf(q,vc(q),D,We)}),sqe=fh(V5);function iqe(D,q){var be=B1(D);return q==null?be:Ka(be,q)}var aqe=Oi(function(D,q){D=Ss(D);var be=-1,We=q.length,gt=We>2?q[2]:n;for(gt&&zc(q[0],q[1],gt)&&(We=1);++be<We;)for(var qt=q[be],hn=Od(qt),Pn=-1,qn=hn.length;++Pn<qn;){var Or=hn[Pn],Mr=D[Or];(Mr===n||kp(Mr,ka[Or])&&!Fi.call(D,Or))&&(D[Or]=qt[Or])}return D}),oqe=Oi(function(D){return D.push(n,B8),dr(nde,n,D)});function lqe(D,q){return Ut(D,qs(q,3),Vu)}function cqe(D,q){return Ut(D,qs(q,3),Rm)}function uqe(D,q){return D==null?D:W5(D,qs(q,3),Od)}function dqe(D,q){return D==null?D:M2(D,qs(q,3),Od)}function fqe(D,q){return D&&Vu(D,qs(q,3))}function hqe(D,q){return D&&Rm(D,qs(q,3))}function pqe(D){return D==null?[]:H1(D,vc(D))}function mqe(D){return D==null?[]:H1(D,Od(D))}function ZU(D,q,be){var We=D==null?n:vp(D,q);return We===n?be:We}function xqe(D,q){return D!=null&&V8(D,q,jd)}function JU(D,q){return D!=null&&V8(D,q,Cx)}var gqe=GT(function(D,q,be){q!=null&&typeof q.toString!="function"&&(q=N2.call(q)),D[q]=be},tz(Md)),bqe=GT(function(D,q,be){q!=null&&typeof q.toString!="function"&&(q=N2.call(q)),Fi.call(D,q)?D[q].push(be):D[q]=[be]},qs),yqe=Oi(Ed);function vc(D){return Fd(D)?rh(D):Sp(D)}function Od(D){return Fd(D)?rh(D,!0):w8(D)}function vqe(D,q){var be={};return q=qs(q,3),Vu(D,function(We,gt,qt){ih(be,q(We,gt,qt),We)}),be}function wqe(D,q){var be={};return q=qs(q,3),Vu(D,function(We,gt,qt){ih(be,gt,q(We,gt,qt))}),be}var Cqe=X1(function(D,q,be){Sx(D,q,be)}),nde=X1(function(D,q,be,We){Sx(D,q,be,We)}),Sqe=fh(function(D,q){var be={};if(D==null)return be;var We=!1;q=Zn(q,function(qt){return qt=uh(qt,D),We||(We=qt.length>1),qt}),gf(D,q2(D),be),We&&(be=fu(be,f|x|g,$8));for(var gt=q.length;gt--;)e6(be,q[gt]);return be});function Nqe(D,q){return rde(D,Ps(qs(q)))}var Aqe=fh(function(D,q){return D==null?{}:N8(D,q)});function rde(D,q){if(D==null)return{};var be=Zn(q2(D),function(We){return[We]});return q=qs(q),Bm(D,be,function(We,gt){return q(We,gt[0])})}function jqe(D,q,be){q=uh(q,D);var We=-1,gt=q.length;for(gt||(gt=1,D=n);++We<gt;){var qt=D==null?n:D[wf(q[We])];qt===n&&(We=gt,qt=be),D=Fx(qt)?qt.call(D):qt}return D}function Eqe(D,q,be){return D==null?D:Ax(D,q,be)}function _qe(D,q,be,We){return We=typeof We=="function"?We:n,D==null?D:Ax(D,q,be,We)}var sde=L8(vc),ide=L8(Od);function kqe(D,q,be){var We=Ni(D),gt=We||sb(D)||O6(D);if(q=qs(q,4),be==null){var qt=D&&D.constructor;gt?be=We?new qt:[]:Bo(D)?be=Fx(qt)?B1(mf(D)):{}:be={}}return(gt?pr:Vu)(D,function(hn,Pn,qn){return q(be,hn,Pn,qn)}),be}function Tqe(D,q){return D==null?!0:e6(D,q)}function Iqe(D,q,be){return D==null?D:k8(D,q,n6(be))}function Pqe(D,q,be,We){return We=typeof We=="function"?We:n,D==null?D:k8(D,q,n6(be),We)}function M6(D){return D==null?[]:Ui(D,vc(D))}function Fqe(D){return D==null?[]:Ui(D,Od(D))}function Oqe(D,q,be){return be===n&&(be=q,q=n),be!==n&&(be=ph(be),be=be===be?be:0),q!==n&&(q=ph(q),q=q===q?q:0),yp(ph(D),q,be)}function Mqe(D,q,be){return q=Ox(q),be===n?(be=q,q=0):be=Ox(be),D=ph(D),y8(D,q,be)}function Rqe(D,q,be){if(be&&typeof be!="boolean"&&zc(D,q,be)&&(q=be=n),be===n&&(typeof q=="boolean"?(be=q,q=n):typeof D=="boolean"&&(be=D,D=n)),D===n&&q===n?(D=0,q=1):(D=Ox(D),q===n?(q=D,D=0):q=Ox(q)),D>q){var We=D;D=q,q=We}if(be||D%1||q%1){var gt=_2();return hc(D+gt*(q-D+Ur("1e-"+((gt+"").length-1))),q)}return q1(D,q)}var Lqe=jx(function(D,q,be){return q=q.toLowerCase(),D+(be?ade(q):q)});function ade(D){return ez(Ta(D).toLowerCase())}function ode(D){return D=Ta(D),D&&D.replace(nr,_s).replace(_r,"")}function Dqe(D,q,be){D=Ta(D),q=hu(q);var We=D.length;be=be===n?We:yp(Mi(be),0,We);var gt=be;return be-=q.length,be>=0&&D.slice(be,gt)==q}function Bqe(D){return D=Ta(D),D&&xn.test(D)?D.replace(un,_a):D}function $qe(D){return D=Ta(D),D&&Cn.test(D)?D.replace(Yn,"\\$&"):D}var Uqe=jx(function(D,q,be){return D+(be?"-":"")+q.toLowerCase()}),zqe=jx(function(D,q,be){return D+(be?" ":"")+q.toLowerCase()}),Hqe=O8("toLowerCase");function Vqe(D,q,be){D=Ta(D),q=Mi(q);var We=q?H(D):0;if(!q||We>=q)return D;var gt=(q-We)/2;return V2(Tm(gt),be)+D+V2(mx(gt),be)}function Wqe(D,q,be){D=Ta(D),q=Mi(q);var We=q?H(D):0;return q&&We<q?D+V2(q-We,be):D}function qqe(D,q,be){D=Ta(D),q=Mi(q);var We=q?H(D):0;return q&&We<q?V2(q-We,be)+D:D}function Gqe(D,q,be){return be||q==null?q=0:q&&(q=+q),kT(Ta(D).replace(rn,""),q||0)}function Kqe(D,q,be){return(be?zc(D,q,be):q===n)?q=1:q=Mi(q),Nx(Ta(D),q)}function Yqe(){var D=arguments,q=Ta(D[0]);return D.length<3?q:q.replace(D[1],D[2])}var Xqe=jx(function(D,q,be){return D+(be?"_":"")+q.toLowerCase()});function Qqe(D,q,be){return be&&typeof be!="number"&&zc(D,q,be)&&(q=be=n),be=be===n?ae:be>>>0,be?(D=Ta(D),D&&(typeof q=="string"||q!=null&&!QU(q))&&(q=hu(q),!q&&qo(D))?Ap(Y(D),0,be):D.split(q,be)):[]}var Zqe=jx(function(D,q,be){return D+(be?" ":"")+ez(q)});function Jqe(D,q,be){return D=Ta(D),be=be==null?0:yp(Mi(be),0,D.length),q=hu(q),D.slice(be,be+q.length)==q}function eGe(D,q,be){var We=Mt.templateSettings;be&&zc(D,q,be)&&(q=n),D=Ta(D),q=vI({},q,We,D8);var gt=vI({},q.imports,We.imports,D8),qt=vc(gt),hn=Ui(gt,qt),Pn,qn,Or=0,Mr=q.interpolate||Rt,zr="__p += '",cs=Zs((q.escape||Rt).source+"|"+Mr.source+"|"+(Mr===yn?en:Rt).source+"|"+(q.evaluate||Rt).source+"|$","g"),Ls="//# sourceURL="+(Fi.call(q,"sourceURL")?(q.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ds+"]")+`
`;D.replace(cs,function(ei,Gi,Qi,Af,Gu,jf){return Qi||(Qi=Af),zr+=D.slice(Or,jf).replace(En,$u),Gi&&(Pn=!0,zr+=`' +
__e(`+Gi+`) +
'`),Gu&&(qn=!0,zr+=`';
`+Gu+`;
__p += '`),Qi&&(zr+=`' +
((__t = (`+Qi+`)) == null ? '' : __t) +
'`),Or=jf+ei.length,ei}),zr+=`';
`;var Js=Fi.call(q,"variable")&&q.variable;if(!Js)zr=`with (obj) {
`+zr+`
}
`;else if(gn.test(Js))throw new mr(l);zr=(qn?zr.replace(nt,""):zr).replace(mt,"$1").replace($t,"$1;"),zr="function("+(Js||"obj")+`) {
`+(Js?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(Pn?", __e = _.escape":"")+(qn?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+zr+`return __p
}`;var Ri=cde(function(){return Sr(qt,Ls+"return "+zr).apply(n,hn)});if(Ri.source=zr,XU(Ri))throw Ri;return Ri}function tGe(D){return Ta(D).toLowerCase()}function nGe(D){return Ta(D).toUpperCase()}function rGe(D,q,be){if(D=Ta(D),D&&(be||q===n))return ms(D);if(!D||!(q=hu(q)))return D;var We=Y(D),gt=Y(q),qt=bs(We,gt),hn=Cs(We,gt)+1;return Ap(We,qt,hn).join("")}function sGe(D,q,be){if(D=Ta(D),D&&(be||q===n))return D.slice(0,le(D)+1);if(!D||!(q=hu(q)))return D;var We=Y(D),gt=Cs(We,Y(q))+1;return Ap(We,0,gt).join("")}function iGe(D,q,be){if(D=Ta(D),D&&(be||q===n))return D.replace(rn,"");if(!D||!(q=hu(q)))return D;var We=Y(D),gt=bs(We,Y(q));return Ap(We,gt).join("")}function aGe(D,q){var be=ne,We=J;if(Bo(q)){var gt="separator"in q?q.separator:gt;be="length"in q?Mi(q.length):be,We="omission"in q?hu(q.omission):We}D=Ta(D);var qt=D.length;if(qo(D)){var hn=Y(D);qt=hn.length}if(be>=qt)return D;var Pn=be-H(We);if(Pn<1)return We;var qn=hn?Ap(hn,0,Pn).join(""):D.slice(0,Pn);if(gt===n)return qn+We;if(hn&&(Pn+=qn.length-Pn),QU(gt)){if(D.slice(Pn).search(gt)){var Or,Mr=qn;for(gt.global||(gt=Zs(gt.source,Ta(In.exec(gt))+"g")),gt.lastIndex=0;Or=gt.exec(Mr);)var zr=Or.index;qn=qn.slice(0,zr===n?Pn:zr)}}else if(D.indexOf(hu(gt),Pn)!=Pn){var cs=qn.lastIndexOf(gt);cs>-1&&(qn=qn.slice(0,cs))}return qn+We}function oGe(D){return D=Ta(D),D&&an.test(D)?D.replace(Pt,ve):D}var lGe=jx(function(D,q,be){return D+(be?" ":"")+q.toUpperCase()}),ez=O8("toUpperCase");function lde(D,q,be){return D=Ta(D),q=be?n:q,q===n?Uu(D)?xt(D):lt(D):D.match(q)||[]}var cde=Oi(function(D,q){try{return dr(D,n,q)}catch(be){return XU(be)?be:new mr(be)}}),cGe=fh(function(D,q){return pr(q,function(be){be=wf(be),ih(D,be,Br(D[be],D))}),D});function uGe(D){var q=D==null?0:D.length,be=qs();return D=q?Zn(D,function(We){if(typeof We[1]!="function")throw new Ja(o);return[be(We[0]),We[1]]}):[],Oi(function(We){for(var gt=-1;++gt<q;){var qt=D[gt];if(dr(qt[0],this,We))return dr(qt[1],this,We)}})}function dGe(D){return RT(fu(D,f))}function tz(D){return function(){return D}}function fGe(D,q){return D==null||D!==D?q:D}var hGe=o6(),pGe=o6(!0);function Md(D){return D}function nz(D){return W1(typeof D=="function"?D:fu(D,f))}function mGe(D){return X5(fu(D,f))}function xGe(D,q){return to(D,fu(q,f))}var gGe=Oi(function(D,q){return function(be){return Ed(be,D,q)}}),bGe=Oi(function(D,q){return function(be){return Ed(D,be,q)}});function rz(D,q,be){var We=vc(q),gt=H1(q,We);be==null&&!(Bo(q)&&(gt.length||!We.length))&&(be=q,q=D,D=this,gt=H1(q,vc(q)));var qt=!(Bo(be)&&"chain"in be)||!!be.chain,hn=Fx(D);return pr(gt,function(Pn){var qn=q[Pn];D[Pn]=qn,hn&&(D.prototype[Pn]=function(){var Or=this.__chain__;if(qt||Or){var Mr=D(this.__wrapped__),zr=Mr.__actions__=$c(this.__actions__);return zr.push({func:qn,args:arguments,thisArg:D}),Mr.__chain__=Or,Mr}return qn.apply(D,xs([this.value()],arguments))})}),D}function yGe(){return yr._===this&&(yr._=AT),this}function sz(){}function vGe(D){return D=Mi(D),Oi(function(q){return Q5(q,D)})}var wGe=l6(Zn),CGe=l6(Kr),SGe=l6(Pr);function ude(D){return ys(D)?Rs(wf(D)):ho(D)}function NGe(D){return function(q){return D==null?n:vp(D,q)}}var AGe=R8(),jGe=R8(!0);function iz(){return[]}function az(){return!1}function EGe(){return{}}function _Ge(){return""}function kGe(){return!0}function TGe(D,q){if(D=Mi(D),D<1||D>G)return[];var be=ae,We=hc(D,ae);q=qs(q),D-=ae;for(var gt=as(We,q);++be<D;)q(be);return gt}function IGe(D){return Ni(D)?Zn(D,wf):Nf(D)?[D]:$c(K8(Ta(D)))}function PGe(D){var q=++km;return Ta(D)+q}var FGe=H2(function(D,q){return D+q},0),OGe=Gl("ceil"),MGe=H2(function(D,q){return D/q},1),RGe=Gl("floor");function LGe(D){return D&&D.length?wx(D,Md,Lm):n}function DGe(D,q){return D&&D.length?wx(D,qs(q,2),Lm):n}function BGe(D){return es(D,Md)}function $Ge(D,q){return es(D,qs(q,2))}function UGe(D){return D&&D.length?wx(D,Md,Dm):n}function zGe(D,q){return D&&D.length?wx(D,qs(q,2),Dm):n}var HGe=H2(function(D,q){return D*q},1),VGe=Gl("round"),WGe=H2(function(D,q){return D-q},0);function qGe(D){return D&&D.length?Hr(D,Md):0}function GGe(D,q){return D&&D.length?Hr(D,qs(q,2)):0}return Mt.after=lr,Mt.ary=$r,Mt.assign=nqe,Mt.assignIn=tde,Mt.assignInWith=vI,Mt.assignWith=rqe,Mt.at=sqe,Mt.before=Vr,Mt.bind=Br,Mt.bindAll=cGe,Mt.bindKey=fs,Mt.castArray=EWe,Mt.chain=N6,Mt.chunk=x6,Mt.compact=Y8,Mt.concat=Id,Mt.cond=uGe,Mt.conforms=dGe,Mt.constant=tz,Mt.countBy=hI,Mt.create=iqe,Mt.curry=Ns,Mt.curryRight=Is,Mt.debounce=jo,Mt.defaults=aqe,Mt.defaultsDeep=oqe,Mt.defer=Jn,Mt.delay=Mn,Mt.difference=Xi,Mt.differenceBy=Tl,Mt.differenceWith=Yo,Mt.drop=Xl,Mt.dropRight=qu,Mt.dropRightWhile=nb,Mt.dropWhile=dl,Mt.fill=Z2,Mt.filter=E6,Mt.flatMap=o7,Mt.flatMapDeep=xI,Mt.flatMapDepth=l7,Mt.flatten=g6,Mt.flattenDeep=ev,Mt.flattenDepth=pu,Mt.flip=sr,Mt.flow=hGe,Mt.flowRight=pGe,Mt.fromPairs=X8,Mt.functions=pqe,Mt.functionsIn=mqe,Mt.groupBy=T6,Mt.initial=b6,Mt.intersection=Q8,Mt.intersectionBy=Hm,Mt.intersectionWith=y6,Mt.invert=gqe,Mt.invertBy=bqe,Mt.invokeMap=GU,Mt.iteratee=nz,Mt.keyBy=I6,Mt.keys=vc,Mt.keysIn=Od,Mt.map=P6,Mt.mapKeys=vqe,Mt.mapValues=wqe,Mt.matches=mGe,Mt.matchesProperty=xGe,Mt.memoize=Xr,Mt.merge=Cqe,Mt.mergeWith=nde,Mt.method=gGe,Mt.methodOf=bGe,Mt.mixin=rz,Mt.negate=Ps,Mt.nthArg=vGe,Mt.omit=Sqe,Mt.omitBy=Nqe,Mt.once=Hs,Mt.orderBy=sv,Mt.over=wGe,Mt.overArgs=Vs,Mt.overEvery=CGe,Mt.overSome=SGe,Mt.partial=Xs,Mt.partialRight=fl,Mt.partition=KU,Mt.pick=Aqe,Mt.pickBy=rde,Mt.property=ude,Mt.propertyOf=NGe,Mt.pull=v6,Mt.pullAll=nv,Mt.pullAllBy=Vc,Mt.pullAllWith=Wm,Mt.pullAt=Cf,Mt.range=AGe,Mt.rangeRight=jGe,Mt.rearg=aa,Mt.reject=M,Mt.remove=mu,Mt.rest=Gm,Mt.reverse=w6,Mt.sampleSize=pe,Mt.set=Eqe,Mt.setWith=_qe,Mt.shuffle=Ie,Mt.slice=J8,Mt.sortBy=fn,Mt.sortedUniq=n7,Mt.sortedUniqBy=Tx,Mt.split=Qqe,Mt.spread=YU,Mt.tail=aI,Mt.take=oI,Mt.takeRight=r7,Mt.takeRightWhile=C6,Mt.takeWhile=LU,Mt.tap=VU,Mt.throttle=NWe,Mt.thru=Sf,Mt.toArray=Zue,Mt.toPairs=sde,Mt.toPairsIn=ide,Mt.toPath=IGe,Mt.toPlainObject=ede,Mt.transform=kqe,Mt.unary=AWe,Mt.union=DU,Mt.unionBy=lI,Mt.unionWith=cI,Mt.uniq=Ix,Mt.uniqBy=BU,Mt.uniqWith=rb,Mt.unset=Tqe,Mt.unzip=S6,Mt.unzipWith=po,Mt.update=Iqe,Mt.updateWith=Pqe,Mt.values=M6,Mt.valuesIn=Fqe,Mt.without=$U,Mt.words=lde,Mt.wrap=jWe,Mt.xor=uI,Mt.xorBy=UU,Mt.xorWith=zU,Mt.zip=dI,Mt.zipObject=fI,Mt.zipObjectDeep=HU,Mt.zipWith=Pd,Mt.entries=sde,Mt.entriesIn=ide,Mt.extend=tde,Mt.extendWith=vI,rz(Mt,Mt),Mt.add=FGe,Mt.attempt=cde,Mt.camelCase=Lqe,Mt.capitalize=ade,Mt.ceil=OGe,Mt.clamp=Oqe,Mt.clone=_We,Mt.cloneDeep=TWe,Mt.cloneDeepWith=IWe,Mt.cloneWith=kWe,Mt.conformsTo=PWe,Mt.deburr=ode,Mt.defaultTo=fGe,Mt.divide=MGe,Mt.endsWith=Dqe,Mt.eq=kp,Mt.escape=Bqe,Mt.escapeRegExp=$qe,Mt.every=pI,Mt.find=_6,Mt.findIndex=zm,Mt.findKey=lqe,Mt.findLast=mI,Mt.findLastIndex=J2,Mt.findLastKey=cqe,Mt.floor=RGe,Mt.forEach=rv,Mt.forEachRight=k6,Mt.forIn=uqe,Mt.forInRight=dqe,Mt.forOwn=fqe,Mt.forOwnRight=hqe,Mt.get=ZU,Mt.gt=FWe,Mt.gte=OWe,Mt.has=xqe,Mt.hasIn=JU,Mt.head=_x,Mt.identity=Md,Mt.includes=gI,Mt.indexOf=_p,Mt.inRange=Mqe,Mt.invoke=yqe,Mt.isArguments=iv,Mt.isArray=Ni,Mt.isArrayBuffer=MWe,Mt.isArrayLike=Fd,Mt.isArrayLikeObject=hl,Mt.isBoolean=RWe,Mt.isBuffer=sb,Mt.isDate=LWe,Mt.isElement=DWe,Mt.isEmpty=BWe,Mt.isEqual=$We,Mt.isEqualWith=UWe,Mt.isError=XU,Mt.isFinite=zWe,Mt.isFunction=Fx,Mt.isInteger=Kue,Mt.isLength=bI,Mt.isMap=Yue,Mt.isMatch=HWe,Mt.isMatchWith=VWe,Mt.isNaN=WWe,Mt.isNative=qWe,Mt.isNil=KWe,Mt.isNull=GWe,Mt.isNumber=Xue,Mt.isObject=Bo,Mt.isObjectLike=Xo,Mt.isPlainObject=c7,Mt.isRegExp=QU,Mt.isSafeInteger=YWe,Mt.isSet=Que,Mt.isString=yI,Mt.isSymbol=Nf,Mt.isTypedArray=O6,Mt.isUndefined=XWe,Mt.isWeakMap=QWe,Mt.isWeakSet=ZWe,Mt.join=Vm,Mt.kebabCase=Uqe,Mt.last=Hc,Mt.lastIndexOf=tv,Mt.lowerCase=zqe,Mt.lowerFirst=Hqe,Mt.lt=JWe,Mt.lte=eqe,Mt.max=LGe,Mt.maxBy=DGe,Mt.mean=BGe,Mt.meanBy=$Ge,Mt.min=UGe,Mt.minBy=zGe,Mt.stubArray=iz,Mt.stubFalse=az,Mt.stubObject=EGe,Mt.stubString=_Ge,Mt.stubTrue=kGe,Mt.multiply=HGe,Mt.nth=Z8,Mt.noConflict=yGe,Mt.noop=sz,Mt.now=_n,Mt.pad=Vqe,Mt.padEnd=Wqe,Mt.padStart=qqe,Mt.parseInt=Gqe,Mt.random=Rqe,Mt.reduce=F6,Mt.reduceRight=A,Mt.repeat=Kqe,Mt.replace=Yqe,Mt.result=jqe,Mt.round=VGe,Mt.runInContext=St,Mt.sample=Z,Mt.size=Ve,Mt.snakeCase=Xqe,Mt.some=Nt,Mt.sortedIndex=e7,Mt.sortedIndexBy=RU,Mt.sortedIndexOf=qm,Mt.sortedLastIndex=iI,Mt.sortedLastIndexBy=t7,Mt.sortedLastIndexOf=kx,Mt.startCase=Zqe,Mt.startsWith=Jqe,Mt.subtract=WGe,Mt.sum=qGe,Mt.sumBy=GGe,Mt.template=eGe,Mt.times=TGe,Mt.toFinite=Ox,Mt.toInteger=Mi,Mt.toLength=Jue,Mt.toLower=tGe,Mt.toNumber=ph,Mt.toSafeInteger=tqe,Mt.toString=Ta,Mt.toUpper=nGe,Mt.trim=rGe,Mt.trimEnd=sGe,Mt.trimStart=iGe,Mt.truncate=aGe,Mt.unescape=oGe,Mt.uniqueId=PGe,Mt.upperCase=lGe,Mt.upperFirst=ez,Mt.each=rv,Mt.eachRight=k6,Mt.first=_x,rz(Mt,function(){var D={};return Vu(Mt,function(q,be){Fi.call(Mt.prototype,be)||(D[be]=q)}),D}(),{chain:!1}),Mt.VERSION=r,pr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(D){Mt[D].placeholder=Mt}),pr(["drop","take"],function(D,q){Si.prototype[D]=function(be){be=be===n?1:Ko(Mi(be),0);var We=this.__filtered__&&!q?new Si(this):this.clone();return We.__filtered__?We.__takeCount__=hc(be,We.__takeCount__):We.__views__.push({size:hc(be,ae),type:D+(We.__dir__<0?"Right":"")}),We},Si.prototype[D+"Right"]=function(be){return this.reverse()[D](be).reverse()}}),pr(["filter","map","takeWhile"],function(D,q){var be=q+1,We=be==he||be==ie;Si.prototype[D]=function(gt){var qt=this.clone();return qt.__iteratees__.push({iteratee:qs(gt,3),type:be}),qt.__filtered__=qt.__filtered__||We,qt}}),pr(["head","last"],function(D,q){var be="take"+(q?"Right":"");Si.prototype[D]=function(){return this[be](1).value()[0]}}),pr(["initial","tail"],function(D,q){var be="drop"+(q?"":"Right");Si.prototype[D]=function(){return this.__filtered__?new Si(this):this[be](1)}}),Si.prototype.compact=function(){return this.filter(Md)},Si.prototype.find=function(D){return this.filter(D).head()},Si.prototype.findLast=function(D){return this.reverse().find(D)},Si.prototype.invokeMap=Oi(function(D,q){return typeof D=="function"?new Si(this):this.map(function(be){return Ed(be,D,q)})}),Si.prototype.reject=function(D){return this.filter(Ps(qs(D)))},Si.prototype.slice=function(D,q){D=Mi(D);var be=this;return be.__filtered__&&(D>0||q<0)?new Si(be):(D<0?be=be.takeRight(-D):D&&(be=be.drop(D)),q!==n&&(q=Mi(q),be=q<0?be.dropRight(-q):be.take(q-D)),be)},Si.prototype.takeRightWhile=function(D){return this.reverse().takeWhile(D).reverse()},Si.prototype.toArray=function(){return this.take(ae)},Vu(Si.prototype,function(D,q){var be=/^(?:filter|find|map|reject)|While$/.test(q),We=/^(?:head|last)$/.test(q),gt=Mt[We?"take"+(q=="last"?"Right":""):q],qt=We||/^find/.test(q);gt&&(Mt.prototype[q]=function(){var hn=this.__wrapped__,Pn=We?[1]:arguments,qn=hn instanceof Si,Or=Pn[0],Mr=qn||Ni(hn),zr=function(Gi){var Qi=gt.apply(Mt,xs([Gi],Pn));return We&&cs?Qi[0]:Qi};Mr&&be&&typeof Or=="function"&&Or.length!=1&&(qn=Mr=!1);var cs=this.__chain__,Ls=!!this.__actions__.length,Js=qt&&!cs,Ri=qn&&!Ls;if(!qt&&Mr){hn=Ri?hn:new Si(this);var ei=D.apply(hn,Pn);return ei.__actions__.push({func:Sf,args:[zr],thisArg:n}),new pc(ei,cs)}return Js&&Ri?D.apply(this,Pn):(ei=this.thru(zr),Js?We?ei.value()[0]:ei.value():ei)})}),pr(["pop","push","shift","sort","splice","unshift"],function(D){var q=eo[D],be=/^(?:push|sort|unshift)$/.test(D)?"tap":"thru",We=/^(?:pop|shift)$/.test(D);Mt.prototype[D]=function(){var gt=arguments;if(We&&!this.__chain__){var qt=this.value();return q.apply(Ni(qt)?qt:[],gt)}return this[be](function(hn){return q.apply(Ni(hn)?hn:[],gt)})}}),Vu(Si.prototype,function(D,q){var be=Mt[q];if(be){var We=be.name+"";Fi.call(L1,We)||(L1[We]=[]),L1[We].push({name:q,func:be})}}),L1[Z1(n,N).name]=[{name:"wrapper",func:n}],Si.prototype.clone=B5,Si.prototype.reverse=m8,Si.prototype.value=$1,Mt.prototype.at=A6,Mt.prototype.chain=Px,Mt.prototype.commit=j6,Mt.prototype.next=s7,Mt.prototype.plant=WU,Mt.prototype.reverse=a7,Mt.prototype.toJSON=Mt.prototype.valueOf=Mt.prototype.value=qU,Mt.prototype.first=Mt.prototype.head,gp&&(Mt.prototype[gp]=i7),Mt},Qt=It();Ks?((Ks.exports=Qt)._=Qt,Jr._=Qt):yr._=Qt}).call(fin)}(Ij,Ij.exports)),Ij.exports}var pin=hin();const xCe=Ii(pin),min=({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 P,I;return typeof N=="string"?N.toLowerCase():((I=(P=N==null?void 0:N.wallet_address)==null?void 0:P.toLowerCase)==null?void 0:I.call(P))||""}).filter(Boolean);m.useEffect(()=>{(async()=>{a(!0);const N=t&&t.length?c(t):[e];if(!N[0]){r([]),a(!1);return}const P=Date.now()-30*24*60*60*1e3;try{const R=(await Promise.all(N.map(O=>hs.post("https://api-ui.hyperliquid.xyz/info",{type:"userNonFundingLedgerUpdates",user:O,startTime:P})))).flatMap(O=>O.data||[]).sort((O,U)=>U.time-O.time);r(R)}catch(I){console.error("Error fetching transaction data:",I)}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 P=xCe.get(C,o.key),I=xCe.get(N,o.key);return P<I?o.direction==="asc"?-1:1:P>I?o.direction==="asc"?1:-1:0}),f=C=>{if(o.key===C){if(o.direction==="asc")return i.jsx(P3,{className:"inline ml-2 text-white"});if(o.direction==="desc")return i.jsx(I3,{className:"inline ml-2 text-white"})}return i.jsx(F3,{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,P]=m.useState(Ro(C));return m.useEffect(()=>{const I=setInterval(()=>P(Ro(C)),1e3);return()=>clearInterval(I)},[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}):iu(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:KD(C.hash)})]},N))})]})})})};function kne(){return kne=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},kne.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 Tne(e,t){return Tne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Tne(e,t)}function xin(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Tne(e,t)}var bCe=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function gin(e,t){return!!(e===t||bCe(e)&&bCe(t))}function bin(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!gin(e[n],t[n]))return!1;return!0}function HY(e,t){t===void 0&&(t=bin);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 yin=typeof performance=="object"&&typeof performance.now=="function",yCe=yin?function(){return performance.now()}:function(){return Date.now()};function vCe(e){cancelAnimationFrame(e.id)}function vin(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 VY=-1;function wCe(e){if(e===void 0&&(e=!1),VY===-1||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),VY=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return VY}var oC=null;function CCe(e){if(e===void 0&&(e=!1),oC===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?oC="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?oC="negative":oC="positive-ascending"),document.body.removeChild(t),oC}return oC}var win=150,Cin=function(t,n){return t};function Sin(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){xin(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=HY(function(C,N,P,I){return w.props.onItemsRendered({overscanStartIndex:C,overscanStopIndex:N,visibleStartIndex:P,visibleStopIndex:I})}),w._callOnScroll=void 0,w._callOnScroll=HY(function(C,N,P){return w.props.onScroll({scrollDirection:C,scrollOffset:N,scrollUpdateWasRequested:P})}),w._getItemStyle=void 0,w._getItemStyle=function(C){var N=w.props,P=N.direction,I=N.itemSize,R=N.layout,O=w._getItemStyleCache(u&&I,u&&R,u&&P),U;if(O.hasOwnProperty(C))U=O[C];else{var L=n(w.props,C,w._instanceProps),z=s(w.props,C,w._instanceProps),X=P==="horizontal"||R==="horizontal",ne=P==="rtl",J=X?L:0;O[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=HY(function(C,N,P){return{}}),w._onScrollHorizontal=function(C){var N=C.currentTarget,P=N.clientWidth,I=N.scrollLeft,R=N.scrollWidth;w.setState(function(O){if(O.scrollOffset===I)return null;var U=w.props.direction,L=I;if(U==="rtl")switch(CCe()){case"negative":L=-I;break;case"positive-descending":L=R-P-I;break}return L=Math.max(0,Math.min(L,R-P)),{isScrolling:!0,scrollDirection:O.scrollOffset<L?"forward":"backward",scrollOffset:L,scrollUpdateWasRequested:!1}},w._resetIsScrollingDebounced)},w._onScrollVertical=function(C){var N=C.currentTarget,P=N.clientHeight,I=N.scrollHeight,R=N.scrollTop;w.setState(function(O){if(O.scrollOffset===R)return null;var U=Math.max(0,Math.min(R,I-P));return{isScrolling:!0,scrollDirection:O.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=vin(w._resetIsScrolling,win)},w._resetIsScrolling=function(){w._resetIsScrollingTimeoutId=null,w.setState({isScrolling:!1},function(){w._getItemStyleCache(-1,null)})},w}x.getDerivedStateFromProps=function(w,C){return Nin(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,P=N.itemCount,I=N.layout,R=this.state.scrollOffset;w=Math.max(0,Math.min(w,P-1));var O=0;if(this._outerRef){var U=this._outerRef;I==="vertical"?O=U.scrollWidth>U.clientWidth?wCe():0:O=U.scrollHeight>U.clientHeight?wCe():0}this.scrollTo(a(this.props,w,C,R,this._instanceProps,O))},g.componentDidMount=function(){var w=this.props,C=w.direction,N=w.initialScrollOffset,P=w.layout;if(typeof N=="number"&&this._outerRef!=null){var I=this._outerRef;C==="horizontal"||P==="horizontal"?I.scrollLeft=N:I.scrollTop=N}this._callPropsCallbacks()},g.componentDidUpdate=function(){var w=this.props,C=w.direction,N=w.layout,P=this.state,I=P.scrollOffset,R=P.scrollUpdateWasRequested;if(R&&this._outerRef!=null){var O=this._outerRef;if(C==="horizontal"||N==="horizontal")if(C==="rtl")switch(CCe()){case"negative":O.scrollLeft=-I;break;case"positive-ascending":O.scrollLeft=I;break;default:var U=O.clientWidth,L=O.scrollWidth;O.scrollLeft=L-U-I;break}else O.scrollLeft=I;else O.scrollTop=I}this._callPropsCallbacks()},g.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&vCe(this._resetIsScrollingTimeoutId)},g.render=function(){var w=this.props,C=w.children,N=w.className,P=w.direction,I=w.height,R=w.innerRef,O=w.innerElementType,U=w.innerTagName,L=w.itemCount,z=w.itemData,X=w.itemKey,ne=X===void 0?Cin:X,J=w.layout,K=w.outerElementType,re=w.outerTagName,he=w.style,Q=w.useIsScrolling,ie=w.width,oe=this.state.isScrolling,G=P==="horizontal"||J==="horizontal",V=G?this._onScrollHorizontal:this._onScrollVertical,te=this._getRangeToRender(),ae=te[0],fe=te[1],Ne=[];if(L>0)for(var me=ae;me<=fe;me++)Ne.push(m.createElement(C,{data:z,key:ne(me,z),index:me,isScrolling:Q?oe:void 0,style:this._getItemStyle(me)}));var we=r(this.props,this._instanceProps);return m.createElement(K||re||"div",{className:N,onScroll:V,ref:this._outerRefSetter,style:kne({position:"relative",height:I,width:ie,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:P},he)},m.createElement(O||U||"div",{children:Ne,ref:R,style:{height:G?"100%":we,pointerEvents:oe?"none":void 0,width:G?we:"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],P=C[1],I=C[2],R=C[3];this._callOnItemsRendered(N,P,I,R)}}if(typeof this.props.onScroll=="function"){var O=this.state,U=O.scrollDirection,L=O.scrollOffset,z=O.scrollUpdateWasRequested;this._callOnScroll(U,L,z)}},g._getRangeToRender=function(){var w=this.props,C=w.itemCount,N=w.overscanCount,P=this.state,I=P.isScrolling,R=P.scrollDirection,O=P.scrollOffset;if(C===0)return[0,0,0,0];var U=o(this.props,O,this._instanceProps),L=l(this.props,U,O,this._instanceProps),z=!I||R==="backward"?Math.max(1,N):1,X=!I||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 Nin=function(t,n){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,n.instance},Ain=Sin({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 P=Math.round(N+(C-N)/2);return P<Math.ceil(v/2)?0:P>w+Math.floor(v/2)?w:P}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}}),wO={exports:{}},jin=wO.exports,SCe;function Ein(){return SCe||(SCe=1,function(e,t){(function(n,r){e.exports=r()})(jin,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,P={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 Q=["th","st","nd","rd"],ie=he%100;return"["+he+(Q[(ie-20)%10]||Q[ie]||Q[0])+"]"}},I=function(he,Q,ie){var oe=String(he);return!oe||oe.length>=Q?he:""+Array(Q+1-oe.length).join(ie)+he},R={s:I,z:function(he){var Q=-he.utcOffset(),ie=Math.abs(Q),oe=Math.floor(ie/60),G=ie%60;return(Q<=0?"+":"-")+I(oe,2,"0")+":"+I(G,2,"0")},m:function he(Q,ie){if(Q.date()<ie.date())return-he(ie,Q);var oe=12*(ie.year()-Q.year())+(ie.month()-Q.month()),G=Q.clone().add(oe,f),V=ie-G<0,te=Q.clone().add(oe+(V?-1:1),f);return+(-(oe+(ie-G)/(V?G-te:te-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}},O="en",U={};U[O]=P;var L="$isDayjsObject",z=function(he){return he instanceof K||!(!he||!he[L])},X=function he(Q,ie,oe){var G;if(!Q)return O;if(typeof Q=="string"){var V=Q.toLowerCase();U[V]&&(G=V),ie&&(U[V]=ie,G=V);var te=Q.split("-");if(!G&&te.length>1)return he(te[0])}else{var ae=Q.name;U[ae]=Q,G=ae}return!oe&&G&&(O=G),G||!oe&&O},ne=function(he,Q){if(z(he))return he.clone();var ie=typeof Q=="object"?Q:{};return ie.date=he,ie.args=arguments,new K(ie)},J=R;J.l=X,J.i=z,J.w=function(he,Q){return ne(he,{locale:Q.$L,utc:Q.$u,x:Q.$x,$offset:Q.$offset})};var K=function(){function he(ie){this.$L=X(ie.locale,null,!0),this.parse(ie),this.$x=this.$x||ie.x||{},this[L]=!0}var Q=he.prototype;return Q.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 te=G.match(C);if(te){var ae=te[2]-1||0,fe=(te[7]||"0").substring(0,3);return V?new Date(Date.UTC(te[1],ae,te[3]||1,te[4]||0,te[5]||0,te[6]||0,fe)):new Date(te[1],ae,te[3]||1,te[4]||0,te[5]||0,te[6]||0,fe)}}return new Date(G)}(ie),this.init()},Q.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()},Q.$utils=function(){return J},Q.isValid=function(){return this.$d.toString()!==w},Q.isSame=function(ie,oe){var G=ne(ie);return this.startOf(oe)<=G&&G<=this.endOf(oe)},Q.isAfter=function(ie,oe){return ne(ie)<this.startOf(oe)},Q.isBefore=function(ie,oe){return this.endOf(oe)<ne(ie)},Q.$g=function(ie,oe,G){return J.u(ie)?this[oe]:this.set(G,ie)},Q.unix=function(){return Math.floor(this.valueOf()/1e3)},Q.valueOf=function(){return this.$d.getTime()},Q.startOf=function(ie,oe){var G=this,V=!!J.u(oe)||oe,te=J.p(ie),ae=function(Pe,Re){var Xe=J.w(G.$u?Date.UTC(G.$y,Re,Pe):new Date(G.$y,Re,Pe),G);return V?Xe:Xe.endOf(u)},fe=function(Pe,Re){return J.w(G.toDate()[Pe].apply(G.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(Re)),G)},Ne=this.$W,me=this.$M,we=this.$D,xe="set"+(this.$u?"UTC":"");switch(te){case g:return V?ae(1,0):ae(31,11);case f:return V?ae(1,me):ae(0,me+1);case d:var ye=this.$locale().weekStart||0,je=(Ne<ye?Ne+7:Ne)-ye;return ae(V?we-je:we+(6-je),me);case u:case v:return fe(xe+"Hours",0);case c:return fe(xe+"Minutes",1);case l:return fe(xe+"Seconds",2);case o:return fe(xe+"Milliseconds",3);default:return this.clone()}},Q.endOf=function(ie){return this.startOf(ie,!1)},Q.$set=function(ie,oe){var G,V=J.p(ie),te="set"+(this.$u?"UTC":""),ae=(G={},G[u]=te+"Date",G[v]=te+"Date",G[f]=te+"Month",G[g]=te+"FullYear",G[c]=te+"Hours",G[l]=te+"Minutes",G[o]=te+"Seconds",G[a]=te+"Milliseconds",G)[V],fe=V===u?this.$D+(oe-this.$W):oe;if(V===f||V===g){var Ne=this.clone().set(v,1);Ne.$d[ae](fe),Ne.init(),this.$d=Ne.set(v,Math.min(this.$D,Ne.daysInMonth())).$d}else ae&&this.$d[ae](fe);return this.init(),this},Q.set=function(ie,oe){return this.clone().$set(ie,oe)},Q.get=function(ie){return this[J.p(ie)]()},Q.add=function(ie,oe){var G,V=this;ie=Number(ie);var te=J.p(oe),ae=function(me){var we=ne(V);return J.w(we.date(we.date()+Math.round(me*ie)),V)};if(te===f)return this.set(f,this.$M+ie);if(te===g)return this.set(g,this.$y+ie);if(te===u)return ae(1);if(te===d)return ae(7);var fe=(G={},G[l]=r,G[c]=s,G[o]=n,G)[te]||1,Ne=this.$d.getTime()+ie*fe;return J.w(Ne,this)},Q.subtract=function(ie,oe){return this.add(-1*ie,oe)},Q.format=function(ie){var oe=this,G=this.$locale();if(!this.isValid())return G.invalidDate||w;var V=ie||"YYYY-MM-DDTHH:mm:ssZ",te=J.z(this),ae=this.$H,fe=this.$m,Ne=this.$M,me=G.weekdays,we=G.months,xe=G.meridiem,ye=function(Re,Xe,Ke,ut){return Re&&(Re[Xe]||Re(oe,V))||Ke[Xe].slice(0,ut)},je=function(Re){return J.s(ae%12||12,Re,"0")},Pe=xe||function(Re,Xe,Ke){var ut=Re<12?"AM":"PM";return Ke?ut.toLowerCase():ut};return V.replace(N,function(Re,Xe){return Xe||function(Ke){switch(Ke){case"YY":return String(oe.$y).slice(-2);case"YYYY":return J.s(oe.$y,4,"0");case"M":return Ne+1;case"MM":return J.s(Ne+1,2,"0");case"MMM":return ye(G.monthsShort,Ne,we,3);case"MMMM":return ye(we,Ne);case"D":return oe.$D;case"DD":return J.s(oe.$D,2,"0");case"d":return String(oe.$W);case"dd":return ye(G.weekdaysMin,oe.$W,me,2);case"ddd":return ye(G.weekdaysShort,oe.$W,me,3);case"dddd":return me[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 Pe(ae,fe,!0);case"A":return Pe(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 te}return null}(Re)||te.replace(":","")})},Q.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},Q.diff=function(ie,oe,G){var V,te=this,ae=J.p(oe),fe=ne(ie),Ne=(fe.utcOffset()-this.utcOffset())*r,me=this-fe,we=function(){return J.m(te,fe)};switch(ae){case g:V=we()/12;break;case f:V=we();break;case x:V=we()/3;break;case d:V=(me-Ne)/6048e5;break;case u:V=(me-Ne)/864e5;break;case c:V=me/s;break;case l:V=me/r;break;case o:V=me/n;break;default:V=me}return G?V:J.a(V)},Q.daysInMonth=function(){return this.endOf(f).$D},Q.$locale=function(){return U[this.$L]},Q.locale=function(ie,oe){if(!ie)return this.$L;var G=this.clone(),V=X(ie,oe,!0);return V&&(G.$L=V),G},Q.clone=function(){return J.w(this.$d,this)},Q.toDate=function(){return new Date(this.valueOf())},Q.toJSON=function(){return this.isValid()?this.toISOString():null},Q.toISOString=function(){return this.$d.toISOString()},Q.toString=function(){return this.$d.toUTCString()},he}(),re=K.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(Q){return this.$g(Q,he[0],he[1])}}),ne.extend=function(he,Q){return he.$i||(he(Q,K,ne),he.$i=!0),ne},ne.locale=X,ne.isDayjs=z,ne.unix=function(he){return ne(1e3*he)},ne.en=U[O],ne.Ls=U,ne.p={},ne})}(wO)),wO.exports}var _in=Ein();const WY=Ii(_in),kin=Ae.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})}),Lu=({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,P]=m.useState({key:null,direction:null}),[I,R]=m.useState({}),[O,U]=m.useState(null),[L,z]=m.useState(null),[X,ne]=m.useState({top:0,left:0}),J=m.useRef(null),K=m.useRef(null);m.useEffect(()=>{function et(tt){J.current&&!J.current.contains(tt.target)&&(U(null),z(null))}return document.addEventListener("mousedown",et),()=>document.removeEventListener("mousedown",et)},[]),m.useEffect(()=>{O&&(L==null?void 0:L.filterType)==="text"&&setTimeout(()=>{var et;return(et=K.current)==null?void 0:et.focus()},0)},[O,L]);function re(et,tt,Le){return et.filter($e=>tt.every(ht=>{const pt=Le[ht.key];if(!ht.filterType||!pt)return!0;const Kt=$e[ht.key];if(pt.filterType==="text"){const wt=pt.value||"";return Kt==null?void 0:Kt.toString().toLowerCase().includes(wt.toLowerCase())}if(pt.filterType==="select")return!pt.values||pt.values.length===0?!0:pt.values.includes(Kt);if(pt.filterType==="dateRange"){if(!Kt)return!1;const wt=WY(Kt);return!(pt.start&&wt.isBefore(WY(pt.start))||pt.end&&wt.isAfter(WY(pt.end)))}if(pt.filterType==="numberRange"){const wt=parseFloat(pt.min),nn=parseFloat(pt.max),cn=parseFloat(Kt);return!(!isNaN(wt)&&cn<wt||!isNaN(nn)&&cn>nn)}return!0}))}function he(et,tt){if(!tt.key||!tt.direction)return et;const Le=t.find($e=>$e.key===tt.key);return Le?[...et].sort(($e,ht)=>{const pt=Le.sortValue?Le.sortValue($e):$e[tt.key],Kt=Le.sortValue?Le.sortValue(ht):ht[tt.key],wt=pt==null||pt==="-",nn=Kt==null||Kt==="-";return wt&&nn?0:wt?1:nn?-1:typeof pt=="number"&&typeof Kt=="number"?tt.direction==="asc"?pt-Kt:Kt-pt:typeof pt=="string"&&typeof Kt=="string"?tt.direction==="asc"?pt.localeCompare(Kt):Kt.localeCompare(pt):pt<Kt?tt.direction==="asc"?-1:1:pt>Kt?tt.direction==="asc"?1:-1:0}):et}function Q(et){P(tt=>tt.key===et?tt.direction==="asc"?{key:et,direction:"desc"}:tt.direction==="desc"?{key:null,direction:null}:{key:et,direction:"asc"}:{key:et,direction:"asc"})}function ie(et){if(N.key===et){if(N.direction==="asc")return i.jsx(P3,{className:"inline ml-1"});if(N.direction==="desc")return i.jsx(I3,{className:"inline ml-1"})}return i.jsx(F3,{className:"inline ml-1"})}function oe(et,tt){R(Le=>{const $e=Le[et]||{};return{...Le,[et]:{...$e,...tt}}})}function G(et){R(tt=>{const Le={...tt};return delete Le[et],Le})}function V(et,tt){const Le=et.currentTarget.getBoundingClientRect(),$e=Le.left+Le.width/2-192/2+window.scrollX,ht=Le.bottom+window.scrollY;if(ne({top:ht,left:$e}),O===tt.key)U(null),z(null);else{U(tt.key);const pt=I[tt.key]||{};z({filterType:tt.filterType,value:pt.value||"",values:pt.values||[],start:pt.start||"",end:pt.end||"",min:pt.min||"",max:pt.max||""})}}function te(et){L&&oe(et,L),U(null),z(null)}function ae(et){if(!L)return null;const tt=L.filterType;return bre.createPortal(i.jsxs("div",{ref:J,style:{position:"absolute",top:X.top,left:X.left,zIndex:9999},children:[tt==="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:K,type:"text",value:L.value,onChange:Le=>z($e=>({...$e,value:Le.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(et.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:()=>te(et.key),className:"text-xs px-2 py-1 bg-[rgba(103,255,189,0.16)] text-[#67FFBD] font-semibold",children:"Apply"})]})]}),tt==="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:[(et.options||[]).map(Le=>{const $e=L.values,ht=$e.includes(Le);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:ht,onChange:()=>{z(ht?pt=>({...pt,values:$e.filter(Kt=>Kt!==Le)}):pt=>({...pt,values:[...$e,Le]}))}}),Le]},Le)}),i.jsxs("div",{className:"flex justify-between mt-2",children:[i.jsx("button",{onClick:()=>{G(et.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:()=>te(et.key),className:"text-xs px-2 py-1 bg-[rgba(103,255,189,0.16)] text-[#67FFBD] font-semibold",children:"Apply"})]})]}),tt==="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:Le=>z($e=>({...$e,start:Le.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:Le=>z($e=>({...$e,end:Le.target.value}))})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("button",{onClick:()=>{G(et.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:()=>te(et.key),className:"text-xs px-2 py-1 bg-[rgba(103,255,189,0.16)] text-[#67FFBD] font-semibold",children:"Apply"})]})]}),tt==="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:Le=>z($e=>({...$e,min:Le.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:Le=>z($e=>({...$e,max:Le.target.value}))})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("button",{onClick:()=>{G(et.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:()=>te(et.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:[],Ne=x?[]:he(re(fe,t,I),N),me=t.map(et=>et.width||"minmax(0, 100%)").join(" "),we=t.map((et,tt)=>typeof et.skeletonWidth=="number"?et.skeletonWidth:60+tt*23%80),xe=Object.keys(I).length>0,ye=!x&&Ne.length===0;function je({w:et}){return i.jsx("span",{className:"block h-[14px] rounded bg-[#242424] animate-pulse",style:{width:et}})}function Pe({index:et,style:tt}){return i.jsx("div",{style:{...tt,display:"grid",gridTemplateColumns:me,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({},et)||"":a||""}`,children:t.map((Le,$e)=>i.jsx("div",{className:`px-4 ${typeof o=="function"?o(Le,{},et)||"":o||""}`,children:v?v({column:Le,index:et,width:we[$e]}):i.jsx(je,{w:we[$e]})},`sk-${Le.key}-${$e}`))})}function Re({index:et,style:tt}){if(et<0||et>=Ne.length)return null;const Le=Ne[et];return i.jsx("div",{onClick:()=>f&&f(Le),style:{...tt,display:"grid",gridTemplateColumns:me,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(Le,et)||"":a||""}`,children:t.map($e=>{const ht=$e.render?$e.render(Le[$e.key],Le,et):Le[$e.key];return i.jsx("div",{className:`px-4 overflow-hidden whitespace-nowrap ${typeof o=="function"?o($e,Le,et)||"":o||""}`,children:ht},$e.key)})})}const Xe=x?g:Ne.length,Ke=x?void 0:u?et=>u(Ne[et]):void 0,ut=et=>et.headerTooltip?i.jsx(xi,{content:et.headerTooltip,align:et.headerTooltipAlign||"center",children:i.jsx("span",{className:"inline-flex underline decoration-dotted underline-offset-2 cursor-help pointer-events-auto",children:et.label})}):et.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:me},children:t.map(et=>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&&et.sortable&&Q(et.key),children:[ut(et),et.sortable&&i.jsx("span",{className:"ml-1",children:ie(et.key)}),et.filterType&&i.jsx("span",{className:"ml-2 cursor-pointer",onClick:tt=>{tt.stopPropagation(),x||V(tt,et)},children:i.jsx(j6t,{className:"w-3 h-3"})}),O===et.key&&ae(et)]},et.key))}),x&&C?i.jsx("div",{className:`${s||""} min-w-max`,children:typeof C=="function"?C({hasFilters:xe}):C}):ye?i.jsx("div",{className:`${s||""} min-w-max text-xs text-center text-[#9B9B9B]`,children:typeof w=="function"?w({hasFilters:xe}):w}):i.jsx(Ain,{className:`${s||""} min-w-max`,height:c,itemCount:Xe,itemSize:l,itemKey:Ke,innerElementType:kin,width:"100%",onItemsRendered:({visibleStartIndex:et,visibleStopIndex:tt})=>!x&&d&&d(Ne.slice(et,tt+1)),children:x?Pe:Re})]})})})},$P=e=>Number(e).toLocaleString("en-US",{maximumFractionDigits:2}),Tin=e=>!isFinite(e)||isNaN(e)?"-":`${Math.floor(e)}h ${Math.round((e-Math.floor(e))*60)}m`,Iin=(e,t,n,r)=>{const s=e*t/n;return r/s*100};function Pin({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),P=m.useRef(new Set),I=m.useRef(new Set),{isReferralCodeName:R}=m.useContext(Qr),O=m.useCallback(G=>{const V=G==null?void 0:G.toLowerCase();return V?(r==null?void 0:r.length)>0?r.some(te=>{var ae;return((ae=te.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"),te=localStorage.getItem("hyperToken");if(!(!V||!te||G.length===0))try{const{data:ae}=await hs.post("https://dextrabothypev2.nftinit.io/api/hyper/order/get_leverage_with_oids/",{address:V,token:te,position_oids:G},{headers:{"Content-Type":"application/json"}});if(ae&&ae.success){const fe=parseFloat(ae.leverage);f(Ne=>{const me=new Map(Ne);return G.forEach(we=>me.set(String(we),fe)),me})}}catch(ae){console.error("leverage fetch error:",ae)}},[]),z=m.useCallback(async G=>{const V=localStorage.getItem("hyperAddress"),te=localStorage.getItem("hyperToken");if(!(!V||!te||G.length===0))try{const{data:ae}=await hs.post("https://dextrabothypev2.nftinit.io/api/hyper/order/get_position_details_with_oids/",{address:V,token:te,position_oids:G},{headers:{"Content-Type":"application/json"}});ae&&ae.success&&g(fe=>{const Ne=new Map(fe);return ae.data.forEach(me=>Ne.set(String(me.oid),me)),Ne})}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),P.current.clear(),I.current.clear(),f(new Map),g(new Map),u(new Map),(async()=>{try{const V=X.split(","),te=(await Promise.all(V.map(async fe=>{const[Ne,me]=await Promise.all([Oce(fe),Mce(fe)]),we=[...Ne,...me.map(({fill:xe,twapId:ye})=>({...xe,twapId:ye}))];return Rce(we).closed_positions||[]}))).flat();if(G)return;const ae=te.sort((fe,Ne)=>(Ne.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,te=new Set;G.forEach(ae=>{((t==null?void 0:t.some(Ne=>O(Ne.wallet_address)))||!1)&&ae.has_builder_fee&&(ae.oids||[]).forEach(Ne=>{P.current.has(Ne)||V.add(Ne),I.current.has(Ne)||te.add(Ne)})}),V.size>0&&(V.forEach(ae=>P.current.add(ae)),L([...V])),te.size>0&&(te.forEach(ae=>I.current.add(ae)),z([...te]))},[t,O,L,z]);function J({date:G}){const[V,te]=m.useState(Ro(G));return m.useEffect(()=>{const ae=setInterval(()=>{te(Ro(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 K=G=>u(V=>new Map(V).set(G,!V.get(G))),re=(G,V)=>c.get(V)?i.jsx(J,{date:G}):iu(G),he=m.useMemo(()=>[...new Set(U.map(G=>G.coin))],[U]),Q=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 we;const V=localStorage.getItem("hyperAddress"),te=localStorage.getItem("hyperToken"),ae=G.oids??[];let fe=G.leverage??G.positionDistribution??0;if(V&&te&&ae.length>0)try{fe=((we=(await hs.post("https://dextrabothypev2.nftinit.io/api/hyper/order/get_leverage_with_oids/",{address:V,token:te,position_oids:ae},{headers:{"Content-Type":"application/json"}})).data)==null?void 0:we.leverage)??fe}catch(xe){console.error("Leverage fetch failed:",xe)}const Ne=Iin(G.entry_price_wma,G.total_size,fe,G.total_pnl),me=xe=>Math.abs(xe)<1?xe.toFixed(4):xe.toFixed(2);l({coin:G.coin,type:G.position_side,leverage:fe,roe:me(Ne),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:sa}),V.coin]})},{key:"source_tag",label:"Source Tag",sortable:!0,filterType:"text",render:(G,V)=>{const te=x.get(V.oids&&String(V.oids[0]));return te?i.jsx("a",{href:`/wallet-details/${te.copy_trader_wallet}`,className:"text-white hover:text-white",children:te.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()),Ne=["sell","short"].includes(ae.toLowerCase()),me=(()=>{if(!(((t==null?void 0:t.some(ye=>O(ye.wallet_address)))||!1)&&V.has_builder_fee))return"";const xe=d.get(V.oids&&String(V.oids[0]));return xe?` - ${xe}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":Ne?"text-[#ff787b] bg-[#ff797c]/20":"text-white"}`,children:[i.jsx(Fs,{className:`w-3 h-3 ${fe?"fill-[#67ffbd] rotate-180":Ne?"fill-[#ff787b]":""}`}),i.jsxs("span",{className:"text-[11px] font-semibold uppercase",children:[ae,me," "]})]})}},{key:"total_size",label:"Size",sortable:!0,filterType:"numberRange",render:$P},{key:"entry_price_wma",label:"Entry Price",sortable:!0,filterType:"numberRange",render:$P},{key:"close_px",label:"Close Price",sortable:!0,filterType:"numberRange",render:$P},{key:"total_pnl",label:"PnL",sortable:!0,filterType:"numberRange",sortValue:G=>G.total_pnl-G.total_fee,render:(G,V)=>{const te=(t==null?void 0:t.some(ae=>O(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:["$",$P(Math.abs(V.total_pnl-V.total_fee))]}),te&&V.has_builder_fee&&i.jsx("img",{src:bm,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:Tin},{key:"open_time",label:"Opened",sortable:!0,filterType:"dateRange",render:(G,V)=>i.jsx("div",{onClick:()=>K(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:()=>K(V.uid),className:"cursor-pointer",children:re(V.close_time,V.uid)}),width:"200px"}],[he,c,d,x,t,O]);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(Lu,{data:Q,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(pT,{open:s,setOpen:a,data:o,setShare:()=>{},setTradeInfo:()=>{},pnlTitle:"REALIZED PNL"})]})}const Fin=({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",[P,I]=m.useState(N);m.useEffect(()=>{localStorage.setItem("isDateTwapFillsFormat",P)},[P]);const R="-time",[O,U]=m.useState(R),L=V=>{const te=r.find(ae=>ae.label===V);return te?te.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 te,ae;return x?(ae=(te=V==null?void 0:V.oid)==null?void 0:te.toString())==null?void 0:ae.includes(x):!0}),X=V=>z==null?void 0:z.sort((te,ae)=>{const fe=te.coin?te.coin.toUpperCase():"",Ne=ae.coin?ae.coin.toUpperCase():"",me=je=>parseFloat(je.closedPnl||0)-parseFloat(je.fee||0),we=(je="")=>{const Pe=je.toLowerCase(),Re=Pe.includes("long")||Pe==="buy",Xe=Pe.includes("short")||Pe==="sell";return Re&&!Xe?3:Re&&Xe?2:Xe&&!Re?1:0},xe=parseFloat(te.sz)*parseFloat(te.px),ye=parseFloat(ae.sz)*parseFloat(ae.px);return V==="-price"?ae.px-te.px:V==="price"?te.px-ae.px:V==="-size"?ae.sz-te.sz:V==="size"?te.sz-ae.sz:V==="-fee"?ae.fee-te.fee:V==="fee"?te.fee-ae.fee:V==="-closedPnl"?me(ae)-me(te):V==="closedPnl"?me(te)-me(ae):V==="-oid"?ae.oid-te.oid:V==="oid"?te.oid-ae.oid:V==="-coin"?fe<Ne?-1:fe>Ne?1:0:V==="coin"?fe>Ne?-1:fe<Ne?1:0:V==="-time"?new Date(ae.time)-new Date(te.time):V==="time"?new Date(te.time)-new Date(ae.time):V==="-dir"?we(ae.dir)-we(te.dir):V==="dir"?we(te.dir)-we(ae.dir):V==="-tradeValue"?ye-xe:V==="tradeValue"?xe-ye:0});m.useEffect(()=>{(async()=>{try{a(!0);const te=await hs.post("https://api-ui.hyperliquid.xyz/info",{type:"userTwapSliceFills",user:n}),fe=((te==null?void 0:te.data)||[]).map(Ne=>({...Ne.fill,twapId:Ne.twapId||null}));t(fe==null?void 0:fe.sort((Ne,me)=>me.time-Ne.time))}catch(te){console.error("Error fetching twap data:",te)}finally{a(!1)}})()},[n]),m.useEffect(()=>{function V(te){v.current&&!v.current.contains(te.target)&&l(!1),w.current&&!w.current.contains(te.target)&&u(!1)}return document.addEventListener("mousedown",V),()=>document.removeEventListener("mousedown",V)},[]);const ne=m.useRef(null),J=()=>{ne.current&&(ne.current.scrollLeft-=200)},K=()=>{ne.current&&(ne.current.scrollLeft+=200)},re=()=>{ne.current&&(ne.current.scrollTop+=200)},he=()=>{ne.current&&(ne.current.scrollTop-=200)},Q=V=>V>=640&&V<1024?5:V>=1024&&V<1240?8:V>=1240&&V<1540||V>=1540?9:4;function ie({date:V}){const[te,ae]=m.useState(Ro(V));return m.useEffect(()=>{const fe=setInterval(()=>{ae(Ro(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:te.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(Dl,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:K,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(Dl,{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(Dl,{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(Dl,{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:O,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(pi,{title:"Coin",sortKey:"coin",sortOption:O,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(zf,{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:O,setSortOption:U}),i.jsx(K7,{className:"min-w-[70px] max-w-[70px] sm:min-w-[100px] sm:max-w-[100px] px-1",title:"Price",sortKey:"price",sortOption:O,setSortOption:U}),i.jsx(K7,{className:"min-w-[90px] max-w-[90px] sm:min-w-[130px] sm:max-w-[130px] px-1",title:"Size",sortKey:"size",sortOption:O,setSortOption:U}),i.jsx(K7,{className:"min-w-[130px] max-w-[130px] sm:min-w-[150px] sm:max-w-[150px] px-1",title:"Trade Value",sortKey:"tradeValue",sortOption:O,setSortOption:U}),i.jsx(K7,{className:"min-w-[90px] max-w-[90px] sm:min-w-[120px] sm:max-w-[120px] px-1",title:"Fee",sortKey:"fee",sortOption:O,setSortOption:U}),i.jsx(K7,{className:"min-w-[120px] max-w-[120px] sm:min-w-[150px] sm:max-w-[150px] px-1",title:"Closed PnL",sortKey:"closedPnl",sortOption:O,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(pi,{title:"Order ID",sortKey:"oid",sortOption:O,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(zf,{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(O).length==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:Q(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(Ba,{}):i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3",children:[i.jsx("img",{src:ac,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(O))==null?void 0:G.map((V,te)=>{var ae,fe,Ne,me,we,xe;return i.jsxs(Ae.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:()=>{I(P=="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:P=="time"?i.jsx(ie,{date:V.time}):iu(V.time)})}),i.jsx("td",{className:"text-left cursor-pointer",children:i.jsx("div",{onClick:()=>{var ye;window.open(`/terminal/${((ye=r==null?void 0:r.find(je=>je.label===V.coin))==null?void 0:ye.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(ye=>ye.label===V.coin))==null?void 0:ae.value)||oe[V.coin]||((fe=V.coin)==null?void 0:fe.split("/")[0])}.svg`||Wa,alt:V==null?void 0:V.coin,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:ye=>sa(ye)})}),i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-tight",children:(()=>{const ye=r.find(je=>je.label===V.coin);return ye?ye.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":(Ne=V.dir)!=null&&Ne.includes("Short")||(me=V.dir)!=null&&me.includes("Sell")?"text-[#ff6b6b]":(we=V.dir)!=null&&we.includes("Long")||(xe=V.dir)!=null&&xe.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:"--"})})})]},te),i.jsx("tr",{children:i.jsx("td",{colSpan:"100",style:{height:"2px"}})})]},te)})})]})})]})},K7=({className:e,title:t,sortKey:n,sortOption:r,setSortOption:s})=>i.jsx("th",{scope:"col",className:e,children:i.jsx(pi,{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(pi,{title:t,sortKey:n,sortOption:r,setSortOption:s,isFilterIcon:!1})}),lC="https://api-ui.hyperliquid.xyz/info",Oin="wss://api.hyperliquid.xyz/ws",YUe=({initialAddress:e="",wallets:t})=>{var Es,gr,Vt;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,P]=m.useState("positions"),I=m.useRef(null),R=Wo(),O=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:K,hyperToken:re,copyTradeWatchList:he,getCopyTradeWatchList:Q,setTelegramChatId:ie,setSubscriberRole:oe,setSubsExpireDay:G,setMushboomerETH:V,setMushboomerSOL:te,setIsReferralCode:ae,isReferralCodeName:fe,setIsReferralCodeName:Ne,setIsWhitelist:me,setHyperToken:we,setHyperAddress:xe,setSignModalOpen:ye,latestPnL:je}=m.useContext(Qr),{isConnected:Pe,address:Re}=ts();m.useState(!1),m.useState(!1),m.useState(null),m.useState("");const[Xe,Ke]=m.useState(!1);m.useState(!1);const[ut,et]=m.useState({}),[tt,Le]=m.useState(!1),[$e,ht]=m.useState([]),[pt,Kt]=m.useState(null);pt||je.activeRange;const wt=oc(),nn=wt.pathname.includes("/wallet-management");m.useEffect(()=>{Kt(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 zn(de,st){const Ct=st.map(({fill:vt,twapId:ln})=>({...vt,twapId:ln}));return[...de,...Ct]}const Xt=(de,st)=>{const Ct=Bt(st,de);o.current={...o.current,[de]:Ct},a(Object.values(o.current).flat()),d(!1)};m.useEffect(()=>{e&&(async()=>{const de=await Oce(e),st=await Mce(e),Ct=zn(de,st),{closed_positions:vt}=Rce(Ct);J(vt)})()},[e]);const on=(t??[]).map(de=>{var st;return(st=de.wallet_address)==null?void 0:st.toLowerCase()}).filter(Boolean),Zt=m.useMemo(()=>[...new Set(on)].sort().join("|"),[on.join("|")]);m.useEffect(()=>{if(!t||t.length===0)return;const de=t.map(Ct=>Ct.wallet_address.toLowerCase());if(de.length===0)return;let st=!0;return c(!0),d(!0),(async()=>{try{const Ct=await Promise.all(de.map(async jr=>{const[pr,fr]=await Promise.all([hs.post(lC,{aggregateByTime:!0,type:"userFills",user:jr}),hs.post(lC,{type:"clearinghouseState",user:jr})]);return{addr:jr,fills:pr.data??[],state:fr.data}}));if(!st)return;const vt=Ct.flatMap(jr=>jr.fills),ln=Ft(vt);r(ln);const pn=Ct.flatMap(jr=>{var pr;return(pr=jr.state)!=null&&pr.assetPositions?jr.state.assetPositions.map(fr=>({...fr,_wallet:jr.addr})):[]}),dr=Bt({assetPositions:pn});a(dr),Ye(de)}catch(Ct){console.error("Multi-wallet fetch error:",Ct)}finally{st&&c(!1)}})(),()=>{st=!1}},[Zt]),m.useEffect(()=>(e&&(O.current=e,Ze(e)),()=>{I.current&&(I.current.close(),I.current=null),U.current&&(clearTimeout(U.current),U.current=null),L.current&&(clearInterval(L.current),L.current=null)}),[e]),m.useEffect(()=>{const de=async()=>{var st;document.visibilityState==="visible"&&(((st=I.current)==null?void 0:st.readyState)!==WebSocket.OPEN&&Ye(O.current.split("|")),O.current.split("|").forEach(Ct=>{hs.post(lC,{type:"clearinghouseState",user:Ct}).then(vt=>Xt(Ct,vt.data))}))};return document.addEventListener("visibilitychange",de),()=>document.removeEventListener("visibilitychange",de)},[]),m.useEffect(()=>{const de=localStorage.getItem("favoriteAddresses");de&&X(JSON.parse(de))},[]);const Ye=de=>{var Ct;const st=Array.isArray(de)?de:[de];o.current={},a([]),!(((Ct=I.current)==null?void 0:Ct.readyState)===WebSocket.OPEN&&O.current===Re)&&(L.current&&(clearInterval(L.current),L.current=null),U.current&&(clearTimeout(U.current),U.current=null),I.current&&(I.current.close(),I.current=null),O.current=st.join("|"),I.current=new WebSocket(Oin),I.current.onopen=()=>{console.log("WebSocket Connected"),C(!0);const vt=[];st.forEach(ln=>{vt.push({method:"subscribe",subscription:{aggregateByTime:!0,type:"userFills",user:ln}},{method:"subscribe",subscription:{type:"user",user:ln}},{method:"subscribe",subscription:{type:"webData2",user:ln}},{method:"subscribe",subscription:{type:"userTwapSliceFills",user:ln}})}),vt.forEach(ln=>{I.current.send(JSON.stringify(ln))}),L.current=setInterval(()=>{var ln;if(((ln=I.current)==null?void 0:ln.readyState)===WebSocket.OPEN){const pn={id:99,method:"ping"};I.current.send(JSON.stringify(pn))}},3e4)},I.current.onclose=vt=>{C(!1),L.current&&(clearInterval(L.current),L.current=null),vt.code!==1e3&&(U.current||(U.current=setTimeout(()=>{U.current=null,O.current===Re&&Ye([Re])},5e3)))},I.current.onerror=vt=>{console.error("WebSocket Error:",vt),C(!1)},I.current.onmessage=vt=>{var ln,pn,dr,jr;try{const pr=JSON.parse(vt.data);if(pr.method==="pong"||pr.result==="success")return;if(pr.channel==="userFills"&&((ln=pr.data)!=null&&ln.fills)&&O.current.toLowerCase()===pr.data.user.toLowerCase()&&r(fr=>{const Kr=fr.flatMap(Zn=>Zn.fills),rs=new Map;Kr.forEach(Zn=>{rs.set(Zn.hash,!0)});const Ir=pr.data.fills.filter(Zn=>!rs.has(Zn.hash));if(Ir.length===0)return fr;const br=[...Ir,...Kr];return Ft(br)}),pr.channel==="webData2"&&((pn=pr.data)!=null&&pn.clearinghouseState)&&(v(pr.data.clearinghouseState),Xt(pr.data.user.toLowerCase(),pr.data.clearinghouseState)),pr.channel==="user"&&((dr=pr.data)!=null&&dr.fills&&r(fr=>{const Kr=fr.flatMap(Zn=>Zn.fills),rs=new Map;Kr.forEach(Zn=>{rs.set(Zn.hash,!0)});const Ir=pr.data.fills.filter(Zn=>!rs.has(Zn.hash));if(Ir.length===0)return fr;const br=[...Ir,...Kr];return Ft(br)}),(jr=pr.data)!=null&&jr.state)){v(pr.data.state);const fr=Bt(pr.data.state);a(fr)}if(pr.channel==="userTwapSliceFills"){const fr=pr==null?void 0:pr.data;if(!$e||$e.length===0||!fr||fr.length===0)return;const Kr=fr==null?void 0:fr.map(Ir=>({...Ir.fill,twapId:Ir.twapId||null})),rs=[...$e];Kr.forEach(Ir=>{const br=rs==null?void 0:rs.findIndex(Zn=>Zn.oid===Ir.oid);br!==-1?rs[br]={...rs[br],...Ir}:rs.unshift(Ir)}),ht(rs)}}catch(pr){console.error("Error processing WebSocket message:",pr),console.error("Raw message that caused error:",vt.data)}})},Ze=async de=>{const[st,Ct]=await Promise.all([hs.post(lC,{aggregateByTime:!0,type:"userFills",user:de}),hs.post(lC,{type:"clearinghouseState",user:de})]);if(Ct.data&&Xt(de.toLowerCase(),Ct.data),!de){tn.error("Please enter a wallet address");return}if(!de.match(/^0x[a-fA-F0-9]{40}$/)){tn.error("Please enter a valid Ethereum address");return}c(!0),d(!0);try{de!==e&&R(`/wallet-details/${de}`),Ye(de);const vt=await hs.post(lC,{aggregateByTime:!0,type:"userFills",user:de});if(vt.data&&Array.isArray(vt.data)){const ln=Ft(vt.data);r(ln),x(1)}else console.error("Invalid response format:",vt.data)}catch(vt){console.error("Error fetching data:",vt)}finally{c(!1)}},Ft=de=>{const st=[...de].sort((vt,ln)=>ln.time-vt.time),Ct=new Map;return st.forEach(vt=>{var pn;const ln=vt.oid;if(!Ct.has(ln)){const dr=st.filter(br=>br.oid===vt.oid),jr=dr.reduce((br,Zn)=>br+parseFloat(Zn.sz),0),pr=dr.map(br=>parseFloat(br.startPosition));let fr;pr.includes(0)?fr=0:pr.every(br=>br>0)?fr=Math.max(...pr):pr.every(br=>br<0)?fr=Math.min(...pr):fr=dr.reduce((br,Zn)=>br+parseFloat(Zn.startPosition),0);const Kr=dr.reduce((br,Zn)=>br+parseFloat(Zn.sz)*parseFloat(Zn.px),0),rs=dr.reduce((br,Zn)=>br+parseFloat(Zn.closedPnl||0),0),Ir=((pn=dr.find(br=>br.dir==="Long > Short"||br.dir==="Short > Long"))==null?void 0:pn.dir)||"";Ct.set(ln,{oid:vt.oid,asset:vt.coin,direction:Ir==""?vt.dir:Ir,fills:dr,totalSize:jr,totalStartPositions:fr,totalValue:Kr,pnl:rs,latestFill:vt.time,isLiquidation:!!vt.liquidation})}}),Array.from(Ct.values()).sort((vt,ln)=>ln.latestFill-vt.latestFill)},dn=de=>{const st=new Date(de),Ct=st.toLocaleString("en-US",{month:"short"}),vt=st.getDate(),ln=st.getFullYear(),pn=st.getHours().toString().padStart(2,"0"),dr=st.getMinutes().toString().padStart(2,"0"),jr=st.getHours()>=12?" PM":" AM";return`${Ct} ${vt}, ${ln}, ${pn}:${dr}  ${jr}`},Yt=n,Bt=(de,st="")=>{if(!(de!=null&&de.assetPositions))return[];const Ct=new Map;return n.forEach(vt=>{vt.fills.forEach(ln=>{let pn="";ln.dir.includes("Open")?pn=ln.dir.includes("Long")?"Long":"Short":ln.side==="B"?pn="Long":ln.side==="S"&&(pn="Short");const dr=`${ln.coin}-${pn}`;(!Ct.has(dr)||ln.time<Ct.get(dr))&&Ct.set(dr,ln.time)})}),de.assetPositions.filter(vt=>{if(!vt.position||!vt.position.szi)return!1;const ln=parseFloat(vt.position.szi);return!isNaN(ln)&&ln!==0}).map(vt=>{const ln=vt._wallet||st||(e==null?void 0:e.toLowerCase()),pn=vt.position,dr=parseFloat(pn.szi),jr=parseFloat(pn.entryPx),pr=parseFloat(pn.positionValue),fr=parseFloat(pn.unrealizedPnl),Kr=parseFloat(pn.returnOnEquity)*100,rs=parseFloat(pn.marginUsed),Ir=pn.leverage.value,br=pn.leverage.type,Zn=parseFloat(pn.cumFunding.sinceOpen),xs=dr>0?"Long":"Short",Qs=Ct.get(`${pn.coin}-${xs}`);return{wallet:ln,asset:pn.coin,type:xs,size:dr,entryPrice:jr.toFixed(4),currentPrice:(pr/Math.abs(dr)).toFixed(4),leverage:Ir,marginMode:br,positionValue:pr.toFixed(2),marginUsed:rs.toFixed(2),unrealizedPnl:fr.toFixed(2),roe:Kr.toFixed(2),funding:Zn.toFixed(4),startTime:Qs?dn(Qs):"N/A",liquidationPrice:pn.liquidationPx?parseFloat(pn.liquidationPx).toFixed(2):"N/A"}})};m.useEffect(()=>{window.localStorage.getItem("hyperToken")&&(K(),Q())},[]);const ot=m.useRef(null),De=()=>{ot.current&&(ot.current.scrollLeft-=200)},_t=()=>{ot.current&&(ot.current.scrollLeft+=200)},ze=()=>{ot.current&&(ot.current.scrollTop+=200)},nt=()=>{ot.current&&(ot.current.scrollTop-=200)};m.useRef(null);const mt=m.useRef(null),$t=()=>{mt.current&&(mt.current.scrollLeft-=200)},Pt=()=>{mt.current&&(mt.current.scrollLeft+=200)},un=()=>{mt.current&&(mt.current.scrollTop+=200)},an=()=>{mt.current&&(mt.current.scrollTop-=200)};m.useRef(null),m.useEffect(()=>{(async()=>{var vt,ln;const st=window.localStorage.getItem("hyperToken"),Ct=window.localStorage.getItem("hyperAddress");if(!(!st||!Ct))try{const pn=await _i(Ct.toLowerCase(),st);pn!=null&&pn.success?(ie(pn==null?void 0:pn.telegram_chat_id),oe(pn==null?void 0:pn.subscriber_role),G(pn==null?void 0:pn.subs_expire_day),V((vt=pn==null?void 0:pn.mushboomer_counts)==null?void 0:vt.eth),te((ln=pn==null?void 0:pn.mushboomer_counts)==null?void 0:ln.sol),ae(pn==null?void 0:pn.referral_code),Ne(pn==null?void 0:pn.refcode),me(pn==null?void 0:pn.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),we(""),xe(""))}catch(pn){console.error("Token verification error:",pn),console.error(pn.message||"An unknown error occurred.")}})()},[]);const xn=["Open Position","Increase","Decrease","Changed Position","Position Closed","Spot","Liquidation"],An="-latestFill",[kn,yn]=m.useState(An),[Vn,Gn]=m.useState([]),[Rn,Yn]=m.useState(""),[Cn,rn]=m.useState(""),[Oe,Jt]=m.useState(""),[sn,Et]=m.useState(!1),[Xn,gn]=m.useState(!1),[Dt,en]=m.useState(!1),[In,Qn]=m.useState(!1),ar=m.useRef(null),hr=m.useRef(null),Gt=m.useRef(null),$n=m.useRef(null),nr=de=>{Gn(st=>st.includes(de)?st.filter(Ct=>Ct!==de):[...st,de])};m.useEffect(()=>{function de(st){ar.current&&!ar.current.contains(st.target)&&Et(!1),hr.current&&!hr.current.contains(st.target)&&gn(!1),Gt.current&&!Gt.current.contains(st.target)&&en(!1),$n.current&&!$n.current.contains(st.target)&&Qn(!1)}return document.addEventListener("mousedown",de),()=>document.removeEventListener("mousedown",de)},[]);const Rt=Yt.map(de=>{let st=de.isLiquidation?"Liquidation":de.totalStartPositions==0?"Open Position":de.direction!="Short > Long"&&de.direction!="Long > Short"?(de==null?void 0:de.totalSize)-Math.abs(de==null?void 0:de.totalStartPositions)==0&&(de.direction=="Close Long"||de.direction=="Close Short")?"Position Closed":de.direction=="Open Short"||de.direction=="Open Long"?"Increase":de.direction=="Close Long"||de.direction=="Close Short"?"Decrease":de.direction=="Sell"||de.direction=="Buy"?"Spot":"Changed Position":de.direction=="Short > Long"||de.direction=="Long > Short"?"Changed Position":"Open Position";return{...de,computedType:st}}),En=de=>{const st=cn.find(Ct=>Ct.label===de);return st?st.value.toUpperCase():de==null?void 0:de.toUpperCase()},Ee=Rt.filter(de=>Vn.length?Vn.includes(de.computedType):!0).filter(de=>{var st,Ct;return Rn?(Ct=(st=de==null?void 0:de.oid)==null?void 0:st.toString())==null?void 0:Ct.includes(Rn):!0}).filter(de=>Cn?En(de.asset).includes(Cn.toUpperCase()):!0),h=de=>Ee==null?void 0:Ee.sort((st,Ct)=>{var rs,Ir,br,Zn;const vt=st.totalSize?st.totalValue/st.totalSize:0,ln=Ct.totalSize?Ct.totalValue/Ct.totalSize:0,pn=xs=>{const Qs=cn.find(ai=>ai.label===xs);return Qs?Qs.value.toUpperCase():xs==null?void 0:xs.toUpperCase()},dr=pn(st.asset),jr=pn(Ct.asset),pr=xs=>{if(!xs)return"";const Qs=xs.toLowerCase();return Qs.includes("short")?"Short":Qs.includes("long")?"Long":Qs==="buy"?"Buy":Qs==="sell"?"Sell":xs},fr=pr(st.direction),Kr=pr(Ct.direction);if(de==="-totalSize")return Ct.totalSize-st.totalSize;if(de==="totalSize")return st.totalSize-Ct.totalSize;if(de==="-pnl")return Ct.pnl-st.pnl;if(de==="pnl")return st.pnl-Ct.pnl;if(de==="-fills")return(((rs=Ct.fills)==null?void 0:rs.length)||0)-(((Ir=st.fills)==null?void 0:Ir.length)||0);if(de==="fills")return(((br=st.fills)==null?void 0:br.length)||0)-(((Zn=Ct.fills)==null?void 0:Zn.length)||0);if(de==="-latestFill")return new Date(Ct.latestFill)-new Date(st.latestFill);if(de==="latestFill")return new Date(st.latestFill)-new Date(Ct.latestFill);if(de==="-avgPrice")return ln-vt;if(de==="avgPrice")return vt-ln;if(de==="-oid")return Ct.oid-st.oid;if(de==="oid")return st.oid-Ct.oid;if(de==="direction"){const xs={Short:1,Sell:2,Long:3,Buy:4};return(xs[fr]||99)-(xs[Kr]||99)}else if(de==="-direction"){const xs={Long:1,Buy:2,Short:3,Sell:4};return(xs[fr]||99)-(xs[Kr]||99)}else{if(de==="-coin")return dr<jr?-1:dr>jr?1:0;if(de==="coin")return dr>jr?-1:dr<jr?1:0}return 0}),p=h(kn).filter(de=>(de.totalStartPositions==0?"Open Position":de.direction!="Short > Long"&&de.direction!="Long > Short"?(de==null?void 0:de.totalSize)-Math.abs(de==null?void 0:de.totalStartPositions)==0&&(de.direction=="Close Long"||de.direction=="Close Short")?"Position Closed":de.direction=="Open Short"||de.direction=="Open Long"?"Increase":de.direction=="Close Long"||de.direction=="Close Short"?"Decrease":de.direction=="Sell"||de.direction=="Buy"?"Spot":"Changed Position":de.direction=="Short > Long"||de.direction=="Long > Short"?"Changed Position":"Open Position")==="Open Position"),S={};p.forEach(de=>{var vt;const st=de==null?void 0:de.asset,Ct=new Date(de==null?void 0:de.latestFill).getTime();if(!S[st])S[st]=de;else{const ln=new Date((vt=S[st])==null?void 0:vt.latestFill).getTime();Ct>ln&&(S[st]=de)}});const _=Object.values(S),[k,T]=m.useState([]),B=s==null?void 0:s.filter(de=>{var st;return Oe?(st=de.asset)==null?void 0:st.toLowerCase().includes(Oe.toLowerCase()):!0}).map(de=>{const st=_.find(vt=>(vt==null?void 0:vt.asset)===(de==null?void 0:de.asset)),Ct=k.find(vt=>vt.coin===de.asset&&(vt.wallet||"").toLowerCase()===(de.wallet||"").toLowerCase());return{...de,latestFill:(st==null?void 0:st.latestFill)||null,tagName:(Ct==null?void 0:Ct.tag)||null,tagWallet:(Ct==null?void 0:Ct.cp_wallet)||null}}),W="-unrealizedPnl",[ee,ce]=m.useState(W),ue=de=>B==null?void 0:B.sort((st,Ct)=>{const vt=st.tagName?st.tagName.toUpperCase():"",ln=Ct.tagName?Ct.tagName.toUpperCase():"",pn=st.asset?st.asset.toUpperCase():"",dr=Ct.asset?Ct.asset.toUpperCase():"",jr=st.type==="Long"?1:0,pr=Ct.type==="Long"?1:0,fr=st.type==="Short"?1:0,Kr=Ct.type==="Short"?1:0;return de==="-unrealizedPnl"?Ct.unrealizedPnl-st.unrealizedPnl:de==="unrealizedPnl"?st.unrealizedPnl-Ct.unrealizedPnl:de==="-roe"?Ct.roe-st.roe:de==="roe"?st.roe-Ct.roe:de==="-size"?Ct.size-st.size:de==="size"?st.size-Ct.size:de==="-entryPrice"?Ct.entryPrice-st.entryPrice:de==="entryPrice"?st.entryPrice-Ct.entryPrice:de==="-currentPrice"?Ct.currentPrice-st.currentPrice:de==="currentPrice"?st.currentPrice-Ct.currentPrice:de==="-leverage"?Ct.leverage-st.leverage:de==="leverage"?st.leverage-Ct.leverage:de==="-positionValue"?Ct.positionValue-st.positionValue:de==="positionValue"?st.positionValue-Ct.positionValue:de==="-marginUsed"?Ct.marginUsed-st.marginUsed:de==="marginUsed"?st.marginUsed-Ct.marginUsed:de==="funding"?Ct.funding-st.funding:de==="-funding"?st.funding-Ct.funding:de==="-liquidationPrice"?Ct.liquidationPrice-st.liquidationPrice:de==="liquidationPrice"?st.liquidationPrice-Ct.liquidationPrice:de==="-entryTime"?new Date(Ct.latestFill)-new Date(st.latestFill):de==="entryTime"?new Date(st.latestFill)-new Date(Ct.latestFill):de==="-source_tag"?vt<ln?-1:vt>ln?1:0:de==="source_tag"?vt>ln?-1:vt<ln?1:0:de==="-type_leverage"?jr!==pr?pr-jr:Ct.leverage-st.leverage:de==="type_leverage"?fr!==Kr?Kr-fr:Ct.leverage-st.leverage:de==="-asset"?pn<dr?-1:pn>dr?1:0:de==="asset"?pn>dr?-1:pn<dr?1:0:0}),[ge,Se]=m.useState([]),[ke,Me]=m.useState(!0),[qe,Fe]=m.useState(null),[at,se]=m.useState([]),[Ce,Ue]=m.useState(!0),[Be,_e]=m.useState(null),[rt,ct]=m.useState([]),[yt,Lt]=m.useState(!0),[ft,Tt]=m.useState(null);async function Ge(){try{Me(!0);const de=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(!de.ok)throw new Error(`HTTP error! status: ${de.status}`);const st=await de.json();Se(st.results)}catch(de){console.error("Error resetting filters:",de),Fe(de.message)}finally{Me(!1)}}async function At(){try{Ue(!0);const de=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(!de.ok)throw new Error(`HTTP error! status: ${de.status}`);const st=await de.json();se(st.results)}catch(de){console.error("Error resetting filters:",de),_e(de.message)}finally{Ue(!1)}}async function Ot(){try{Lt(!0);const de=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(!de.ok)throw new Error(`HTTP error! status: ${de.status}`);const st=await de.json();ct(st.results)}catch(de){console.error("Error resetting filters:",de),Tt(de.message)}finally{Lt(!1)}}m.useEffect(()=>{Ge(),At(),Ot()},[]),m.useState("7D"),m.useState("7D"),s.length,s.filter(de=>de.unrealizedPnl>=0).length;const[it,jt]=m.useState({coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,referral:"",positionDistribution:0,pnl:0,closePx:0});((Es=ue(ee))==null?void 0:Es.reduce((de,st)=>de+((st==null?void 0:st.leverage)||0),0))/(((gr=ue(ee))==null?void 0:gr.length)||1),(Vt=ue(ee))==null||Vt.reduce((de,st)=>{const Ct=parseFloat(st==null?void 0:st.funding)||0;return de+Ct},0);const ir=localStorage.getItem("isDateOpenPositionsFormat")||"date",[Sn,Bn]=m.useState(ir);m.useEffect(()=>{localStorage.setItem("isDateOpenPositionsFormat",Sn)},[Sn]);const ur=localStorage.getItem("isDateFillsFormat")||"date",[_r,Un]=m.useState(ur);m.useEffect(()=>{localStorage.setItem("isDateFillsFormat",_r)},[_r]);function Ln({date:de}){const[st,Ct]=m.useState(Ro(de));return m.useEffect(()=>{const vt=setInterval(()=>{Ct(Ro(de))},1e3);return()=>clearInterval(vt)},[de]),i.jsx("span",{className:"text-white text-sm font-normal font-manrope leading-[13px] tracking-[0.18px] min-w-max",children:st.dateTime})}const[Kn,Yr]=m.useState([]),os=async()=>{try{const de=window.localStorage.getItem("hyperToken");if(!de){ye(!0);return}const st="https://dextrabothypev2.nftinit.io/api/wallet/list",Ct=window.localStorage.getItem("hyperAddress"),ln=await(await fetch(st,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:Re?Re.toLowerCase():Ct,token:de,balance:"false"})})).json();ln!=null&&ln.success?(Yr(ln.data||[]),Dr(ln.data)):console.log(ln.error_message)}catch(de){console.error("Error fetching generate wallet list:",de)}};m.useEffect(()=>{window.localStorage.getItem("hyperToken")&&os()},[re]);const[ds,Je]=m.useState([]),[bt,Tn]=m.useState(!0),[er,kr]=m.useState(!1);m.useEffect(()=>{B&&B.length>0&&(Ur(),Kn.length>0&&bt&&Dr())},[B]);const Dr=()=>{ds.length!==0&&(cr(ds),bt&&Tn(!1))};m.useEffect(()=>{const de=window.localStorage.getItem("hyperToken");ds.length&&de&&cr(ds)},[ds]);const Ur=()=>{const de=window.localStorage.getItem("hyperToken");let st=!1;const Ct=[...ds];B.forEach(vt=>{var jr;const ln=vt.asset,pn=(jr=vt.wallet||e)==null?void 0:jr.toLowerCase();Ct.some(pr=>pr.coin===ln&&(pr.wallet||"").toLowerCase()===pn)||(Ct.push({coin:ln,wallet:pn}),st=!0)}),st&&(Je(Ct),Kn.some(ln=>ln.wallet_address===(e==null?void 0:e.toLowerCase()))&&de&&cr(Ct))},cr=async de=>{if(!er)try{kr(!0);const st=window.localStorage.getItem("hyperToken"),Ct="https://dextrabothypev2.nftinit.io/api/hyper/following/position_info/";if(!st||!de){kr(!1);return}st||ye(!0);const vt=window.localStorage.getItem("hyperAddress"),pn=await(await fetch(Ct,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:Re?Re.toLowerCase():vt,token:st,positions:de})})).json();pn.success?T(pn==null?void 0:pn.data):(console.log(pn.error_message),tn.error(pn.error_message))}catch(st){console.error("Error tag request",st),tn.error(st.message)}finally{kr(!1)}},Cr=(t==null?void 0:t.length)>1||Kn.some(de=>de.wallet_address===(e==null?void 0:e.toLowerCase())),ls=async(de,st,Ct,vt,ln)=>{if(!de||!Ct||!vt||!ln){console.error("Close order called with invalid parameters"),tn.error("Close order called with invalid parameters");return}const pn=`${vt}_${Ct}_${ln}`;try{et(rs=>({...rs,[pn]:!0}));const dr=window.localStorage.getItem("hyperToken"),jr="https://dextrabothypev2.nftinit.io/api/hyper/order/close_order_new/";if(!dr){ye(!0),et(rs=>({...rs,[pn]:!1}));return}const pr=window.localStorage.getItem("hyperAddress"),fr=await fetch(jr,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:Re?Re.toLowerCase():pr,token:dr,coin:Ct,wallet_id:de.toString(),leverage:vt,size:ln})});if(!fr.ok)throw new Error(`Server responded with status ${fr.status}`);const Kr=await fr.json();Kr.success?(et(rs=>({...rs,[pn]:!1})),tn.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"}})):Kr.status=="ok"?(et(rs=>({...rs,[pn]:!1})),tn.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!"),tn.error("Something went wrong!"),et(rs=>({...rs,[pn]:!1})))}catch{console.error("Something went wrong!"),tn.error("Something went wrong!"),et(jr=>({...jr,[pn]:!1}))}},yr=async(de=[])=>{if(de.length!==0){Le(!0);try{await Promise.all(de.map(st=>Jr(st)))}finally{Le(!1)}}},Jr=async de=>{if((B==null?void 0:B.length)===0){tn.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(!de){console.error("Close order called with invalid parameters"),tn.error("Close order called with invalid parameters");return}try{Le(!0);const st=window.localStorage.getItem("hyperToken"),Ct="https://dextrabothypev2.nftinit.io/api/hyper/order/close_order_all_new/";if(!st){ye(!0),Le(!1);return}const vt=window.localStorage.getItem("hyperAddress"),ln=await fetch(Ct,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:Re?Re.toLowerCase():vt,token:st,wallet_id:de.toString()})});if(!ln.ok)throw new Error(`Server responded with status ${ln.status}`);const pn=await ln.json();pn.status=="ok"?(Le(!1),tn.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"}})):pn.success?(Le(!1),tn.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."),tn.error("Close order operation failed."),Le(!1))}catch(st){throw console.error("Something went wrong!"),tn.error("Something went wrong!"),Le(!1),st}},Ks={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};return i.jsxs("div",{className:"w-full",children:[i.jsx(pT,{open:Xe,setOpen:Ke,data:it,setTradeInfo:jt}),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:()=>P("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:()=>P("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:()=>P("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:()=>P("twap-history"),className:`${N==="twap-history"?"active text-[#67FFBD] border-b border-[#67FFBD] z-20":"text-[#C1C1C1]"} ${wt.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:()=>P("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:()=>P("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"})}),!nn&&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:Jbt,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:$t,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(Dl,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:Pt,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(Dl,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:an,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(Dl,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:un,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(Dl,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{ref:mt,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(pi,{title:"Coin",sortKey:"coin",sortOption:kn,setSortOption:yn,isFilterIcon:!1}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>en(!Dt),className:`${Cn?"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(zf,{className:`w-4 h-4 ${Cn?"text-blue-500":"text-white"}`})}),Dt&&i.jsxs("div",{ref:Gt,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:()=>rn(""),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:Cn,onChange:de=>rn(de.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(qY,{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:yn}),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(!sn),className:`${Vn.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(zf,{className:`w-4 h-4 ${Vn.length>0?"text-blue-500":"text-white"}`})}),sn&&i.jsxs("div",{ref:ar,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:()=>Gn([]),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"})})]}),xn.map(de=>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:Vn.includes(de),onChange:()=>nr(de),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 ${Vn.includes(de)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:Vn.includes(de)&&i.jsx("img",{src:Xc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[1px]"})}),de]},de))]})]})}),i.jsx(Ld,{className:"min-w-[80px] max-w-[80px] px-1",title:"Size",sortKey:"totalSize",sortOption:kn,setSortOption:yn}),i.jsx(Ld,{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:yn}),i.jsx(Ld,{className:"min-w-[100px] max-w-[100px] sm:min-w-[120px] sm:max-w-[120px] px-1",title:"PnL",sortKey:"pnl",sortOption:kn,setSortOption:yn}),i.jsx(Ld,{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:yn}),i.jsx(Ld,{className:"min-w-[200px] max-w-[200px] px-1",title:"Latest Fill",sortKey:"latestFill",sortOption:kn,setSortOption:yn}),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(pi,{title:"Order ID",sortKey:"oid",sortOption:kn,setSortOption:yn,isFilterIcon:!0}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>gn(!Xn),className:`${Rn?"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(zf,{className:`w-4 h-4 ${Rn?"text-blue-500":"text-white"}`})}),Xn&&i.jsxs("div",{ref:hr,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:()=>Yn(""),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:Rn,onChange:de=>Yn(de.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:h(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:ac,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"})})]})]})})})})}):h(kn).map((de,st)=>{var vt,ln,pn,dr,jr,pr;const Ct=de.totalValue/de.totalSize;return(vt=de==null?void 0:de.direction)==null||vt.includes("Long"),i.jsxs(Ae.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 fr;window.open(`/terminal/${((fr=cn.find(Kr=>Kr.label===de.asset))==null?void 0:fr.value)||de.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/${((ln=cn.find(fr=>fr.label===de.asset))==null?void 0:ln.value)||Ks[de.asset]||((pn=de.asset)==null?void 0:pn.split("/")[0])}.svg`||Wa,alt:de==null?void 0:de.asset,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:fr=>sa(fr)})}),i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-tight",children:(()=>{const fr=cn.find(Kr=>Kr.label===de.asset);return fr?fr.value:de.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:`${(dr=de.direction)!=null&&dr.includes("Long")?de.direction==="Short > Long"?"text-[#67ffbd] bg-[#67ffbd]/20":de.direction==="Long > Short"?"text-[#ff787b] bg-[#ff797c]/20":"text-[#67ffbd] bg-[#67ffbd]/20":de.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:(jr=de.direction)!=null&&jr.includes("Long")?de.direction==="Short > Long"?i.jsx(Fs,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):de.direction==="Long > Short"?i.jsx(Fs,{className:"text-[#FF797C] w-3 h-3"}):i.jsx(Fs,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):de.direction=="Buy"?i.jsx(Fs,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):i.jsx(Fs,{className:"text-[#FF797C] w-3 h-3"})})}),i.jsx("div",{className:" text-[11px] font-semibold font-manrope leading-[8px] tracking-wide",children:de.direction=="Sell"?"Sell":de.direction=="Buy"?"Buy":de.direction=="Close Short"?"Short":de.direction=="Close Long"?"Long":de.direction=="Open Short"?"Short":de.direction=="Open Long"?"Long":de.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:`${de!=null&&de.isLiquidation?"text-[#ff787b]":"text-white"} text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px] min-w-max`,children:de!=null&&de.isLiquidation?`Market Liquidation: ${de.direction=="Sell"?"Sell":de.direction=="Buy"?"Buy":de.direction=="Close Short"?"Close Short":de.direction=="Close Long"?"Close Long":de.direction=="Open Short"?"Close Short":de.direction=="Open Long"?"Close Long":"Close "+de.direction} `:de.totalStartPositions==0?"Open Position":de.direction!="Short > Long"&&de.direction!="Long > Short"?(de==null?void 0:de.totalSize)-Math.abs(de==null?void 0:de.totalStartPositions)==0&&(de.direction=="Close Long"||de.direction=="Close Short")?"Position Closed":de.direction=="Open Short"||de.direction=="Open Long"?"Increase":de.direction=="Close Long"||de.direction=="Close Short"?"Decrease":de.direction=="Sell"||de.direction=="Buy"?"Spot":"Changed Position":de.direction=="Short > Long"||de.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:oo(de.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:Ct?`$${Sv(Ct)}`:Sv(Ct)})})}),i.jsx("td",{children:i.jsx("div",{className:`${de.pnl,""} px-1 flex justify-end gap-2 font-manrope  min-w-max`,children:i.jsx("div",{className:`${de.pnl>=0?"text-[#67ffbd]":"text-[#ff787b]"} text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]`,children:de.pnl?`$${Sv(Math.abs(de.pnl))}`:Sv(Math.abs(de.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:[(pr=de==null?void 0:de.fills)==null?void 0:pr.length," Fills"]})})}),i.jsx("td",{children:i.jsx("div",{onClick:()=>{Un(_r=="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:_r=="time"?i.jsx(Ln,{date:de.latestFill}):iu(de.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:de==null?void 0:de.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:De,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(Dl,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:_t,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(Dl,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),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",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Dl,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:ze,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(Dl,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{ref:ot,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(pi,{title:"Coin",sortKey:"asset",sortOption:ee,setSortOption:ce,isFilterIcon:!1}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>Qn(!In),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(zf,{className:`w-4 h-4 ${Oe?"text-blue-500":"text-white"}`})}),In&&i.jsxs("div",{ref:$n,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:()=>Jt(""),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:de=>Jt(de.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"})]})]})]})}),Cr&&i.jsx(qY,{className:"min-w-[130px] sm:min-w-[130px] px-1",title:"Source Tag",sortKey:"source_tag",sortOption:ee,setSortOption:ce}),i.jsx(qY,{className:"min-w-[100px] sm:min-w-[120px] px-1",title:"Type",sortKey:"type_leverage",sortOption:ee,setSortOption:ce}),i.jsx(Ld,{className:"min-w-[80px] sm:min-w-[80px] px-1",title:"Size",sortKey:"size",sortOption:ee,setSortOption:ce}),i.jsx(Ld,{className:"min-w-[130px] sm:min-w-[145px] px-1",title:"Position Value",sortKey:"positionValue",sortOption:ee,setSortOption:ce}),i.jsx(Ld,{className:"min-w-[120px] sm:min-w-[120px] px-1",title:"Entry Price",sortKey:"entryPrice",sortOption:ee,setSortOption:ce}),i.jsx(Ld,{className:"min-w-[120px]  sm:min-w-[120px] px-1",title:"Mark Price",sortKey:"currentPrice",sortOption:ee,setSortOption:ce}),i.jsx(Ld,{className:"min-w-[100px] sm:min-w-[160px] px-1",title:"PnL(ROE%)",sortKey:"unrealizedPnl",sortOption:ee,setSortOption:ce}),i.jsx(Ld,{className:"min-w-[120px] sm:min-w-[120px] px-1",title:"Liq. Price",sortKey:"liquidationPrice",sortOption:ee,setSortOption:ce}),i.jsx(Ld,{className:"min-w-[120px] sm:min-w-[130px] px-1",title:"Margin",sortKey:"marginUsed",sortOption:ee,setSortOption:ce}),i.jsx(Ld,{className:"min-w-[110px] sm:min-w-[130px] px-1",title:"Funding",sortKey:"funding",sortOption:ee,setSortOption:ce}),i.jsx(Ld,{className:`${Cr?"pr-0":"pr-8"} min-w-[185px] sm:min-w-[185px] pl-1`,title:"Entry Time",sortKey:"entryTime",sortOption:ee,setSortOption:ce}),Cr&&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:de=>{if(de.preventDefault(),tt)return;const Ct=(t!=null&&t.length?t.map(vt=>vt.wallet_address.toLowerCase()):[e==null?void 0:e.toLowerCase()]).map(vt=>{var ln;return(ln=Kn.find(pn=>pn.wallet_address===vt))==null?void 0:ln.wallet_id}).filter(Boolean);yr(Ct)},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:eae,alt:"",className:"w-4 h-4"})}),tt?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(Ba,{}):i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3",children:[i.jsx("img",{src:ac,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((de,st)=>{var Ct,vt,ln,pn,dr;return i.jsxs(Ae.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/${de==null?void 0:de.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/${Ks[de.asset]||((Ct=de.asset)==null?void 0:Ct.split("/")[0])}.svg`||Wa,alt:de==null?void 0:de.asset,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:jr=>sa(jr)})}),i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:de.asset})]})})}),Cr&&i.jsx("td",{children:i.jsx("div",{onClick:jr=>{jr.preventDefault(),de!=null&&de.tagWallet&&(de==null?void 0:de.tagWallet)!=null&&window.open(`/wallet-details/${de==null?void 0:de.tagWallet}`,"_blank")},className:`${de!=null&&de.tagWallet&&(de==null?void 0:de.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:[(de==null?void 0:de.tagName)==null||(de==null?void 0:de.tagName)==""?"--":((vt=de==null?void 0:de.tagName)==null?void 0:vt.length)>10?((ln=de==null?void 0:de.tagName)==null?void 0:ln.slice(0,10))+"...":de==null?void 0:de.tagName,(de==null?void 0:de.tagName)&&(de==null?void 0:de.tagName.length)>10&&i.jsx("span",{children:i.jsx(Oa,{content:`${de==null?void 0:de.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:`${de.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:de.type==="Long"?i.jsx(Fs,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):i.jsx(Fs,{className:"text-[#FF797C] w-3 h-3"})})}),i.jsxs("div",{className:" text-[11px] font-semibold font-manrope leading-[8px] tracking-wide uppercase",children:[de.type," - ",de==null?void 0:de.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:oo(Math.abs(de.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:de.positionValue?`$${oo(de.positionValue)}`:oo(de.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:de.entryPrice?`$${Er(de.entryPrice)}`:Er(de.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:de.currentPrice?`$${Er(de.currentPrice)}`:Er(de.currentPrice)})})}),i.jsx("td",{children:i.jsxs("div",{onClick:()=>{jt(jr=>({...jr,coin:de.asset,type:de.type,leverage:de.leverage,roe:de.roe,entryPrice:de.entryPrice,markPrice:de.currentPrice,pnl:de.unrealizedPnl,referral:window.localStorage.getItem("hyperToken")?fe:null})),Ke(!0)},className:"pl-1 pr-2 flex justify-end gap-2 font-manrope cursor-pointer min-w-max",children:[i.jsxs("div",{className:`${de.unrealizedPnl>=0?"text-[#67ffbd]":"text-[#ff787b]"} text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]`,children:[de.unrealizedPnl?`$${oo(Math.abs(de.unrealizedPnl))}`:oo(Math.abs(de.unrealizedPnl)),` (${oo(Math.abs(de==null?void 0:de.roe))}%)`]}),i.jsx("div",{className:"flex justify-center items-center rounded",children:i.jsx("img",{src:bm,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:de.liquidationPrice!=null&&de.liquidationPrice!==""&&!isNaN(de.liquidationPrice)?`$${oo(de.liquidationPrice)}`:oo(de.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:[de.marginUsed?`$${oo(de.marginUsed)}`:oo(de.marginUsed),"  (",((pn=de==null?void 0:de.marginMode)==null?void 0:pn.charAt(0).toUpperCase())+((dr=de==null?void 0:de.marginMode)==null?void 0:dr.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:`${de.funding<=0?"text-[#67ffbd]":"text-[#ff787b]"} text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]`,children:de.funding?`$${Sv(Math.abs(de.funding))}`:Sv(Math.abs(de.funding))})})}),i.jsx("td",{className:`${Cr?"":"pr-8 sm:rounded-r-2xl"}`,children:i.jsx("div",{onClick:()=>{Bn(Sn=="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:de!=null&&de.latestFill?Sn=="time"?i.jsx(Ln,{date:de==null?void 0:de.latestFill}):iu(de==null?void 0:de.latestFill):i.jsx("span",{className:"text-[#979797]",children:"--"})})})}),Cr&&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:ut[`${de==null?void 0:de.leverage}_${de==null?void 0:de.asset}_${de==null?void 0:de.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 jr=Kn.find(Kr=>{var rs;return Kr.wallet_address===((rs=de.wallet||e)==null?void 0:rs.toLowerCase())}),pr=jr==null?void 0:jr.wallet_id,fr=jr==null?void 0:jr.wallet_address;pr&&ls(pr,fr,de==null?void 0:de.asset,de==null?void 0:de.leverage,de==null?void 0:de.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"&&wt.pathname.startsWith("/wallet-details")?i.jsx(Fin,{data:$e,setData:ht,wallet:e,coinNameData:cn}):N==="trade-history"?i.jsx(din,{wallet:e,wallets:t}):N==="completed-trades"?i.jsx(Pin,{trades:ne,generatedWallets:Kn,wallet:e,wallets:t}):N==="deposit-withdraw"?i.jsx(min,{wallet:e,wallets:t}):""]})},Ld=({className:e,title:t,sortKey:n,sortOption:r,setSortOption:s})=>i.jsx("th",{scope:"col",className:e,children:i.jsx(pi,{title:t,sortKey:n,sortOption:r,setSortOption:s,isFilterIcon:!0})}),qY=({className:e,title:t,sortKey:n,sortOption:r,setSortOption:s})=>i.jsx("th",{scope:"col",className:e,children:i.jsx(pi,{title:t,sortKey:n,sortOption:r,setSortOption:s,isFilterIcon:!1})});function GY({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=()=>{hs.post("https://dextrabothypev2.nftinit.io/api/hyper/wallet/getwalletreportsdetail/",{wallet_address:e}).then(P=>{s(P.data.report_count||0);const I=P.data.report_detail.reduce((R,O)=>(R[O.report_type_id]=(R[O.report_type_id]||0)+1,R),{});c(I)})};m.useEffect(()=>{w()},[e]),m.useEffect(()=>{const P=I=>{I.key==="Escape"&&n(!1)};return t&&window.addEventListener("keydown",P),()=>{window.removeEventListener("keydown",P)}},[t]);const C=()=>{a.length||hs.get("https://dextrabothypev2.nftinit.io/api/hyper/wallet/getreporttypes/").then(P=>{var I;return o(((I=P.data)==null?void 0:I.data)||[])})},N=()=>{if(!u){v("Please select a report type");return}const P=localStorage.getItem("hyperAddress"),I=localStorage.getItem("hyperToken");hs.post("https://dextrabothypev2.nftinit.io/api/hyper/wallet/walletreport/",{address:P,token:I,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:P=>P.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(zIe,{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(P=>i.jsxs("button",{onClick:()=>{d(P.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===P.id?"bg-white text-[#161616]":"bg-[#1f1f1f] border border-[#353535]"}`,children:[P.name,i.jsx("span",{className:"bg-[#FFC940] text-[#30260E] text-13px font-bold rounded-[6px] px-2",children:l[P.id]||0})]},P.id))}),i.jsx("label",{className:"block text-xs mb-1",children:"Comment (Optional)"}),i.jsx("textarea",{value:f,onChange:P=>x(P.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",Min="wss://api.hyperliquid.xyz/ws",Rin=({initialAddress:e=""})=>{var Es,gr,Vt;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=Wo(),N=m.useRef(e),P=m.useRef(null),I=m.useRef(null),R=m.useRef(null),[O,U]=m.useState({}),[L,z]=m.useState(!1),[X,ne]=m.useState(""),[J,K]=m.useState(null),{trackedWatchList:re,getTrackedWatchList:he,hyperToken:Q,copyTradeWatchList:ie,getCopyTradeWatchList:oe,setTelegramChatId:G,setSubscriberRole:V,setSubsExpireDay:te,setMushboomerETH:ae,setMushboomerSOL:fe,setIsReferralCode:Ne,isReferralCodeName:me,setIsReferralCodeName:we,setIsWhitelist:xe,setHyperToken:ye,setHyperAddress:je,setSignModalOpen:Pe,latestPnL:Re}=m.useContext(Qr),{isConnected:Xe,address:Ke}=ts(),[ut,et]=m.useState(!1),[tt,Le]=m.useState(!1),[$e,ht]=m.useState(null),[pt,Kt]=m.useState(null),[wt,nn]=m.useState(""),[cn,zn]=m.useState(!1),[Xt,on]=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),Zt=Xt||Re.activeRange;m.useEffect(()=>{on(null)},[Re.activeRange]);const Ye=[{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 Ze(de,st){const Ct=st.map(({fill:vt,twapId:ln})=>({...vt,twapId:ln}));return[...de,...Ct]}m.useEffect(()=>{e&&(async()=>{const de=await Oce(e),st=await Mce(e),Ct=Ze(de,st),{closed_positions:vt}=Rce(Ct);K(vt)})()},[e]),m.useEffect(()=>(e&&(N.current=e,Yt(e),ze(e)),()=>{w.current&&(w.current.close(),w.current=null),P.current&&(clearTimeout(P.current),P.current=null),I.current&&(clearInterval(I.current),I.current=null),R.current&&(clearInterval(R.current),R.current=null)}),[e]),m.useEffect(()=>{const de=localStorage.getItem("favoriteAddresses");de&&U(JSON.parse(de))},[]),m.useCallback(()=>{if(O[t]){const de={...O};delete de[t],U(de),localStorage.setItem("favoriteAddresses",JSON.stringify(de))}else z(!0),ne("")},[t,O]),m.useCallback(()=>{if(!X.trim())return;const de={...O,[t]:{name:X,address:t}};U(de),localStorage.setItem("favoriteAddresses",JSON.stringify(de)),z(!1)},[X,t,O]),m.useCallback(de=>{de&&(n(de),Yt(de),C(`/wallet-details/${de}`))},[]);const Ft=de=>{var st;((st=w.current)==null?void 0:st.readyState)===WebSocket.OPEN&&N.current===de||(I.current&&(clearInterval(I.current),I.current=null),P.current&&(clearTimeout(P.current),P.current=null),w.current&&(w.current.close(),w.current=null),N.current=de,w.current=new WebSocket(Min),w.current.onopen=()=>{console.log("WebSocket Connected"),v(!0),[{method:"subscribe",subscription:{aggregateByTime:!0,type:"userFills",user:de}},{method:"subscribe",subscription:{type:"user",user:de}}].forEach(vt=>{w.current.send(JSON.stringify(vt))}),I.current=setInterval(()=>{var vt;if(((vt=w.current)==null?void 0:vt.readyState)===WebSocket.OPEN){const ln={id:99,method:"ping"};w.current.send(JSON.stringify(ln))}},3e4)},w.current.onclose=Ct=>{v(!1),I.current&&(clearInterval(I.current),I.current=null),Ct.code!==1e3&&(P.current||(P.current=setTimeout(()=>{P.current=null,N.current===de&&Ft(de)},5e3)))},w.current.onerror=Ct=>{console.error("WebSocket Error:",Ct),v(!1)},w.current.onmessage=Ct=>{var vt,ln,pn;try{const dr=JSON.parse(Ct.data);if(dr.method==="pong"||dr.result==="success")return;if(dr.channel==="userFills"&&((vt=dr.data)!=null&&vt.fills)&&N.current.toLowerCase()===dr.data.user.toLowerCase()&&(s(jr=>{const pr=jr.flatMap(Ir=>Ir.fills),fr=new Map;pr.forEach(Ir=>{fr.set(Ir.hash,!0)});const Kr=dr.data.fills.filter(Ir=>!fr.has(Ir.hash));if(Kr.length===0)return jr;const rs=[...Kr,...pr];return Bt(rs)}),R.current||ze(N.current)),dr.channel==="user"&&((ln=dr.data)!=null&&ln.fills&&s(jr=>{const pr=jr.flatMap(Ir=>Ir.fills),fr=new Map;pr.forEach(Ir=>{fr.set(Ir.hash,!0)});const Kr=dr.data.fills.filter(Ir=>!fr.has(Ir.hash));if(Kr.length===0)return jr;const rs=[...Kr,...pr];return Bt(rs)}),(pn=dr.data)!=null&&pn.state)){x(dr.data.state);const jr=_t(dr.data.state);o(jr)}}catch(dr){console.error("Error processing WebSocket message:",dr),console.error("Raw message that caused error:",Ct.data)}})},dn=async de=>{try{et(!0);const st=await hs.post(ACe,{type:"clearinghouseState",user:de});if(st.data){x(st.data);const Ct=_t(st.data);o(Ct),et(!1),Ct.length>0&&!R.current?ze(de):Ct.length===0&&R.current&&(clearInterval(R.current),R.current=null)}}catch(st){console.error("Error fetching user state:",st),et(!1)}},Yt=async de=>{if(!de){tn.error("Please enter a wallet address");return}if(!de.match(/^0x[a-fA-F0-9]{40}$/)){tn.error("Please enter a valid Ethereum address");return}c(!0);try{de!==e&&C(`/wallet-details/${de}`),Ft(de);const[st]=await Promise.all([hs.post(ACe,{aggregateByTime:!0,type:"userFills",user:de}),dn(de)]);if(st.data&&Array.isArray(st.data)){const Ct=Bt(st.data);s(Ct),d(1)}else console.error("Invalid response format:",st.data)}catch(st){console.error("Error fetching data:",st)}finally{c(!1)}},Bt=de=>{const st=[...de].sort((vt,ln)=>ln.time-vt.time),Ct=new Map;return st.forEach(vt=>{var pn;const ln=vt.oid;if(!Ct.has(ln)){const dr=st.filter(br=>br.oid===vt.oid),jr=dr.reduce((br,Zn)=>br+parseFloat(Zn.sz),0),pr=dr.map(br=>parseFloat(br.startPosition));let fr;pr.includes(0)?fr=0:pr.every(br=>br>0)?fr=Math.max(...pr):pr.every(br=>br<0)?fr=Math.min(...pr):fr=dr.reduce((br,Zn)=>br+parseFloat(Zn.startPosition),0);const Kr=dr.reduce((br,Zn)=>br+parseFloat(Zn.sz)*parseFloat(Zn.px),0),rs=dr.reduce((br,Zn)=>br+parseFloat(Zn.closedPnl||0),0),Ir=((pn=dr.find(br=>br.dir==="Long > Short"||br.dir==="Short > Long"))==null?void 0:pn.dir)||"";Ct.set(ln,{oid:vt.oid,asset:vt.coin,direction:Ir==""?vt.dir:Ir,fills:dr,totalSize:jr,totalStartPositions:fr,totalValue:Kr,pnl:rs,latestFill:vt.time})}}),Array.from(Ct.values()).sort((vt,ln)=>ln.latestFill-vt.latestFill)},ot=de=>{const st=new Date(de),Ct=st.toLocaleString("en-US",{month:"short"}),vt=st.getDate(),ln=st.getFullYear(),pn=st.getHours().toString().padStart(2,"0"),dr=st.getMinutes().toString().padStart(2,"0"),jr=st.getHours()>=12?" PM":" AM";return`${Ct} ${vt}, ${ln}, ${pn}:${dr}  ${jr}`},De=r,_t=de=>{if(!(de!=null&&de.assetPositions))return[];const st=new Map;return r.forEach(Ct=>{Ct.fills.forEach(vt=>{let ln="";vt.dir.includes("Open")?ln=vt.dir.includes("Long")?"Long":"Short":vt.side==="B"?ln="Long":vt.side==="S"&&(ln="Short");const pn=`${vt.coin}-${ln}`;(!st.has(pn)||vt.time<st.get(pn))&&st.set(pn,vt.time)})}),de.assetPositions.filter(Ct=>{if(!Ct.position||!Ct.position.szi)return!1;const vt=parseFloat(Ct.position.szi);return!isNaN(vt)&&vt!==0}).map(Ct=>{const vt=Ct.position,ln=parseFloat(vt.szi),pn=parseFloat(vt.entryPx),dr=parseFloat(vt.positionValue),jr=parseFloat(vt.unrealizedPnl),pr=parseFloat(vt.returnOnEquity)*100,fr=parseFloat(vt.marginUsed),Kr=vt.leverage.value,rs=vt.leverage.type,Ir=parseFloat(vt.cumFunding.sinceOpen),br=ln>0?"Long":"Short",Zn=st.get(`${vt.coin}-${br}`);return{asset:vt.coin,type:br,size:ln,entryPrice:pn.toFixed(4),currentPrice:(dr/Math.abs(ln)).toFixed(4),leverage:Kr,marginMode:rs,positionValue:dr.toFixed(2),marginUsed:fr.toFixed(2),unrealizedPnl:jr.toFixed(2),roe:pr.toFixed(2),funding:Ir.toFixed(4),startTime:Zn?ot(Zn):"N/A",liquidationPrice:vt.liquidationPx?parseFloat(vt.liquidationPx).toFixed(2):"N/A"}})},ze=de=>{R.current&&(clearInterval(R.current),R.current=null),R.current=setInterval(()=>{dn(de)},7e3)},nt=de=>de>=1e6?`${(de/1e6).toFixed(2)}M`:de>=1e3?`${(de/1e3).toFixed(2)}K`:de.toFixed(2);m.useEffect(()=>{window.localStorage.getItem("hyperToken")&&(he(),oe())},[]);const mt=m.useRef(null),$t=()=>{mt.current&&(mt.current.scrollLeft-=200)},Pt=()=>{mt.current&&(mt.current.scrollLeft+=200)};m.useEffect(()=>{(async()=>{var vt,ln;const st=window.localStorage.getItem("hyperToken"),Ct=window.localStorage.getItem("hyperAddress");if(!(!st||!Ct))try{const pn=await _i(Ct.toLowerCase(),st);pn!=null&&pn.success?(G(pn==null?void 0:pn.telegram_chat_id),V(pn==null?void 0:pn.subscriber_role),te(pn==null?void 0:pn.subs_expire_day),ae((vt=pn==null?void 0:pn.mushboomer_counts)==null?void 0:vt.eth),fe((ln=pn==null?void 0:pn.mushboomer_counts)==null?void 0:ln.sol),Ne(pn==null?void 0:pn.referral_code),we(pn==null?void 0:pn.refcode),xe(pn==null?void 0:pn.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),ye(""),je(""))}catch(pn){console.error("Token verification error:",pn),console.error(pn.message||"An unknown error occurred.")}})()},[]);const un=async({walletAddress:de,isFollow:st,isScalper:Ct})=>{try{nn(de);const vt=window.localStorage.getItem("hyperToken"),ln=window.localStorage.getItem("hyperAddress");if(!vt){Pe(!0);return}const pn=st?"https://dextrabothypev2.nftinit.io/api/test_app/following/info/":"https://dextrabothypev2.nftinit.io/api/hyper/following/get_setting/",dr=st?{address:Ke?Ke.toLowerCase():ln,token:vt,follow_address:de.toLowerCase()}:{address:Ke?Ke.toLowerCase():ln,token:vt},jr=await fetch(pn,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(dr)});if(!jr.ok)throw new Error(`Server responded with status ${jr.status}`);const pr=await jr.json();pr.success?(ht(Array.isArray(pr==null?void 0:pr.data)?[...pr.data].sort((fr,Kr)=>new Date(Kr.created_at||0)-new Date(fr.created_at||0)):pr==null?void 0:pr.data),Kt(Ct),Le(!0)):(console.log(pr.error_message),tn.error(pr.error_message))}catch(vt){console.error("Error in like function:",vt),tn.error(vt.message||"Something went wrong!")}},an="-latestFill",[xn,An]=m.useState(an),[kn,yn]=m.useState([]),[Vn,Gn]=m.useState(""),[Rn,Yn]=m.useState(""),[Cn,rn]=m.useState(""),[Oe,Jt]=m.useState(!1),[sn,Et]=m.useState(!1),[Xn,gn]=m.useState(!1),[Dt,en]=m.useState(!1),In=m.useRef(null),Qn=m.useRef(null),ar=m.useRef(null),hr=m.useRef(null);m.useEffect(()=>{function de(st){In.current&&!In.current.contains(st.target)&&Jt(!1),Qn.current&&!Qn.current.contains(st.target)&&Et(!1),ar.current&&!ar.current.contains(st.target)&&gn(!1),hr.current&&!hr.current.contains(st.target)&&en(!1)}return document.addEventListener("mousedown",de),()=>document.removeEventListener("mousedown",de)},[]);const Gt=De.map(de=>{let st=de.totalStartPositions==0?"Open Position":de.direction!="Short > Long"&&de.direction!="Long > Short"?(de==null?void 0:de.totalSize)-Math.abs(de==null?void 0:de.totalStartPositions)==0&&(de.direction=="Close Long"||de.direction=="Close Short")?"Position Closed":de.direction=="Open Short"||de.direction=="Open Long"?"Increase":de.direction=="Close Long"||de.direction=="Close Short"?"Decrease":de.direction=="Sell"||de.direction=="Buy"?"Spot":"Changed Position":de.direction=="Short > Long"||de.direction=="Long > Short"?"Changed Position":"Open Position";return{...de,computedType:st}}),$n=de=>{const st=Ye.find(Ct=>Ct.label===de);return st?st.value.toUpperCase():de==null?void 0:de.toUpperCase()},nr=Gt.filter(de=>kn.length?kn.includes(de.computedType):!0).filter(de=>{var st,Ct;return Vn?(Ct=(st=de==null?void 0:de.oid)==null?void 0:st.toString())==null?void 0:Ct.includes(Vn):!0}).filter(de=>Rn?$n(de.asset).includes(Rn.toUpperCase()):!0),En=(de=>nr==null?void 0:nr.sort((st,Ct)=>{var rs,Ir,br,Zn;const vt=st.totalSize?st.totalValue/st.totalSize:0,ln=Ct.totalSize?Ct.totalValue/Ct.totalSize:0,pn=xs=>{const Qs=Ye.find(ai=>ai.label===xs);return Qs?Qs.value.toUpperCase():xs==null?void 0:xs.toUpperCase()},dr=pn(st.asset),jr=pn(Ct.asset),pr=xs=>{if(!xs)return"";const Qs=xs.toLowerCase();return Qs.includes("short")?"Short":Qs.includes("long")?"Long":Qs==="buy"?"Buy":Qs==="sell"?"Sell":xs},fr=pr(st.direction),Kr=pr(Ct.direction);if(de==="-totalSize")return Ct.totalSize-st.totalSize;if(de==="totalSize")return st.totalSize-Ct.totalSize;if(de==="-pnl")return Ct.pnl-st.pnl;if(de==="pnl")return st.pnl-Ct.pnl;if(de==="-fills")return(((rs=Ct.fills)==null?void 0:rs.length)||0)-(((Ir=st.fills)==null?void 0:Ir.length)||0);if(de==="fills")return(((br=st.fills)==null?void 0:br.length)||0)-(((Zn=Ct.fills)==null?void 0:Zn.length)||0);if(de==="-latestFill")return new Date(Ct.latestFill)-new Date(st.latestFill);if(de==="latestFill")return new Date(st.latestFill)-new Date(Ct.latestFill);if(de==="-avgPrice")return ln-vt;if(de==="avgPrice")return vt-ln;if(de==="-oid")return Ct.oid-st.oid;if(de==="oid")return st.oid-Ct.oid;if(de==="direction"){const xs={Short:1,Sell:2,Long:3,Buy:4};return(xs[fr]||99)-(xs[Kr]||99)}else if(de==="-direction"){const xs={Long:1,Buy:2,Short:3,Sell:4};return(xs[fr]||99)-(xs[Kr]||99)}else{if(de==="-coin")return dr<jr?-1:dr>jr?1:0;if(de==="coin")return dr>jr?-1:dr<jr?1:0}return 0}))(xn).filter(de=>(de.totalStartPositions==0?"Open Position":de.direction!="Short > Long"&&de.direction!="Long > Short"?(de==null?void 0:de.totalSize)-Math.abs(de==null?void 0:de.totalStartPositions)==0&&(de.direction=="Close Long"||de.direction=="Close Short")?"Position Closed":de.direction=="Open Short"||de.direction=="Open Long"?"Increase":de.direction=="Close Long"||de.direction=="Close Short"?"Decrease":de.direction=="Sell"||de.direction=="Buy"?"Spot":"Changed Position":de.direction=="Short > Long"||de.direction=="Long > Short"?"Changed Position":"Open Position")==="Open Position"),Ee={};En.forEach(de=>{var vt;const st=de==null?void 0:de.asset,Ct=new Date(de==null?void 0:de.latestFill).getTime();if(!Ee[st])Ee[st]=de;else{const ln=new Date((vt=Ee[st])==null?void 0:vt.latestFill).getTime();Ct>ln&&(Ee[st]=de)}});const h=Object.values(Ee),[p,S]=m.useState([]),_=a==null?void 0:a.filter(de=>{var st;return Cn?(st=de.asset)==null?void 0:st.toLowerCase().includes(Cn.toLowerCase()):!0}).map(de=>{const st=h.find(vt=>(vt==null?void 0:vt.asset)===(de==null?void 0:de.asset)),Ct=p.find(vt=>(vt==null?void 0:vt.coin)===(de==null?void 0:de.asset));return{...de,latestFill:(st==null?void 0:st.latestFill)||null,tagName:(Ct==null?void 0:Ct.tag)||null,tagWallet:(Ct==null?void 0:Ct.cp_wallet)||null}}),k="-unrealizedPnl",[T,B]=m.useState(k),W=de=>_==null?void 0:_.sort((st,Ct)=>{const vt=st.tagName?st.tagName.toUpperCase():"",ln=Ct.tagName?Ct.tagName.toUpperCase():"",pn=st.asset?st.asset.toUpperCase():"",dr=Ct.asset?Ct.asset.toUpperCase():"",jr=st.type==="Long"?1:0,pr=Ct.type==="Long"?1:0,fr=st.type==="Short"?1:0,Kr=Ct.type==="Short"?1:0;return de==="-unrealizedPnl"?Ct.unrealizedPnl-st.unrealizedPnl:de==="unrealizedPnl"?st.unrealizedPnl-Ct.unrealizedPnl:de==="-roe"?Ct.roe-st.roe:de==="roe"?st.roe-Ct.roe:de==="-size"?Ct.size-st.size:de==="size"?st.size-Ct.size:de==="-entryPrice"?Ct.entryPrice-st.entryPrice:de==="entryPrice"?st.entryPrice-Ct.entryPrice:de==="-currentPrice"?Ct.currentPrice-st.currentPrice:de==="currentPrice"?st.currentPrice-Ct.currentPrice:de==="-leverage"?Ct.leverage-st.leverage:de==="leverage"?st.leverage-Ct.leverage:de==="-positionValue"?Ct.positionValue-st.positionValue:de==="positionValue"?st.positionValue-Ct.positionValue:de==="-marginUsed"?Ct.marginUsed-st.marginUsed:de==="marginUsed"?st.marginUsed-Ct.marginUsed:de==="funding"?Ct.funding-st.funding:de==="-funding"?st.funding-Ct.funding:de==="-liquidationPrice"?Ct.liquidationPrice-st.liquidationPrice:de==="liquidationPrice"?st.liquidationPrice-Ct.liquidationPrice:de==="-entryTime"?new Date(Ct.latestFill)-new Date(st.latestFill):de==="entryTime"?new Date(st.latestFill)-new Date(Ct.latestFill):de==="-source_tag"?vt<ln?-1:vt>ln?1:0:de==="source_tag"?vt>ln?-1:vt<ln?1:0:de==="-type_leverage"?jr!==pr?pr-jr:Ct.leverage-st.leverage:de==="type_leverage"?fr!==Kr?Kr-fr:Ct.leverage-st.leverage:de==="-asset"?pn<dr?-1:pn>dr?1:0:de==="asset"?pn>dr?-1:pn<dr?1:0:0}),[ee,ce]=m.useState([]),[ue,ge]=m.useState([]),[Se,ke]=m.useState([]),[Me,qe]=m.useState([]),[Fe,at]=m.useState([]);async function se(){try{const de=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(!de.ok)throw new Error(`HTTP error! status: ${de.status}`);const st=await de.json();ce(st.results)}catch(de){console.error("Error resetting filters:",de)}}async function Ce(){try{const de=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(!de.ok)throw new Error(`HTTP error! status: ${de.status}`);const st=await de.json();ge(st.results)}catch(de){console.error("Error resetting filters:",de)}}async function Ue(){try{const de=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(!de.ok)throw new Error(`HTTP error! status: ${de.status}`);const st=await de.json();ke(st.results)}catch(de){console.error("Error resetting filters:",de)}}async function Be(){try{const de=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(!de.ok)throw new Error(`HTTP error! status: ${de.status}`);const st=await de.json();qe(st.results)}catch(de){console.error("Error resetting filters:",de)}}async function _e(){try{const de=await fetch(`https://dextradata.nftinit.io/api/hyper/wallet/details/?user_token=${e}`);if(!de.ok)throw new Error(`HTTP error! status: ${de.status}`);const st=await de.json();at(st)}catch(de){console.error("Error pnlSharpeRateData:",de)}}m.useEffect(()=>{se(),Ce(),Ue(),Be(),_e()},[]);const[rt,ct]=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"),[yt,Lt]=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"),[ft,Tt]=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"),Ge=rt==="1D"?ee:rt==="7D"?ue:rt==="30D"?Se:Me,At=yt==="1D"?ee:yt==="7D"?ue:yt==="30D"?Se:Me,Ot=a.length,it=a.filter(de=>de.unrealizedPnl>=0).length,jt=Ot>0?it/Ot*100:0,[Nn,mn]=m.useState({coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,referral:"",positionDistribution:0,pnl:0,closePx:0}),Sn=((Es=W(T))==null?void 0:Es.reduce((de,st)=>de+((st==null?void 0:st.leverage)||0),0))/(((gr=W(T))==null?void 0:gr.length)||1),Bn=(Vt=W(T))==null?void 0:Vt.reduce((de,st)=>{const Ct=parseFloat(st==null?void 0:st.funding)||0;return de+Ct},0),ur=localStorage.getItem("isDateOpenPositionsFormat")||"date",[_r,Un]=m.useState(ur);m.useEffect(()=>{localStorage.setItem("isDateOpenPositionsFormat",_r)},[_r]);const Kn=localStorage.getItem("isDateFillsFormat")||"date",[Yr,os]=m.useState(Kn);m.useEffect(()=>{localStorage.setItem("isDateFillsFormat",Yr)},[Yr]);const[ds,Je]=m.useState([]),bt=async()=>{try{const de=window.localStorage.getItem("hyperToken");if(!de){Pe(!0);return}const st="https://dextrabothypev2.nftinit.io/api/wallet/list",Ct=window.localStorage.getItem("hyperAddress"),ln=await(await fetch(st,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:Ke?Ke.toLowerCase():Ct,token:de,balance:"false"})})).json();ln!=null&&ln.success?(Je(ln.data||[]),yr(ln.data)):console.log(ln.error_message)}catch(de){console.error("Error fetching generate wallet list:",de)}};m.useEffect(()=>{window.localStorage.getItem("hyperToken")&&bt()},[Q]);const Tn=ds==null?void 0:ds.find(de=>(de==null?void 0:de.wallet_address)===(e==null?void 0:e.toLowerCase())),er=ie==null?void 0:ie.find(de=>(de==null?void 0:de.wallet_address)===(e==null?void 0:e.toLowerCase())),[kr,Dr]=m.useState([]),[Ur,cr]=m.useState(!0),[Cr,ls]=m.useState(!1);m.useEffect(()=>{_&&_.length>0&&(Jr(),ds.length>0&&Ur&&yr())},[_]);const yr=de=>{const st=[...kr];st.length>0&&((de==null?void 0:de.some(vt=>(vt==null?void 0:vt.wallet_address)===(e==null?void 0:e.toLowerCase())))?Ks(st):Ur&&(Ks(st),cr(!1)))},Jr=()=>{const de=window.localStorage.getItem("hyperToken");let st=!1;const Ct=[...kr];_==null||_.forEach(vt=>{const ln=vt.asset;(Ct==null?void 0:Ct.some(dr=>dr.coin===ln))||(Ct==null||Ct.push({coin:ln,wallet:e}),st=!0)}),st&&(Dr(Ct),ds!=null&&ds.some(ln=>(ln==null?void 0:ln.wallet_address)===(e==null?void 0:e.toLowerCase()))&&de&&Ks(Ct))},Ks=async de=>{if(!Cr)try{ls(!0);const st=window.localStorage.getItem("hyperToken"),Ct="https://dextrabothypev2.nftinit.io/api/hyper/following/position_info/";if(!st||!de){ls(!1);return}st||Pe(!0);const vt=window.localStorage.getItem("hyperAddress"),pn=await(await fetch(Ct,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:Ke?Ke.toLowerCase():vt,token:st,positions:de})})).json();pn.success?S(pn==null?void 0:pn.data):(console.log(pn.error_message),tn.error(pn.error_message))}catch(st){console.error("Error tag request",st),tn.error(st.message)}finally{ls(!1)}};return i.jsxs(i.Fragment,{children:[i.jsx(RUe,{}),i.jsx(w5,{open:tt,setOpen:Le,copyTradeData:$e,copyTradeWallet:wt,setCopyTradeWallet:nn,isScalper:pt,setCopyTradeData:ht}),i.jsx(cin,{open:cn,setOpen:zn,data:Nn,setTradeInfo:mn}),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(sDe,{wallet:e,className:"w-10 h-10 rounded-full"}),i.jsxs("div",{className:`${ds.some(de=>(de==null?void 0:de.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:`${ds.some(de=>(de==null?void 0:de.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:de=>{de.stopPropagation(),navigator.clipboard.writeText(e),tn.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:`${ds.some(de=>(de==null?void 0:de.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:`${ds.some(de=>(de==null?void 0:de.wallet_address)==(e==null?void 0:e.toLowerCase()))?"#67FFBD":"#909090"}`,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),i.jsxs("div",{className:`${ds.some(de=>(de==null?void 0:de.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:[Tn&&i.jsx("div",{className:"text-[#67ffbd] text-sm font-semibold font-manrope leading-[8px]",children:Tn.wallet_name.length>13?Tn.wallet_name.slice(0,13)+"...":Tn.wallet_name}),Tn&&Tn.wallet_name.length>13&&i.jsx("span",{className:"",children:i.jsx(Oa,{content:`${Tn==null?void 0:Tn.wallet_name}`,positionTop:!1,alignRight:!1})})]}),i.jsxs("div",{className:`${ie.some(de=>de.wallet_address===e)?Tn?"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:[er&&i.jsx("div",{className:"text-[#67ffbd] text-sm font-semibold font-manrope leading-[8px]",children:(er==null?void 0:er.tag.length)>13?(er==null?void 0:er.tag.slice(0,13))+"...":er==null?void 0:er.tag}),er&&er.tag.length>13&&i.jsx("span",{className:"",children:i.jsx(Oa,{content:`${er==null?void 0:er.tag}`,positionTop:!1,alignRight:!1})})]})]}),i.jsx(v5,{walletAddress:e,children:i.jsx("div",{className:`${re.some(de=>de.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(de=>de.wallet_address===e)?i.jsx("img",{src:o5,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:de=>{var vt;de.preventDefault();const st=ie==null?void 0:ie.some(ln=>ln.wallet_address===e),Ct=(ue==null?void 0:ue.length)>0?(vt=ue[0])==null?void 0:vt.is_scalper:!1;un({walletAddress:e,isFollow:st,isScalper:Ct})},className:`${ie.some(de=>de.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(de=>de.wallet_address===e)?"Edit Copy Trade":"Copy Trade"})}),i.jsx("div",{className:"sm:hidden h-6 flex justify-end",children:Q&&i.jsx(GY,{walletAddress:e})})]}),i.jsx(nin,{traderWallet:e,trades:J})]}),i.jsxs("div",{className:"absolute right-0 flex justify-end",children:[Q&&i.jsx(GY,{walletAddress:e}),i.jsx("div",{className:"absolute right-0 hidden sm:flex",children:Q&&i.jsx(GY,{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:mt,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:()=>{mn(de=>({...de,coin:"--",type:f?parseFloat(f.marginSummary.totalNtlPos)===0?"NEUTRAL":a.reduce((st,Ct)=>st+(Ct.type==="Long"?parseFloat(Ct.positionValue):-parseFloat(Ct.positionValue)),0)>0?"LONG":"SHORT":"--",leverage:Sn&&Sn!=0?`${parseFloat(Sn).toFixed(2)}x`:"--",roe:At.length>0?At.map(st=>st==null?void 0:st.margin_roi).join(", "):"--",entryPrice:f?a.reduce((st,Ct)=>st+parseFloat(Ct.unrealizedPnl||0),0):"-",markPrice:Ot>0?`${it} / ${Ot} (${it/Ot*100===0||it/Ot*100===100?it/Ot*100:(it/Ot*100).toFixed(2)}%)`:"--",positionDistribution:f?`${isNaN(a.reduce((st,Ct)=>Ct.type==="Long"?st+parseFloat(Ct.positionValue):st,0)/parseFloat(f.marginSummary.totalNtlPos)*100)?0:a.reduce((st,Ct)=>Ct.type==="Long"?st+parseFloat(Ct.positionValue):st,0)/parseFloat(f.marginSummary.totalNtlPos)*100===0||a.reduce((st,Ct)=>Ct.type==="Long"?st+parseFloat(Ct.positionValue):st,0)/parseFloat(f.marginSummary.totalNtlPos)*100===100?a.reduce((st,Ct)=>Ct.type==="Long"?st+parseFloat(Ct.positionValue):st,0)/parseFloat(f.marginSummary.totalNtlPos)*100:(a.reduce((st,Ct)=>Ct.type==="Long"?st+parseFloat(Ct.positionValue):st,0)/parseFloat(f.marginSummary.totalNtlPos)*100).toFixed(2)}% / ${isNaN(a.reduce((st,Ct)=>Ct.type==="Short"?st+parseFloat(Ct.positionValue):st,0)/parseFloat(f.marginSummary.totalNtlPos)*100)?0:a.reduce((st,Ct)=>Ct.type==="Short"?st+parseFloat(Ct.positionValue):st,0)/parseFloat(f.marginSummary.totalNtlPos)*100===0||a.reduce((st,Ct)=>Ct.type==="Short"?st+parseFloat(Ct.positionValue):st,0)/parseFloat(f.marginSummary.totalNtlPos)*100===100?a.reduce((st,Ct)=>Ct.type==="Short"?st+parseFloat(Ct.positionValue):st,0)/parseFloat(f.marginSummary.totalNtlPos)*100:(a.reduce((st,Ct)=>Ct.type==="Short"?st+parseFloat(Ct.positionValue):st,0)/parseFloat(f.marginSummary.totalNtlPos)*100).toFixed(2)}%`:"-",referral:window.localStorage.getItem("hyperToken")?me:null})),zn(!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:ayt,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((de,st)=>de+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((de,st)=>de+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:it})," ","/ ",Ot," (",jt==0?"0":jt!=0&&jt!=100?jt.toFixed(2):jt,"%)"]})]})})]}),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:()=>{ct("1D"),localStorage.setItem("discover_period",0)},className:`${rt==="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:()=>{ct("7D"),localStorage.setItem("discover_period",1)},className:`${rt==="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:()=>{ct("30D"),localStorage.setItem("discover_period",2)},className:`${rt==="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:()=>{ct("90D"),localStorage.setItem("discover_period",3)},className:`${rt==="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"})})]}),(Ge==null?void 0:Ge.length)>0?Ge==null?void 0:Ge.map((de,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:(de==null?void 0:de.win_complated_rate)==null||isNaN(parseFloat(de==null?void 0:de.win_complated_rate))?"--":(de==null?void 0:de.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:(de==null?void 0:de.rtx_count)==null||isNaN(parseFloat(de==null?void 0:de.rtx_count))?"--":Os(de==null?void 0:de.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:()=>{on("day"),Lt("1D"),localStorage.setItem("discover_period",0)},className:`${Zt==="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:()=>{on("week"),Lt("7D"),localStorage.setItem("discover_period",1)},className:`${Zt==="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:()=>{on("month"),Lt("30D"),localStorage.setItem("discover_period",2)},className:`${Zt==="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:()=>{on("threeMonth"),Lt("90D"),localStorage.setItem("discover_period",3)},className:`${Zt==="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:()=>{on("allTime"),Lt("90D"),localStorage.setItem("discover_period",4)},className:`${Zt==="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:`${!(At!=null&&At.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":Zt==="day"?Re.day>0?"text-[#67FFBD]":Re.day<0?"text-[#FF7173]":"text-white":Zt==="week"?Re.week>0?"text-[#67FFBD]":Re.week<0?"text-[#FF7173]":"text-white":Zt==="month"?Re.month>0?"text-[#67FFBD]":Re.month<0?"text-[#FF7173]":"text-white":Zt==="threeMonth"?Re.threeMonth>0?"text-[#67FFBD]":Re.threeMonth<0?"text-[#FF7173]":"text-white":Zt==="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 de={day:Re.day,week:Re.week,month:Re.month,threeMonth:Re.threeMonth,allTime:Re.all}[Zt];return`$${Os(Math.abs(de))}`})()}):i.jsx("div",{className:"text-white text-xs font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:"No trades in this period"})]}),!(At!=null&&At.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"}),(At==null?void 0:At.length)>0?At==null?void 0:At.map((de,st)=>i.jsx("div",{className:`${(de==null?void 0:de.margin_roi)==null||isNaN(parseFloat(de==null?void 0:de.margin_roi))||(de==null?void 0:de.margin_roi)==0?"text-white":(de==null?void 0:de.margin_roi)>0?"text-[#67FFBD]":"text-[#FF7173]"} text-lg font-semibold font-manrope leading-[13px] tracking-[0.18px]`,children:(de==null?void 0:de.margin_roi)==null||isNaN(parseFloat(de==null?void 0:de.margin_roi))?"--":Os(Math.abs(de==null?void 0:de.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((de,st)=>de+(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((de,st)=>st.type==="Long"?de+parseFloat(st.positionValue):de,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((de,st)=>st.type==="Long"?de+parseFloat(st.positionValue):de,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((de,st)=>st.type==="Long"?de+parseFloat(st.positionValue):de,0)/parseFloat(f.marginSummary.totalNtlPos)*100)?0:(a.reduce((de,st)=>st.type==="Long"?de+parseFloat(st.positionValue):de,0)/parseFloat(f.marginSummary.totalNtlPos)*100).toFixed(2):"-","%"]}),i.jsxs("span",{className:"text-[#FF7173]",children:[f?isNaN(a.reduce((de,st)=>st.type==="Short"?de+parseFloat(st.positionValue):de,0)/parseFloat(f.marginSummary.totalNtlPos)*100)?0:(a.reduce((de,st)=>st.type==="Short"?de+parseFloat(st.positionValue):de,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?nt(a.reduce((de,st)=>st.type==="Long"?de+parseFloat(st.positionValue):de,0)):"-"}),i.jsx("span",{className:"text-[#ff787b]",children:f?nt(a.reduce((de,st)=>st.type==="Short"?de+parseFloat(st.positionValue):de,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((de,st)=>st.type==="Long"?de+parseFloat(st.positionValue):de,0)/parseFloat(f.marginSummary.totalNtlPos)*100)?{width:"0%"}:{width:`${a.reduce((de,st)=>st.type==="Long"?de+parseFloat(st.positionValue):de,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((de,st)=>st.type==="Short"?de+parseFloat(st.positionValue):de,0)/parseFloat(f.marginSummary.totalNtlPos)*100)?{width:"0%"}:{width:`${a.reduce((de,st)=>st.type==="Short"?de+parseFloat(st.positionValue):de,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:Sn&&Sn!=0?`${parseFloat(Sn).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:`${Bn<=0?"text-[#67FFBD]":"text-[#FF7173]"} text-sm font-semibold font-['Manrope'] leading-[13px] tracking-tight`,children:Bn&&Bn!=0?`$${Sv(Math.abs(Bn))}`:"--"})]})})]}),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:()=>{Tt("7D"),localStorage.setItem("discover_period",1)},className:`${ft==="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:()=>{Tt("30D"),localStorage.setItem("discover_period",2)},className:`${ft==="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:()=>{Tt("90D"),localStorage.setItem("discover_period",3)},className:`${ft==="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(Ai,{className:"text-[#7C7C7C] w-3 min-w-3 min-h-3 h-3"}),i.jsx("span",{className:"",children:i.jsx(so,{content:"Sharpe_tooltip",positionTop:!1,alignRight:!1,tooltipCss:"max-w-[80px] min-w-[80px] leading-[16px] -mb-12"})})]})})]}),i.jsx("div",{className:`${(ft==="7D"?Fe==null?void 0:Fe.portfolio_perp_week_sharpe:ft==="30D"?Fe==null?void 0:Fe.portfolio_perp_month_sharpe:Fe==null?void 0:Fe.portfolio_perp_3month_sharpe)>=1&&(ft==="7D"?Fe==null?void 0:Fe.portfolio_perp_week_sharpe:ft==="30D"?Fe==null?void 0:Fe.portfolio_perp_month_sharpe:Fe==null?void 0:Fe.portfolio_perp_3month_sharpe)<=2?"text-[#E5BB18]":(ft==="7D"?Fe==null?void 0:Fe.portfolio_perp_week_sharp:ft==="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:ft==="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):ft==="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:`${(ft==="7D"?Fe==null?void 0:Fe.portfolio_perp_week_growth_rate:ft==="30D"?Fe==null?void 0:Fe.portfolio_perp_month_growth_rate:Fe==null?void 0:Fe.portfolio_perp_3month_growth_rate)==0?"text-white":(ft==="7D"?Fe==null?void 0:Fe.portfolio_perp_week_growth_rate:ft==="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:ft==="7D"?(Fe==null?void 0:Fe.portfolio_perp_week_growth_rate)==null||isNaN(parseFloat(Fe==null?void 0:Fe.portfolio_perp_week_growth_rate))?"--":Os(Fe==null?void 0:Fe.portfolio_perp_week_growth_rate)+"%":ft==="30D"?(Fe==null?void 0:Fe.portfolio_perp_month_growth_rate)==null||isNaN(parseFloat(Fe==null?void 0:Fe.portfolio_perp_month_growth_rate))?"--":Os(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))?"--":Os(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:`${(ft==="7D"?Fe==null?void 0:Fe.portfolio_perp_week_dd:ft==="30D"?Fe==null?void 0:Fe.portfolio_perp_month_dd:Fe==null?void 0:Fe.portfolio_perp_3month_dd)==0?"text-white":(ft==="7D"?Fe==null?void 0:Fe.portfolio_perp_week_dd:ft==="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:ft==="7D"?(Fe==null?void 0:Fe.portfolio_perp_week_dd)==null||isNaN(parseFloat(Fe==null?void 0:Fe.portfolio_perp_week_dd))?"--":Os(Math.abs(Fe==null?void 0:Fe.portfolio_perp_week_dd))+"%":ft==="30D"?(Fe==null?void 0:Fe.portfolio_perp_month_dd)==null||isNaN(parseFloat(Fe==null?void 0:Fe.portfolio_perp_month_dd))?"--":Os(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))?"--":Os(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:$t,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(Dl,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:Pt,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(Dl,{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(Zsn,{})})]})]}),i.jsx(YUe,{initialAddress:e})]})]})},Lin=()=>{const e=t5(),t=(e==null?void 0:e.walletAddress.toLowerCase())||"";return i.jsxs(i.Fragment,{children:[i.jsx(No,{children:i.jsxs(Lo,{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(Rin,{initialAddress:t})})]})},Din=({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?bre.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 Bin(){const{signModalOpen:e,setSignModalOpen:t,signIn:n,hyperToken:r,walletLogin:s}=m.useContext(Qr),{isConnected:a}=ts(),{openConnectModal:o}=y5(),l=typeof window<"u"&&window.matchMedia("(max-width:640px)").matches,c=()=>{window.localStorage.getItem("hyperToken")&&r?s():(n(1),t(!1))};return i.jsx(Din,{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:$a,alt:"close",className:"p-1"})}),i.jsx("img",{src:Ki,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(t_,{}):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(t_,{})})}):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 Ul=()=>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:Hbt,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"]})]})]})]}),$in=({data:e,loading:t,error:n,trackerData:r,isRequest:s,setIsRequest:a})=>{var xe;const{trackedWatchList:o,getTrackedWatchList:l,setSignModalOpen:c}=m.useContext(Qr),{isConnected:u,address:d}=ts(),[f,x]=m.useState(!1),[g,v]=m.useState(null),[w,C]=m.useState(null),[N,P]=m.useState(""),[I,R]=m.useState([]),[O,U]=m.useState(!1),[L,z]=m.useState({}),X="-tag",[ne,J]=m.useState(X),K=ye=>r.sort((je,Pe)=>{const Re=I.find(ht=>ht.wallet_address===je.wallet_address)||{},Xe=I.find(ht=>ht.wallet_address===Pe.wallet_address)||{},Ke=Re.data?Re.data.reduce((ht,pt)=>ht+parseFloat(pt.unrealizedPnl||0),0):Re.unrealizedPnl||0,ut=Xe.data?Xe.data.reduce((ht,pt)=>ht+parseFloat(pt.unrealizedPnl||0),0):Xe.unrealizedPnl||0,et=je.tag?je.tag.toUpperCase():"",tt=Pe.tag?Pe.tag.toUpperCase():"",Le=je.wallet_address?je.wallet_address.toLowerCase():"",$e=Pe.wallet_address?Pe.wallet_address.toLowerCase():"";return ye==="tag"?et<tt?-1:et>tt?1:0:ye==="-tag"?et>tt?-1:et<tt?1:0:ye==="-wallet_address"?Le<$e?-1:Le>$e?1:0:ye==="wallet_address"?Le>$e?-1:Le<$e?1:0:ye==="perp_equity"?(Re.perp_equity||0)-(Xe.perp_equity||0):ye==="-perp_equity"?(Xe.perp_equity||0)-(Re.perp_equity||0):ye==="margin_usage"?(Re.margin_usage||0)-(Xe.margin_usage||0):ye==="-margin_usage"?(Xe.margin_usage||0)-(Re.margin_usage||0):ye==="unrealizedPnl"?Ke-ut:ye==="-unrealizedPnl"?ut-Ke:ye==="-expire_date"?new Date(Pe.expire_date)-new Date(je.expire_date):ye==="expire_date"?new Date(je.expire_date)-new Date(Pe.expire_date):0}),re=async({walletAddress:ye,isFollow:je,isScalper:Pe})=>{try{P(ye);const Re=window.localStorage.getItem("hyperToken"),Xe=window.localStorage.getItem("hyperAddress");if(!Re){c(!0);return}const Ke=je?"https://dextrabothypev2.nftinit.io/api/test_app/following/info/":"https://dextrabothypev2.nftinit.io/api/hyper/following/get_setting/",ut=je?{address:d?d.toLowerCase():Xe,token:Re,follow_address:ye.toLowerCase()}:{address:d?d.toLowerCase():Xe,token:Re},et=await fetch(Ke,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(ut)});if(!et.ok)throw new Ul(`Server responded with status ${et.status}`);const tt=await et.json();tt.success?(v(Array.isArray(tt==null?void 0:tt.data)?[...tt.data].sort((Le,$e)=>new Date($e.created_at||0)-new Date(Le.created_at||0)):tt==null?void 0:tt.data),C(Pe),x(!0)):(console.log(tt.error_message),tn.error(tt.error_message))}catch(Re){console.error("Error in like function:",Re),tn.error(Re.message||"Something went wrong!")}},he=ye=>ye!=null&&ye.assetPositions?ye.assetPositions.filter(je=>{if(!je.position||!je.position.szi)return!1;const Pe=parseFloat(je.position.szi);return!isNaN(Pe)&&Pe!==0}).map(je=>{const Pe=je.position,Re=parseFloat(Pe.szi),Xe=parseFloat(Pe.entryPx),Ke=parseFloat(Pe.positionValue),ut=parseFloat(Pe.unrealizedPnl),et=parseFloat(Pe.returnOnEquity)*100,tt=parseFloat(Pe.marginUsed),Le=Pe.leverage.value,$e=parseFloat(Pe.cumFunding.sinceOpen),ht=Re>0?"Long":"Short";return{asset:Pe.coin,type:ht,size:Math.abs(Re),entryPrice:Xe.toFixed(2),currentPrice:(Ke/Math.abs(Re)).toFixed(2),leverage:Le,positionValue:Ke.toFixed(2),marginUsed:tt.toFixed(2),unrealizedPnl:ut.toFixed(2),roe:et.toFixed(2),funding:$e.toFixed(4),liquidationPrice:Pe.liquidationPx?parseFloat(Pe.liquidationPx).toFixed(2):"N/A"}}):[],Q=async ye=>{try{const Pe=await hs.post("https://api-ui.hyperliquid.xyz/info",{type:"clearinghouseState",user:ye});if(Pe.data){const Re=he(Pe.data);R(Xe=>{var Ke,ut,et,tt;return[...Xe,{wallet_address:ye,perp_equity:(ut=(Ke=Pe==null?void 0:Pe.data)==null?void 0:Ke.marginSummary)==null?void 0:ut.accountValue,margin_usage:parseFloat((et=Pe==null?void 0:Pe.data)==null?void 0:et.marginSummary.totalMarginUsed)/parseFloat((tt=Pe==null?void 0:Pe.data)==null?void 0:tt.marginSummary.accountValue),data:Re}]})}}catch(je){console.error("Error fetching user state from HyperState:",je)}},ie=async ye=>{try{const je=window.localStorage.getItem("hyperToken"),Pe="https://dextrabothypev2.nftinit.io/api/hyper/tracker/getclearinghousestate/",Re=window.localStorage.getItem("hyperAddress"),Xe=await fetch(Pe,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:d?d.toLowerCase():Re,token:je,follow_address:ye})});if(Xe.ok){const Ke=await Xe.json();if(Ke.success){const ut=he(Ke==null?void 0:Ke.data);R(et=>{var tt;return[...et,{wallet_address:ye,perp_equity:(tt=Ke==null?void 0:Ke.data.marginSummary)==null?void 0:tt.accountValue,margin_usage:parseFloat(Ke==null?void 0:Ke.data.marginSummary.totalMarginUsed)/parseFloat(Ke==null?void 0:Ke.data.marginSummary.accountValue),data:ut}]})}}else if(Xe.status===500)console.warn(`Received 500 error for ${ye}, retrying with getUserHyperState`),await Q(ye);else throw new Ul(`Request failed with status ${Xe.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 Pe=r[je];ie(Pe==null?void 0:Pe.wallet_address.toLowerCase()).catch(Re=>{console.error(`Error fetching user state for wallet ${Pe.wallet_address}:`,Re)}),await new Promise(Re=>setTimeout(Re,500))}})())},[s,t,r]);const G=async(ye,je)=>{try{const Pe=window.localStorage.getItem("hyperToken"),Re="https://dextrabothypev2.nftinit.io/api/hyper/tracker/extend_tracker_expiry/";if(!Pe||!ye||!je)return;z(et=>({...et,[je]:!0}));const Xe=window.localStorage.getItem("hyperAddress"),Ke=await fetch(Re,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:d?d==null?void 0:d.toLowerCase():Xe,token:Pe,tracker_id:ye})});if(!Ke.ok)throw new Ul(`Failed to unlike: ${Ke.status} ${Ke.statusText}`);const ut=await Ke.json();ut.success?(z(et=>({...et,[je]:!1})),l(),tn.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"}})):(tn.error(ut.error_message),z(et=>({...et,[je]:!1})))}catch(Pe){tn.error(Pe.message||"Something went wrong!"),z(Re=>({...Re,[je]:!1}))}},V=m.useRef(null),te=()=>{V.current&&(V.current.scrollLeft-=100)},ae=()=>{V.current&&(V.current.scrollLeft+=100)},fe=()=>{V.current&&(V.current.scrollTop+=200)},Ne=()=>{V.current&&(V.current.scrollTop-=200)},me=ye=>{const je=new Date(ye),Pe=new Date,Re=new Date(je.getFullYear(),je.getMonth(),je.getDate()),Xe=new Date(Pe.getFullYear(),Pe.getMonth(),Pe.getDate());return(Re-Xe)/(1e3*60*60*24)<=3},we=ye=>ye>=640&&ye<1024?5:ye>=1024&&ye<1240?6:ye>=1240&&ye<1540||ye>=1540?7:3;return i.jsxs(i.Fragment,{children:[i.jsx(w5,{open:f,setOpen:x,copyTradeData:g,copyTradeWallet:N,setCopyTradeWallet:P,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:te,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(Qa,{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(Qa,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:Ne,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(Qa,{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(Qa,{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(pi,{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(pi,{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(pi,{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(pi,{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(pi,{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(Ai,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(so,{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(pi,{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:we(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(Ba,{})})})}):n&&!r?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:we(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(Ul,{})})})}):(r==null?void 0:r.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:we(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:ac,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."]})]})]})]})})})})}):(xe=K(ne))==null?void 0:xe.map((ye,je)=>{var Re,Xe;const Pe=I.find(Ke=>Ke.wallet_address===ye.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:Ke=>{Ke.preventDefault();const ut=e==null?void 0:e.some(et=>et.wallet_address===(ye==null?void 0:ye.wallet_address));re({walletAddress:ye==null?void 0:ye.wallet_address,isFollow:ut,isScalper:ye==null?void 0:ye.is_scalper})},className:`${e!=null&&e.some(Ke=>Ke.wallet_address===(ye==null?void 0:ye.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(v5,{walletAddress:ye==null?void 0:ye.wallet_address,children:i.jsx("div",{className:"w-[18px] h-[18px] justify-center items-center flex cursor-pointer",children:o.some(Ke=>Ke.wallet_address===(ye==null?void 0:ye.wallet_address))?i.jsx("img",{src:o5,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"}):i.jsx("img",{src:NA,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(oa,{info1:ye!=null&&ye.tag?(ye==null?void 0:ye.tag.length)>=13?(ye==null?void 0:ye.tag).slice(0,13)+"...":ye==null?void 0:ye.tag:"--",info1_Color:"text-white",rowTwo:!1}),(ye==null?void 0:ye.tag)&&(ye==null?void 0:ye.tag.length)>=13&&i.jsx("span",{className:"-ml-[9px]",children:i.jsx(Oa,{content:`${ye==null?void 0:ye.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/${ye==null?void 0:ye.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:Ki,alt:"dextra",className:"w-4 h-4 sm:w-8 sm:h-8",loading:"lazy",onError:Ke=>{Ke.target.onerror=null,Ke.target.src="https://app.dextrabot.com/dextrabotIcon.png"}})})}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx(oa,{info1:`${(ye==null?void 0:ye.wallet_address).slice(0,5)+"..."+(ye==null?void 0:ye.wallet_address).slice(-4)}`,info1_Color:"text-white",rowTwo:!1}),i.jsx("img",{onClick:Ke=>{Ke.stopPropagation(),navigator.clipboard.writeText(ye==null?void 0:ye.wallet_address),tn.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:Co,alt:"",className:"cursor-pointer"})]})]})})}),i.jsx("td",{className:"pr-1",children:O?i.jsx(e0,{info:"Loading...",textColor:"text-white"}):Pe?i.jsx(e0,{info:(Pe==null?void 0:Pe.perp_equity)!=0?`$${Er(Pe==null?void 0:Pe.perp_equity)}`:"$0",textColor:"text-white"}):i.jsx(e0,{info:"Loading...",textColor:"text-white"})}),i.jsx("td",{className:"pr-1",children:O?i.jsx(e0,{info:"Loading...",textColor:"text-white"}):Pe?i.jsx(e0,{info:isNaN(Pe==null?void 0:Pe.margin_usage)?"0%":`${((Pe==null?void 0:Pe.margin_usage)*100).toFixed(2)}%`,textColor:"text-white"}):i.jsx(e0,{info:"Loading...",textColor:"text-white"})}),i.jsx("td",{className:"pr-1",children:O?i.jsx(e0,{info:"Loading...",textColor:"text-white"}):Pe?i.jsx(e0,{info:(Pe==null?void 0:Pe.data)!=0?`$${Er(Math.abs((Re=Pe==null?void 0:Pe.data)==null?void 0:Re.reduce((Ke,ut)=>Ke+parseFloat(ut.unrealizedPnl||0),0)))}`:"$0",textColor:`${((Xe=Pe==null?void 0:Pe.data)==null?void 0:Xe.reduce((Ke,ut)=>Ke+parseFloat(ut.unrealizedPnl),0))>=0?"text-[#4ae3b5]":"text-[#ff6b6b]"}`}):i.jsx(e0,{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:[me(ye==null?void 0:ye.expire_date)&&i.jsxs("div",{className:"flex justify-end items-center has-tooltip relative min-w-max",children:[i.jsx("img",{src:_yt,alt:"",className:"w-[14px] min-w-[14px] min-h-[14px] h-[14px]"}),i.jsx("span",{className:"",children:i.jsx(so,{content:`This tracker will expire on ${p3(ye==null?void 0:ye.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(e0,{info:ye!=null&&ye.expire_date?p3(ye==null?void 0:ye.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:me(ye==null?void 0:ye.expire_date)&&(L[ye==null?void 0:ye.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(ye==null?void 0:ye.id,ye==null?void 0:ye.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:kyt,alt:""}),i.jsx("div",{className:"justify-start text-[#ffaa46] text-[11px] font-semibold font-['Manrope'] leading-[8px]",children:"Renew"})]}))})})]},je)})})]})})]})]})]})},e0=({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})}),fU=()=>{const{isConnected:e}=ts(),{openConnectModal:t}=y5(),{walletLogin:n,signIn:r}=m.useContext(Qr),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:Ki,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(t_,{}):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(t_,{}):"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"})]})]})},Uin=()=>{const[e,t]=m.useState(!1),[n,r]=m.useState(!1);ts();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:P,setIsWhitelist:I,setHyperToken:R,setHyperAddress:O}=m.useContext(Qr);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 _i(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),P(J==null?void 0:J.refcode),I(J==null?void 0:J.whitelist),R(L),O(z)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),R(""),O(""))}catch(J){console.error("Token verification error:",J),console.error(J.message||"An unknown error occurred.")}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(No,{children:i.jsxs(Lo,{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($in,{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(fU,{})})})})]})},zin=()=>{m.useRef([]);const e=m.useRef(null),{isConnected:t,address:n}=ts(),{setSignModalOpen:r,trackedWatchList:s,hyperToken:a}=m.useContext(Qr),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:K,dir:re,side:he,crossed:Q,feeToken:ie,listen_user:oe,cloid:G,coin:V,subs_address:te,sz:ae,closedPnl:fe,fee:Ne,time:me,startPosition:we,insert_date:xe,hash:ye}=ne;z[J]||(z[J]={oid:J,px:K,dir:re,side:he,crossed:Q,feeToken:ie,listen_user:oe,cloid:G,coin:V,subs_address:te,totalSize:0,totalStartPositions:0,totalClosedPnl:0,totalFee:0,closestTime:me,earliestStartPosition:we,insertDate:xe,hashes:[],hasZeroStartPosition:!1}),parseFloat(we)===0&&(z[J].hasZeroStartPosition=!0),z[J].hasZeroStartPosition?z[J].totalStartPositions=0:z[J].totalStartPositions+=parseFloat(we),z[J].totalSize+=parseFloat(ae),z[J].totalClosedPnl+=parseFloat(fe),z[J].totalFee+=parseFloat(Ne),new Date(me)>new Date(z[J].closestTime)&&(z[J].closestTime=me),new Date(me)>new Date(z[J].insertDate)&&(z[J].insertDate=xe),new Date(me)<new Date(z[J].closestTime)&&(z[J].earliestStartPosition=we),z[J].hashes.push(ye)}),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 K=w(J==null?void 0:J.data);v(K)}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:K,dir:re,side:he,crossed:Q,feeToken:ie,listen_user:oe,cloid:G,coin:V,subs_address:te,sz:ae,closedPnl:fe,fee:Ne,time:me,startPosition:we,insert_date:xe,hash:ye}=ne;X[J]||(X[J]={oid:J,px:K,dir:re,side:he,crossed:Q,feeToken:ie,listen_user:oe,cloid:G,coin:V,subs_address:te,totalSize:0,totalStartPositions:0,totalClosedPnl:0,totalFee:0,closestTime:me,earliestStartPosition:we,insertDate:xe,hashes:[],hasZeroStartPosition:!1}),parseFloat(we)===0&&(X[J].hasZeroStartPosition=!0),X[J].hasZeroStartPosition?X[J].totalStartPositions=0:X[J].totalStartPositions+=parseFloat(we),X[J].totalSize+=parseFloat(ae),X[J].totalClosedPnl+=parseFloat(fe),X[J].totalFee+=parseFloat(Ne),new Date(me)>new Date(X[J].closestTime)&&(X[J].closestTime=me),new Date(me)>new Date(X[J].insertDate)&&(X[J].insertDate=xe),new Date(me)<new Date(X[J].closestTime)&&(X[J].earliestStartPosition=we),X[J].hashes.push(ye)}),Object.values(X).sort((ne,J)=>new Date(J.closestTime)-new Date(ne.closestTime))}const P=m.useRef(!1),I=m.useRef(n),R=m.useRef(s);m.useEffect(()=>{I.current=n},[n]),m.useEffect(()=>{o.current=a},[a]),m.useEffect(()=>{R.current=s},[s]);const O="hyper_get_message";m.useEffect(()=>{if(!a||P.current)return;const L=Ny("https://dextrabothypesocketv2.nftinit.io/");return e.current=L,P.current=!0,e.current.on("connect",()=>{console.log("Socket connected");const z=()=>{var J;const X=(J=I.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(O,function(z){if(z){const X=Array.isArray(z)?z:[z];v(ne=>{const J=N([],X);let K=ne.filter(Q=>X.some(ie=>ie.oid===Q.oid)),re=[];K.length>0?re=N(J,K):re=J;const he=ne.filter(Q=>!X.some(ie=>ie.oid===Q.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",O)}),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"),P.current=!1}),()=>{e.current.disconnect(),console.log("Socket cleanup on unmount")}},[a]);function U({date:L}){const[z,X]=m.useState(Ro(L));return m.useEffect(()=>{const ne=setInterval(()=>{X(Ro(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(Ba,{}):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:ac,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,K,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(Fs,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):(L==null?void 0:L.dir)==="Long > Short"?i.jsx(Fs,{className:"text-[#FF797C] w-3 h-3"}):i.jsx(Fs,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):(L==null?void 0:L.dir)=="Buy"?i.jsx(Fs,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):i.jsx(Fs,{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:Ki,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:Q=>{Q.stopPropagation(),navigator.clipboard.writeText(L==null?void 0:L.listen_user),tn.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:Co,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:Q=>{Q.stopPropagation(),navigator.clipboard.writeText(L==null?void 0:L.oid),tn.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:Co,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}):iu(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":(K=L==null?void 0:L.dir)==null?void 0:K.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`||Wa,alt:L==null?void 0:L.coin,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:Q=>sa(Q)})})]})]})]}),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`||Wa,alt:L==null?void 0:L.coin,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:Q=>sa(Q)})}),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(Fs,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):(L==null?void 0:L.dir)==="Long > Short"?i.jsx(Fs,{className:"text-[#FF797C] w-3 h-3"}):i.jsx(Fs,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):(L==null?void 0:L.dir)=="Buy"?i.jsx(Fs,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):i.jsx(Fs,{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(cC,{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(cC,{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(cC,{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(cC,{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(cC,{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(cC,{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)})})})},cC=({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})})]}),Hin="https://dextrabothypesocketv2.nftinit.io/";function Vin(){var X,ne;const{isConnected:e,address:t}=ts(),{setSignModalOpen:n,trackedWatchList:r,hyperToken:s}=m.useContext(Qr),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[K,re]=m.useState(Ro(J));return m.useEffect(()=>{const he=setInterval(()=>re(Ro(J)),1e3);return()=>clearInterval(he)},[J]),i.jsx("span",{className:"text-[11px] text-[#a5a5a5] font-normal",children:K.dateTime})}m.useEffect(()=>{localStorage.setItem("isDateTrackedWalletsFormat",x)},[x]);function N(J){const K={};return J.forEach(re=>{const{oid:he,px:Q,dir:ie,side:oe,crossed:G,feeToken:V,listen_user:te,cloid:ae,coin:fe,subs_address:Ne,sz:me,closedPnl:we,fee:xe,time:ye,startPosition:je,insert_date:Pe,hash:Re}=re;K[he]||(K[he]={oid:he,px:Q,dir:ie,side:oe,crossed:G,feeToken:V,listen_user:te,cloid:ae,coin:fe,subs_address:Ne,totalSize:0,totalClosedPnl:0,totalFee:0,earliestStartPosition:je,hasZeroStartPosition:!1,closestTime:ye,insertDate:Pe,hashes:[]}),parseFloat(je)===0&&(K[he].hasZeroStartPosition=!0),K[he].totalSize+=parseFloat(me),K[he].totalClosedPnl+=parseFloat(we),K[he].totalFee+=parseFloat(xe),new Date(ye)>new Date(K[he].closestTime)&&(K[he].closestTime=ye),new Date(ye)>new Date(K[he].insertDate)&&(K[he].insertDate=Pe),K[he].hashes.push(Re)}),Object.keys(K).map(re=>({oid:re,...K[re]}))}async function P(){const J=window.localStorage.getItem("hyperToken");try{u(!0),J||n(!0);const K=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(!K.ok)throw new Error(`Server responded with status ${K.status}`);const re=await K.json();if(re.success){const he=N(re==null?void 0:re.data);l(he)}}catch(K){console.log("Error :>> ",K)}finally{u(!1)}}function I(J,K){const re={};return J.forEach(he=>{re[he.oid]={...he}}),K.forEach(he=>{const{oid:Q,px:ie,dir:oe,side:G,crossed:V,feeToken:te,listen_user:ae,cloid:fe,coin:Ne,subs_address:me,sz:we,closedPnl:xe,fee:ye,time:je,startPosition:Pe,insert_date:Re,hash:Xe}=he;re[Q]||(re[Q]={oid:Q,px:ie,dir:oe,side:G,crossed:V,feeToken:te,listen_user:ae,cloid:fe,coin:Ne,subs_address:me,totalSize:0,totalClosedPnl:0,totalFee:0,hasZeroStartPosition:!1,earliestStartPosition:Pe,closestTime:je,insertDate:Re,hashes:[]}),parseFloat(Pe)===0&&(re[Q].hasZeroStartPosition=!0),re[Q].totalSize+=parseFloat(we),re[Q].totalClosedPnl+=parseFloat(xe),re[Q].totalFee+=parseFloat(ye),new Date(je)>new Date(re[Q].closestTime)&&(re[Q].closestTime=je),new Date(je)>new Date(re[Q].insertDate)&&(re[Q].insertDate=Re),re[Q].hashes.push(Xe)}),Object.values(re).sort((he,Q)=>new Date(Q.closestTime)-new Date(he.closestTime))}m.useEffect(()=>{P()},[window.localStorage.getItem("hyperToken")]),m.useEffect(()=>{a.current=Ny(Hin);const J=window.localStorage.getItem("hyperToken");return a.current.on("connect",()=>{r==null||r.map(K=>K.wallet_address),a.current.emit("subscribe",{login:t.toLowerCase(),token:J})}),a.current.on("hyper_get_message",K=>{if(K){const re=Array.isArray(K)?K:[K];l(he=>{const Q=I([],re);let ie=he.filter(V=>re.some(te=>te.oid===V.oid)),oe=[];ie.length>0?oe=I(Q,ie):oe=Q;const G=he.filter(V=>!re.some(te=>te.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]",O=J=>J?J.includes("Long")?J==="Short > Long"?i.jsx(Fs,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):J==="Long > Short"?i.jsx(Fs,{className:"text-[#ff797c] w-3 h-3"}):i.jsx(Fs,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):J==="Buy"?i.jsx(Fs,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):i.jsx(Fs,{className:"text-[#ff797c] w-3 h-3"}):i.jsx(Fs,{className:"text-[#767676] w-3 h-3"}),U=J=>{const K=J==null?void 0:J.hasZeroStartPosition,re=J.dir==="Close Short"||J.dir==="Close Long"||J.dir==="Short > Long"||J.dir==="Long > Short";return K||re?{text:"Closed",icon:pM}:{text:"Open",icon:mM}},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(Ba,{}):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:ac,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:Ki,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:Co,alt:"",className:"w-4 h-4 cursor-pointer",onClick:K=>{K.stopPropagation(),navigator.clipboard.writeText((J==null?void 0:J.listen_user)||""),tn.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:iu(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`||Wa,alt:J==null?void 0:J.coin,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:K=>sa(K)})}),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:O(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(dp,{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:Ki,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:Co,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}):iu(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:O(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`||Wa,onError:J=>sa(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 Win=({open:e,setOpen:t,handleTelegramClick:n})=>(m.useContext(Qr),ts(),y5(),i.jsxs(Ea,{open:e,onClose:t,className:"relative z-50 font-manrope",children:[i.jsx(ja,{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(ga,{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:$a})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Ki,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"})})]})})})})})]})),qin=({open:e,setOpen:t,setIsfilterModal:n,handleTelegramClick:r})=>{const[s,a]=m.useState(!1),o=()=>{a(!1),n(!1),t(!1)};return i.jsxs(Ea,{open:e,onClose:o,className:"relative z-50 font-manrope",children:[i.jsx(ja,{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(ga,{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(ELe,{className:"w-4 h-4 text-black"})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Pyt,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"})})]})})})})})]})},Gin=({open:e,setOpen:t,handleTelegramClick:n})=>{const{setSignModalOpen:r}=m.useContext(Qr),{address:s}=ts(),[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,P]=m.useState(""),[I,R]=m.useState(!1),[O]=m.useState(["Open Position","Increase","Decrease","Changed Position","Position Closed","Twaps"]),[U,L]=m.useState([]),[z,X]=m.useState(!1),ne=async()=>{var xe;const me=window.localStorage.getItem("hyperToken"),we=window.localStorage.getItem("hyperAddress");if(!me){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():we,token:me})})).json();if(je.success){const Pe=(je==null?void 0:je.data)||[],Re=u?((xe=u==null?void 0:u.message_filters)==null?void 0:xe.source)||[]:[],Xe=[...Pe].sort((Ke,ut)=>{const et=Re==null?void 0:Re.includes(Ke.wallet_address),tt=Re==null?void 0:Re.includes(ut.wallet_address);return Number(tt)-Number(et)});o(Xe),await J(Xe)}else P((je==null?void 0:je.error_message)||"Failed to fetch source wallets"),console.error("API Error:",je==null?void 0:je.error_message)}catch(ye){console.error("Fetch Error:",ye),P("Failed to fetch source wallets")}finally{setTimeout(()=>{x(!1)},200)}},J=async me=>{var ye;const we=window.localStorage.getItem("hyperToken"),xe=window.localStorage.getItem("hyperAddress");if(!we){r(!0);return}try{v(!0);const Pe=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():xe,token:we})})).json();if(Pe.success){const Re=Pe==null?void 0:Pe.filters;if(d(Re),Re===null){const Xe=me==null?void 0:me.map(Ke=>`${Ke.wallet_address}::${Ke.tag}`);c(Xe),L([...O])}else{const Xe=((ye=Re==null?void 0:Re.message_filters)==null?void 0:ye.source)||[],Ke=[...me].sort((ut,et)=>{const tt=Xe==null?void 0:Xe.includes(ut.wallet_address),Le=Xe==null?void 0:Xe.includes(et.wallet_address);return Number(Le)-Number(tt)});o(Ke)}}else P((Pe==null?void 0:Pe.error_message)||"Failed to fetch filter info"),console.error("API telegram filter info error:",Pe==null?void 0:Pe.error_message)}catch(je){console.error("Fetch Error:",je),P("Failed to fetch filter info")}finally{v(!1)}},K=async()=>{const me=window.localStorage.getItem("hyperToken"),we=window.localStorage.getItem("hyperAddress");if(!me){r(!0);return}const xe=[...new Set(l==null?void 0:l.map(Re=>Re.split("::")[0]))];let ye={};xe.length>0&&(ye.source=xe);const je=U.filter(Re=>!Re.includes("Spot"));je.length>0&&(ye.type=je),xe.length===0&&U.length===0&&(ye={});const Pe={address:s?s==null?void 0:s.toLowerCase():we,token:me,filters:ye};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(Pe)}),Xe=await Re.json();Re.ok&&Xe.success?(d(Xe.filters),fe(Xe.filters),R(!0),tn.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"}})):(P((Xe==null?void 0:Xe.error_message)||"Failed to save filter"),console.error("API telegram filter save error:",Xe==null?void 0:Xe.error_message))}catch(Re){console.error("Fetch Error:",Re),P("Failed to save filter")}finally{C(!1)}};m.useEffect(()=>{a.length>0&&u&&fe(u)},[a,u]),m.useEffect(()=>{e&&ne()},[e]);const re=me=>{const{value:we,checked:xe}=me.target;if(we==="all"){const ye=a.map(je=>`${je.wallet_address}::${je.tag}`);c(xe?ye:[])}else c(ye=>xe?[...ye,we]:ye.filter(je=>je!==we))},he=a==null?void 0:a.map(me=>`${me.wallet_address}::${me.tag}`),Q=a.length>0&&(he==null?void 0:he.every(me=>l==null?void 0:l.includes(me))),ie=me=>{const{value:we,checked:xe}=me.target;if(we==="all")if(xe){const ye=O==null?void 0:O.filter(je=>!(je!=null&&je.includes("Spot")));L(ye)}else L([]);else L(ye=>xe?[...ye,we]:ye.filter(je=>je!==we))},G=(O==null?void 0:O.filter(me=>!me.includes("Spot"))).length,te=U.filter(me=>!me.includes("Spot")).length,ae=te===G&&G>0,fe=me=>{const we=me==null?void 0:me.message_filters;if(we&&(Array.isArray(we.type)&&L(we.type.filter(xe=>!xe.includes("Spot"))),Array.isArray(we.source))){const xe=a.filter(ye=>{var je;return(je=we.source)==null?void 0:je.includes(ye.wallet_address)}).map(ye=>`${ye.wallet_address}::${ye.tag}`);c(xe)}},Ne=()=>{t(!1),X(!1),o([]),L([]),c([])};return i.jsxs(i.Fragment,{children:[i.jsx(qin,{open:I,setOpen:R,handleTelegramClick:n,setIsfilterModal:t}),i.jsxs(Ea,{open:e,onClose:Ne,className:"relative z-50 font-manrope",children:[i.jsx(ja,{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(ga,{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:()=>Ne(),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:$a,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:`${Q?"text-white":"text-[#7C7C7C]"}`,children:"All"}),i.jsx("input",{type:"checkbox",value:"all",checked:Q,onChange:re,className:"hidden"}),i.jsx("div",{className:`w-[32px] h-[18px] flex items-center px-[2px] rounded-full transition-colors duration-200 ${Q?"bg-[#1DE674]":"bg-white/10"}`,children:i.jsx("div",{className:`w-[14px] h-[14px] bg-white rounded-full shadow transform transition-transform duration-200 ${Q?"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((me,we)=>{var je,Pe,Re,Xe,Ke;const xe=`${me==null?void 0:me.wallet_address}::${me==null?void 0:me.tag}`,ye=l==null?void 0:l.includes(xe);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:`${ye?"text-white":"text-[#7C7C7C]"} text-[13px] font-semibold min-w-[88px]`,children:((je=me.wallet_address)==null?void 0:je.slice(0,5))+"..."+((Pe=me.wallet_address)==null?void 0:Pe.slice(-4))}),i.jsx("span",{className:`${ye?"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=me.tag)==null?void 0:Re.length)>10?`${(Xe=me==null?void 0:me.tag)==null?void 0:Xe.slice(0,10)}...`:`${me==null?void 0:me.tag}`}),i.jsx("span",{className:`${ye?"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:((Ke=me.tag)==null?void 0:Ke.length)>24?`${me==null?void 0:me.tag.slice(0,24)}...`:`${me==null?void 0:me.tag}`})]}),i.jsx("input",{type:"checkbox",value:`${me==null?void 0:me.wallet_address}::${me==null?void 0:me.tag}`,checked:ye,onChange:re,className:"hidden"}),i.jsx("div",{className:`w-[32px] h-[18px] flex items-center px-[2px] rounded-full transition-colors duration-200 ${ye?"bg-[#1DE674]":"bg-white/10"}`,children:i.jsx("div",{className:`w-[14px] h-[14px] bg-white rounded-full shadow transform transition-transform duration-200 ${ye?"translate-x-[14px]":"translate-x-0"}`})})]},we)})]})})})})]}),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:te>0?`(${te} 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"}),O==null?void 0:O.map((me,we)=>{const xe=U==null?void 0:U.includes(me);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:`${xe?"text-white":"text-[#7C7C7C]"}`,children:me}),i.jsx("input",{type:"checkbox",value:me,checked:xe,onChange:ie,className:"hidden"}),i.jsx("div",{className:`w-[32px] h-[18px] flex items-center px-[2px] rounded-full transition-colors duration-200 ${xe?"bg-[#1DE674]":"bg-white/10"}`,children:i.jsx("div",{className:`w-[14px] h-[14px] bg-white rounded-full shadow transform transition-transform duration-200 ${xe?"translate-x-[14px]":"translate-x-0"}`})})]},we)})]})})})]}),i.jsx("div",{onClick:me=>{if(me.preventDefault(),!f&&!g&&!w)if((l==null?void 0:l.length)===0||(U==null?void 0:U.length)===0){tn.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 K()},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})]})})})})]})]})},Kin=({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(Qr);ts();const v=async()=>{var C,N;let w="";try{const P=window.localStorage.getItem("hyperToken"),I=window.localStorage.getItem("hyperAddress");if(!P){a(!0);return}if(I&&P){const R=await _i(I,P);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 O=await Mbt(I,P);if(!O.success){console.error("Telegram-ID kunne ikke hentes:",R.message),tn.error(O.message);return}O.success&&(w=e=="My Activities"?`https://t.me/DextraCopyTraderBot?start=${O.telegram_temp_password}`:`https://t.me/DextraTraderBot?start=${O.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"),tn.error("Failed to generate Telegram URL"))}catch(P){console.error("Error during Telegram handling:",P),tn.error(P.message)}};return i.jsxs(i.Fragment,{children:[i.jsx(Win,{open:t,setOpen:n,handleTelegramClick:v}),i.jsx(Gin,{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 Yin(e){var zn,Xt,on,Zt,Ye,Ze,Ft,dn,Yt,Bt,ot,De,_t,ze,nt,mt,$t,Pt,un,an,xn,An,kn,yn,Vn,Gn,Rn,Yn,Cn,rn,Oe,Jt,sn,Et,Xn,gn,Dt,en,In,Qn,ar,hr;const[t,n]=m.useState(!1),r=m.useRef(null),{isConnected:s,address:a}=ts(),[o,l]=m.useState([]);m.useEffect(()=>{var $n,nr;const Gt=($n=e.advancedFilters)==null?void 0:$n.coinFeed;if(Gt&&((nr=e.dataCoin)==null?void 0:nr.length)>0){const Rt=Gt.map(En=>e.dataCoin.find(Ee=>Ee.value===En)).filter(Boolean);e.setSelectedCoins(Rt)}},[e.dataCoin]);const c=Gt=>{if(!Gt)return;const nr=Array.isArray(Gt)?Gt:[Gt],Rt=e.selectedCoins||[],En=[...Rt,...nr.filter(h=>!Rt.some(p=>p.value===h.value))],Ee=En.map(h=>h.value);Ee.join(","),e.setSelectedCoins(En),e.setAdvancedFilters(h=>({...h,coinFeed:Ee}))},[u,d]=m.useState(!1),[f,x]=m.useState(!1),[g,v]=m.useState(!1),[w,C]=m.useState(!1),[N,P]=m.useState(!1),[I,R]=m.useState(!1),O=()=>{d(Gt=>!Gt)},U=()=>{x(Gt=>!Gt)},L=()=>{v(Gt=>!Gt)},z=()=>{C(Gt=>!Gt)},X=()=>{P(Gt=>!Gt)},ne=()=>{R(Gt=>!Gt)},J=Gt=>{const{value:$n,checked:nr}=Gt.target;e.setAdvancedFilters(Rt=>{let En=[...Rt.positionFeed];return $n==="all"?En=nr?[...je]:[]:nr?En.push($n):En=En.filter(Ee=>Ee!==$n),localStorage.setItem("positionFeed",JSON.stringify(En)),{...Rt,positionFeed:En}})},K=()=>{localStorage.setItem("positionFeed",JSON.stringify([])),e.setAdvancedFilters(Gt=>({...Gt,positionFeed:[]}))},re=Gt=>{const{value:$n,checked:nr}=Gt.target;e.setAdvancedFilters(Rt=>{let En=[...Rt.typeFeed];return $n==="all"?En=nr?[...Xe]:[]:nr?En.push($n):En=En.filter(Ee=>Ee!==$n),{...Rt,typeFeed:En}})},he=()=>{e.setAdvancedFilters(Gt=>({...Gt,typeFeed:[]}))},Q=Gt=>{const{value:$n,checked:nr}=Gt.target;e.setAdvancedFilters(Rt=>{let En=[...Rt.dexMarket];return $n==="all"?En=nr?[...Ke]:[]:nr?En.push($n):En=En.filter(Ee=>Ee!==$n),{...Rt,dexMarket:En}})},ie=()=>{e.setAdvancedFilters(Gt=>({...Gt,dexMarket:[]}))},oe=()=>{e.setSearchTagSellect([])},G=((zn=e.selectTradeWalletData)==null?void 0:zn.length)>0?o:e.walletTags,V=Gt=>{const{value:$n,checked:nr}=Gt.target;e.setSearchTagSellect(Rt=>{let En=[...Rt];return $n==="all"?En=nr?G==null?void 0:G.map(Ee=>Ee.tag):[]:nr?En==null||En.push($n):En=En==null?void 0:En.filter(Ee=>Ee!==$n),En})},te=Gt=>{e.setAdvancedFilters($n=>({...$n,directionFeed:Gt})),R(!1)},ae=()=>{e.setAdvancedFilters(Gt=>({...Gt,directionFeed:""})),R(!1)},fe=()=>{e.setSelectTradeWalletData([])},[Ne,me]=m.useState(!1),we=async Gt=>{const{value:$n,checked:nr}=Gt.target;let Rt;e.setSelectTradeWalletData(En=>{var Ee;return $n==="all"?Rt=nr?(Ee=e.tradeWalletData)==null?void 0:Ee.map(h=>h.wallet):[]:(Rt=nr?[...En,$n]:En==null?void 0:En.filter(h=>h!==$n),!nr&&En.includes("all")&&(Rt=Rt==null?void 0:Rt.filter(h=>h!=="all"))),Rt}),e.setSearchTagSellect([]),setTimeout(async()=>{var En;if((Rt==null?void 0:Rt.length)!==0)try{me(!0);const Ee=window.localStorage.getItem("hyperToken");if(!Ee){setSignModalOpen(!0);return}const p=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:Rt})});if(!p.ok)throw new Error(`Server responded with status ${p.status}`);const S=await p.json();if(S.success){const _=(En=S==null?void 0:S.data)==null?void 0:En.map(k=>({tag:k==null?void 0:k.tag,wallet:k==null?void 0:k.wallet_address}));l(_),me(!1)}else console.log(S.error_message),me(!1)}catch(Ee){console.log("Error :>> ",Ee),me(!1)}},0)},xe={control:(Gt,{isFocused:$n})=>{var nr,Rt,En,Ee;return{...Gt,display:"flex",alignItems:"center",paddingLeft:"21px",backgroundColor:"#353535",minHeight:"32px",maxHeight:"32px",minWidth:"244px",maxWidth:"244px",border:((Rt=(nr=e.advancedFilters)==null?void 0:nr.coinFeed)==null?void 0:Rt.length)>0?"1px solid #8d67ff":"none",boxShadow:"none",borderRadius:"6px",":hover":{border:((Ee=(En=e.advancedFilters)==null?void 0:En.coinFeed)==null?void 0:Ee.length)>0?"1px solid #8d67ff":"none"}}},menu:Gt=>({...Gt,backgroundColor:"#353535",maxWidth:"244px"}),menuList:Gt=>({...Gt,backgroundColor:"#353535",maxHeight:"180px",zIndex:4}),clearIndicator:Gt=>({...Gt,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:Gt=>({...Gt,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:(Gt,{data:$n,isDisabled:nr,isFocused:Rt,isSelected:En})=>{const Ee=gi($n.color);return{...Gt,fontSize:"14px",fontWeight:"600",backgroundColor:nr?void 0:En?$n.color:Rt?Ee.alpha(.1).css():void 0,color:"white",cursor:nr?"not-allowed":"pointer",":active":{...Gt[":active"],backgroundColor:nr?void 0:En?$n.color:Ee.alpha(.9).css()}}},multiValue:(Gt,{data:$n})=>{const nr=gi($n.color);return{...Gt,backgroundColor:nr.alpha(.4).css()}},multiValueLabel:(Gt,{data:$n})=>({...Gt,color:"white"}),multiValueRemove:(Gt,{data:$n})=>({...Gt,color:"white",":hover":{backgroundColor:"rgba(255, 255, 255, 0.3)",color:"white"}}),input:Gt=>({...Gt,color:"white"}),valueContainer:Gt=>({...Gt,paddingTop:"0px",fontSize:"14px",fontWeight:"600"})},ye=(Gt,$n)=>{var Rt;const nr=(Rt=$n.selectedCoins)==null?void 0:Rt.filter(En=>En.value!==Gt.value);nr.map(En=>En.value).join(","),$n.setSelectedCoins(nr),$n.setAdvancedFilters(En=>({...En,coinFeed:nr==null?void 0:nr.map(Ee=>Ee.value)}))};m.useEffect(()=>{const Gt=$n=>{r.current&&!r.current.contains($n.target)&&n(!1)};return document.addEventListener("mousedown",Gt),()=>{document.removeEventListener("mousedown",Gt)}},[]);const je=["Open Position","Increase","Decrease","Changed Position","Position Closed","Other"],Pe=(Xt=e.advancedFilters.positionFeed)==null?void 0:Xt.length,Re=je.length,Xe=["Open Position","Increase","Decrease","Changed Position","Position Closed","Spot","Twaps"],Ke=["HyperLiquid","Lighter"],ut=(on=e.advancedFilters.typeFeed)==null?void 0:on.length,et=Xe.length,tt=(Zt=e.advancedFilters.dexMarket)==null?void 0:Zt.length,Le=Ke.length,$e=(Ye=e.searchTagSellect)==null?void 0:Ye.length,ht=G==null?void 0:G.length,pt=(Ze=e.selectTradeWalletData)==null?void 0:Ze.length,Kt=(Ft=e.tradeWalletData)==null?void 0:Ft.length,wt=["Long","Short"],nn=({src:Gt,alt:$n})=>{const[nr,Rt]=Ae.useState(!1);return nr?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:Gt,alt:$n,className:"rounded-full w-4 h-4 min-w-4 min-h-4 mr-1",loading:"lazy",onError:()=>Rt(!0)})},cn=Gt=>{const{data:$n,innerRef:nr,innerProps:Rt,selectProps:En}=Gt,Ee=En.styles.option({},Gt);return i.jsxs("div",{ref:nr,...Rt,style:Ee,className:"flex items-center p-2",children:[i.jsx(nn,{src:$n.icon,alt:$n.label}),$n.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:`${tt>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:`${tt>0?"text-white":"text-[#7c7c7c]"} text-sm font-semibold font-manrope leading-[8px]`,children:tt>0?`${tt} of ${Le} selected`:"Select Dex"}),i.jsx(rd,{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:((Yt=(dn=e.advancedFilters)==null?void 0:dn.dexMarket)==null?void 0:Yt.length)===Ke.length,onChange:Q,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${((ot=(Bt=e.advancedFilters)==null?void 0:Bt.dexMarket)==null?void 0:ot.length)===Ke.length?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((_t=(De=e.advancedFilters)==null?void 0:De.dexMarket)==null?void 0:_t.length)===(Ke==null?void 0:Ke.length)&&i.jsx("img",{src:Xc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),"All"]}),i.jsx("div",{className:"h-[2px] w-full bg-[#404040]"}),Ke==null?void 0:Ke.map((Gt,$n)=>{var nr,Rt,En,Ee,h,p;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:Gt,checked:(Rt=(nr=e.advancedFilters)==null?void 0:nr.dexMarket)==null?void 0:Rt.includes(Gt),onChange:Q,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${(Ee=(En=e.advancedFilters)==null?void 0:En.dexMarket)!=null&&Ee.includes(Gt)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((p=(h=e.advancedFilters)==null?void 0:h.dexMarket)==null?void 0:p.includes(Gt))&&i.jsx("img",{src:Xc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),Gt==="HyperLiquid"?i.jsx("img",{src:S1,alt:"hyper",className:"w-4 h-4 rounded-sm"}):Gt==="Lighter"?i.jsx(up,{className:"w-4 h-4 text-[#fff]"}):null,Gt]},$n)})]})})]})]}),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:`${pt>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:`${pt>0?"text-white":"text-[#7c7c7c]"} text-sm font-semibold font-manrope leading-[8px]`,children:pt>0?`${pt} of ${Kt} selected`:"Select Wallet"}),i.jsx(rd,{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:((ze=e.selectTradeWalletData)==null?void 0:ze.length)===((nt=e.tradeWalletData)==null?void 0:nt.length),onChange:we,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${((mt=e.selectTradeWalletData)==null?void 0:mt.length)===(($t=e.tradeWalletData)==null?void 0:$t.length)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((Pt=e.selectTradeWalletData)==null?void 0:Pt.length)===((un=e.tradeWalletData)==null?void 0:un.length)&&i.jsx("img",{src:Xc,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..."'}):(an=e.tradeWalletData)==null?void 0:an.map((Gt,$n)=>{var nr,Rt,En,Ee,h,p,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:Gt==null?void 0:Gt.wallet,checked:(nr=e.selectTradeWalletData)==null?void 0:nr.includes(Gt==null?void 0:Gt.wallet),onChange:we,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${(Rt=e.selectTradeWalletData)!=null&&Rt.includes(Gt==null?void 0:Gt.wallet)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((En=e.selectTradeWalletData)==null?void 0:En.includes(Gt==null?void 0:Gt.wallet))&&i.jsx("img",{src:Xc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),((Ee=Gt==null?void 0:Gt.wallet)==null?void 0:Ee.slice(0,5))+"..."+((h=Gt==null?void 0:Gt.wallet)==null?void 0:h.slice(-4)),` (${((p=Gt==null?void 0:Gt.name)==null?void 0:p.length)>10?((S=Gt==null?void 0:Gt.name)==null?void 0:S.slice(0,10))+"...":Gt==null?void 0:Gt.name})`]},$n)})]})})]})]}),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:`${$e>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:`${$e>0?"text-white":"text-[#7c7c7c]"} text-sm font-semibold font-manrope leading-[8px]`,children:$e>0?`${$e} of ${ht} selected`:"Select Wallet"}),i.jsx(rd,{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:Ne?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:((xn=e.searchTagSellect)==null?void 0:xn.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 ${((An=e.searchTagSellect)==null?void 0:An.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:Xc,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((Gt,$n)=>{var nr,Rt,En,Ee,h,p;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:Gt==null?void 0:Gt.tag,checked:(nr=e.searchTagSellect)==null?void 0:nr.includes(Gt==null?void 0:Gt.tag),onChange:V,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${(Rt=e.searchTagSellect)!=null&&Rt.includes(Gt==null?void 0:Gt.tag)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((En=e.searchTagSellect)==null?void 0:En.includes(Gt==null?void 0:Gt.tag))&&i.jsx("img",{src:Xc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),(Gt==null?void 0:Gt.wallet)&&((Ee=Gt==null?void 0:Gt.wallet)==null?void 0:Ee.slice(0,5))+"..."+((h=Gt==null?void 0:Gt.wallet)==null?void 0:h.slice(-4))," ",Gt!=null&&Gt.tag&&(Gt==null?void 0:Gt.tag.length)>10?`(${(p=Gt==null?void 0:Gt.tag)==null?void 0:p.slice(0,10)}...)`:`(${Gt==null?void 0:Gt.tag})`]},$n)})]})})]})]}),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(Gt=>({...Gt,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(_y,{className:"text-[#646464] absolute left-[6px] top-[6px] z-10"}),i.jsx(Nl,{closeMenuOnSelect:!1,value:[],isMulti:!0,options:e.dataCoin.filter(Gt=>Array.isArray(e.selectedCoins)&&!e.selectedCoins.some($n=>$n.value===Gt.value)),components:{Option:cn},styles:xe,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&&((yn=e.selectedCoins)==null?void 0:yn.length)>0?"block":"hidden"}`,children:e.selectedCoins&&((Vn=e.selectedCoins)==null?void 0:Vn.map(Gt=>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(nn,{src:Gt==null?void 0:Gt.icon,alt:Gt==null?void 0:Gt.value}),i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] py-1 min-w-max",children:Gt.label}),i.jsx("div",{onClick:$n=>{$n.stopPropagation(),ye(Gt,e)},className:"cursor-pointer group w-full h-full flex justify-center items-center pr-1.5 py-1",children:i.jsx(nw,{className:"group-hover:text-[#cdcdcd] text-[#7C7C7C] w-[5.66px] h-[5.66px] min-w-[5.66px] min-h-[5.66px]"})})]},Gt.value)))}),i.jsx("div",{className:`${((Gn=e.selectedCoins)==null?void 0:Gn.length)>0?"mt-2.5":""} flex flex-wrap gap-1 max-w-[244px]`,children:e.selectedCoins&&((Rn=e.selectedCoins)==null?void 0:Rn.map(Gt=>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(nn,{src:Gt==null?void 0:Gt.icon,alt:Gt==null?void 0:Gt.value}),i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] py-1 min-w-max",children:Gt.label}),i.jsx("div",{onClick:()=>ye(Gt,e),className:"cursor-pointer group  w-full h-full flex justify-center items-center pr-1.5 py-1",children:i.jsx(nw,{className:"group-hover:text-[#cdcdcd] text-[#7C7C7C] w-[5.66px] h-[5.66px] min-w-[5.66px] min-h-[5.66px]"})})]},Gt.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:`${ut>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:`${ut>0?"text-white":"text-[#7c7c7c]"} text-sm font-semibold font-manrope leading-[8px]`,children:ut>0?`${ut} of ${et} selected`:"Select Type"}),i.jsx(rd,{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:((Cn=(Yn=e.advancedFilters)==null?void 0:Yn.typeFeed)==null?void 0:Cn.length)===Xe.length,onChange:re,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${((Oe=(rn=e.advancedFilters)==null?void 0:rn.typeFeed)==null?void 0:Oe.length)===Xe.length?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((sn=(Jt=e.advancedFilters)==null?void 0:Jt.typeFeed)==null?void 0:sn.length)===(Xe==null?void 0:Xe.length)&&i.jsx("img",{src:Xc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),"All"]}),i.jsx("div",{className:"h-[2px] w-full bg-[#404040]"}),Xe==null?void 0:Xe.map((Gt,$n)=>{var nr,Rt,En,Ee,h,p;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:Gt,checked:(Rt=(nr=e.advancedFilters)==null?void 0:nr.typeFeed)==null?void 0:Rt.includes(Gt),onChange:re,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${(Ee=(En=e.advancedFilters)==null?void 0:En.typeFeed)!=null&&Ee.includes(Gt)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((p=(h=e.advancedFilters)==null?void 0:h.typeFeed)==null?void 0:p.includes(Gt))&&i.jsx("img",{src:Xc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),Gt]},$n)})]})})]})]}),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:K,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:`${Pe>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:O,children:[i.jsx("span",{className:`${Pe>0?"text-white":"text-[#7c7c7c]"} text-sm font-semibold font-manrope leading-[8px]`,children:Pe>0?`${Pe} of ${Re} selected`:"Select Status"}),i.jsx(rd,{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:((Xn=(Et=e.advancedFilters)==null?void 0:Et.positionFeed)==null?void 0:Xn.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 ${((Dt=(gn=e.advancedFilters)==null?void 0:gn.positionFeed)==null?void 0:Dt.length)===(je==null?void 0:je.length)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((In=(en=e.advancedFilters)==null?void 0:en.positionFeed)==null?void 0:In.length)===(je==null?void 0:je.length)&&i.jsx("img",{src:Xc,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((Gt,$n)=>{var nr,Rt,En,Ee,h,p;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:Gt,checked:(Rt=(nr=e.advancedFilters)==null?void 0:nr.positionFeed)==null?void 0:Rt.includes(Gt),onChange:J,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${(Ee=(En=e.advancedFilters)==null?void 0:En.positionFeed)!=null&&Ee.includes(Gt)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((p=(h=e.advancedFilters)==null?void 0:h.positionFeed)==null?void 0:p.includes(Gt))&&i.jsx("img",{src:Xc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),Gt==="Other"?"System Message":Gt]},$n)})]})})]})]}),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:`${(ar=e.advancedFilters)!=null&&ar.directionFeed?"text-white":"text-[#7c7c7c]"} text-sm font-semibold font-manrope leading-[8px]`,children:((hr=e.advancedFilters)==null?void 0:hr.directionFeed)||"Select Direction"}),i.jsx(rd,{className:`w-3.5 h-3.5 transition ${I?"rotate-180":""}`})]}),I&&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:wt==null?void 0:wt.map((Gt,$n)=>i.jsx("div",{onClick:()=>te(Gt),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:Gt},$n))})})]})]})]})}const Xin=({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:P,isWalletLoading:I})=>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(Yin,{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:P,walletTags:d,isWalletLoading:I})})}),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 Qin={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 Zin(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 Qin[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 lw(e){var t=Zin(e);return"".concat(t.value).concat(t.unit)}var Ine=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},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},ean=Ine("BeatLoader","50% {transform: scale(0.75);opacity: 0.2} 100% {transform: scale(1);opacity: 1}","beat");function XUe(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=Jin(e,["loading","color","speedMultiplier","cssOverride","size","margin"]),v=WL({display:"inherit"},c),w=function(C){return{display:"inline-block",backgroundColor:s,width:lw(d),height:lw(d),margin:lw(x),borderRadius:"100%",animation:"".concat(ean," ").concat(.7/o,"s ").concat(C%2?"0s":"".concat(.35/o,"s")," infinite linear"),animationFillMode:"both"}};return n?m.createElement("span",WL({style:v},g),m.createElement("span",{style:w(1)}),m.createElement("span",{style:w(2)}),m.createElement("span",{style:w(3)})):null}var qL=function(){return qL=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},qL.apply(this,arguments)},tan=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=[Ine("PuffLoader","0% {transform: scale(0)} 100% {transform: scale(1.0)}","puff-1"),Ine("PuffLoader","0% {opacity: 1} 100% {opacity: 0}","puff-2")];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?60:u,f=tan(e,["loading","color","speedMultiplier","cssOverride","size"]),x=qL({display:"inherit",position:"relative",width:lw(d),height:lw(d)},c),g=function(v){return{position:"absolute",height:lw(d),width:lw(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",qL({style:x},f),m.createElement("span",{style:g(1)}),m.createElement("span",{style:g(2)})):null}function nan({feedData:e}){var l,c;const[t,n]=m.useState(null);function r({date:u}){const[d,f]=m.useState(Ro(u));return m.useEffect(()=>{const x=setInterval(()=>{f(Ro(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(QUe,{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:Ki,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:S1,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(up,{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:Co,alt:"",className:"w-4 h-4 cursor-pointer",onClick:N=>{N.stopPropagation(),navigator.clipboard.writeText((u==null?void 0:u.listen_user)||""),tn.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:iu(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`||Wa,onError:N=>sa(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(Fs,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):(u==null?void 0:u.dir)==="Long > Short"?i.jsx(Fs,{className:"text-[#ff797c] w-3 h-3"}):i.jsx(Fs,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):(u==null?void 0:u.dir)==="Buy"?i.jsx(Fs,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):i.jsx(Fs,{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:pM,alt:""}):i.jsx("img",{src:mM,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(dp,{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:Ki,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:Co,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:iu(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?pM:mM,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(Fs,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):(t==null?void 0:t.dir)==="Long > Short"?i.jsx(Fs,{className:"text-[#ff797c] w-3 h-3"}):i.jsx(Fs,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):(t==null?void 0:t.dir)==="Buy"?i.jsx(Fs,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):i.jsx(Fs,{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`||Wa,onError:u=>sa(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 ran=()=>{var Zt;const{isConnected:e,address:t}=ts(),{setSignModalOpen:n,copyTradeWatchList:r,hyperToken:s}=m.useContext(Qr),[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),[P,I]=m.useState([]),[R,O]=m.useState(!0),[U,L]=m.useState([]),[z,X]=m.useState([]),[ne,J]=m.useState([]),[K,re]=m.useState([]),[he,Q]=m.useState([]),[ie,oe]=m.useState(!1),[G,V]=m.useState([]),[te,ae]=m.useState([]),Ne=localStorage.getItem("isDateCopyTradeFormat")||"date",[me,we]=m.useState(Ne),[xe,ye]=m.useState(!1);m.useEffect(()=>{localStorage.setItem("isDateCopyTradeFormat",me)},[me]),m.useEffect(()=>{(async()=>{var Ze,Ft;try{const Yt=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_coins/")).json(),Bt=()=>gi.random().hex(),ot=(Ft=(Ze=Yt.coins)==null?void 0:Ze.filter(De=>!De.startsWith("@")&&!De.endsWith("/USDC")))==null?void 0:Ft.map(De=>({value:De,label:De.endsWith("/USDC")?De+" (Spot)":De,icon:`https://app.hyperliquid.xyz/coins/${De}.svg`,color:Bt()}));I(ot),O(!1)}catch(dn){console.error("Data extraction error:",dn),O(!1)}})()},[]);const[je,Pe]=m.useState({userWalletFeed:"",coinFeed:"",positionFeed:[],directionFeed:"",statusFeed:"",typeFeed:"",dexMarket:[]});m.useEffect(()=>{const Ye=["Open Position","Increase","Decrease","Changed Position","Position Closed","Other"],Ze=localStorage.getItem("positionFeed"),Ft=Ze&&Array.isArray(JSON.parse(Ze))?JSON.parse(Ze):Ye;Pe(dn=>({...dn,positionFeed:Ft}))},[]);const Re=m.useRef(je);m.useEffect(()=>{Re.current=je},[je]);const Xe=async(Ye=!1)=>{var Ft,dn,Yt;g(0),w(!0),N(!0);const Ze=window.localStorage.getItem("hyperToken");try{o(!0),c(!0);const Bt=window.localStorage.getItem("hyperAddress");if(!Ze){n(!0);return}const ot={};(G==null?void 0:G.length)>0&&(ot.copy_trader=G),(ne==null?void 0:ne.length)>0&&(ot.trader=ne),(te==null?void 0:te.length)>0&&(ot.tag=te),((Ft=je==null?void 0:je.coinFeed)==null?void 0:Ft.length)>0&&(ot.coin=je.coinFeed.includes(",")?je.coinFeed.split(",").map(An=>An.trim()):je.coinFeed);const De=localStorage.getItem("positionFeed"),_t=Ye?De&&JSON.parse(De)||["Open Position","Increase","Decrease","Changed Position","Position Closed","Other"]:je.positionFeed;(_t==null?void 0:_t.length)>0&&(_t==null?void 0:_t.length)<6&&(ot.position=_t),((dn=je==null?void 0:je.typeFeed)==null?void 0:dn.length)>0&&((Yt=je==null?void 0:je.typeFeed)==null?void 0:Yt.length)<7&&(ot.type=je.typeFeed),je!=null&&je.directionFeed&&(ot.direction=je.directionFeed),je!=null&&je.statusFeed&&(je.statusFeed==="On"?ot.status=!0:je.statusFeed==="Off"?ot.status=!1:je.statusFeed==="All"&&delete ot.status);const ze=((je==null?void 0:je.dexMarket)||[]).map(An=>An.toLowerCase()),nt=ze.includes("hyperliquid"),mt=ze.includes("lighter"),$t=[];nt&&!mt?$t.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new/"):mt&&!nt?$t.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new_lg/"):$t.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new/","https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new_lg/");const Pt=await Promise.all($t.map(An=>fetch(An,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():Bt,token:Ze,offset:0,...Object.keys(ot).length&&{filters:ot}})}))),an=(await Promise.all(Pt.map(An=>An.json()))).filter(An=>An.success&&Array.isArray(An.data)).flatMap(An=>An.data).sort((An,kn)=>new Date(kn.time)-new Date(An.time));d(an),g(An=>An+50),an.length<50&&N(!1);const xn=an.map(An=>({wallet:An.trader_wallet,name:An.wallet_name}));X(An=>{const kn=new Map(An.map(yn=>[yn.wallet,yn.name]));return xn.forEach(yn=>{kn.has(yn.wallet)||kn.set(yn.wallet,yn.name)}),Array.from(kn,([yn,Vn])=>({wallet:yn,name:Vn}))})}catch(Bt){console.log("Error :>> ",Bt)}finally{o(!1),c(!1),w(!1)}},Ke=async()=>{const Ye=window.localStorage.getItem("hyperToken");try{oe(!0);const Ze="https://dextrabothypev2.nftinit.io/api/hyper/trade/feed/tag_list/",Ft=window.localStorage.getItem("hyperAddress");if(!Ye){n(!0);return}const dn=await fetch(Ze,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():Ft,token:Ye})});if(!dn.ok)throw new Error(`Server responded with status ${dn.status}`);const Yt=await dn.json();if(Yt.success){re(Yt==null?void 0:Yt.data);const Bt=Yt==null?void 0:Yt.data.map(ot=>ot.tag?{tag:ot.tag,wallet:ot.wallet_address}:null).filter(ot=>ot!==null);Q(Bt)}else console.log(Yt.error_message)}catch(Ze){console.log("Error :>> ",Ze)}finally{oe(!1)}};m.useEffect(()=>{Xe(!0),Ke()},[s]);const ut=async()=>{g(0),w(!0),N(!0);const Ye=window.localStorage.getItem("hyperToken");try{o(!0);const Ze=window.localStorage.getItem("hyperAddress");if(!Ye){n(!0);return}const Ft=((je==null?void 0:je.dexMarket)||[]).map(ze=>ze.toLowerCase()),dn=Ft.includes("hyperliquid"),Yt=Ft.includes("lighter"),Bt=[];dn&&!Yt?Bt.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new/"):Yt&&!dn?Bt.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new_lg/"):Bt.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new/","https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new_lg/");const ot=await Promise.all(Bt.map(ze=>fetch(ze,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():Ze,token:Ye,offset:0})}))),_t=(await Promise.all(ot.map(ze=>ze.json()))).filter(ze=>ze.success&&Array.isArray(ze.data)).flatMap(ze=>ze.data).sort((ze,nt)=>new Date(nt.time)-new Date(ze.time));d(_t),g(ze=>ze+50),_t.length<50&&N(!1),localStorage.setItem("positionFeed",JSON.stringify([])),Pe({userWalletFeed:"",coinFeed:"",positionFeed:[],directionFeed:"",statusFeed:"",typeFeed:[],dexMarket:[]}),L([]),V([]),J([]),ae([])}catch(Ze){console.log("Error :>> ",Ze)}finally{o(!1),w(!1)}},et=async()=>{var Ze,Ft,dn,Yt,Bt;if(v)return;w(!0);const Ye=window.localStorage.getItem("hyperToken");try{const ot=window.localStorage.getItem("hyperAddress");if(!Ye){n(!0);return}const De={};(G==null?void 0:G.length)>0&&(De.copy_trader=G),(ne==null?void 0:ne.length)>0&&(De.trader=ne),(te==null?void 0:te.length)>0&&(De.tag=te),je!=null&&je.coinFeed&&((Ze=je==null?void 0:je.coinFeed)==null?void 0:Ze.length)>0&&(De.coin=je.coinFeed.includes(",")?je.coinFeed.split(",").map(xn=>xn.trim()):je.coinFeed),((Ft=je==null?void 0:je.positionFeed)==null?void 0:Ft.length)>0&&((dn=je==null?void 0:je.positionFeed)==null?void 0:dn.length)<6&&(De.position=je.positionFeed),((Yt=je==null?void 0:je.typeFeed)==null?void 0:Yt.length)>0&&((Bt=je==null?void 0:je.typeFeed)==null?void 0:Bt.length)<7&&(De.type=je.typeFeed),je!=null&&je.directionFeed&&(De.direction=je.directionFeed),je!=null&&je.statusFeed&&(je.statusFeed==="On"?De.status=!0:je.statusFeed==="Off"?De.status=!1:je.statusFeed==="All"&&delete De.status);const _t=((je==null?void 0:je.dexMarket)||[]).map(xn=>xn.toLowerCase()),ze=_t.includes("hyperliquid"),nt=_t.includes("lighter"),mt=[];ze&&!nt?mt.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new/"):nt&&!ze?mt.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new_lg/"):mt.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new/","https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new_lg/");const $t=await Promise.all(mt.map(xn=>fetch(xn,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():ot,token:Ye,offset:x,...Object.keys(De).length&&{filters:De}})}))),un=(await Promise.all($t.map(xn=>xn.json()))).filter(xn=>xn.success&&Array.isArray(xn.data)).flatMap(xn=>xn.data).sort((xn,An)=>new Date(An.time)-new Date(xn.time));d(xn=>[...xn,...un].sort((kn,yn)=>new Date(yn.time)-new Date(kn.time))),g(xn=>xn+50),un.length<50&&N(!1);const an=un.map(xn=>({wallet:xn.trader_wallet,name:xn.wallet_name}));X(xn=>{const An=new Set(xn.map(yn=>yn.wallet)),kn=[...xn];return an.forEach(yn=>{An.has(yn.wallet)||(An.add(yn.wallet),kn.push(yn))}),kn})}catch(ot){console.log("Error :>> ",ot)}finally{w(!1)}},tt=(Ye,Ze)=>{let Ft;return function(...dn){clearTimeout(Ft),Ft=setTimeout(()=>{Ye.apply(this,dn)},Ze)}},Le=()=>{const Ye=f.current;Ye.scrollTop+Ye.clientHeight>=Ye.scrollHeight-10&&C&&!v&&et()};m.useEffect(()=>{const Ye=tt(Le,300),Ze=f.current;return Ze.addEventListener("scroll",Ye),()=>{Ze.removeEventListener("scroll",Ye)}},[x,C,v]);const $e=m.useRef(null),ht=m.useRef(!1),pt=m.useRef(t),Kt=m.useRef(r),wt=m.useRef(s);m.useEffect(()=>{pt.current=t},[t]),m.useEffect(()=>{Kt.current=r},[r]),m.useEffect(()=>{wt.current=s},[s]);const nn="hyper_get_trade_message";m.useEffect(()=>{if(!s||ht.current)return;const Ye=Ny("https://dextrabothypesocketv2.nftinit.io/");return $e.current=Ye,ht.current=!0,Ye.on("connect",()=>{console.log("Socket connected");const Ze=()=>{var Yt;const Ft=(Yt=pt.current)==null?void 0:Yt.toLowerCase(),dn=wt.current;Ft&&dn?Ye.emit("subscribe",{login:Ft,token:dn}):setTimeout(Ze,300)};Ze()}),Ye.on(nn,function(Ze){var _t;const Ft=Re.current,dn=(_t=(Ft==null?void 0:Ft.dexMarket)||[])==null?void 0:_t.map(ze=>ze.toLowerCase()),Yt=dn.includes("hyperliquid"),Bt=dn.includes("lighter"),De=(Array.isArray(Ze)?Ze:[Ze]).filter(ze=>ze!=null&&ze.target_platform?Yt&&!Bt?ze.target_platform==="hyper":Bt&&!Yt?ze.target_platform==="lighter":!0:!1);d(ze=>{const nt=[...De,...ze],mt=Re.current;return nt==null?void 0:nt.filter(Pt=>{var un,an,xn,An,kn,yn,Vn,Gn,Rn;if(!Pt||(G==null?void 0:G.length)>0&&!(G!=null&&G.includes((un=Pt==null?void 0:Pt.listen_user)==null?void 0:un.toLowerCase()))||(ne==null?void 0:ne.length)>0&&!(ne!=null&&ne.includes((an=Pt==null?void 0:Pt.trader_wallet)==null?void 0:an.toLowerCase()))||(te==null?void 0:te.length)>0&&!(te!=null&&te.includes(Pt==null?void 0:Pt.tag))||((xn=mt.coinFeed)==null?void 0:xn.length)>0&&!((An=mt.coinFeed)!=null&&An.includes(Pt==null?void 0:Pt.coin)))return!1;if(((kn=mt==null?void 0:mt.typeFeed)==null?void 0:kn.length)>0){const Cn=((yn=mt==null?void 0:mt.typeFeed)==null?void 0:yn.includes("Twaps"))&&(Pt==null?void 0:Pt.is_twap)===!0,rn=(Pt==null?void 0:Pt.fill_direction_type)&&((Vn=mt==null?void 0:mt.typeFeed)==null?void 0:Vn.includes(Pt==null?void 0:Pt.fill_direction_type));if(!(Cn||rn))return!1}if(((Gn=mt==null?void 0:mt.positionFeed)==null?void 0:Gn.length)>0){const Yn=zn(Pt);if(!((Rn=mt==null?void 0:mt.positionFeed)!=null&&Rn.includes(Yn)))return!1}else return!0;return!(mt!=null&&mt.directionFeed&&cn(Pt)!==(mt==null?void 0:mt.directionFeed))})})}),Ye.io.on("reconnect_attempt",Ze=>{console.log("reconnect_attempt",Ze)}),Ye.io.on("reconnect",Ze=>{console.log("reconnect",Ze),Ye.emit("room",nn)}),Ye.io.on("reconnect_failed",()=>{console.log("reconnect_failed")}),Ye.io.on("reconnect_error",Ze=>{console.log("reconnect_error",Ze)}),Ye.io.on("error",Ze=>{console.log("error",Ze)}),Ye.on("disconnect",()=>{console.log("Socket disconnected"),ht.current=!1}),()=>{Ye.disconnect(),console.log("Socket cleanup on unmount")}},[s]);const cn=Ye=>Ye!=null&&Ye.dir?["Sell","Close Short","Open Short"].includes(Ye==null?void 0:Ye.dir)?"Short":["Buy","Close Long","Open Long"].includes(Ye==null?void 0:Ye.dir)?"Long":(Ye==null?void 0:Ye.dir)||"--":"--",zn=Ye=>{var dn,Yt;const Ze=(Yt=(dn=Ye.message)==null?void 0:dn.split("-")[0])==null?void 0:Yt.trim();if(!Ze)return"Other";const Ft=/^Position Changed \(/;return Ze==="Close Position"?"Position Closed":Ze==="Position Increase"?"Increase":Ze==="Position Decreased"?"Decrease":Ft.test(Ze)?"Changed Position":Ze==="Open Position"?"Open Position":"Other"};function Xt({date:Ye}){const[Ze,Ft]=m.useState(Ro(Ye));return m.useEffect(()=>{const dn=setInterval(()=>{Ft(Ro(Ye))},1e3);return()=>clearInterval(dn)},[Ye]),i.jsx("span",{className:"text-[#a5a5a5] text-[11px] font-normal font-manrope leading-[13px] tracking-tight",children:Ze.dateTime})}const on={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:()=>ye(!xe),children:xe?"Hide Filters":"Show Filters"})}),i.jsx("div",{className:`${xe?"block":"hidden"}  lg:block mx-auto`,children:i.jsx(Xin,{advancedFilters:je,setAdvancedFilters:Pe,getFeedData:Xe,getFeedClearData:ut,dataCoin:P,selectedCoins:U,setSelectedCoins:L,isLoadingCoin:R,setIsLoadingCoin:O,walletTagData:K,walletTags:he,searchWalletSellect:G,setSearchWalletSellect:V,walletTagLoading:ie,tradeWalletData:z,selectTradeWalletData:ne,setSelectTradeWalletData:J,searchTagSellect:te,setSearchTagSellect:ae,isWalletLoading:l})}),i.jsx(nan,{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(Ba,{}):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:ac,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&&((Zt=u==null?void 0:u.map)==null?void 0:Zt.call(u,(Ye,Ze)=>{var Ft,dn,Yt,Bt,ot,De,_t,ze,nt,mt,$t,Pt,un,an,xn,An;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=Ye==null?void 0:Ye.dir)!=null&&Ft.includes("Long")?(Ye==null?void 0:Ye.dir)==="Short > Long"?"bg-[#67ffbd]/20":(Ye==null?void 0:Ye.dir)==="Long > Short"?"bg-[#ff797c]/20":"bg-[#67ffbd]/20":(Ye==null?void 0:Ye.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:(dn=Ye==null?void 0:Ye.dir)!=null&&dn.includes("Long")?(Ye==null?void 0:Ye.dir)==="Short > Long"?i.jsx(Fs,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):(Ye==null?void 0:Ye.dir)==="Long > Short"?i.jsx(Fs,{className:"text-[#FF797C] w-3 h-3"}):i.jsx(Fs,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):(Ye==null?void 0:Ye.dir)=="Buy"?i.jsx(Fs,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):i.jsx(Fs,{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:Ki,alt:"",className:"w-8 h-8"})}),(Ye==null?void 0:Ye.target_platform)==="hyper"?i.jsxs("div",{className:"flex justify-start items-center gap-2 min-w-max",children:[i.jsx("img",{src:S1,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"})]}):(Ye==null?void 0:Ye.target_platform)==="lighter"?i.jsxs("div",{className:"flex justify-start items-center gap-2 min-w-max",children:[i.jsx(up,{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/${Ye==null?void 0:Ye.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:(Ye==null?void 0:Ye.listen_user)&&((Yt=Ye==null?void 0:Ye.listen_user)==null?void 0:Yt.slice(0,5))+"..."+((Bt=Ye==null?void 0:Ye.listen_user)==null?void 0:Bt.slice(-4))}),i.jsx("img",{onClick:kn=>{kn.stopPropagation(),navigator.clipboard.writeText(Ye==null?void 0:Ye.listen_user),tn.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:Co,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:(Ye==null?void 0:Ye.oid)&&(Ye==null?void 0:Ye.oid)})]}),i.jsx("span",{onClick:kn=>{kn.stopPropagation(),navigator.clipboard.writeText(Ye==null?void 0:Ye.oid),tn.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:Co,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:()=>{we(me=="time"?"date":"time")},className:"text-[#a5a5a5] text-[11px] font-normal font-manrope leading-[13px] tracking-tight cursor-pointer",children:me=="time"?i.jsx(Xt,{date:Ye==null?void 0:Ye.time}):iu(Ye==null?void 0:Ye.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"," ",(Ye==null?void 0:Ye.dir)=="Sell"?"spot sell":(Ye==null?void 0:Ye.dir)=="Buy"?"spot buy":(ot=Ye==null?void 0:Ye.dir)==null?void 0:ot.toLowerCase()," ","position for"," "]}),i.jsxs("span",{className:"pl-1 text-white text-[13px] font-normal font-manrope leading-[21px] tracking-tight",children:[Ye==null?void 0:Ye.coin,"/",(Ye==null?void 0:Ye.feeToken)==null?"USDC":Ye==null?void 0:Ye.feeToken]})]}),i.jsx("div",{className:"w-5 h-5 bg-transparent rounded-[256px]",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${on[Ye==null?void 0:Ye.coin]||((De=Ye==null?void 0:Ye.coin)==null?void 0:De.split("/")[0])}.svg`||Wa,alt:Ye==null?void 0:Ye.coin,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:kn=>sa(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/${on[Ye==null?void 0:Ye.coin]||((_t=Ye==null?void 0:Ye.coin)==null?void 0:_t.split("/")[0])}.svg`||Wa,alt:Ye==null?void 0:Ye.coin,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:kn=>sa(kn)})}),i.jsxs("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-tight",children:[Ye==null?void 0:Ye.coin,"/",(Ye==null?void 0:Ye.feeToken)==null?"USDC":Ye==null?void 0:Ye.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:`${(ze=Ye==null?void 0:Ye.dir)!=null&&ze.includes("Long")?(Ye==null?void 0:Ye.dir)==="Short > Long"?"text-[#67ffbd] bg-[#67ffbd]/20":(Ye==null?void 0:Ye.dir)==="Long > Short"?"text-[#ff787b] bg-[#ff797c]/20":"text-[#67ffbd] bg-[#67ffbd]/20":(Ye==null?void 0:Ye.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:(nt=Ye==null?void 0:Ye.dir)!=null&&nt.includes("Long")?(Ye==null?void 0:Ye.dir)==="Short > Long"?i.jsx(Fs,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):(Ye==null?void 0:Ye.dir)==="Long > Short"?i.jsx(Fs,{className:"text-[#FF797C] w-3 h-3"}):i.jsx(Fs,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):(Ye==null?void 0:Ye.dir)=="Buy"?i.jsx(Fs,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):i.jsx(Fs,{className:"text-[#FF797C] w-3 h-3"})})}),i.jsxs("div",{className:"text-[11px] font-semibold font-manrope leading-[8px] tracking-wide",children:[(Ye==null?void 0:Ye.dir)=="Sell"?"Sell":(Ye==null?void 0:Ye.dir)=="Buy"?"Buy":(Ye==null?void 0:Ye.dir)=="Close Short"?"Short":(Ye==null?void 0:Ye.dir)=="Close Long"?"Long":(Ye==null?void 0:Ye.dir)=="Open Short"?"Short":(Ye==null?void 0:Ye.dir)=="Open Long"?"Long":Ye!=null&&Ye.dir?Ye==null?void 0:Ye.dir:"--",Ye!=null&&Ye.leverage?" - "+(Ye==null?void 0:Ye.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(fv,{title:"Type",value:Ye!=null&&Ye.fill_direction_type?Ye!=null&&Ye.is_twap?`${Ye==null?void 0:Ye.fill_direction_type} - Twap`:Ye==null?void 0:Ye.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(fv,{title:"Price",value:Er(Ye==null?void 0:Ye.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(fv,{title:"Size",value:Er(Ye==null?void 0:Ye.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(fv,{title:"Entry Price",value:Ye!=null&&Ye.markPrice?`$${Er(Ye==null?void 0:Ye.markPrice)}`:Er(Ye==null?void 0:Ye.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(fv,{title:"PnL",value:Ye!=null&&Ye.closedPnl?`$${Er(Math.abs(Ye==null?void 0:Ye.closedPnl))}`:Er(Math.abs(Ye==null?void 0:Ye.closedPnl)),color:`${(Ye==null?void 0:Ye.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(fv,{title:"Fee",value:Ye!=null&&Ye.fee?`$${Er(Math.abs(Ye==null?void 0:Ye.fee))}`:Er(Math.abs(Ye==null?void 0:Ye.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(fv,{title:"Margin Mode",value:(Ye==null?void 0:Ye.is_cross)==null||Ye!=null&&Ye.is_cross?"Cross":"Isolated",color:"text-white"}),i.jsx("div",{className:"w-px h-8 bg-transparent"})]})]})})}),i.jsx("div",{className:`${Ye!=null&&Ye.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:[Ye!=null&&Ye.success?i.jsx("img",{src:pM,alt:""}):i.jsx("img",{src:mM,alt:""}),i.jsx("div",{className:`${Ye!=null&&Ye.success?"text-[#67ffbd]":"text-[#ff787b]"}  text-xs font-semibold font-manrope leading-3 tracking-tight`,children:Ye!=null&&Ye.success?"Status:":"System Message:"}),i.jsxs("div",{className:"text-white text-xs font-semibold font-manrope leading-3 tracking-tight -ml-1",children:[Ye!=null&&Ye.message&&((mt=Ye==null?void 0:Ye.message)==null?void 0:mt.length)>100?`${($t=Ye==null?void 0:Ye.message)==null?void 0:$t.slice(0,100)}...`:Ye==null?void 0:Ye.message," ","on"]}),i.jsx("div",{onClick:()=>{window.open(`/wallet-details/${Ye==null?void 0:Ye.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:Ye!=null&&Ye.wallet_name?Ye==null?void 0:Ye.wallet_name:Ye!=null&&Ye.trader_wallet?((Pt=Ye==null?void 0:Ye.trader_wallet)==null?void 0:Pt.slice(0,5))+"..."+((un=Ye==null?void 0:Ye.trader_wallet)==null?void 0:un.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/${Ye==null?void 0:Ye.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:Ye!=null&&Ye.tag?Ye==null?void 0:Ye.tag:Ye!=null&&Ye.listen_user?((an=Ye==null?void 0:Ye.listen_user)==null?void 0:an.slice(0,5))+"..."+((xn=Ye==null?void 0:Ye.listen_user)==null?void 0:xn.slice(-4)):"--"})}),(Ye==null?void 0:Ye.message)&&((An=Ye==null?void 0:Ye.message)==null?void 0:An.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"})})]})})]})]})},Ze)}))})})]})},fv=({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})})]}),san=({isMenu:e,setIsMenu:t,handleMenuChange:n})=>{const{trackedWatchList:r,getTrackedWatchList:s,copyTradeWatchList:a,getCopyTradeWatchList:o}=m.useContext(Qr);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(Kin,{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(zin,{})}),i.jsx("div",{className:"block lg:hidden",children:i.jsx(Vin,{})})]}):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(ran,{})}):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})})]}),ian=()=>{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(Qr),f=oc(),[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 P,I;const C=window.localStorage.getItem("hyperToken"),N=window.localStorage.getItem("hyperAddress");if(!(!C||!N))try{const R=await _i(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((P=R==null?void 0:R.mushboomer_counts)==null?void 0:P.eth),s((I=R==null?void 0:R.mushboomer_counts)==null?void 0:I.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(No,{children:i.jsxs(Lo,{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(san,{isMenu:x,setIsMenu:g,handleMenuChange:v})})})]}):null},aan=({open:e,setOpen:t,handleEnterCode:n,inputValue:r,isEnterLoading:s})=>i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{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(ga,{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:Ki,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]})})]})})})})})]}),oan=({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:P,isEnterLoading:I,divRef:R,isEnterModal:O,setIsEnterModal:U})=>{const{mushboomerETH:L,mushboomerSOL:z,isReferralCode:X,isWhitelist:ne}=m.useContext(Qr),J=w?`https://app.dextrabot.com/referral/${w}`:"";return i.jsxs(i.Fragment,{children:[!l&&i.jsx(aan,{open:O,setOpen:U,handleEnterCode:e,inputValue:u,isEnterLoading:I}),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(Ai,{className:"text-[#7C7C7C]"}),i.jsx("span",{className:`${g=="Enter Code"?"ml-44":"ml-32"}`,children:i.jsx(Oa,{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})}),I?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:Ybt,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:Xbt,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:K=>{K.preventDefault(),w&&(navigator.clipboard.writeText(w||""),tn.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:hM,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:K=>{K.preventDefault(),(w||o)&&(navigator.clipboard.writeText(w?`https://app.dextrabot.com/referral/${w}`:o&&o),tn.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:hM,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:"-"})})]})]})]})]})]})},uC=({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(uU,{sortKey:t,state:n,className:""})]})})};function lan({open:e,setOpen:t}){return i.jsxs(Ea,{open:e,onClose:t,className:"relative z-50 font-manrope",children:[i.jsx(ja,{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(ga,{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:$a})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Jie,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 can=({data:e,dataLoading:t,dataError:n,height:r,handleRefTable:s,dataUsage:a,dataUsageLoading:o,dataUsageError:l,setIsOnTableTab:c,isOnTableTab:u})=>{var he,Q,ie,oe;const{isConnected:d,address:f}=ts(),{setSignModalOpen:x,hyperToken:g}=m.useContext(Qr),[v,w]=m.useState(!1),[C,N]=m.useState(!1),[P,I]=m.useState(!1),R=m.useMemo(()=>{var V;const G=new Map;return(V=e==null?void 0:e.claim_lists)==null||V.forEach(te=>{var fe;const ae=((fe=te==null?void 0:te.subscriber_address)==null?void 0:fe.toLowerCase())||"";if(!G.has(ae))G.set(ae,{...te,total_ref_claimable:parseFloat(te==null?void 0:te.total_ref_claimable)||0});else{const Ne=G.get(ae);G.set(ae,{...Ne,total_ref_claimable:(Ne==null?void 0:Ne.total_ref_claimable)+(parseFloat(te==null?void 0:te.total_ref_claimable)||0)})}}),Array.from(G.values())},[e]),O="-total_ref_claimable",[U,L]=m.useState(O),z=G=>R==null?void 0:R.sort((V,te)=>{const ae=V.subscriber_address?V.subscriber_address.toLowerCase():"",fe=te.subscriber_address?te.subscriber_address.toLowerCase():"";return G==="-level"?te.level-V.level:G==="level"?V.level-te.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"?te.total_ref_claimable-V.total_ref_claimable:G==="total_ref_claimable"?V.total_ref_claimable-te.total_ref_claimable:G==="-last_active_date"?new Date(te.last_active_date)-new Date(V.last_active_date):G==="last_active_date"?new Date(V.last_active_date)-new Date(te.last_active_date):0}),X="-created_at",[ne,J]=m.useState(X),K=G=>{var V;return(V=a.claim_lists)==null?void 0:V.sort((te,ae)=>{const fe=te.address?te.address.toLowerCase():"",Ne=ae.address?ae.address.toLowerCase():"";return G==="-level"?ae.level-te.level:G==="level"?te.level-ae.level:G==="-address"?fe<Ne?-1:fe>Ne?1:0:G==="address"?fe>Ne?-1:fe<Ne?1:0:G==="-created_at"?new Date(ae.created_at)-new Date(te.created_at):G==="created_at"?new Date(te.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 te=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():te,token:G})})).json();fe.success?(s(),I(!0)):(console.log(fe.error_message),N(fe.error_message),tn.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(lan,{open:P,setOpen:I}),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?tn.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(uC,{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(uC,{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(uC,{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(Ba,{})})})}):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(Ul,{})})})}):(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:ac,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."]})]})]})]})})})})}):(Q=z(U))==null?void 0:Q.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(oa,{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(uC,{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(uC,{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(uC,{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(Ba,{})})})}):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(Ul,{})})})}):(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:ac,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=K(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(oa,{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?Zlt(G==null?void 0:G.created_at):"--"})})})]},V))})]})})]})]})},uan=({open:e,setOpen:t})=>i.jsxs(Ea,{open:e,onClose:t,className:"relative z-50 font-manrope",children:[i.jsx(ja,{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(ga,{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:$a})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:ake,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"})})})]})]})})})})})]}),dan=()=>{const{isConnected:e,address:t}=ts(),{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(Qr),[v,w]=m.useState("Enter Code"),[C,N]=m.useState("Earnings"),P=t5(),I=(P==null?void 0:P.code)||"",[R,O]=m.useState(""),[U,L]=m.useState(""),[z,X]=m.useState(null),[ne,J]=m.useState(""),[K,re]=m.useState(""),[he,Q]=m.useState(""),[ie,oe]=m.useState(""),[G,V]=m.useState(!1),[te,ae]=m.useState(!1),[fe,Ne]=m.useState([]),[me,we]=m.useState(!1),[xe,ye]=m.useState(!1),[je,Pe]=m.useState(!1),[Re,Xe]=m.useState([]),[Ke,ut]=m.useState(!1),[et,tt]=m.useState(!1),[Le,$e]=m.useState(!1),ht=m.useRef(null),[pt,Kt]=m.useState(0);m.useEffect(()=>{I&&(O(I),Pe(!0))},[I]);const wt=Ft=>{let dn=Ft.target.value.toUpperCase();/^[0-9A-Z_-]{0,10}$/.test(dn)&&(O(dn),L(""))},nn=Ft=>{let dn=Ft.target.value.toUpperCase();/^[0-9A-Z_-]{0,10}$/.test(dn)&&(J(dn),re(""))},cn=async()=>{var Ft,dn;try{const Yt=window.localStorage.getItem("hyperToken"),Bt="https://dextrabothypev2.nftinit.io/api/subscriber/refcode/info/";if(!Yt){n(!0);return}const ot=window.localStorage.getItem("hyperAddress"),_t=await(await fetch(Bt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():ot,token:Yt})})).json();_t.success?(X((Ft=_t==null?void 0:_t.data)==null?void 0:Ft.referrer_code),oe((dn=_t==null?void 0:_t.data)==null?void 0:dn.my_refcode)):console.log(_t.error_message)}catch(Yt){console.error("Error referans request:",Yt)}};m.useEffect(()=>{cn(),Ye(),Ze()},[r]);const zn=async Ft=>{try{V(!0);const dn=window.localStorage.getItem("hyperToken"),Yt="https://dextrabothypev2.nftinit.io/api/subscriber/refcode/set/";dn||(n(!0),V(!1));const Bt=window.localStorage.getItem("hyperAddress"),De=await(await fetch(Yt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():Bt,token:dn,refcode:Ft})})).json();De.success?(X(Ft),V(!1),Pe(!1),tn.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"}}),De!=null&&De.trial_farming&&$e(!0)):(console.log(De.error_message),L(De.error_message),je&&tn.success(i.jsx(i.Fragment,{children:i.jsx("span",{children:De.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(dn){console.error("Error in like function:",dn),L(dn.message),je&&tn.error(dn.message),V(!1)}},Xt=async Ft=>{try{ae(!0);const dn=window.localStorage.getItem("hyperToken"),Yt="https://dextrabothypev2.nftinit.io/api/subscriber/refcode/generate/";dn||(n(!0),ae(!1));const Bt=window.localStorage.getItem("hyperAddress"),De=await(await fetch(Yt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():Bt,token:dn,refcode:Ft})})).json();De.success?(Q(`https://app.dextrabot.com/referral/${De==null?void 0:De.refcode}`),oe(De==null?void 0:De.refcode),ae(!1)):(console.log(De.error_message),ae(!1),re(De.error_message))}catch(dn){console.error("Error in like function:",dn),re(dn.message),ae(!1)}},on=()=>{R.length<4?(L("You must enter at least 4 characters!"),je&&tn.error("This refcode is wrong")):(L(""),zn(R))},Zt=()=>{ne.length<4?re(ie?"You have a generated code, you cannot generate it again.":"You must enter at least 4 characters!"):(re(""),Xt(ne))};m.useEffect(()=>{(async()=>{var Bt,ot;const dn=window.localStorage.getItem("hyperToken"),Yt=window.localStorage.getItem("hyperAddress");if(!(!dn||!Yt))try{const De=await _i(Yt.toLowerCase(),dn);De!=null&&De.success?(s(De==null?void 0:De.telegram_chat_id),a(De==null?void 0:De.subscriber_role),o(De==null?void 0:De.subs_expire_day),l((Bt=De==null?void 0:De.mushboomer_counts)==null?void 0:Bt.eth),c((ot=De==null?void 0:De.mushboomer_counts)==null?void 0:ot.sol),u(De==null?void 0:De.referral_code),d(De==null?void 0:De.refcode),f(De==null?void 0:De.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),x(""),g(""))}catch(De){console.error("Token verification error:",De),console.error(De.message||"An unknown error occurred.")}})()},[z]);const Ye=async()=>{try{we(!0);const Ft=window.localStorage.getItem("hyperToken"),dn="https://dextrabothypev2.nftinit.io/api/subscriber/refcode/claims/";if(!Ft){n(!0),we(!1);return}const Yt=window.localStorage.getItem("hyperAddress"),ot=await(await fetch(dn,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():Yt,token:Ft})})).json();ot.success?(Ne(ot==null?void 0:ot.data),we(!1)):(console.log(ot.error_message),ye(ot.error_message),we(!1))}catch(Ft){console.error("Error in like function:",Ft),ye(Ft.message),we(!1)}},Ze=async()=>{try{ut(!0);const Ft=window.localStorage.getItem("hyperToken"),dn="https://dextrabothypev2.nftinit.io/api/subscriber/refcode/usage/";if(!Ft){n(!0),ut(!1);return}const Yt=window.localStorage.getItem("hyperAddress"),ot=await(await fetch(dn,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():Yt,token:Ft})})).json();ot.success?(Xe(ot==null?void 0:ot.data),ut(!1)):(console.log(ot.error_message),tt(ot.error_message),ut(!1))}catch(Ft){console.error("Error in like function:",Ft),tt(Ft.message),ut(!1)}};return m.useEffect(()=>{const Ft=()=>{ht.current&&Kt(ht.current.clientHeight)},dn=new ResizeObserver(Ft);return ht.current&&dn.observe(ht.current),()=>{dn.disconnect()}},[]),i.jsxs(i.Fragment,{children:[i.jsx(uan,{open:Le,setOpen:$e}),i.jsx(No,{children:i.jsxs(Lo,{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(oan,{handleEnterCode:on,handleChange:wt,error:U,handleGenerateCode:Zt,handleGenerateChange:nn,generateError:K,generateData:he,userReferansCode:z,setInputValue:O,setGenerateValue:J,inputValue:R,generateValue:ne,setIsMenu:w,isMenu:v,setGenerateCode:oe,generateCode:ie,setIsGenerateLoading:ae,isGenerateLoading:te,setIsEnterLoading:V,isEnterLoading:G,divRef:ht,isEnterModal:je,setIsEnterModal:Pe}),i.jsx(can,{data:fe,dataLoading:me,dataError:xe,height:pt,handleRefTable:Ye,dataUsage:Re,dataUsageLoading:Ke,dataUsageError:et,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:bm,alt:"Dextrabot - Referral",className:"w-3 h-3 mb-2"})]}),i.jsx("img",{src:Kbt,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(Qr),{isConnected:u,address:d}=ts(),[f,x]=m.useState(""),[g,v]=m.useState(!1),[w,C]=m.useState("");m.useEffect(()=>{const I=n.find(R=>R.wallet_address===r);I&&a(I==null?void 0:I.withdrawableUsdc)},[n]);const N=async()=>{var I,R,O,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=(I=re==null?void 0:re.result)==null?void 0:I.result)==null?void 0:R.status)=="err"?(v(!1),C((U=(O=re==null?void 0:re.result)==null?void 0:O.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(""),tn.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)}},P=I=>{x(I.target.value)};return i.jsx(i.Fragment,{children:i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{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(ga,{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:$a})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Ki,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:I=>{I.stopPropagation(),navigator.clipboard.writeText(d),tn.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:Co,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:I=>{let R=I.target.value;R.includes("-")?R=R.replace("-",""):(R===""||parseFloat(R)>=0)&&P({...I,target:{...I.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:I=>{I.preventDefault(),f!=null&&f!==""?g||N():tn.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})})]})})})})})]})})}function Dce({open:e,setOpen:t,walletAddress:n}){return i.jsxs(Ea,{open:e,onClose:t,className:"relative z-50 font-manrope",children:[i.jsx(ja,{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(ga,{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:$a})})}),i.jsxs("div",{className:"flex flex-col items-center justify-start gap-2.5",children:[i.jsx("div",{className:"pt-4",children:i.jsx(tse,{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),tn.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:Co,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 Bce=({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(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{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(ga,{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:$a})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Ki,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:Xc,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:Xc,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"})})]})]})})})})})]})})},$ce=({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:p3(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,fan=({data:e,loading:t,error:n,socketLoading:r,currentPage:s,handlePageChange:a,allWallets:o,handleListRequest:l})=>{var Le;m.useState(!1);const{setSignModalOpen:c}=m.useContext(Qr),{isConnected:u,address:d}=ts(),f=5,[x,g]=m.useState(null),[v,w]=m.useState(null),[C,N]=m.useState(!1),[P,I]=m.useState(null),[R,O]=m.useState(!1),[U,L]=m.useState("");m.useState({});const[z,X]=m.useState({}),[ne,J]=m.useState(!1),[K,re]=m.useState({wallet:"",walletId:"",walletName:"",unrealizedPnL:"",perpEquity:""}),[he,Q]=m.useState(!1),[ie,oe]=m.useState(!1),G="-perpEquity",[V,te]=m.useState(G),ae=$e=>e.sort((ht,pt)=>{if(ht.version===3&&pt.version!==3)return-1;if(pt.version===3&&ht.version!==3)return 1;const Kt=ht.wallet_name?ht.wallet_name.toUpperCase():"",wt=pt.wallet_name?pt.wallet_name.toUpperCase():"",nn=ht.wallet_address?ht.wallet_address.toLowerCase():"",cn=pt.wallet_address?pt.wallet_address.toLowerCase():"";return $e==="wallet_name"?Kt<wt?-1:Kt>wt?1:0:$e==="-wallet_name"?Kt>wt?-1:Kt<wt?1:0:$e==="-wallet_address"?nn<cn?-1:nn>cn?1:0:$e==="wallet_address"?nn>cn?-1:nn<cn?1:0:$e==="-wallet_created_data"?new Date(pt.wallet_created_data)-new Date(ht.wallet_created_data):$e==="wallet_created_data"?new Date(ht.wallet_created_data)-new Date(pt.wallet_created_data):$e==="-perpEquity"?pt.perpEquity-ht.perpEquity:$e==="perpEquity"?ht.perpEquity-pt.perpEquity:$e==="-unrealizedPnl"?pt.unrealizedPnl-ht.unrealizedPnl:$e==="unrealizedPnl"?ht.unrealizedPnl-pt.unrealizedPnl:$e==="-marginUsed"?pt.marginUsed-ht.marginUsed:$e==="marginUsed"?ht.marginUsed-pt.marginUsed:$e==="-withdrawableUsdc"?pt.withdrawableUsdc-ht.withdrawableUsdc:$e==="withdrawableUsdc"?ht.withdrawableUsdc-pt.withdrawableUsdc:0}),fe=async($e,ht,pt)=>{if(!$e||!ht||!pt){console.error("Delete order called with invalid parameters"),tn.error("Delete order called with invalid parameters");return}const Kt=`${$e}_${ht}`;try{X(on=>({...on,[Kt]:!0}));const wt=window.localStorage.getItem("hyperToken"),nn="https://dextrabothypev2.nftinit.io/api/wallet/delete";if(!wt){c(!0),X(on=>({...on,[Kt]:!1}));return}const cn=window.localStorage.getItem("hyperAddress"),zn=await fetch(nn,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:d?d.toLowerCase():cn,token:wt,wallet_id:$e.toString()})});if(!zn.ok)throw new Ul(`Server responded with status ${zn.status}`);const Xt=await zn.json();Xt.success?(l(),re({wallet:"",walletId:"",walletName:"",unrealizedPnL:"",perpEquity:""}),Q(!1),oe(!1),J(!1),X(on=>({...on,[Kt]:!1})),tn.success(i.jsxs(i.Fragment,{children:[i.jsx("span",{children:pt.slice(0,5)+"..."+pt.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(Xt.error_message),tn.error(Xt.error_message),X(on=>({...on,[Kt]:!1})))}catch(wt){console.error("Error deleting wallet:",wt),tn.error(wt.message),X(nn=>({...nn,[Kt]:!1}))}},Ne=m.useRef(null),me=()=>{Ne.current&&(Ne.current.scrollLeft-=100)},we=()=>{Ne.current&&(Ne.current.scrollLeft+=100)},xe=()=>{Ne.current&&(Ne.current.scrollTop+=200)},ye=()=>{Ne.current&&(Ne.current.scrollTop-=200)},je=$e=>$e>=640&&$e<1024?4:$e>=1024&&$e<1240?7:$e>=1240&&$e<1540||$e>=1540?8:3,[Pe,Re]=m.useState(null),[Xe,Ke]=m.useState(!1),[ut,et]=m.useState(!1);m.useEffect(()=>{const $e=()=>{et(window.innerWidth<640)};return window.addEventListener("resize",$e),$e(),()=>window.removeEventListener("resize",$e)},[]);const tt=$e=>{ut&&(Re($e),Ke(!0))};return i.jsxs(i.Fragment,{children:[i.jsx(Lce,{open:C,setOpen:N,data:e,walletData:x,withdrawableUsdc:P,setWithdrawableUsdc:I,modalWalletId:v,setModalWalletId:w}),i.jsx(Dce,{open:R,setOpen:O,walletAddress:U}),i.jsx(Bce,{open:ne,setOpen:J,handleDeleteWallet:fe,deleteWalleInfo:K,confirmClosePositions:he,setConfirmClosePositions:Q,confirmWithdrawEquity:ie,setConfirmWithdrawEquity:oe}),i.jsx(dp,{isOpen:Xe,onClose:()=>Ke(!1),children:i.jsx($ce,{rowData:Pe})}),i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[17px] text-white bg-[#161616] w-full h-full sm:min-h-[280px] max-h-max font-manrope relative",children:[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:me,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(Qa,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:we,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(Qa,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:ye,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(Qa,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:xe,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(Qa,{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:Ne,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(pi,{title:"Name",sortKey:"wallet_name",sortOption:V,setSortOption:te,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(pi,{title:"Follower Wallet",sortKey:"wallet_address",sortOption:V,setSortOption:te,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[110px] sm:min-w-[110px] px-1 hidden sm:table-cell",children:i.jsx(pi,{title:"Creation Date",sortKey:"wallet_created_data",sortOption:V,setSortOption:te,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[120px] sm:min-w-[120px] px-1",children:i.jsx(pi,{title:"Perp Equity",sortKey:"perpEquity",sortOption:V,setSortOption:te,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[134px] sm:min-w-[134px] px-1",children:i.jsx(pi,{title:"uPnL",sortKey:"unrealizedPnl",sortOption:V,setSortOption:te,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[104px] sm:min-w-[104px] px-1 hidden sm:table-cell",children:i.jsx(pi,{title:"Margin",sortKey:"marginUsed",sortOption:V,setSortOption:te,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[130px] sm:min-w-[130px] px-1 hidden sm:table-cell",children:i.jsx(pi,{title:"Avail. Balance",sortKey:"withdrawableUsdc",sortOption:V,setSortOption:te,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:je(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(Ba,{})})})}):n&&!e?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:je(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(Ul,{})})})}):(e==null?void 0:e.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:je(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:ac,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."]})]})]})]})})})})}):(Le=ae(V))==null?void 0:Le.map(($e,ht)=>{const pt=!isNaN($e==null?void 0:$e.perpEquity)&&!isNaN($e==null?void 0:$e.marginUsed)?($e==null?void 0:$e.perpEquity)-($e==null?void 0:$e.marginUsed):0,Kt=ut?{onClick:()=>tt($e),className:"cursor-pointer"}:{};return i.jsxs("tr",{...Kt,className:`${ht%2===0,"bg-[#161616]"} relative group hover:bg-[#222222] h-[44px] border-b border-[#232323] text-white`,children:[i.jsx("td",{scope:"row",className:`${ht%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:($e==null?void 0:$e.version)==3?i.jsx(xi,{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:($e==null?void 0:$e.wallet_name.length)>=12?($e==null?void 0:$e.wallet_name).slice(0,12)+"... (API-AGENT) Wallet":($e==null?void 0:$e.wallet_name)+"(API-AGENT) Wallet"}),($e==null?void 0:$e.wallet_name.length)>=12&&i.jsx("span",{className:"ml-3",children:i.jsx(Oa,{content:`${$e==null?void 0:$e.wallet_name}`,positionTop:!0,alignRight:!1})}),i.jsx(Ai,{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:($e==null?void 0:$e.wallet_name.length)>=12?($e==null?void 0:$e.wallet_name).slice(0,12)+"...":$e==null?void 0:$e.wallet_name}),($e==null?void 0:$e.wallet_name.length)>=12&&i.jsx("span",{className:"ml-3",children:i.jsx(Oa,{content:`${$e==null?void 0:$e.wallet_name}`,positionTop:!0,alignRight:!1})})]})})}),i.jsx("td",{scope:"row",className:`${ht%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/${$e==null?void 0:$e.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:Ki,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(oa,{info1:`${($e==null?void 0:$e.wallet_address).slice(0,5)+"..."+($e==null?void 0:$e.wallet_address).slice(-4)}`,info1_Color:"text-white",rowTwo:!1}),i.jsx("img",{onClick:wt=>{wt.stopPropagation(),navigator.clipboard.writeText($e==null?void 0:$e.wallet_address),tn.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:Co,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:($e==null?void 0:$e.wallet_created_data)&&p3($e==null?void 0:$e.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...":($e==null?void 0:$e.perpEquity)!=0&&!isNaN($e==null?void 0:$e.perpEquity)?`$${Er($e==null?void 0:$e.perpEquity)}`:"$0"})})}),i.jsx("td",{children:i.jsx("div",{className:"flex flex-col items-end gap-0.5",children:i.jsx("div",{className:`${($e==null?void 0:$e.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..."}):($e==null?void 0:$e.unrealizedPnl)!=0&&!isNaN($e==null?void 0:$e.unrealizedPnl)?`$${Er(Math.abs($e==null?void 0:$e.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..."}):($e==null?void 0:$e.marginUsed)!=0&&!isNaN($e==null?void 0:$e.marginUsed)?`$${Er($e==null?void 0:$e.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&&pt<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(pt)?"$0":`$${Er(Math.abs(pt))}`})})}),i.jsx("td",{className:"hidden sm:table-cell",children:i.jsxs("div",{className:"flex items-center justify-end gap-2 pr-3",children:[($e==null?void 0:$e.version)===3?i.jsx(xi,{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(xy,{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:()=>{O(!0),L($e==null?void 0:$e.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(xy,{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"})]}),($e==null?void 0:$e.version)===3?i.jsx(xi,{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(xy,{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:()=>{I($e==null?void 0:$e.withdrawableUsdc),N(!0),g($e==null?void 0:$e.wallet_address),w($e==null?void 0:$e.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(xy,{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"})]}),z[`${$e==null?void 0:$e.wallet_id}_${$e==null?void 0:$e.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..."})]}):($e==null?void 0:$e.version)===3?i.jsx(xi,{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:()=>{re({wallet:$e==null?void 0:$e.wallet_address,walletId:$e==null?void 0:$e.wallet_id,walletName:$e==null?void 0:$e.wallet_name.toLowerCase(),unrealizedPnL:$e==null?void 0:$e.unrealizedPnl,perpEquity:$e==null?void 0:$e.perpEquity}),J(!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"})})]})})]},ht)})})]})})]}),i.jsxs("div",{className:"flex justify-start items-center gap-2 absolute -top-[16px] sm:-top-[18px] right-1 sm:translate-x-0 sm:right-4 z-50",children:[i.jsx("button",{onClick:()=>a(s-1),disabled:s===1,className:`${s===1?"cursor-not-allowed":"cursor-pointer"} h-6 lg:h-7 px-2 sm:px-3 py-1 lg:py-1.5 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-[11px] lg: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/f)]}),i.jsx("button",{onClick:()=>a(s+1),disabled:s*f>=o.length,className:`${s*f>=o.length?"cursor-not-allowed":"cursor-pointer"} h-6 lg:h-7 px-2 sm:px-3 py-1.5 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-[11px] lg:text-[13px] font-medium font-inter leading-[8px]",children:"Next"})})]})]})]})};function ZUe({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 P1(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),tn.success("PNG successfully downloaded!")}catch(x){console.error("Error generating PNG:",x),tn.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(Wa))},[n==null?void 0:n.coin]),i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{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(ga,{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:$a})})}),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:EA,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||Wa,alt:"",className:"rounded-full w-8 h-8",loading:"lazy",onError:x=>sa(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?"+":"-",oo(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?`$${oo(Math.abs(n==null?void 0:n.pnl))}`:oo(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?`$${fy(n==null?void 0:n.entryPrice)}`:fy(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?`$${fy(n==null?void 0:n.markPrice)}`:fy(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:AA,alt:"",className:"h-full"}):i.jsx("img",{src:jA,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"),tn.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 han=({data:e})=>{const{isConnected:t,address:n}=ts(),{setSignModalOpen:r,hyperToken:s,isReferralCodeName:a}=m.useContext(Qr),[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),[P,I]=m.useState(!1),[R,O]=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,K]=m.useState(!1);m.useEffect(()=>{if(e.length===0||J)return;const fe=e.reduce((Ne,me)=>parseFloat(me.perpEquity||0)>parseFloat(Ne.perpEquity||0)?me:Ne);fe.wallet_address&&l(fe.wallet_address)},[e,J]);const re=(fe,Ne,me)=>{const we=fe==null?void 0:fe.filter(xe=>xe&&xe.walletAddress&&xe.asset).filter(xe=>{var ye,je;return me?(je=(ye=xe==null?void 0:xe.asset)==null?void 0:ye.toString())==null?void 0:je.toUpperCase().includes(me.toUpperCase()):!0});return we==null?void 0:we.sort((xe,ye)=>{const je=xe.wallet_name?xe.wallet_name.toUpperCase():"",Pe=ye.wallet_name?ye.wallet_name.toUpperCase():"",Re=xe.tag?xe.tag.toUpperCase():"",Xe=ye.tag?ye.tag.toUpperCase():"",Ke=xe.asset?xe.asset.toUpperCase():"",ut=ye.asset?ye.asset.toUpperCase():"",et=xe.type==="Long"?1:0,tt=ye.type==="Long"?1:0,Le=xe.type==="Short"?1:0,$e=ye.type==="Short"?1:0;return Ne==="wallet_name"?je<Pe?-1:je>Pe?1:0:Ne==="-wallet_name"?je>Pe?-1:je<Pe?1:0:Ne==="-unrealizedPnl"?ye.unrealizedPnl-xe.unrealizedPnl:Ne==="unrealizedPnl"?xe.unrealizedPnl-ye.unrealizedPnl:Ne==="-roe"?ye.roe-xe.roe:Ne==="roe"?xe.roe-ye.roe:Ne==="-size"?ye.size-xe.size:Ne==="size"?xe.size-ye.size:Ne==="-entryPrice"?ye.entryPrice-xe.entryPrice:Ne==="entryPrice"?xe.entryPrice-ye.entryPrice:Ne==="-currentPrice"?ye.currentPrice-xe.currentPrice:Ne==="currentPrice"?xe.currentPrice-ye.currentPrice:Ne==="-leverage"?ye.leverage-xe.leverage:Ne==="leverage"?xe.leverage-ye.leverage:Ne==="-positionValue"?ye.positionValue-xe.positionValue:Ne==="positionValue"?xe.positionValue-ye.positionValue:Ne==="-marginUsed"?ye.marginUsed-xe.marginUsed:Ne==="marginUsed"?xe.marginUsed-ye.marginUsed:Ne==="funding"?ye.funding-xe.funding:Ne==="-funding"?xe.funding-ye.funding:Ne==="-liquidationPrice"?ye.liquidationPrice-xe.liquidationPrice:Ne==="liquidationPrice"?xe.liquidationPrice-ye.liquidationPrice:Ne==="-tag"?Re<Xe?-1:Re>Xe?1:0:Ne==="tag"?Re>Xe?-1:Re<Xe?1:0:Ne==="-coin"?Ke<ut?-1:Ke>ut?1:0:Ne==="coin"?Ke>ut?-1:Ke<ut?1:0:Ne==="-type_leverage"?et!==tt?tt-et:ye.leverage-xe.leverage:Ne==="type_leverage"?Le!==$e?$e-Le:ye.leverage-xe.leverage:0})},he=async fe=>{if(fe===""&&X.filter(Ne=>Ne!==void 0).length===0||fe===""&&re(X,L,d).length===0||re(X,L,d).length===0){tn.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 Ne=re(X,L,d),me=[...new Set(Ne.map(we=>we.wallet_id))];if(me.length===0){tn.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(me.map(xe=>Q(xe,!1))),tn.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(we){console.error("Error closing all orders:",we)}finally{u(!1)}return}await Q(fe)},Q=async(fe,Ne=!0)=>{if(X.filter(me=>me!==void 0).length===0){tn.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"),tn.error("Close order called with invalid parameters");return}try{u(!0);const me=window.localStorage.getItem("hyperToken"),we="https://dextrabothypev2.nftinit.io/api/hyper/order/close_order_all_new/";if(!me){r(!0),u(!1);return}const xe=window.localStorage.getItem("hyperAddress"),ye=await fetch(we,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:n?n.toLowerCase():xe,token:me,wallet_id:fe.toString()})});if(!ye.ok)throw new Error(`Server responded with status ${ye.status}`);const je=await ye.json();je.status=="ok"?(u(!1),Ne&&tn.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),Ne&&tn.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."),tn.error("Close order operation failed."),u(!1))}catch(me){throw console.error("Something went wrong!"),tn.error("Something went wrong!"),u(!1),me}},[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 Ne=setInterval(()=>{fe()},1e3*60*30);return()=>{clearInterval(Ne)}},[]);const G=async fe=>{try{const Ne=window.localStorage.getItem("hyperToken"),me="https://dextrabothypev2.nftinit.io/api/hyper/following/position_info/";if(!Ne){r(!0);return}const we=fe==null?void 0:fe.filter(Pe=>Pe&&Pe.walletAddress&&Pe.asset).map(Pe=>({wallet:Pe.walletAddress,coin:Pe.asset})),xe=window.localStorage.getItem("hyperAddress"),je=await(await fetch(me,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:n?n.toLowerCase():xe,token:Ne,positions:we})})).json();je.success?ne(Pe=>Pe.map(Re=>{const Xe=je==null?void 0:je.data.find(Ke=>(Ke==null?void 0:Ke.wallet)===(Re==null?void 0:Re.walletAddress)&&(Ke==null?void 0:Ke.coin)===(Re==null?void 0:Re.asset));return{...Re,tag:Xe==null?void 0:Xe.tag,tagWallet:Xe==null?void 0:Xe.cp_wallet}})):(console.log(je.error_message),tn.error(je.error_message))}catch(Ne){console.error("Error tag request",Ne),tn.error(Ne.message)}},V=m.useRef(X==null?void 0:X.filter(fe=>(fe==null?void 0:fe.walletAddress)&&(fe==null?void 0:fe.asset)).length),te=m.useRef(),ae=m.useRef(!0);return m.useEffect(()=>{const fe=X==null?void 0:X.filter(me=>me!==void 0&&(me==null?void 0:me.walletAddress)&&(me==null?void 0:me.asset)),Ne=fe==null?void 0:fe.length;if(Ne>0&&Ne>V.current){const me=o===""?X:X.filter(we=>(we==null?void 0:we.wallet_id)==o);ae.current?(G(me),ae.current=!1):(te.current&&clearTimeout(te.current),te.current=setTimeout(()=>{G(me)},5e3))}V.current=Ne},[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(Ne=>(Ne==null?void 0:Ne.wallet_id)==o);(fe==null?void 0:fe.length)>0&&G(fe)}},[o]),m.useEffect(()=>{function fe(Ne){v.current&&!v.current.contains(Ne.target)&&setIsDropdownOpen(!1),w.current&&!w.current.contains(Ne.target)&&g(!1)}return document.addEventListener("mousedown",fe),()=>document.removeEventListener("mousedown",fe)},[]),i.jsx(i.Fragment,{children:i.jsxs(i.Fragment,{children:[i.jsx(ZUe,{open:C,setOpen:N,data:R,setShare:I,setTradeInfo:O}),i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[12px] text-white bg-[#161616] w-full h-full min-h-[500px] max-h-max font-manrope relative sm:pt-3",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:eae,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 sm:min-w-[200px] lg:min-w-max text-xs sm:text-[14px]",children:"Select wallet to see your current positions:"}),i.jsxs("div",{className:"relative w-full min-w-[150px]",children:[i.jsxs("select",{className:"rounded-md py-0.5 bg-[#303030] text-white text-base font-medium outline-none w-full h-8 pl-2 pr-4 appearance-none border border-[#404040]",onChange:fe=>{l(fe.target.value),K(!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))]}),i.jsx(rd,{className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-[#9b9b9b]"})]})]}),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:$a})})}),i.jsx("img",{src:Zbt,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(YUe,{initialAddress:o,wallets:o===""?e:void 0})})]})]})]})})},pan=({initialAddress:e="",wallets:t,positions:n,setPositions:r,isWalletIndex:s,posLoading:a,setPosLoading:o,setGenerateWalletData:l})=>{var Ye;const{getTrackedWatchList:c,hyperToken:u,copyTradeWatchList:d,getCopyTradeWatchList:f,setTelegramChatId:x,setSubscriberRole:g,setSubsExpireDay:v,setMushboomerETH:w,setMushboomerSOL:C,setIsReferralCode:N,isReferralCodeName:P,setIsReferralCodeName:I,setIsWhitelist:R,setHyperToken:O,setHyperAddress:U,setSignModalOpen:L,latestPnL:z}=m.useContext(Qr),{address:X}=ts(),[ne,J]=m.useState(!1);m.useState({}),m.useState(!1),m.useEffect(()=>{if(!(s!=null&&s.index))return;const Ze=new WebSocket("wss://mainnet.zklighter.elliot.ai/stream");let Ft;Ze.onopen=()=>{console.log("Lighter WebSocket connected"),Ze.send(JSON.stringify({type:"subscribe",channel:`account_all/${s.index}`})),Ft=setInterval(()=>{Ze.readyState===WebSocket.OPEN&&Ze.send(JSON.stringify({type:"subscribe",channel:`account_all/${s.index}`}))},5e3)},Ze.onmessage=Yt=>{const Bt=JSON.parse(Yt==null?void 0:Yt.data);if(Bt!=null&&Bt.positions&&Object.keys(Bt.positions).length>0){const ot=Object.values(Bt.positions).filter(nt=>Number(nt.position)!==0).map(nt=>({funding:0,leverage:nt.initial_margin_fraction?Math.round(100/Number(nt.initial_margin_fraction)):0,positionValue:Number(nt.position_value??0),unrealizedPnl:Number(nt.unrealized_pnl??0),currentPrice:nt.avg_entry_price&&nt.unrealized_pnl&&nt.position&&nt.sign?Number(nt.avg_entry_price)+Number(nt.unrealized_pnl)/(Number(nt.position)*Number(nt.sign)):Number(nt.position_value)/Math.abs(Number(nt.position)),entryPrice:Number(nt.avg_entry_price??0),size:Number(nt.position??0),type:Number(nt.sign)>0?"Long":"Short",asset:nt.symbol??"",sign:Number(nt.sign??1)})),De=ot.reduce((nt,mt)=>nt+mt.unrealizedPnl,0),_t=ot.reduce((nt,mt)=>{const $t=mt.leverage>0?mt.leverage:1,Pt=mt.positionValue/$t;return nt+(isFinite(Pt)?Pt:0)},0),ze=Number(Bt.available_balance??0);l(nt=>nt==null?void 0:nt.map(mt=>{var $t;return(($t=mt.wallet_address)==null?void 0:$t.toLowerCase())===(e==null?void 0:e.toLowerCase())?{...mt,unrealizedPnl:De.toFixed(6),withdrawableUsdc:ze.toFixed(6),marginUsed:_t.toFixed(6),positions:ot}:mt})),r(ot),(me==null?void 0:me.length)>0&&o(!1)}else r([]),a&&o(!1)},Ze.onclose=Yt=>{console.log("🔌 ZkLighter WebSocket disconnected",Yt.code,Yt.reason),clearInterval(Ft)},Ze.onerror=Yt=>{console.error("❌ ZkLighter WS error:",Yt),clearInterval(Ft)};const dn=()=>{Ze.readyState===WebSocket.OPEN&&Ze.send(JSON.stringify({type:"unsubscribe",channel:`account_all/${s.index}`})),clearInterval(Ft),Ze.close()};return window.addEventListener("beforeunload",dn),()=>{dn(),window.removeEventListener("beforeunload",dn)}},[s]);const K=m.useRef(null),re=()=>{K.current&&(K.current.scrollLeft-=200)},he=()=>{K.current&&(K.current.scrollLeft+=200)},Q=()=>{K.current&&(K.current.scrollTop+=200)},ie=()=>{K.current&&(K.current.scrollTop-=200)};m.useEffect(()=>{(async()=>{var Yt,Bt;const Ft=window.localStorage.getItem("hyperToken"),dn=window.localStorage.getItem("hyperAddress");if(!(!Ft||!dn))try{const ot=await _i(dn.toLowerCase(),Ft);ot!=null&&ot.success?(x(ot==null?void 0:ot.telegram_chat_id),g(ot==null?void 0:ot.subscriber_role),v(ot==null?void 0:ot.subs_expire_day),w((Yt=ot==null?void 0:ot.mushboomer_counts)==null?void 0:Yt.eth),C((Bt=ot==null?void 0:ot.mushboomer_counts)==null?void 0:Bt.sol),N(ot==null?void 0:ot.referral_code),I(ot==null?void 0:ot.refcode),R(ot==null?void 0:ot.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),O(""),U(""))}catch(ot){console.error("Token verification error:",ot),console.error(ot.message||"An unknown error occurred.")}})()},[]);const[oe,G]=m.useState(""),[V,te]=m.useState(!1),ae=m.useRef(null);m.useEffect(()=>{function Ze(Ft){ae.current&&!ae.current.contains(Ft.target)&&te(!1)}return document.addEventListener("mousedown",Ze),()=>document.removeEventListener("mousedown",Ze)},[]);const[fe,Ne]=m.useState([]),me=n==null?void 0:n.filter(Ze=>{var Ft;return oe?(Ft=Ze.asset)==null?void 0:Ft.toLowerCase().includes(oe.toLowerCase()):!0}).map(Ze=>{const Ft=fe.find(dn=>dn.coin===Ze.asset&&(dn.wallet||"").toLowerCase()===(Ze.wallet||"").toLowerCase());return{...Ze,tagName:(Ft==null?void 0:Ft.tag)||null,tagWallet:(Ft==null?void 0:Ft.cp_wallet)||null}}),we="-unrealizedPnl",[xe,ye]=m.useState(we),je=Ze=>{const ot=me==null?void 0:me.map(De=>{const _t=De!=null&&De.positionValue&&(De!=null&&De.leverage)?De.unrealizedPnl*De.leverage*100/De.positionValue:0,ze=.004+6e-4*De.leverage;let nt=0;(De==null?void 0:De.type)==="Long"?nt=De.entryPrice*(De.leverage/(De.leverage+1-De.leverage*ze)):nt=De.entryPrice*(De.leverage/(De.leverage-1+De.leverage*ze));const mt=nt*5.05,$t=De.leverage?De.positionValue/De.leverage:0,Pt=De.positionValue*1e-4*(De.sign??-1);return{...De,roe:_t,liquidationPrice:mt,marginUsed:$t,funding:Pt}});return ot==null?void 0:ot.sort((De,_t)=>{const ze=De.tagName?De.tagName.toUpperCase():"",nt=_t.tagName?_t.tagName.toUpperCase():"",mt=De.asset?De.asset.toUpperCase():"",$t=_t.asset?_t.asset.toUpperCase():"",Pt=De.type==="Long"?1:0,un=_t.type==="Long"?1:0,an=De.type==="Short"?1:0,xn=_t.type==="Short"?1:0;return Ze==="-unrealizedPnl"?_t.unrealizedPnl-De.unrealizedPnl:Ze==="unrealizedPnl"?De.unrealizedPnl-_t.unrealizedPnl:Ze==="-roe"?_t.roe-De.roe:Ze==="roe"?De.roe-_t.roe:Ze==="-size"?_t.size-De.size:Ze==="size"?De.size-_t.size:Ze==="-entryPrice"?_t.entryPrice-De.entryPrice:Ze==="entryPrice"?De.entryPrice-_t.entryPrice:Ze==="-currentPrice"?_t.currentPrice-De.currentPrice:Ze==="currentPrice"?De.currentPrice-_t.currentPrice:Ze==="-leverage"?_t.leverage-De.leverage:Ze==="leverage"?De.leverage-_t.leverage:Ze==="-positionValue"?_t.positionValue-De.positionValue:Ze==="positionValue"?De.positionValue-_t.positionValue:Ze==="-marginUsed"?_t.marginUsed-De.marginUsed:Ze==="marginUsed"?De.marginUsed-_t.marginUsed:Ze==="-funding"?_t.funding-De.funding:Ze==="funding"?De.funding-_t.funding:Ze==="-liquidationPrice"?_t.liquidationPrice-De.liquidationPrice:Ze==="liquidationPrice"?De.liquidationPrice-_t.liquidationPrice:Ze==="-entryTime"?new Date(_t.latestFill)-new Date(De.latestFill):Ze==="entryTime"?new Date(De.latestFill)-new Date(_t.latestFill):Ze==="-source_tag"?ze<nt?-1:ze>nt?1:0:Ze==="source_tag"?ze>nt?-1:ze<nt?1:0:Ze==="-type_leverage"?Pt!==un?un-Pt:_t.leverage-De.leverage:Ze==="type_leverage"?an!==xn?xn-an:_t.leverage-De.leverage:Ze==="-asset"?mt<$t?-1:mt>$t?1:0:Ze==="asset"?mt>$t?-1:mt<$t?1:0:0})};n.length,n.filter(Ze=>Ze.unrealizedPnl>=0).length;const[Pe,Re]=m.useState({coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,referral:"",positionDistribution:0,pnl:0,closePx:0}),Ke=localStorage.getItem("isDateOpenPositionsLighterFormat")||"date",[ut,et]=m.useState(Ke);m.useEffect(()=>{localStorage.setItem("isDateOpenPositionsLighterFormat",ut)},[ut]);const[tt,Le]=m.useState([]),$e=async()=>{try{const Ze=window.localStorage.getItem("hyperToken");if(!Ze){L(!0);return}const Ft="https://dextrabothypev2.nftinit.io/api/wallet/list-lighter",dn=window.localStorage.getItem("hyperAddress"),Bt=await(await fetch(Ft,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:X?X.toLowerCase():dn,token:Ze,balance:"false"})})).json();Bt!=null&&Bt.success?(Le(Bt.data||[]),zn(Bt.data)):console.log(Bt.error_message)}catch(Ze){console.error("Error fetching generate wallet list:",Ze)}};m.useEffect(()=>{window.localStorage.getItem("hyperToken")&&$e()},[u]);const[ht,pt]=m.useState([]),[Kt,wt]=m.useState(!0),[nn,cn]=m.useState(!1);m.useEffect(()=>{me&&me.length>0&&(Xt(),tt.length>0&&Kt&&zn())},[me]);const zn=()=>{ht.length!==0&&(on(ht),Kt&&wt(!1))};m.useEffect(()=>{const Ze=window.localStorage.getItem("hyperToken");ht.length&&Ze&&on(ht)},[ht]);const Xt=()=>{const Ze=window.localStorage.getItem("hyperToken");let Ft=!1;const dn=[...ht];me.forEach(Yt=>{var _t;const Bt=Yt.asset,ot=(_t=Yt.wallet||e)==null?void 0:_t.toLowerCase();dn.some(ze=>ze.coin===Bt&&(ze.wallet||"").toLowerCase()===ot)||(dn.push({coin:Bt,wallet:ot}),Ft=!0)}),Ft&&(pt(dn),tt.some(Bt=>Bt.wallet_address===(e==null?void 0:e.toLowerCase()))&&Ze&&on(dn))},on=async Ze=>{if(!nn)try{cn(!0);const Ft=window.localStorage.getItem("hyperToken"),dn="https://dextrabothypev2.nftinit.io/api/hyper/following/position_info/";if(!Ft||!Ze){cn(!1);return}Ft||L(!0);const Yt=window.localStorage.getItem("hyperAddress"),ot=await(await fetch(dn,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:X?X.toLowerCase():Yt,token:Ft,positions:Ze})})).json();ot.success?Ne(ot==null?void 0:ot.data):(console.log(ot.error_message),tn.error(ot.error_message))}catch(Ft){console.error("Error tag request",Ft),tn.error(Ft.message)}finally{cn(!1)}};(t==null?void 0:t.length)>1||tt.some(Ze=>Ze.wallet_address===(e==null?void 0:e.toLowerCase()));const Zt={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};return i.jsxs("div",{className:"w-full",children:[i.jsx(pT,{open:ne,setOpen:J,data:Pe,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(Dl,{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(Dl,{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(Dl,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:Q,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(Dl,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{ref:K,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(pi,{title:"Coin",sortKey:"asset",sortOption:xe,setSortOption:ye,isFilterIcon:!1}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>te(!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(zf,{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:Ze=>G(Ze.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(man,{className:"min-w-[100px] sm:min-w-[120px] px-1",title:"Type",sortKey:"type_leverage",sortOption:xe,setSortOption:ye}),i.jsx(hv,{className:"min-w-[80px] sm:min-w-[80px] px-1",title:"Size",sortKey:"size",sortOption:xe,setSortOption:ye}),i.jsx(hv,{className:"min-w-[130px] sm:min-w-[145px] px-1",title:"Position Value",sortKey:"positionValue",sortOption:xe,setSortOption:ye}),i.jsx(hv,{className:"min-w-[120px] sm:min-w-[120px] px-1",title:"Entry Price",sortKey:"entryPrice",sortOption:xe,setSortOption:ye}),i.jsx(hv,{className:"min-w-[120px]  sm:min-w-[120px] px-1",title:"Mark Price",sortKey:"currentPrice",sortOption:xe,setSortOption:ye}),i.jsx(hv,{className:"min-w-[100px] sm:min-w-[160px] px-1",title:"PnL(ROE%)",sortKey:"unrealizedPnl",sortOption:xe,setSortOption:ye}),i.jsx(hv,{className:"min-w-[120px] sm:min-w-[130px] px-1",title:"Margin",sortKey:"marginUsed",sortOption:xe,setSortOption:ye}),i.jsx(hv,{className:"min-w-[110px] sm:min-w-[130px] px-1",title:"Funding",sortKey:"funding",sortOption:xe,setSortOption:ye})]})}),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(Ba,{})})})})}):(me==null?void 0:me.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:ac,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."]})]})]})]})})})})}):(Ye=je(xe))==null?void 0:Ye.map((Ze,Ft)=>{var _t;const dn=Ze!=null&&Ze.positionValue&&(Ze!=null&&Ze.leverage)?(Ze==null?void 0:Ze.unrealizedPnl)*(Ze==null?void 0:Ze.leverage)*100/(Ze==null?void 0:Ze.positionValue):0,Yt=.004+6e-4*Ze.leverage;Ze.entryPrice*(Ze.leverage/(Ze.sign===1?Ze.leverage+1-Ze.leverage*Yt:Ze.leverage-1+Ze.leverage*Yt));const Bt=Ze!=null&&Ze.leverage?(Ze==null?void 0:Ze.positionValue)/(Ze==null?void 0:Ze.leverage):0,De=(Ze==null?void 0:Ze.positionValue)*1e-4*(Ze==null?void 0:Ze.sign);return i.jsxs(Ae.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/${Ze==null?void 0:Ze.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/${Zt[Ze.asset]||((_t=Ze.asset)==null?void 0:_t.split("/")[0])}.svg`||Wa,alt:Ze==null?void 0:Ze.asset,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:ze=>sa(ze)})}),i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:Ze.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:`${Ze.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:Ze.type==="Long"?i.jsx(Fs,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):i.jsx(Fs,{className:"text-[#FF797C] w-3 h-3"})})}),i.jsxs("div",{className:" text-[11px] font-semibold font-manrope leading-[8px] tracking-wide uppercase",children:[Ze.type," - ",Ze==null?void 0:Ze.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:oo(Math.abs(Ze.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:Ze.positionValue?`$${oo(Ze.positionValue)}`:oo(Ze.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:Ze.entryPrice?`$${Er(Ze.entryPrice)}`:Er(Ze.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:Ze.currentPrice?`$${Er(Ze.currentPrice)}`:Er(Ze.currentPrice)})})}),i.jsx("td",{children:i.jsxs("div",{onClick:()=>{Re(ze=>({...ze,coin:Ze.asset,type:Ze.type,leverage:Ze.leverage,roe:dn,entryPrice:Ze.entryPrice,markPrice:Ze.currentPrice,pnl:Ze.unrealizedPnl,referral:window.localStorage.getItem("hyperToken")?P: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:`${Ze.unrealizedPnl>=0?"text-[#67ffbd]":"text-[#ff787b]"} text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]`,children:[Ze.unrealizedPnl?`$${oo(Math.abs(Ze.unrealizedPnl))}`:oo(Math.abs(Ze.unrealizedPnl)),` (${oo(Math.abs(dn.toFixed(2)))}%)`]}),i.jsx("div",{className:"flex justify-center items-center rounded",children:i.jsx("img",{src:bm,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:Bt?`$${oo(Bt)}`:oo(Bt)})})}),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(De))&&Number(De)<=0?"text-[#67ffbd]":"text-[#ff787b]"} text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]`,children:isNaN(Number(De))?"$0.00":`$${Math.abs(Number(De)).toFixed(4)}`})})})]}),i.jsx("tr",{children:i.jsx("td",{colSpan:"100",style:{height:"2px"}})})]},Ft)})})]})})]})]})},hv=({className:e,title:t,sortKey:n,sortOption:r,setSortOption:s})=>i.jsx("th",{scope:"col",className:e,children:i.jsx(pi,{title:t,sortKey:n,sortOption:r,setSortOption:s,isFilterIcon:!0})}),man=({className:e,title:t,sortKey:n,sortOption:r,setSortOption:s})=>i.jsx("th",{scope:"col",className:e,children:i.jsx(pi,{title:t,sortKey:n,sortOption:r,setSortOption:s,isFilterIcon:!1})}),xan=({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(pan,{initialAddress:e,wallets:t,positions:c,setPositions:u,isWalletIndex:n,posLoading:r,setPosLoading:s,setGenerateWalletData:a}):""]})},gan=({data:e,isWalletIndex:t,fetchAllIndex:n,setGenerateWalletData:r})=>{const{isConnected:s,address:a}=ts(),{setSignModalOpen:o,hyperToken:l,isReferralCodeName:c}=m.useContext(Qr),[u,d]=m.useState(""),[f,x]=m.useState(!0);m.useState({});const[g,v]=m.useState(!1),[w,C]=m.useState(""),[N,P]=m.useState(!1),I=m.useRef(null),R=m.useRef(null),[O,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",[K,re]=m.useState(J),[he,Q]=m.useState([]),[ie,oe]=m.useState(!1);m.useEffect(()=>{if(e.length===0||ie)return;const ye=e.reduce((je,Pe)=>parseFloat(Pe.perpEquity||0)>parseFloat(je.perpEquity||0)?Pe:je);ye.wallet_address&&d(ye.wallet_address)},[e,ie]);const G=(ye,je,Pe)=>{const Re=ye==null?void 0:ye.filter(Xe=>Xe&&Xe.walletAddress&&Xe.asset).filter(Xe=>{var Ke,ut;return Pe?(ut=(Ke=Xe==null?void 0:Xe.asset)==null?void 0:Ke.toString())==null?void 0:ut.toUpperCase().includes(Pe.toUpperCase()):!0});return Re==null?void 0:Re.sort((Xe,Ke)=>{const ut=Xe.wallet_name?Xe.wallet_name.toUpperCase():"",et=Ke.wallet_name?Ke.wallet_name.toUpperCase():"",tt=Xe.tag?Xe.tag.toUpperCase():"",Le=Ke.tag?Ke.tag.toUpperCase():"",$e=Xe.asset?Xe.asset.toUpperCase():"",ht=Ke.asset?Ke.asset.toUpperCase():"",pt=Xe.type==="Long"?1:0,Kt=Ke.type==="Long"?1:0,wt=Xe.type==="Short"?1:0,nn=Ke.type==="Short"?1:0;return je==="wallet_name"?ut<et?-1:ut>et?1:0:je==="-wallet_name"?ut>et?-1:ut<et?1:0:je==="-unrealizedPnl"?Ke.unrealizedPnl-Xe.unrealizedPnl:je==="unrealizedPnl"?Xe.unrealizedPnl-Ke.unrealizedPnl:je==="-roe"?Ke.roe-Xe.roe:je==="roe"?Xe.roe-Ke.roe:je==="-size"?Ke.size-Xe.size:je==="size"?Xe.size-Ke.size:je==="-entryPrice"?Ke.entryPrice-Xe.entryPrice:je==="entryPrice"?Xe.entryPrice-Ke.entryPrice:je==="-currentPrice"?Ke.currentPrice-Xe.currentPrice:je==="currentPrice"?Xe.currentPrice-Ke.currentPrice:je==="-leverage"?Ke.leverage-Xe.leverage:je==="leverage"?Xe.leverage-Ke.leverage:je==="-positionValue"?Ke.positionValue-Xe.positionValue:je==="positionValue"?Xe.positionValue-Ke.positionValue:je==="-marginUsed"?Ke.marginUsed-Xe.marginUsed:je==="marginUsed"?Xe.marginUsed-Ke.marginUsed:je==="funding"?Ke.funding-Xe.funding:je==="-funding"?Xe.funding-Ke.funding:je==="-liquidationPrice"?Ke.liquidationPrice-Xe.liquidationPrice:je==="liquidationPrice"?Xe.liquidationPrice-Ke.liquidationPrice:je==="-tag"?tt<Le?-1:tt>Le?1:0:je==="tag"?tt>Le?-1:tt<Le?1:0:je==="-coin"?$e<ht?-1:$e>ht?1:0:je==="coin"?$e>ht?-1:$e<ht?1:0:je==="-type_leverage"?pt!==Kt?Kt-pt:Ke.leverage-Xe.leverage:je==="type_leverage"?wt!==nn?nn-wt:Ke.leverage-Xe.leverage:0})},V=async ye=>{if(ye===""&&he.filter(je=>je!==void 0).length===0||ye===""&&G(he,K,w).length===0||G(he,K,w).length===0){tn.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(ye===""&&(e==null?void 0:e.length)>0){const je=G(he,K,w),Pe=[...new Set(je.map(Re=>Re.wallet_id))];if(Pe.length===0){tn.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(Pe.map(Xe=>te(Xe,!1))),tn.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 te(ye)},te=async(ye,je=!0)=>{if(he.filter(Pe=>Pe!==void 0).length===0){tn.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(!ye){console.error("Close order called with invalid parameters"),tn.error("Close order called with invalid parameters");return}try{v(!0);const Pe=window.localStorage.getItem("hyperToken"),Re="https://dextrabothypev2.nftinit.io/api/hyper/order/close_order_all_new/";if(!Pe){o(!0),v(!1);return}const Xe=window.localStorage.getItem("hyperAddress"),Ke=await fetch(Re,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:a?a.toLowerCase():Xe,token:Pe,wallet_id:ye.toString()})});if(!Ke.ok)throw new Error(`Server responded with status ${Ke.status}`);const ut=await Ke.json();ut.status=="ok"?(v(!1),je&&tn.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"}})):ut.success?(v(!1),je&&tn.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."),tn.error("Close order operation failed."),v(!1))}catch(Pe){throw console.error("Something went wrong!"),tn.error("Something went wrong!"),v(!1),Pe}},[ae,fe]=m.useState(!1);m.useEffect(()=>{const ye=()=>{(localStorage.getItem("walletManagementInfo")!==void 0||localStorage.getItem("walletManagementInfo")!==null)&&Date.now()-Number(localStorage.getItem("walletManagementInfo"))>=864e5&&fe(!0)};ye();const je=setInterval(()=>{ye()},1e3*60*30);return()=>{clearInterval(je)}},[]);const Ne=async ye=>{try{const je=window.localStorage.getItem("hyperToken"),Pe="https://dextrabothypev2.nftinit.io/api/hyper/following/position_info/";if(!je){o(!0);return}const Re=ye==null?void 0:ye.filter(et=>et&&et.walletAddress&&et.asset).map(et=>({wallet:et.walletAddress,coin:et.asset})),Xe=window.localStorage.getItem("hyperAddress"),ut=await(await fetch(Pe,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:a?a.toLowerCase():Xe,token:je,positions:Re})})).json();ut.success?Q(et=>et.map(tt=>{const Le=ut==null?void 0:ut.data.find($e=>($e==null?void 0:$e.wallet)===(tt==null?void 0:tt.walletAddress)&&($e==null?void 0:$e.coin)===(tt==null?void 0:tt.asset));return{...tt,tag:Le==null?void 0:Le.tag,tagWallet:Le==null?void 0:Le.cp_wallet}})):(console.log(ut.error_message),tn.error(ut.error_message))}catch(je){console.error("Error tag request",je),tn.error(je.message)}},me=m.useRef(he==null?void 0:he.filter(ye=>(ye==null?void 0:ye.walletAddress)&&(ye==null?void 0:ye.asset)).length),we=m.useRef(),xe=m.useRef(!0);return m.useEffect(()=>{const ye=he==null?void 0:he.filter(Pe=>Pe!==void 0&&(Pe==null?void 0:Pe.walletAddress)&&(Pe==null?void 0:Pe.asset)),je=ye==null?void 0:ye.length;if(je>0&&je>me.current){const Pe=u===""?he:he.filter(Re=>(Re==null?void 0:Re.wallet_id)==u);xe.current?(Ne(Pe),xe.current=!1):(we.current&&clearTimeout(we.current),we.current=setTimeout(()=>{Ne(Pe)},5e3))}me.current=je},[he]),m.useEffect(()=>{if((he==null?void 0:he.filter(ye=>ye!==void 0&&(ye==null?void 0:ye.walletAddress)&&(ye==null?void 0:ye.asset)).length)>0){const ye=u==""?he:he==null?void 0:he.filter(je=>(je==null?void 0:je.wallet_id)==u);(ye==null?void 0:ye.length)>0&&Ne(ye)}},[u]),m.useEffect(()=>{function ye(je){I.current&&!I.current.contains(je.target)&&setIsDropdownOpen(!1),R.current&&!R.current.contains(je.target)&&P(!1)}return document.addEventListener("mousedown",ye),()=>document.removeEventListener("mousedown",ye)},[]),i.jsx(i.Fragment,{children:i.jsxs(i.Fragment,{children:[i.jsx(ZUe,{open:O,setOpen:U,data:X,setShare:z,setTradeInfo:ne}),i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[12px] text-white bg-[#161616] w-full h-full min-h-[500px] max-h-max font-manrope relative sm:pt-3",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:ye=>{ye.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:eae,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.jsx("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("div",{className:"relative w-full min-w-[150px]",children:[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 appearance-none border border-[#404040]",onChange:ye=>{d(ye.target.value),oe(!0),n(ye.target.value),x(!0),r(je=>je==null?void 0:je.map(Pe=>({...Pe,unrealizedPnl:0,marginUsed:0})))},value:u,children:e==null?void 0:e.map(ye=>i.jsx("option",{value:ye==null?void 0:ye.wallet_address,children:`${ye==null?void 0:ye.wallet_name} - (${(ye==null?void 0:ye.wallet_address).slice(0,5)+"..."+(ye==null?void 0:ye.wallet_address).slice(-4)})`},ye==null?void 0:ye.wallet_id))}),i.jsx(rd,{className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-[#9b9b9b]"})]})]})}),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(xan,{initialAddress:u,wallets:u===""?e:void 0,isWalletIndex:t,posLoading:f,setPosLoading:x,setGenerateWalletData:r})})]})]})]})})},ban=({data:e,loading:t,error:n,currentPage:r,handlePageChange:s,allWallets:a,handleListRequest:o})=>{var tt;m.useState(!1);const{setSignModalOpen:l}=m.useContext(Qr),{isConnected:c,address:u}=ts(),d=5,[f,x]=m.useState(null),[g,v]=m.useState(null),[w,C]=m.useState(!1),[N,P]=m.useState(null),[I,R]=m.useState(!1),[O,U]=m.useState("");m.useState({});const[L,z]=m.useState({}),[X,ne]=m.useState(!1),[J,K]=m.useState({wallet:"",walletId:"",walletName:"",unrealizedPnL:"",perpEquity:""}),[re,he]=m.useState(!1),[Q,ie]=m.useState(!1),oe="-perpEquity",[G,V]=m.useState(oe),te=Le=>e.sort(($e,ht)=>{if($e.version===3&&ht.version!==3)return-1;if(ht.version===3&&$e.version!==3)return 1;const pt=$e.wallet_name?$e.wallet_name.toUpperCase():"",Kt=ht.wallet_name?ht.wallet_name.toUpperCase():"",wt=$e.wallet_address?$e.wallet_address.toLowerCase():"",nn=ht.wallet_address?ht.wallet_address.toLowerCase():"";return Le==="wallet_name"?pt<Kt?-1:pt>Kt?1:0:Le==="-wallet_name"?pt>Kt?-1:pt<Kt?1:0:Le==="-wallet_address"?wt<nn?-1:wt>nn?1:0:Le==="wallet_address"?wt>nn?-1:wt<nn?1:0:Le==="-wallet_created_data"?new Date(ht.wallet_created_data)-new Date($e.wallet_created_data):Le==="wallet_created_data"?new Date($e.wallet_created_data)-new Date(ht.wallet_created_data):Le==="-perpEquity"?ht.perpEquity-$e.perpEquity:Le==="perpEquity"?$e.perpEquity-ht.perpEquity:Le==="-unrealizedPnl"?ht.unrealizedPnl-$e.unrealizedPnl:Le==="unrealizedPnl"?$e.unrealizedPnl-ht.unrealizedPnl:Le==="-marginUsed"?ht.marginUsed-$e.marginUsed:Le==="marginUsed"?$e.marginUsed-ht.marginUsed:Le==="-withdrawableUsdc"?ht.withdrawableUsdc-$e.withdrawableUsdc:Le==="withdrawableUsdc"?$e.withdrawableUsdc-ht.withdrawableUsdc:0}),ae=async(Le,$e,ht)=>{if(!Le||!$e||!ht){console.error("Delete order called with invalid parameters"),tn.error("Delete order called with invalid parameters");return}const pt=`${Le}_${$e}`;try{z(Xt=>({...Xt,[pt]:!0}));const Kt=window.localStorage.getItem("hyperToken"),wt="https://dextrabothypev2.nftinit.io/api/wallet/delete-lighter";if(!Kt){l(!0),z(Xt=>({...Xt,[pt]:!1}));return}const nn=window.localStorage.getItem("hyperAddress"),cn=await fetch(wt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:u?u.toLowerCase():nn,token:Kt,wallet_id:Le})});if(!cn.ok)throw new Ul(`Server responded with status ${cn.status}`);const zn=await cn.json();zn.success?(o(),K({wallet:"",walletId:"",walletName:"",unrealizedPnL:"",perpEquity:""}),he(!1),ie(!1),ne(!1),z(Xt=>({...Xt,[pt]:!1})),tn.success(i.jsxs(i.Fragment,{children:[i.jsx("span",{children:ht.slice(0,5)+"..."+ht.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(zn.error_message),tn.error(zn.error_message),z(Xt=>({...Xt,[pt]:!1})))}catch(Kt){console.error("Error deleting wallet:",Kt),tn.error(Kt.message),z(wt=>({...wt,[pt]:!1}))}},fe=m.useRef(null),Ne=()=>{fe.current&&(fe.current.scrollLeft-=100)},me=()=>{fe.current&&(fe.current.scrollLeft+=100)},we=()=>{fe.current&&(fe.current.scrollTop+=200)},xe=()=>{fe.current&&(fe.current.scrollTop-=200)},ye=Le=>Le>=640&&Le<1024?4:Le>=1024&&Le<1240?7:Le>=1240&&Le<1540||Le>=1540?8:3,[je,Pe]=m.useState(null),[Re,Xe]=m.useState(!1),[Ke,ut]=m.useState(!1);m.useEffect(()=>{const Le=()=>{ut(window.innerWidth<640)};return window.addEventListener("resize",Le),Le(),()=>window.removeEventListener("resize",Le)},[]);const et=Le=>{Ke&&(Pe(Le),Xe(!0))};return i.jsxs(i.Fragment,{children:[i.jsx(Lce,{open:w,setOpen:C,data:e,walletData:f,withdrawableUsdc:N,setWithdrawableUsdc:P,modalWalletId:g,setModalWalletId:v}),i.jsx(Dce,{open:I,setOpen:R,walletAddress:O}),i.jsx(Bce,{open:X,setOpen:ne,handleDeleteWallet:ae,deleteWalleInfo:J,confirmClosePositions:re,setConfirmClosePositions:he,confirmWithdrawEquity:Q,setConfirmWithdrawEquity:ie}),i.jsx(dp,{isOpen:Re,onClose:()=>Xe(!1),children:i.jsx($ce,{rowData:je})}),i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[17px] text-white bg-[#161616] w-full h-full sm:min-h-[280px] max-h-max font-manrope relative",children:[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:Ne,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(Qa,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:me,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(Qa,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:xe,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(Qa,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:we,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(Qa,{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:fe,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(pi,{title:"Name",sortKey:"wallet_name",sortOption:G,setSortOption:V,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(pi,{title:"Follower Wallet",sortKey:"wallet_address",sortOption:G,setSortOption:V,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[110px] sm:min-w-[110px] px-1 hidden sm:table-cell",children:i.jsx(pi,{title:"Creation Date",sortKey:"wallet_created_data",sortOption:G,setSortOption:V,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:ye(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(Ba,{})})})}):n&&!e?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:ye(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(Ul,{})})})}):(e==null?void 0:e.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:ye(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:ac,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."]})]})]})]})})})})}):(tt=te(G))==null?void 0:tt.map((Le,$e)=>{!isNaN(Le==null?void 0:Le.perpEquity)&&!isNaN(Le==null?void 0:Le.marginUsed)&&(Le==null?void 0:Le.perpEquity)-(Le==null?void 0:Le.marginUsed);const ht=Ke?{onClick:()=>et(Le),className:"cursor-pointer"}:{};return i.jsxs("tr",{...ht,className:`${$e%2===0,"bg-[#161616]"} relative group hover:bg-[#222222] h-[44px] border-b border-[#232323] text-white`,children:[i.jsx("td",{scope:"row",className:`${$e%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:(Le==null?void 0:Le.version)==3?i.jsx(xi,{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:(Le==null?void 0:Le.wallet_name.length)>=12?(Le==null?void 0:Le.wallet_name).slice(0,12)+"... (API-AGENT) Wallet":(Le==null?void 0:Le.wallet_name)+"(API-AGENT) Wallet"}),(Le==null?void 0:Le.wallet_name.length)>=12&&i.jsx("span",{className:"ml-3",children:i.jsx(Oa,{content:`${Le==null?void 0:Le.wallet_name}`,positionTop:!0,alignRight:!1})}),i.jsx(Ai,{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:(Le==null?void 0:Le.wallet_name.length)>=12?(Le==null?void 0:Le.wallet_name).slice(0,12)+"...":Le==null?void 0:Le.wallet_name}),(Le==null?void 0:Le.wallet_name.length)>=12&&i.jsx("span",{className:"ml-3",children:i.jsx(Oa,{content:`${Le==null?void 0:Le.wallet_name}`,positionTop:!0,alignRight:!1})})]})})}),i.jsx("td",{scope:"row",className:`${$e%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/${Le==null?void 0:Le.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:Ki,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(oa,{info1:`${(Le==null?void 0:Le.wallet_address).slice(0,5)+"..."+(Le==null?void 0:Le.wallet_address).slice(-4)}`,info1_Color:"text-white",rowTwo:!1}),i.jsx("img",{onClick:pt=>{pt.stopPropagation(),navigator.clipboard.writeText(Le==null?void 0:Le.wallet_address),tn.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:Co,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:(Le==null?void 0:Le.wallet_created_data)&&p3(Le==null?void 0:Le.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(xi,{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(xy,{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(xi,{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(xy,{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"})]})}),L[`${Le==null?void 0:Le.wallet_id}_${Le==null?void 0:Le.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..."})]}):(Le==null?void 0:Le.version)===3?i.jsx(xi,{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:()=>{K({wallet:Le==null?void 0:Le.wallet_address,walletId:Le==null?void 0:Le.wallet_id,walletName:Le==null?void 0:Le.wallet_name.toLowerCase(),unrealizedPnL:Le==null?void 0:Le.unrealizedPnl,perpEquity:Le==null?void 0:Le.perpEquity}),ne(!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"})})]})})]},$e)})})]})})]}),i.jsxs("div",{className:"flex justify-start items-center gap-2 absolute -top-[16px] sm:-top-[18px] right-1 sm:translate-x-0 sm:right-4 z-50",children:[i.jsx("button",{onClick:()=>s(r-1),disabled:r===1,className:`${r===1?"cursor-not-allowed":"cursor-pointer"} h-6 lg:h-7 px-2 sm:px-3 py-1 lg:py-1.5 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-[11px] lg: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 ",r," / ",Math.ceil(a.length/d)]}),i.jsx("button",{onClick:()=>s(r+1),disabled:r*d>=a.length,className:`${r*d>=a.length?"cursor-not-allowed":"cursor-pointer"} h-6 lg:h-7 px-2 sm:px-3 py-1 lg:py-1.5 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-[11px] lg:text-[13px] font-medium font-inter leading-[8px]",children:"Next"})})]})]})]})},yan=({lighterWalletList:e})=>{const{isConnected:t,address:n}=ts(),{setSignModalOpen:r,hyperToken:s}=m.useContext(Qr),[a,o]=m.useState([]),[l,c]=m.useState(!1),[u,d]=m.useState(null),[f,x]=m.useState(!0),[g,v]=m.useState(null),[w,C]=m.useState([]),[N,P]=m.useState(()=>parseInt(localStorage.getItem("walletManagementLighterPage"))||1),I=5,[R,O]=m.useState(!1),[U,L]=m.useState(!1);m.useEffect(()=>{window.localStorage.getItem("hyperToken")?z():(r(!0),o([]),window.localStorage.setItem("walletManagementLighterPage",1))},[t,s]);const z=async()=>{var K;try{c(!0);const re=window.localStorage.getItem("hyperToken");if(!re){r(!0);return}const he="https://dextrabothypev2.nftinit.io/api/wallet/list-lighter",Q=window.localStorage.getItem("hyperAddress"),oe=await(await fetch(he,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:n?n.toLowerCase():Q,token:re})})).json();if(oe.success){e(),C(oe.data||[]),O(!0);const G=parseInt(localStorage.getItem("walletManagementLighterPage"))||1,V=Math.max(Math.ceil(((oe==null?void 0:oe.data)||[]).length/I),1),te=Math.min(G,V);P(te),localStorage.setItem("walletManagementLighterPage",te),ne(te,oe.data||[]);const ae=(te-1)*I,fe=(K=oe.data)==null?void 0:K[ae];fe&&X(fe==null?void 0:fe.wallet_address)}else console.log(oe.error_message),c(!1),d(oe.error_message)}catch(re){console.error("Error fetching lighter wallet list:",re),c(!1),d(re.message)}},X=async K=>{try{const he=`https://mainnet.zklighter.elliot.ai/api/v1/accountsByL1Address?l1_address=${Ec(K)}`,ie=await(await fetch(he,{method:"GET",headers:{accept:"application/json"}})).json();if(ie.sub_accounts&&ie.sub_accounts.length>0){const oe=ie.sub_accounts[0],G=(oe==null?void 0:oe.collateral)??oe.collateral??"",V=(oe==null?void 0:oe.margin_used)??"",te=(oe==null?void 0:oe.available_balance)??"",ae=(oe==null?void 0:oe.unrealized_pnl)??"",fe=(oe==null?void 0:oe.positions)??[];o(Ne=>Ne==null?void 0:Ne.map(me=>me.wallet_address.toLowerCase()===K.toLowerCase()?{...me,perpEquity:G,unrealizedPnl:ae,withdrawableUsdc:te,marginUsed:V,positions:fe}:me)),v(oe),L(!0),c(!1),x(!1)}}catch(re){console.error("Error fetching lighter index:",re)}};m.useEffect(()=>{const K=()=>{const re=parseInt(localStorage.getItem("walletManagementLighterPage"))||1;re!==N&&R&&U&&(P(re),ne(re,w))};return window.addEventListener("storage",K),()=>{window.removeEventListener("storage",K)}},[N,w,R,U]);const ne=(K,re)=>{if(!re||re.length===0){c(!1);return}c(!0);const he=(K-1)*I,Q=he+I,ie=re.slice(he,Q);o(ie)},J=K=>{K<1||K>Math.ceil(w.length/I)||(c(!0),P(K),localStorage.setItem("walletManagementLighterPage",K),ne(K,w))};return i.jsxs(i.Fragment,{children:[i.jsx(ban,{data:a,loading:l,error:u,handlePageChange:J,handleListRequest:z,currentPage:N,allWallets:w}),i.jsx(gan,{data:a,setGenerateWalletData:o,isWalletIndex:g,fetchAllIndex:X})]})},van=({data:e,loading:t,error:n,currentPage:r,handlePageChange:s,allWallets:a,handleListRequest:o})=>{var tt;m.useState(!1);const{setSignModalOpen:l}=m.useContext(Qr),{isConnected:c,address:u}=ts(),d=5,[f,x]=m.useState(null),[g,v]=m.useState(null),[w,C]=m.useState(!1),[N,P]=m.useState(null),[I,R]=m.useState(!1),[O,U]=m.useState("");m.useState({});const[L,z]=m.useState({}),[X,ne]=m.useState(!1),[J,K]=m.useState({wallet:"",walletId:"",walletName:"",unrealizedPnL:"",perpEquity:""}),[re,he]=m.useState(!1),[Q,ie]=m.useState(!1),oe="-perpEquity",[G,V]=m.useState(oe),te=Le=>e.sort(($e,ht)=>{if($e.version===3&&ht.version!==3)return-1;if(ht.version===3&&$e.version!==3)return 1;const pt=$e.wallet_name?$e.wallet_name.toUpperCase():"",Kt=ht.wallet_name?ht.wallet_name.toUpperCase():"",wt=$e.wallet_address?$e.wallet_address.toLowerCase():"",nn=ht.wallet_address?ht.wallet_address.toLowerCase():"";return Le==="wallet_name"?pt<Kt?-1:pt>Kt?1:0:Le==="-wallet_name"?pt>Kt?-1:pt<Kt?1:0:Le==="-wallet_address"?wt<nn?-1:wt>nn?1:0:Le==="wallet_address"?wt>nn?-1:wt<nn?1:0:Le==="-wallet_created_data"?new Date(ht.wallet_created_data)-new Date($e.wallet_created_data):Le==="wallet_created_data"?new Date($e.wallet_created_data)-new Date(ht.wallet_created_data):Le==="-perpEquity"?ht.perpEquity-$e.perpEquity:Le==="perpEquity"?$e.perpEquity-ht.perpEquity:Le==="-unrealizedPnl"?ht.unrealizedPnl-$e.unrealizedPnl:Le==="unrealizedPnl"?$e.unrealizedPnl-ht.unrealizedPnl:Le==="-marginUsed"?ht.marginUsed-$e.marginUsed:Le==="marginUsed"?$e.marginUsed-ht.marginUsed:Le==="-withdrawableUsdc"?ht.withdrawableUsdc-$e.withdrawableUsdc:Le==="withdrawableUsdc"?$e.withdrawableUsdc-ht.withdrawableUsdc:0}),ae=async(Le,$e,ht)=>{if(!Le||!$e||!ht){console.error("Delete order called with invalid parameters"),tn.error("Delete order called with invalid parameters");return}const pt=`${Le}_${$e}`;try{z(Xt=>({...Xt,[pt]:!0}));const Kt=window.localStorage.getItem("hyperToken"),wt="https://dextrabothypev2.nftinit.io/api/wallet/delete-extended";if(!Kt){l(!0),z(Xt=>({...Xt,[pt]:!1}));return}const nn=window.localStorage.getItem("hyperAddress"),cn=await fetch(wt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:u?u.toLowerCase():nn,token:Kt,wallet_id:Le})});if(!cn.ok)throw new Ul(`Server responded with status ${cn.status}`);const zn=await cn.json();zn.success?(o(),K({wallet:"",walletId:"",walletName:"",unrealizedPnL:"",perpEquity:""}),he(!1),ie(!1),ne(!1),z(Xt=>({...Xt,[pt]:!1})),tn.success(i.jsxs(i.Fragment,{children:[i.jsx("span",{children:ht.slice(0,5)+"..."+ht.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(zn.error_message),tn.error(zn.error_message),z(Xt=>({...Xt,[pt]:!1})))}catch(Kt){console.error("Error deleting wallet:",Kt),tn.error(Kt.message),z(wt=>({...wt,[pt]:!1}))}},fe=m.useRef(null),Ne=()=>{fe.current&&(fe.current.scrollLeft-=100)},me=()=>{fe.current&&(fe.current.scrollLeft+=100)},we=()=>{fe.current&&(fe.current.scrollTop+=200)},xe=()=>{fe.current&&(fe.current.scrollTop-=200)},ye=Le=>Le>=640&&Le<1024?4:Le>=1024&&Le<1240?7:Le>=1240&&Le<1540||Le>=1540?8:3,[je,Pe]=m.useState(null),[Re,Xe]=m.useState(!1),[Ke,ut]=m.useState(!1);m.useEffect(()=>{const Le=()=>{ut(window.innerWidth<640)};return window.addEventListener("resize",Le),Le(),()=>window.removeEventListener("resize",Le)},[]);const et=Le=>{Ke&&(Pe(Le),Xe(!0))};return i.jsxs(i.Fragment,{children:[i.jsx(Lce,{open:w,setOpen:C,data:e,walletData:f,withdrawableUsdc:N,setWithdrawableUsdc:P,modalWalletId:g,setModalWalletId:v}),i.jsx(Dce,{open:I,setOpen:R,walletAddress:O}),i.jsx(Bce,{open:X,setOpen:ne,handleDeleteWallet:ae,deleteWalleInfo:J,confirmClosePositions:re,setConfirmClosePositions:he,confirmWithdrawEquity:Q,setConfirmWithdrawEquity:ie}),i.jsx(dp,{isOpen:Re,onClose:()=>Xe(!1),children:i.jsx($ce,{rowData:je})}),i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[17px] text-white bg-[#161616] w-full h-full sm:min-h-[280px] max-h-max font-manrope relative",children:[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:Ne,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(Qa,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:me,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(Qa,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:xe,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(Qa,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:we,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(Qa,{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:fe,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(pi,{title:"Name",sortKey:"wallet_name",sortOption:G,setSortOption:V,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(pi,{title:"Follower Wallet",sortKey:"wallet_address",sortOption:G,setSortOption:V,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[110px] sm:min-w-[110px] px-1 hidden sm:table-cell",children:i.jsx(pi,{title:"Creation Date",sortKey:"wallet_created_data",sortOption:G,setSortOption:V,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:ye(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(Ba,{})})})}):n&&!e?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:ye(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(Ul,{})})})}):(e==null?void 0:e.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:ye(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:ac,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."]})]})]})]})})})})}):(tt=te(G))==null?void 0:tt.map((Le,$e)=>{!isNaN(Le==null?void 0:Le.perpEquity)&&!isNaN(Le==null?void 0:Le.marginUsed)&&(Le==null?void 0:Le.perpEquity)-(Le==null?void 0:Le.marginUsed);const ht=Ke?{onClick:()=>et(Le),className:"cursor-pointer"}:{};return i.jsxs("tr",{...ht,className:`${$e%2===0,"bg-[#161616]"} relative group hover:bg-[#222222] h-[44px] border-b border-[#232323] text-white`,children:[i.jsx("td",{scope:"row",className:`${$e%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:(Le==null?void 0:Le.version)==3?i.jsx(xi,{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:(Le==null?void 0:Le.wallet_name.length)>=12?(Le==null?void 0:Le.wallet_name).slice(0,12)+"... (API-AGENT) Wallet":(Le==null?void 0:Le.wallet_name)+"(API-AGENT) Wallet"}),(Le==null?void 0:Le.wallet_name.length)>=12&&i.jsx("span",{className:"ml-3",children:i.jsx(Oa,{content:`${Le==null?void 0:Le.wallet_name}`,positionTop:!0,alignRight:!1})}),i.jsx(Ai,{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:(Le==null?void 0:Le.wallet_name.length)>=12?(Le==null?void 0:Le.wallet_name).slice(0,12)+"...":Le==null?void 0:Le.wallet_name}),(Le==null?void 0:Le.wallet_name.length)>=12&&i.jsx("span",{className:"ml-3",children:i.jsx(Oa,{content:`${Le==null?void 0:Le.wallet_name}`,positionTop:!0,alignRight:!1})})]})})}),i.jsx("td",{scope:"row",className:`${$e%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/${Le==null?void 0:Le.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:Ki,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(oa,{info1:`${(Le==null?void 0:Le.wallet_address).slice(0,5)+"..."+(Le==null?void 0:Le.wallet_address).slice(-4)}`,info1_Color:"text-white",rowTwo:!1}),i.jsx("img",{onClick:pt=>{pt.stopPropagation(),navigator.clipboard.writeText(Le==null?void 0:Le.wallet_address),tn.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:Co,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:(Le==null?void 0:Le.wallet_created_data)&&p3(Le==null?void 0:Le.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(xi,{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(xy,{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(xi,{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(xy,{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"})]})}),L[`${Le==null?void 0:Le.wallet_id}_${Le==null?void 0:Le.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..."})]}):(Le==null?void 0:Le.version)===3?i.jsx(xi,{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:()=>{K({wallet:Le==null?void 0:Le.wallet_address,walletId:Le==null?void 0:Le.wallet_id,walletName:Le==null?void 0:Le.wallet_name.toLowerCase(),unrealizedPnL:Le==null?void 0:Le.unrealizedPnl,perpEquity:Le==null?void 0:Le.perpEquity}),ne(!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"})})]})})]},$e)})})]})})]}),i.jsxs("div",{className:"flex justify-start items-center gap-2 absolute -top-[16px] sm:-top-[18px] right-1 sm:translate-x-0 sm:right-4 z-50",children:[i.jsx("button",{onClick:()=>s(r-1),disabled:r===1,className:`${r===1?"cursor-not-allowed":"cursor-pointer"} h-6 lg:h-7 px-2 sm:px-3 py-1 lg:py-1.5 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-[11px] lg: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 ",r," / ",Math.ceil(a.length/d)]}),i.jsx("button",{onClick:()=>s(r+1),disabled:r*d>=a.length,className:`${r*d>=a.length?"cursor-not-allowed":"cursor-pointer"} h-6 lg:h-7 px-2 sm:px-3 py-1 lg:py-1.5 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-[11px] lg:text-[13px] font-medium font-inter leading-[8px]",children:"Next"})})]})]})]})},_Ce=({fetchAllWalletList:e})=>{const{isConnected:t,address:n}=ts(),{setSignModalOpen:r,hyperToken:s}=m.useContext(Qr),[a,o]=m.useState([]),[l,c]=m.useState(!1),[u,d]=m.useState(null);m.useState(null);const[f,x]=m.useState([]),[g,v]=m.useState(()=>parseInt(localStorage.getItem("walletManagementExtendedPage"))||1),w=5,[C,N]=m.useState(!1),[P,I]=m.useState(!1);m.useEffect(()=>{window.localStorage.getItem("hyperToken")?R():(r(!0),o([]),window.localStorage.setItem("walletManagementExtendedPage",1))},[t,s]);const R=async()=>{var L,z;try{c(!0);const X=window.localStorage.getItem("hyperToken");if(!X){r(!0);return}const ne="https://dextrabothypev2.nftinit.io/api/wallet/list-extended",J=window.localStorage.getItem("hyperAddress"),re=await(await fetch(ne,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:n?n.toLowerCase():J,token:X})})).json();if(re.success&&((L=re==null?void 0:re.data)==null?void 0:L.length)>0){e(),x(re.data||[]),N(!0);const he=parseInt(localStorage.getItem("walletManagementExtendedPage"))||1,Q=Math.max(Math.ceil(((re==null?void 0:re.data)||[]).length/w),1),ie=Math.min(he,Q);v(ie),localStorage.setItem("walletManagementExtendedPage",ie),O(ie,re.data||[]);const oe=(ie-1)*w,G=(z=re.data)==null?void 0:z[oe];c(!1)}else console.log(re.error_message),c(!1),d(re.error_message),o([])}catch(X){console.error("Error fetching lighter wallet list:",X),c(!1),d(X.message)}};m.useEffect(()=>{const L=()=>{const z=parseInt(localStorage.getItem("walletManagementExtendedPage"))||1;z!==g&&C&&P&&(v(z),O(z,f))};return window.addEventListener("storage",L),()=>{window.removeEventListener("storage",L)}},[g,f,C,P]);const O=(L,z)=>{if(!z||z.length===0){c(!1);return}c(!0);const X=(L-1)*w,ne=X+w,J=z.slice(X,ne);o(J)},U=L=>{L<1||L>Math.ceil(f.length/w)||(c(!0),v(L),localStorage.setItem("walletManagementExtendedPage",L),O(L,f))};return i.jsx(i.Fragment,{children:i.jsx(van,{data:a,loading:l,error:u,handlePageChange:U,handleListRequest:R,currentPage:g,allWallets:f})})},wan=({handleListRequest:e,handlePageChange:t,isGenWalletModal:n,setIsGenWalletModal:r})=>{const{setSignModalOpen:s}=m.useContext(Qr);return i.jsxs(i.Fragment,{children:[i.jsx(f5,{open:n,setOpen:r,handleListRequest:e,handlePageChange:t}),i.jsx("div",{className:"flex justify-center items-center w-max h-max",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"})]})})]})},Can=({value:e,onChange:t,allWallets:n,lighterWallet:r,extendedWallet:s,pacificaWallet:a})=>{const[o,l]=m.useState(!1),c=[{key:"HYPER",label:"HyperLiquid",icon:i.jsx("img",{src:S1,className:"w-4 h-4"}),count:(n==null?void 0:n.length)||0},{key:"LIGHTER",label:"Lighter",icon:i.jsx(up,{className:"w-4 h-4 text-white"}),count:(r==null?void 0:r.length)||0},{key:"EXTENDED",label:"Extended",icon:i.jsx("img",{src:"https://app.extended.exchange/assets/logo/extended.svg",className:"w-4 h-4"}),count:(s==null?void 0:s.length)||0}],u=c.find(d=>d.key===e);return i.jsxs("div",{className:"relative w-max sm:w-[250px]",children:[i.jsxs("div",{onClick:()=>l(!o),className:`${e?"border border-[#67ffbd]/20":""} flex justify-between items-center bg-[#67ffbd]/20 text-[#67FFBD] rounded-md py-3 px-2.5 cursor-pointer select-none h-8`,children:[i.jsx("span",{className:`${e?"text-white":"text-[#7c7c7c]"} text-sm font-semibold font-manrope leading-[8px]`,children:u?`${u.label} (⚡${u.count} wallet)`:"Select Dex"}),i.jsx(rd,{className:`w-3.5 h-3.5 transition ${o?"rotate-180":""}`})]}),o&&i.jsx("div",{className:"absolute z-[55] top-full left-0 w-full bg-[#353535] rounded-md mt-[2px] p-1",children:i.jsx("div",{className:"max-h-[260px] overflow-y-auto",children:c.map(d=>i.jsxs("div",{onClick:()=>{t(d.key),l(!1)},className:`flex justify-between items-center p-[7px] h-8 rounded cursor-pointer text-white text-sm font-semibold font-manrope leading-[8px] min-w-max ${e===d.key?"bg-[#67ffbd]/20 text-[#67FFBD]":"hover:bg-[#464646]"}`,children:[i.jsxs("div",{className:"flex items-center gap-2",children:[d.icon,i.jsx("span",{children:d.label})]}),i.jsxs("span",{className:"text-[#9b9b9b] text-xs",children:["⚡",d.count," wallet"]})]},d.key))})})]})},San=({isSelectMenu:e,setIsSelectMenu:t,handlePageChange:n,handleListRequest:r,allWallets:s,lighterWallet:a,extendedWallet:o,pacificaWallet:l})=>{const[c,u]=m.useState(!1);m.useEffect(()=>{const f=window.location.hash;if(!f)return;const x=f.split("#").filter(Boolean);x.includes("add-account")&&(u(!0),x[0]==="hyperliquid"&&(t("HYPER"),localStorage.setItem("isWalletSelectMenu","HYPER")),x[0]==="lighter"&&(t("LIGHTER"),localStorage.setItem("isWalletSelectMenu","LIGHTER")),x[0]==="extended"&&(t("EXTENDED"),localStorage.setItem("isWalletSelectMenu","EXTENDED")),x[0]==="pacifica"&&(t("PACIFICA"),localStorage.setItem("isWalletSelectMenu","PACIFICA")))},[]);const d=f=>{u(!1),f==="HYPER"?(window.history.replaceState(null,"",`${window.location.pathname}#hyperliquid`),t("HYPER"),localStorage.setItem("isWalletSelectMenu","HYPER")):f==="LIGHTER"?(window.history.replaceState(null,"",`${window.location.pathname}#lighter`),t("LIGHTER"),localStorage.setItem("isWalletSelectMenu","LIGHTER")):f==="EXTENDED"?(window.history.replaceState(null,"",`${window.location.pathname}#extended`),t("EXTENDED"),localStorage.setItem("isWalletSelectMenu","EXTENDED")):f==="PACIFICA"&&(window.history.replaceState(null,"",`${window.location.pathname}#pacifica`),t("PACIFICA"),localStorage.setItem("isWalletSelectMenu","PACIFICA"))};return i.jsxs("div",{className:"flex justify-start items-center gap-10  pl-2 sm:pl-0",children:[i.jsxs("div",{className:"hidden lg: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 justify-start items-center gap-2 sm:gap-10",children:[i.jsx(wan,{handleListRequest:r,handlePageChange:n,isGenWalletModal:c,setIsGenWalletModal:u}),i.jsxs("div",{className:"hidden lg: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:s,handleSelectMenuChange:d,isSelectMenu:e}),i.jsx(KY,{title:"LIGHTER",label:"LIGHTER",walletLength:a,handleSelectMenuChange:d,isSelectMenu:e}),i.jsx(KY,{title:"EXTENDED",label:"EXTENDED",walletLength:o,handleSelectMenuChange:d,isSelectMenu:e})]}),i.jsx("div",{className:"flex lg:hidden items-center justify-start",children:i.jsx(Can,{value:e,onChange:d,allWallets:s,lighterWallet:a,extendedWallet:o,pacificaWallet:l})})]})]})},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:S1,alt:"hyper",className:"w-4 h-4 rounded-sm"}):e==="LIGHTER"?i.jsx(up,{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"}):e==="PACIFICA"?i.jsx("img",{src:"https://app.pacifica.fi/imgs/icon.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"}) `]}),Nan="wss://api.hyperliquid.xyz/ws",Aan=()=>{const e=oc(),{isConnected:t,address:n}=ts(),{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(Qr),w=m.useRef(null),C=m.useRef(null),N=m.useRef(null),[P,I]=m.useState([]),[R,O]=m.useState(!1),[U,L]=m.useState(null),[z,X]=m.useState(!0),[ne,J]=m.useState("null");m.useEffect(()=>{const et=e.hash;if(et){const tt=et.split("#").filter(Boolean);tt[0]==="hyperliquid"?(J("HYPER"),localStorage.setItem("isWalletSelectMenu","HYPER")):tt[0]==="lighter"?(J("LIGHTER"),localStorage.setItem("isWalletSelectMenu","LIGHTER")):tt[0]==="extended"?(J("EXTENDED"),localStorage.setItem("isWalletSelectMenu","EXTENDED")):tt[0]==="pacifica"?(J("PACIFICA"),localStorage.setItem("isWalletSelectMenu","PACIFICA")):(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[K,re]=m.useState([]),[he,Q]=m.useState([]),[ie,oe]=m.useState([]),[G,V]=m.useState([]),[te,ae]=m.useState(()=>parseInt(localStorage.getItem("walletManagementPage"))||1),fe=5,[Ne,me]=m.useState(!1);m.useEffect(()=>{window.localStorage.getItem("hyperToken")?(we(),xe(),ye()):(r(!0),I([]),window.localStorage.setItem("walletManagementPage",1))},[t,s]);const we=async()=>{try{O(!0);const et=window.localStorage.getItem("hyperToken");if(!et){r(!0);return}const tt="https://dextrabothypev2.nftinit.io/api/wallet/list",Le=window.localStorage.getItem("hyperAddress"),ht=await(await fetch(tt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:n?n.toLowerCase():Le,token:et,balance:"false"})})).json();if(ht.success){V(ht.data||[]),me(!0);const pt=parseInt(localStorage.getItem("walletManagementPage"))||1,Kt=Math.max(Math.ceil(((ht==null?void 0:ht.data)||[]).length/fe),1),wt=Math.min(pt,Kt);ae(wt),localStorage.setItem("walletManagementPage",wt),Ke(wt,ht.data||[])}else console.log(ht.error_message),O(!1),L(ht.error_message)}catch(et){console.error("Error fetching wallet list:",et),O(!1),L(et.message)}},xe=async()=>{try{O(!0);const et=window.localStorage.getItem("hyperToken");if(!et){r(!0);return}const tt="https://dextrabothypev2.nftinit.io/api/wallet/list-lighter",Le=window.localStorage.getItem("hyperAddress"),ht=await(await fetch(tt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:n?n.toLowerCase():Le,token:et})})).json();ht.success&&re(ht.data||[])}catch(et){console.error("Error fetching wallet list:",et)}},ye=async()=>{try{O(!0);const et=window.localStorage.getItem("hyperToken");if(!et){r(!0);return}const tt="https://dextrabothypev2.nftinit.io/api/wallet/list-extended",Le=window.localStorage.getItem("hyperAddress"),ht=await(await fetch(tt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:n?n.toLowerCase():Le,token:et})})).json();ht.success&&Q(ht.data||[])}catch(et){console.error("Error fetching wallet list:",et)}},je=et=>et!=null&&et.assetPositions?et.assetPositions.filter(tt=>{if(!tt.position||!tt.position.szi)return!1;const Le=parseFloat(tt.position.szi);return!isNaN(Le)&&Le!==0}).map(tt=>{const Le=tt.position,$e=parseFloat(Le.szi),ht=parseFloat(Le.entryPx),pt=parseFloat(Le.positionValue),Kt=parseFloat(Le.unrealizedPnl),wt=parseFloat(Le.returnOnEquity)*100,nn=parseFloat(Le.marginUsed),cn=Le.leverage.value,zn=Le.leverage.type,Xt=parseFloat(Le.cumFunding.sinceOpen),on=$e>0?"Long":"Short";return{asset:Le.coin,type:on,size:$e,entryPrice:ht.toFixed(4),currentPrice:(pt/Math.abs($e)).toFixed(4),leverage:cn,leverageType:zn,positionValue:pt.toFixed(2),marginUsed:nn.toFixed(2),unrealizedPnl:Kt.toFixed(2),roe:wt.toFixed(2),funding:Xt.toFixed(4),liquidationPrice:Le.liquidationPx?parseFloat(Le.liquidationPx).toFixed(2):"N/A"}}):[],Pe=()=>{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)},Re=et=>{w.current=new WebSocket(Nan),w.current.onopen=()=>{console.log("WebSocket Connected"),et.forEach(tt=>{let Le={method:"subscribe",subscription:{type:"webData2",user:tt==null?void 0:tt.wallet_address}};w.current.send(JSON.stringify(Le))}),N.current=setInterval(()=>{var tt;if(((tt=w.current)==null?void 0:tt.readyState)===WebSocket.OPEN){const Le={id:99,method:"ping"};w.current.send(JSON.stringify(Le))}},3e4)},w.current.onclose=tt=>{console.log("WebSocket Disconnected",tt.code,tt.reason),N.current&&(clearInterval(N.current),N.current=null),tt.code!==1e3&&(C.current||(C.current=setTimeout(()=>{C.current=null,Re(et)},5e3)))},w.current.onerror=tt=>{console.error("WebSocket Error:",tt)},w.current.onmessage=tt=>{try{const Le=JSON.parse(tt.data);if(Le.method==="pong")return;if(Le.result==="success"){console.log("Successfully subscribed to channel");return}Le.channel==="webData2"&&Xe(Le)}catch(Le){console.error("Error processing WebSocket message:",Le),console.error("Raw message that caused error:",tt.data),X(!1)}}},Xe=et=>{I(tt=>{let Le=!1;const $e=tt.map(ht=>{var pt,Kt,wt,nn,cn,zn,Xt,on,Zt,Ye,Ze,Ft,dn;if((ht==null?void 0:ht.wallet_address.toLowerCase())===((pt=et==null?void 0:et.data)==null?void 0:pt.user.toLowerCase())){const Yt=(nn=(wt=(Kt=et==null?void 0:et.data)==null?void 0:Kt.clearinghouseState)==null?void 0:wt.assetPositions)==null?void 0:nn.reduce((De,_t)=>{var ze;return De+(parseFloat((ze=_t==null?void 0:_t.position)==null?void 0:ze.unrealizedPnl)||0)},0),Bt=je((cn=et==null?void 0:et.data)==null?void 0:cn.clearinghouseState),ot={...ht,perpEquity:(on=(Xt=(zn=et==null?void 0:et.data)==null?void 0:zn.clearinghouseState)==null?void 0:Xt.marginSummary)==null?void 0:on.accountValue,unrealizedPnl:Yt,withdrawableUsdc:(Ye=(Zt=et==null?void 0:et.data)==null?void 0:Zt.clearinghouseState)==null?void 0:Ye.withdrawable,marginUsed:(dn=(Ft=(Ze=et==null?void 0:et.data)==null?void 0:Ze.clearinghouseState)==null?void 0:Ft.marginSummary)==null?void 0:dn.totalMarginUsed,positions:Bt};if(JSON.stringify(ht)!==JSON.stringify(ot))return Le=!0,ot}return ht});return Le?$e:tt}),setTimeout(()=>{O(!1),X(!1)},3e3)};m.useEffect(()=>{const et=()=>{const tt=parseInt(localStorage.getItem("walletManagementPage"))||1;tt!==te&&Ne&&(Pe(),ae(tt),Ke(tt,G))};return window.addEventListener("storage",et),()=>{window.removeEventListener("storage",et)}},[te,G,Ne]);const Ke=(et,tt)=>{if(!tt||tt.length===0){O(!1);return}O(!0);const Le=(et-1)*fe,$e=Le+fe,ht=tt.slice(Le,$e);I(ht),Pe(),Re(ht)},ut=et=>{et<1||et>Math.ceil(G.length/fe)||(O(!0),ae(et),localStorage.setItem("walletManagementPage",et),Ke(et,G))};return m.useEffect(()=>()=>{Pe()},[e.pathname]),m.useEffect(()=>{(async()=>{var $e,ht;const tt=window.localStorage.getItem("hyperToken"),Le=window.localStorage.getItem("hyperAddress");if(!(!tt||!Le))try{const pt=await _i(Le.toLowerCase(),tt);pt!=null&&pt.success?(a(pt==null?void 0:pt.telegram_chat_id),o(pt==null?void 0:pt.subscriber_role),l(pt==null?void 0:pt.subs_expire_day),c(($e=pt==null?void 0:pt.mushboomer_counts)==null?void 0:$e.eth),u((ht=pt==null?void 0:pt.mushboomer_counts)==null?void 0:ht.sol),d(pt==null?void 0:pt.referral_code),f(pt==null?void 0:pt.refcode),x(pt==null?void 0:pt.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),g(""),v(""))}catch(pt){console.error("Token verification error:",pt),console.error(pt.message||"An unknown error occurred.")}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(No,{children:i.jsxs(Lo,{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.jsxs("div",{className:"flex flex-col items-stretch justify-start h-full gap-[16px] w-full flex-grow xl:flex-grow-0",children:[i.jsx(San,{handlePageChange:ut,handleListRequest:we,isSelectMenu:ne,setIsSelectMenu:J,allWallets:G,lighterWallet:K,extendedWallet:he,pacificaWallet:ie}),ne==="HYPER"?i.jsxs(i.Fragment,{children:[i.jsx(fan,{data:P,loading:R,error:U,socketLoading:z,handlePageChange:ut,handleListRequest:we,currentPage:te,allWallets:G}),i.jsx(han,{data:P,loading:R,error:U,socketLoading:z,handlePageChange:ut,currentPage:te,allWallets:G})]}):ne==="LIGHTER"?i.jsx(i.Fragment,{children:i.jsx(yan,{lighterWalletList:xe})}):ne==="EXTENDED"?i.jsx(i.Fragment,{children:i.jsx(_Ce,{fetchAllWalletList:ye})}):i.jsx(i.Fragment,{children:i.jsx(_Ce,{fetchAllWalletList:ye})})]})})]})};function jan({open:e,setOpen:t,copyTradeDelete:n,isDeleteWallet:r}){return i.jsxs(Ea,{open:e,onClose:t,className:"relative z-50 font-manrope",children:[i.jsx(ja,{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(ga,{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:$a})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Ki,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 JUe=({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(Qr),{address:w}=ts(),[C,N]=m.useState(!1),[P,I]=m.useState(!1),[R,O]=m.useState(""),[U,L]=m.useState(""),[z,X]=m.useState(""),ne=async()=>{var ie,oe;const he=window.localStorage.getItem("hyperToken"),Q=window.localStorage.getItem("hyperAddress");if(!(!he||!Q))try{setLoadingCheckAccount(!0);const G=await _i(Q.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(Q),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 Al(window.ethereum).eth.getAccounts(Q=>Q),K=async(he="farming",Q=24,ie=5e3)=>{Q<=0||(await new Promise(oe=>setTimeout(oe,ie)),await ne(),he==="farming"&&!z?K(he,Q-1,ie):n())},re=async()=>{L("");const he=window.localStorage.getItem("hyperToken"),Q=window.localStorage.getItem("hyperAddress");if(!he||!w){s(!0);return}I(!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 Al(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(te=>{console.log("txHash :>> ",te),N(!1),O(te.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():Q,token:he,payment_tx:te.transactionHash,payment_role:r==="bots_extra_slot"?"bots_extra_slot":"farming_tools"})}),ne(),K(r)}).catch(te=>{console.log(te),te.code===-32003||te.message.includes("insufficient funds")?L("Insufficient funds."):te.message==="MetaMask Tx Signature: User denied transaction signature."&&I(!1)})}else await ie.eth.requestAccounts()};return i.jsxs(i.Fragment,{children:[i.jsx(vd,{open:P,setOpen:I,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:_A,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"})]})})]})]})},Ean=({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(Qr),{isConnected:N,address:P}=ts(),[I,R]=m.useState(!1),[O,U]=m.useState(null),[L,z]=m.useState(""),[X,ne]=m.useState(""),[J,K]=m.useState([]),[re,he]=m.useState(!1),[Q,ie]=m.useState({}),[oe,G]=m.useState({}),[V,te]=m.useState([]),[ae,fe]=m.useState([]),[Ne,me]=m.useState(null),[we,xe]=m.useState(!1),[ye,je]=m.useState(!1),[Pe,Re]=m.useState(!1),[Xe,Ke]=m.useState([]),ut=m.useRef(null),[et,tt]=m.useState([]),Le=m.useRef(!1);m.useEffect(()=>{const De={};n==null||n.forEach(_t=>{const ze=`${_t==null?void 0:_t.wm_address}_${_t==null?void 0:_t.wallet_address}_${_t==null?void 0:_t.wallet_id}`;De[ze]=_t==null?void 0:_t.copy_trait_mode}),ie(De),!Le.current&&(n==null?void 0:n.length)>0&&(ht(),Le.current=!0)},[n]),m.useEffect(()=>{if((n==null?void 0:n.length)>0){const De=[...n];(V==null?void 0:V.length)>0&&V.forEach(_t=>{var ze;((ze=_t.openPositionCoinList)==null?void 0:ze.length)>0&&_t.generated_wallet_public&&!De.some(nt=>nt.wallet_address.toLowerCase()===_t.generated_wallet_public.toLowerCase())&&De.push({wallet_address:_t.generated_wallet_public})}),fe(_t=>{const ze=_t.map(mt=>mt.wallet_address).sort().join(","),nt=De.map(mt=>mt.wallet_address).sort().join(",");return ze!==nt?De:_t})}},[n,V]);const $e=async(De,_t,ze,nt,mt)=>{const $t=`${De}_${_t}_${mt}`;try{const Pt=window.localStorage.getItem("hyperToken"),un="https://dextrabothypev2.nftinit.io/api/test_app/following/status/";Pt||C(!0),G(kn=>({...kn,[$t]:!0}));const an=window.localStorage.getItem("hyperAddress"),An=await(await fetch(un,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:P?P.toLowerCase():an,token:Pt,follow_address:_t==null?void 0:_t.toLowerCase(),copy_trait_mode:ze,target_platform:nt,wallet_id:mt})})).json();An.success?(ie(kn=>({...kn,[$t]:ze})),f()):(console.log(An.error_message),tn.error(An.error_message))}catch(Pt){console.error("Error status mode:",Pt),tn.error(Pt.message||"Something went wrong!")}finally{G(Pt=>({...Pt,[$t]:!1}))}},ht=async()=>{try{const De=window.localStorage.getItem("hyperToken"),_t=window.localStorage.getItem("hyperAddress"),ze="https://dextrabothypev2.nftinit.io/api/wallet/generated_wallet_summary";De||C(!0);const nt=await fetch(ze,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:P?P.toLowerCase():_t,token:De})});if(!nt.ok)throw new Ul(`Server responded with status ${nt.status}`);const mt=await nt.json();mt.success?te(mt.data):(console.log(mt.error_message),tn.error(mt.error_message))}catch(De){console.error("Error in like function:",De),tn.error(De.message||"Something went wrong!")}},pt="tag",[Kt,wt]=m.useState(pt),nn=(De,_t,ze,nt)=>De!=null&&De.length?[...De].sort((mt,$t)=>{var Qn,ar,hr,Gt;if(!Q||Object.keys(Q).length===0)return 0;const Pt=`${mt.wm_address}_${mt.wallet_address}_${mt.wallet_id}`,un=`${$t.wm_address}_${$t.wallet_address}_${$t.wallet_id}`;if(Q!=null&&Q[Pt]&&!(Q!=null&&Q[un]))return-1;if(!(Q!=null&&Q[Pt])&&(Q!=null&&Q[un]))return 1;const an=ze.find($n=>$n.wallet_address===mt.wallet_address)||{},xn=ze.find($n=>$n.wallet_address===$t.wallet_address)||{},An=ze.find($n=>{var nr,Rt;return((nr=$n.wallet_address)==null?void 0:nr.toLowerCase())===((Rt=mt==null?void 0:mt.wm_address)==null?void 0:Rt.toLowerCase())})||{},kn=ze.find($n=>{var nr,Rt;return((nr=$n.wallet_address)==null?void 0:nr.toLowerCase())===((Rt=$t==null?void 0:$t.wm_address)==null?void 0:Rt.toLowerCase())})||{},yn=an.data?an.data.reduce(($n,nr)=>$n+parseFloat(nr.unrealizedPnl||0),0):0,Vn=xn.data?xn.data.reduce(($n,nr)=>$n+parseFloat(nr.unrealizedPnl||0),0):0,Gn=nt==null?void 0:nt.find($n=>{var nr,Rt,En,Ee;return((nr=$n==null?void 0:$n.generated_wallet_public)==null?void 0:nr.toLowerCase())===((Rt=mt==null?void 0:mt.wm_address)==null?void 0:Rt.toLowerCase())&&((En=$n==null?void 0:$n.copy_trader_wallet)==null?void 0:En.toLowerCase())===((Ee=mt==null?void 0:mt.wallet_address)==null?void 0:Ee.toLowerCase())}),Rn=nt==null?void 0:nt.find($n=>{var nr,Rt,En,Ee;return((nr=$n==null?void 0:$n.generated_wallet_public)==null?void 0:nr.toLowerCase())===((Rt=$t==null?void 0:$t.wm_address)==null?void 0:Rt.toLowerCase())&&((En=$n==null?void 0:$n.copy_trader_wallet)==null?void 0:En.toLowerCase())===((Ee=$t==null?void 0:$t.wallet_address)==null?void 0:Ee.toLowerCase())}),Yn=Gn?Gn.total_pnl:0,Cn=Rn?Rn.total_pnl:0,rn=Gn&&((Qn=Gn.openPositionCoinList)==null?void 0:Qn.length)>0&&((ar=An.data)==null?void 0:ar.length)>0?Gn.openPositionCoinList.reduce(($n,nr)=>{const Rt=An.data.find(En=>En.asset===nr);return Rt!=null&&Rt.unrealizedPnl?$n+parseFloat(Rt.unrealizedPnl):$n},0):0,Oe=Rn&&((hr=Rn.openPositionCoinList)==null?void 0:hr.length)>0&&((Gt=kn.data)==null?void 0:Gt.length)>0?Rn.openPositionCoinList.reduce(($n,nr)=>{const Rt=kn.data.find(En=>En.asset===nr);return Rt!=null&&Rt.unrealizedPnl?$n+parseFloat(Rt.unrealizedPnl):$n},0):0,Jt=mt.tag?mt.tag.toUpperCase():"",sn=$t.tag?$t.tag.toUpperCase():"",Et=mt.wm_name?mt.wm_name.toUpperCase():"",Xn=$t.wm_name?$t.wm_name.toUpperCase():"",gn=mt.wallet_address?mt.wallet_address.toLowerCase():"",Dt=$t.wallet_address?$t.wallet_address.toLowerCase():"",en=mt.wm_address?mt.wm_address.toLowerCase():"",In=$t.wm_address?$t.wm_address.toLowerCase():"";return _t==="tag"?Jt<sn?-1:Jt>sn?1:0:_t==="-tag"?Jt>sn?-1:Jt<sn?1:0:_t==="-wallet_address"?gn<Dt?-1:gn>Dt?1:0:_t==="wallet_address"?gn>Dt?-1:gn<Dt?1:0:_t==="-wm_address"?en<In?-1:en>In?1:0:_t==="wm_address"?en>In?-1:en<In?1:0:_t==="perp_equity"?(an.perp_equity||0)-(xn.perp_equity||0):_t==="-perp_equity"?(xn.perp_equity||0)-(an.perp_equity||0):_t==="margin_usage"?(an.margin_usage||0)-(xn.margin_usage||0):_t==="-margin_usage"?(xn.margin_usage||0)-(an.margin_usage||0):_t==="unrealizedPnl"?yn-Vn:_t==="-unrealizedPnl"?Vn-yn:_t==="-wm_name"?Et<Xn?-1:Et>Xn?1:0:_t==="wm_name"?Et>Xn?-1:Et<Xn?1:0:_t==="total_pnl"?Yn-Cn:_t==="-total_pnl"?Cn-Yn:_t==="totalUnrealizedPnl"?rn-Oe:_t==="-totalUnrealizedPnl"?Oe-rn:_t==="-created_at"?new Date($t.created_at)-new Date(mt.created_at):_t==="created_at"?new Date(mt.created_at)-new Date($t.created_at):0}):[];m.useEffect(()=>{if(!(n!=null&&n.length))return;const De=n.filter(_t=>!!(!(Xe!=null&&Xe.length)||Xe.includes("HyperLiquid")&&_t.target_platform==="hyper"||Xe.includes("Lighter")&&_t.target_platform==="lighter"));tt(nn(De,Kt,J,V))},[Kt,n,Xe]);const cn=async(De,_t)=>{try{z(De),ne(_t);const ze=window.localStorage.getItem("hyperToken"),nt=window.localStorage.getItem("hyperAddress"),mt="https://dextrabothypev2.nftinit.io/api/test_app/following/info/";ze||C(!0);const $t=await fetch(mt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:P?P.toLowerCase():nt,token:ze,follow_address:De.toLowerCase()})});if(!$t.ok)throw new Ul(`Server responded with status ${$t.status}`);const Pt=await $t.json();Pt.success?(U(Array.isArray(Pt==null?void 0:Pt.data)?[...Pt.data].sort((un,an)=>new Date(an.created_at||0)-new Date(un.created_at||0)):Pt==null?void 0:Pt.data),R(!0)):(console.log(Pt.error_message),tn.error(Pt.error_message))}catch(ze){console.error("Error in like function:",ze),tn.error(ze.message||"Something went wrong!")}},zn=De=>De!=null&&De.assetPositions?De.assetPositions.filter(_t=>{if(!_t.position||!_t.position.szi)return!1;const ze=parseFloat(_t.position.szi);return!isNaN(ze)&&ze!==0}).map(_t=>{const ze=_t.position,nt=parseFloat(ze.szi),mt=parseFloat(ze.entryPx),$t=parseFloat(ze.positionValue),Pt=parseFloat(ze.unrealizedPnl),un=parseFloat(ze.returnOnEquity)*100,an=parseFloat(ze.marginUsed),xn=ze.leverage.value,An=parseFloat(ze.cumFunding.sinceOpen),kn=nt>0?"Long":"Short";return{asset:ze.coin,type:kn,size:Math.abs(nt),entryPrice:mt.toFixed(2),currentPrice:($t/Math.abs(nt)).toFixed(2),leverage:xn,positionValue:$t.toFixed(2),marginUsed:an.toFixed(2),unrealizedPnl:Pt.toFixed(2),roe:un.toFixed(2),funding:An.toFixed(4),liquidationPrice:ze.liquidationPx?parseFloat(ze.liquidationPx).toFixed(2):"N/A"}}):[],Xt=async De=>{try{const ze=await hs.post("https://api-ui.hyperliquid.xyz/info",{type:"clearinghouseState",user:De});if(ze.data){const nt=zn(ze.data);K(mt=>{var $t,Pt,un,an;return[...mt,{wallet_address:De,perp_equity:(Pt=($t=ze==null?void 0:ze.data)==null?void 0:$t.marginSummary)==null?void 0:Pt.accountValue,margin_usage:parseFloat((un=ze==null?void 0:ze.data)==null?void 0:un.marginSummary.totalMarginUsed)/parseFloat((an=ze==null?void 0:ze.data)==null?void 0:an.marginSummary.accountValue),data:nt}]})}}catch(_t){console.error("Error fetching user state from HyperState:",_t)}},on=async De=>{try{const _t=window.localStorage.getItem("hyperToken"),ze=window.localStorage.getItem("hyperAddress"),mt=await fetch("https://dextrabothypev2.nftinit.io/api/hyper/trade/getclearinghousestate/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:P?P.toLowerCase():ze,token:_t,follow_address:De.toLowerCase()})});if(mt.ok){const $t=await mt.json();if($t.success){const Pt=zn($t==null?void 0:$t.data);K(un=>{var an;return[...un,{wallet_address:De,perp_equity:(an=$t==null?void 0:$t.data.marginSummary)==null?void 0:an.accountValue,margin_usage:parseFloat($t==null?void 0:$t.data.marginSummary.totalMarginUsed)/parseFloat($t==null?void 0:$t.data.marginSummary.accountValue),data:Pt}]})}}else if(mt.status===500)console.warn(`Received 500 error for ${De}, retrying with getUserHyperState`),await Xt(De);else throw new Ul(`Request failed with status ${mt.status}`)}catch(_t){console.error("Error fetching user state:",_t)}},Zt=m.useRef(new Set);m.useEffect(()=>{!e&&r&&(ae==null?void 0:ae.length)>0&&(async()=>{var ze;const _t=new Set;for(let nt=0;nt<ae.length;nt++){const mt=ae[nt],$t=(ze=mt==null?void 0:mt.wallet_address)==null?void 0:ze.toLowerCase();if(!(!$t||Zt.current.has($t))){_t.add($t),Zt.current.add($t);try{await on($t)}catch(Pt){console.error(`Error fetching user state for wallet ${$t}:`,Pt)}await new Promise(Pt=>setTimeout(Pt,500))}}})()},[r,e,ae]),m.useEffect(()=>{I||f()},[I]);const Ye=m.useRef(null),Ze=()=>{Ye.current&&(Ye.current.scrollLeft-=100)},Ft=()=>{Ye.current&&(Ye.current.scrollLeft+=100)},dn=()=>{Ye.current&&(Ye.current.scrollTop+=200)},Yt=()=>{Ye.current&&(Ye.current.scrollTop-=200)},Bt=["HyperLiquid","Lighter"],ot=De=>{Ke(_t=>_t.includes(De)?_t.filter(ze=>ze!==De):[..._t,De])};return m.useEffect(()=>{function De(_t){ut.current&&!ut.current.contains(_t.target)&&Re(!1)}return document.addEventListener("mousedown",De),()=>document.removeEventListener("mousedown",De)},[]),i.jsxs(i.Fragment,{children:[i.jsx(w5,{open:I,setOpen:R,copyTradeData:O,copyTradeWallet:L,setCopyTradeWallet:z,setCopyTradeData:U,sourcePage:X}),i.jsx(jan,{open:o,setOpen:l,copyTradeDelete:s,isDeleteWallet:c}),we&&Na.createPortal(i.jsx(Ale,{open:we,setOpen:xe,oldSlotCount:Ne,checkAccountTrade:f,tradeMarket:"copyTrade"}),document.body),ye&&Na.createPortal(i.jsx(JUe,{open:ye,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:Ze,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(Qa,{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(Qa,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:Yt,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(Qa,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),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(Qa,{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:Ye,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(!Pe)},className:`${Xe.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(zf,{className:`w-4 h-4 ${Xe.length>0?"text-blue-500":"text-white"}`})}),Pe&&i.jsxs("div",{ref:ut,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:()=>Ke(""),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"})})]}),Bt==null?void 0:Bt.map(De=>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:Xe.includes(De),onChange:()=>ot(De),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 ${Xe.includes(De)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:Xe.includes(De)&&i.jsx("img",{src:Xc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[1px]"})}),De]},De))]})]})]})}),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(pi,{title:"Follower Name",sortKey:"wm_name",sortOption:Kt,setSortOption:wt,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"bg-[#161616] h-10 px-1 min-w-[145px] z-[8]",children:i.jsx(pi,{title:"Follower Wallet",sortKey:"wm_address",sortOption:Kt,setSortOption:wt,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"bg-[#161616] h-10 px-1 min-w-[130px]",children:i.jsx(pi,{title:"Source Tag",sortKey:"tag",sortOption:Kt,setSortOption:wt,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"bg-[#161616] h-10 px-1 min-w-[140px] z-[8]",children:i.jsx(pi,{title:"Source Wallet",sortKey:"wallet_address",sortOption:Kt,setSortOption:wt,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[110px] pl-1",children:i.jsx(pi,{title:"Follower PnL",sortKey:"total_pnl",sortOption:Kt,setSortOption:wt,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[130px] pl-1",children:i.jsx(pi,{title:"Follower uPnL",sortKey:"totalUnrealizedPnl",sortOption:Kt,setSortOption:wt,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[115px] sm:min-w-[115px] pl-1",children:i.jsx(pi,{title:"Perp Equity",sortKey:"perp_equity",sortOption:Kt,setSortOption:wt,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[130px] sm:min-w-[130px] pl-1",children:i.jsx(pi,{title:"Margin Usage",sortKey:"margin_usage",sortOption:Kt,setSortOption:wt,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[114px] sm:min-w-[114px] pl-1",children:i.jsx(pi,{title:"uPnL",sortKey:"unrealizedPnl",sortOption:Kt,setSortOption:wt,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[124px] sm:min-w-[124px] pl-1",children:i.jsx(pi,{title:"Created Date",sortKey:"created_at",sortOption:Kt,setSortOption:wt,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(Ba,{})})})}):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(Ul,{})})})}):(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:ac,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."]})]})]})]})})})})}):et==null?void 0:et.map((De,_t)=>{var an,xn,An,kn,yn;const ze=J.find(Vn=>Vn.wallet_address===De.wallet_address),nt=J.find(Vn=>Vn.wallet_address===(De==null?void 0:De.wm_address)),mt=V==null?void 0:V.find(Vn=>{var Gn,Rn,Yn,Cn;return((Gn=Vn==null?void 0:Vn.generated_wallet_public)==null?void 0:Gn.toLowerCase())===((Rn=De==null?void 0:De.wm_address)==null?void 0:Rn.toLowerCase())&&((Yn=Vn==null?void 0:Vn.copy_trader_wallet)==null?void 0:Yn.toLowerCase())===((Cn=De==null?void 0:De.wallet_address)==null?void 0:Cn.toLowerCase())}),$t=mt?mt.total_pnl:null;let Pt=0;mt&&((an=mt==null?void 0:mt.openPositionCoinList)==null?void 0:an.length)>0&&((xn=nt==null?void 0:nt.data)==null?void 0:xn.length)>0&&((An=mt==null?void 0:mt.openPositionCoinList)==null||An.forEach(Vn=>{var Rn;const Gn=(Rn=nt==null?void 0:nt.data)==null?void 0:Rn.find(Yn=>{var Cn;return((Cn=Yn==null?void 0:Yn.asset)==null?void 0:Cn.toLowerCase().trim())===(Vn==null?void 0:Vn.toLowerCase().trim())});Gn&&(Gn!=null&&Gn.unrealizedPnl)&&(Pt+=parseFloat(Gn==null?void 0:Gn.unrealizedPnl))}));const un=`${De.follower_wallet}_${De.wallet_address}_${De.wallet_id}`;return i.jsxs("tr",{className:`${_t%2===0,"bg-[#161616]"} relative group hover:bg-[#222222] h-[56px] border-b border-[#232323] text-white`,children:[i.jsx("td",{scope:"row",className:`${_t%2==0,"bg-[#161616]"} sm:sticky sm:left-0 z-[2] group-hover:bg-[#222222]`,children:(()=>{const Vn=x==null?void 0:x.includes(De.wallet_id),Gn=`${De==null?void 0:De.wm_address}_${De==null?void 0:De.wallet_address}_${De==null?void 0:De.wallet_id}`,Rn=d===0&&!Q[Gn]&&!Vn,Yn=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(_o,{checked:!!Q[Gn],onChange:()=>{if(!Yn&&(De==null?void 0:De.target_platform)==="lighter"){je(!0);return}if(Rn&&(De==null?void 0:De.target_platform)==="lighter"){me(v),xe(!0);return}$e(De==null?void 0:De.wm_address,De.wallet_address,!Q[Gn],De==null?void 0:De.target_platform,De==null?void 0:De.wallet_id)},disabled:oe[Gn],className:`${Q[Gn]?"bg-[#1DE674]":"bg-[#353535]"} ${oe[Gn]?"cursor-not-allowed":"cursor-pointer"} flex h-[18px] w-[28px] rounded-[256px] p-1 transition-colors`,children:i.jsx("span",{"aria-hidden":"true",className:`${Q[Gn]?"translate-x-1.5 bg-white":"-translate-x-[1px] bg-[#D5D5D5]"} inline-block size-[14px] -mt-[3px] rounded-full shadow-lg transition`})}),!Yn&&(De==null?void 0:De.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"}):Rn&&(De==null?void 0:De.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[Gn]?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..."})]}):Q[Gn]?"On":"Off"]})})()}),i.jsx("td",{scope:"row",className:`${_t%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(De==null?void 0:De.wallet_address,De==null?void 0:De.wallet_id)},className:`${n!=null&&n.some(Vn=>Vn.wallet_address===(De==null?void 0:De.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(v5,{walletAddress:De==null?void 0:De.wallet_address,children:i.jsx("div",{className:"w-[18px] h-[18px] justify-center items-center flex cursor-pointer",children:w.some(Vn=>Vn.wallet_address===(De==null?void 0:De.wallet_address))?i.jsx("img",{src:o5,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"}):i.jsx("img",{src:NA,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"})})})]})})}),i.jsx("td",{scope:"row",className:`${_t%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:(De==null?void 0:De.target_platform)==="lighter"?i.jsx(xi,{content:"Lighter",children:i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx(up,{className:"w-4 h-4 text-[#fff]"})})}):(De==null?void 0:De.target_platform)==="hyper"?i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx(xi,{content:"Hyperliquid",children:i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx("img",{src:S1,alt:"",className:"w-4 h-4 text-[#fff]"})})})}):i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx(xi,{content:"Dextrabot",children:i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx("img",{src:Ki,alt:"",className:"w-4 h-4 text-[#fff]"})})})})})})}),i.jsx("td",{scope:"row",className:`${_t%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(oa,{info1:De!=null&&De.wm_name?(De==null?void 0:De.wm_name.length)>=13?(De==null?void 0:De.wm_name).slice(0,13)+"...":De==null?void 0:De.wm_name:"--",info1_Color:"text-white",rowTwo:!1}),(De==null?void 0:De.wm_name)&&(De==null?void 0:De.wm_name.length)>=13&&i.jsx("span",{className:"-ml-[9px]",children:i.jsx(Oa,{content:`${De==null?void 0:De.wm_name}`,positionTop:!0,alignRight:!1})})]})})})}),i.jsx("td",{scope:"row",className:`${_t%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/${De==null?void 0:De.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(oa,{info1:`${(De==null?void 0:De.wm_address).slice(0,5)+"..."+(De==null?void 0:De.wm_address).slice(-4)}`,info1_Color:"text-white",rowTwo:!1}),i.jsx("img",{onClick:Vn=>{Vn.stopPropagation(),navigator.clipboard.writeText(De==null?void 0:De.wm_address),tn.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:Co,alt:"",className:"cursor-pointer"})]})})})}),i.jsx("td",{scope:"row",className:`${_t%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(oa,{info1:De!=null&&De.tag?(De==null?void 0:De.tag.length)>=10?(De==null?void 0:De.tag).slice(0,10)+"...":De==null?void 0:De.tag:"--",info1_Color:"text-white",rowTwo:!1}),(De==null?void 0:De.tag)&&(De==null?void 0:De.tag.length)>=10&&i.jsx("span",{className:"-ml-[9px]",children:i.jsx(Oa,{content:`${De==null?void 0:De.tag}`,positionTop:!0,alignRight:!1})})]})})})}),i.jsx("td",{scope:"row",className:`${_t%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/${De==null?void 0:De.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(oa,{info1:`${(De==null?void 0:De.wallet_address).slice(0,5)+"..."+(De==null?void 0:De.wallet_address).slice(-4)}`,info1_Color:"text-white",rowTwo:!1}),i.jsx("img",{onClick:Vn=>{Vn.stopPropagation(),navigator.clipboard.writeText(De==null?void 0:De.wallet_address),tn.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:Co,alt:"",className:"cursor-pointer"})]})})})}),i.jsx("td",{children:i.jsx(Nh,{info:$t!==null?`$${Er(Math.abs($t))}`:"--",textColor:`${$t>=0?"text-[#4ae3b5]":"text-[#ff6b6b]"}`})}),i.jsx("td",{children:i.jsx(Nh,{info:mt?`$${Er(Math.abs(Pt))}`:"--",textColor:`${Pt>=0?"text-[#4ae3b5]":"text-[#ff6b6b]"}`})}),i.jsx("td",{children:re?i.jsx(Nh,{info:"Loading...",textColor:"text-white"}):ze?i.jsx(Nh,{info:(ze==null?void 0:ze.perp_equity)!=0?`$${Er(ze==null?void 0:ze.perp_equity)}`:"$0",textColor:"text-white"}):i.jsx(Nh,{info:"Loading...",textColor:"text-white"})}),i.jsx("td",{children:re?i.jsx(Nh,{info:"Loading...",textColor:"text-white"}):ze?i.jsx(Nh,{info:isNaN(ze==null?void 0:ze.margin_usage)?"0%":`${((ze==null?void 0:ze.margin_usage)*100).toFixed(2)}%`,textColor:"text-white"}):i.jsx(Nh,{info:"Loading...",textColor:"text-white"})}),i.jsx("td",{children:re?i.jsx(Nh,{info:"Loading...",textColor:"text-white"}):ze?i.jsx(Nh,{info:(ze==null?void 0:ze.data)!=0?`$${Er(Math.abs((kn=ze==null?void 0:ze.data)==null?void 0:kn.reduce((Vn,Gn)=>Vn+parseFloat(Gn.unrealizedPnl||0),0)))}`:"$0",textColor:`${((yn=ze==null?void 0:ze.data)==null?void 0:yn.reduce((Vn,Gn)=>Vn+parseFloat(Gn.unrealizedPnl),0))>=0?"text-[#4ae3b5]":"text-[#ff6b6b]"}`}):i.jsx(Nh,{info:"Loading...",textColor:"text-white"})}),i.jsx("td",{children:i.jsx(Nh,{info:(De==null?void 0:De.created_at)&&p3(De==null?void 0:De.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[un]?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:De==null?void 0:De.wm_address,sourceWallet:De==null?void 0:De.wallet_address,platform:De==null?void 0:De.target_platform,id:De==null?void 0:De.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"})})})})]},_t)})})]})})]})]})]})},Nh=({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})}),_an=()=>{const[e,t]=m.useState(!1),[n,r]=m.useState(!1),{isConnected:s,address:a}=ts(),{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:P,setIsReferralCodeName:I,setHyperToken:R,setHyperAddress:O,hyperToken:U}=m.useContext(Qr),[L,z]=m.useState({}),[X,ne]=m.useState(!1),[J,K]=m.useState({followerWallet:"",sourceWallet:"",platform:"",id:null}),[re,he]=m.useState(0),[Q,ie]=m.useState([]),[oe,G]=m.useState(""),[V,te]=m.useState(0);m.useEffect(()=>{U&&(l(),u(),t(!0),r(!0))},[U]);const ae=async()=>{var xe,ye,je,Pe;const me=window.localStorage.getItem("hyperToken"),we=window.localStorage.getItem("hyperAddress");if(!(!me||!we))try{const Re=await _i(we.toLowerCase(),me);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((xe=Re==null?void 0:Re.mushboomer_counts)==null?void 0:xe.eth),N((ye=Re==null?void 0:Re.mushboomer_counts)==null?void 0:ye.sol),P(Re==null?void 0:Re.referral_code),I(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),te((Pe=Re==null?void 0:Re.copy_trade_slots_info)==null?void 0:Pe.extra_slot_count)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),R(""),O(""))}catch(Re){console.error("Token verification error:",Re)}};m.useEffect(()=>{ae()},[]);const fe=async(me,we,xe,ye)=>{const je=`${me}_${we}_${ye}`;try{const Pe=window.localStorage.getItem("hyperToken"),Re="https://dextrabothypev2.nftinit.io/api/test_app/following/unfollow/";if(!Pe||!we||!xe||!ye||!me)throw new Error("Required information is missing. Please log in or connect your wallet.");z(et=>({...et,[je]:!0}));const Xe=window.localStorage.getItem("hyperAddress"),Ke=await fetch(Re,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:a?a.toLowerCase():Xe,token:Pe,follow_address:we.toLowerCase(),target_platform:xe,wallet_id:ye})});if(!Ke.ok)throw new Error(`Failed to unlike: ${Ke.status} ${Ke.statusText}`);const ut=await Ke.json();ut.success?(z(et=>({...et,[je]:!1})),l(),ne(!1),K({followerWallet:"",sourceWallet:"",platform:"",id:null}),ae(),tn.success(`${we==null?void 0:we.slice(0,5)}...${we==null?void 0:we.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"}})):(tn.error(ut.error_message),z(et=>({...et,[je]:!1})),ne(!1))}catch(Pe){tn.error(Pe.message||"Something went wrong!"),z(Re=>({...Re,[je]:!1})),ne(!1)}},Ne=!!window.localStorage.getItem("hyperToken");return i.jsxs(i.Fragment,{children:[i.jsx(No,{children:i.jsx(Lo,{children:Ne?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:Ne?i.jsx(Ean,{loading:d,error:f,trackerData:o,isRequest:e,handleCopyDelete:fe,deleteLoading:L,isDeleteModalOpen:X,setIsDeleteModalOpen:ne,isDeleteWallet:J,setIsDeleteWallet:K,slotTotalCount:re,checkSlotAccount:ae,slotCountWallets:Q,subsRole:oe,slotCount:V}):i.jsx("div",{className:"flex justify-center items-center w-full",children:i.jsx(fU,{})})})})]})},kan=({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 P=parseFloat(C[x])||0,I=parseFloat(N[x])||0;return P<I?v==="asc"?-1:1:P>I?v==="asc"?1:-1:0});a(w),l({key:x,direction:v})},f=x=>o.key!==x?i.jsx(F3,{className:"inline ml-2 text-white"}):o.direction==="asc"?i.jsx(P3,{className:"inline ml-2 text-white"}):i.jsx(I3,{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:KD(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)})})]})})},Tan=({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 P=[...s].sort((I,R)=>{const O=parseFloat(I[C])||0,U=parseFloat(R[C])||0;return O<U?N==="asc"?-1:1:O>U?N==="asc"?1:-1:0});a(P),u({key:C,direction:N})},f=C=>c.key!==C?i.jsx(F3,{className:"inline ml-2 text-white"}):c.direction==="asc"?i.jsx(P3,{className:"inline ml-2 text-white"}):i.jsx(I3,{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:eyt,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:tyt,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:Ume,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: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.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 P=(n-1)*r+N,I=P%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] ${I} ${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:KD(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:Ume,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: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.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)})]},P)})]})]})})},Ian="/assets/bg_-D6bvhHQD.png",Pan=({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"})})})]}),Fan=({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"})})})]}),Oan=()=>{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),P=25,I=m.useRef(null),R=m.useRef(null),{isConnected:O,address:U}=ts(),{openConnectModal:L}=y5(),{walletLogin:z,signIn:X,hyperToken:ne,hyperAddress:J,setSignInConnectButtonOpen:K,isReferralCodeName:re}=m.useContext(Qr),he=()=>{O?window.localStorage.getItem("hyperToken")&&ne?z():X(1):(L(),K(!0))},Q=re||window.localStorage.getItem("refcode")||"",ie=Q?`https://app.dextrabot.com/referral/${Q}`:"",oe=()=>{if(!J||!ne){he();return}f(!0)},G=()=>{if(!J||!ne){he();return}g(!0)},V=$e=>{$e&&(navigator.clipboard.writeText($e),tn.success("Copied to clipboard"))},te=async()=>{var $e;if(I.current)try{($e=document==null?void 0:document.fonts)!=null&&$e.ready&&await document.fonts.ready;const ht=await P1(I.current,{cacheBust:!0,backgroundColor:"#040707",pixelRatio:2}),pt=document.createElement("a");pt.href=ht,pt.download="dextrabot-leaderboard-rank.png",document.body.appendChild(pt),pt.click(),document.body.removeChild(pt),tn.success("Image downloaded")}catch(ht){console.error("Share card download error",ht),tn.error("Failed to download image")}};m.useCallback(()=>{hs.get("https://dextrabothypev2.nftinit.io/api/subscriber/leaderboard/").then(ht=>{const pt=(ht.data.data||[]).map(Kt=>({ranking:Kt.rank_position,out_subscriber_address:Kt.address,overall_pos_value:Kt.total_volume,calculated_xp:Kt.total_xp,overall_point_result:Kt.total_xp,referral_xp:Kt.ref_bf_xp,refCode:Kt.refCode??null,daily_pos_value:null,generated_wallets:[],owner:!!Kt.owner}));t(pt)}).catch(ht=>{console.error("Error fetching volume data:",ht)})},[]),m.useEffect(()=>{const $e="https://dextrabothypev2.nftinit.io/api/subscriber/leaderboard/",ht=pt=>(pt||[]).map(Kt=>({ranking:Kt.rank_position,out_subscriber_address:Kt.address,overall_pos_value:Kt.total_volume,calculated_xp:Kt.total_xp,overall_point_result:Kt.total_xp,referral_xp:Kt.ref_bf_xp,refCode:Kt.refCode??null,daily_pos_value:null,generated_wallets:[],owner:!!Kt.owner}));hs.get($e).then(pt=>{const Kt=ht(pt.data.data);t(Kt),r(Kt)}).catch(pt=>{console.error("Error fetching leaderboard data:",pt),t([]),r([])})},[]);const ae=m.useCallback(()=>{R.current&&R.current.abort();const $e=J||typeof window<"u"&&window.localStorage.getItem("hyperAddress"),ht=ne||typeof window<"u"&&window.localStorage.getItem("hyperToken");if($e&&ht){w(!0);const pt="https://dextrabothypev2.nftinit.io/api/subscriber/leaderboard/",Kt=new AbortController;R.current=Kt,hs.post(pt,{address:$e,token:ht},{headers:{"Content-Type":"application/json"},signal:Kt.signal}).then(wt=>{if(!Kt.signal.aborted){if(wt.data.ownerRank)a(wt.data.ownerRank);else if(wt.data.data){const nn=wt.data.data.find(cn=>{var zn;return((zn=cn.address)==null?void 0:zn.toLowerCase())===($e==null?void 0:$e.toLowerCase())});a(nn?{ranking:nn.rank_position,rank_position:nn.rank_position,overall_pos_value:nn.total_volume,total_volume:nn.total_volume,calculated_xp:nn.total_xp,total_xp:nn.total_xp,overall_point_result:nn.total_xp,referral_xp:nn.ref_bf_xp,refCode:nn.refCode}:null)}else a(null);w(!1)}}).catch(wt=>{wt.name!=="CanceledError"&&!Kt.signal.aborted&&(console.error("API Error (Volume):",wt),w(!1))})}else a(null),w(!1)},[J,ne]),fe=m.useCallback(()=>{const $e=J||typeof window<"u"&&window.localStorage.getItem("hyperAddress"),ht=ne||typeof window<"u"&&window.localStorage.getItem("hyperToken");$e&&ht?hs.post("https://dextrabothypev2.nftinit.io/api/subscriber/leaderboard/",{address:$e,token:ht},{headers:{"Content-Type":"application/json"}}).then(pt=>{if(pt.data.ownerRanks)l(pt.data.ownerRanks[0]);else if(pt.data.ownerRank)l(pt.data.ownerRank);else if(pt.data.data){const Kt=pt.data.data.find(wt=>{var nn;return((nn=wt.address)==null?void 0:nn.toLowerCase())===($e==null?void 0:$e.toLowerCase())});l(Kt?{ranked:Kt.rank_position,rank_position:Kt.rank_position,subscriber_address:Kt.address,total_pnl:Kt.total_xp,daily_point_result:Kt.daily_point_result||0,mushInfo:Kt.mushInfo||{eth:0,sol:0}}:null)}else l(null)}).catch(pt=>console.error("API Error (PnL):",pt)):l(null)},[J,ne]);m.useEffect(()=>{ae(),c==="pnl"&&fe();const $e=()=>{ae(),c==="pnl"&&fe()};return window.addEventListener("localStorageUpdated",$e),()=>{window.removeEventListener("localStorageUpdated",$e),R.current&&R.current.abort()}},[J,ne,c,ae,fe]);const Ne=m.useMemo(()=>c==="volume"?s:o,[c,s,o]),me=m.useMemo(()=>(Ne==null?void 0:Ne.ranking)??"--",[Ne==null?void 0:Ne.ranking]),we=m.useMemo(()=>(Ne==null?void 0:Ne.overall_pos_value)??(Ne==null?void 0:Ne.total_volume)??0,[Ne==null?void 0:Ne.overall_pos_value,Ne==null?void 0:Ne.total_volume]),xe=m.useMemo(()=>(Ne==null?void 0:Ne.calculated_xp)??(Ne==null?void 0:Ne.total_xp)??0,[Ne==null?void 0:Ne.calculated_xp,Ne==null?void 0:Ne.total_xp]),ye=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]),Pe=m.useMemo(()=>s?s.rank_position??s.ranking??"Unranked":"Unranked",[s]),Re=m.useMemo(()=>c==="volume"?e:n,[c,e,n]),Xe=m.useMemo(()=>Math.ceil(Re.length/P),[Re.length,P]),Ke=Re.length;m.useEffect(()=>{N(1)},[c]);const ut=m.useCallback($e=>{$e>=1&&$e<=Xe&&(N($e),window.scrollTo({top:0,behavior:"smooth"}))},[Xe]),et=Ne?`Here’s my @Dextrabot rank #${me}. Volume (All Time): $${Er(we)} · XP: ${Er(xe)}. Farming points and stacking profit at the same time.`:"Here’s my @Dextrabot rank. Farming points and stacking profit at the same time.",tt=ie||"https://app.dextrabot.com/leaderboard",Le=`https://x.com/intent/post?text=${encodeURIComponent(et)}&url=${encodeURIComponent(tt)}`;return i.jsxs(i.Fragment,{children:[i.jsx(No,{children:i.jsxs(Lo,{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(${Ian})`}}),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:KD(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(ye):"0"}),i.jsx(Pan,{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?Pe:"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(Fan,{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(Ai,{className:"text-white hidden sm:block"}),i.jsx("span",{className:"text-white",children:Ke}),i.jsx("span",{className:"text-white",children:"wallets found"})]}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("button",{onClick:()=>ut(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(rd,{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(Xe,1)]}),i.jsx("button",{onClick:()=>ut(C+1),disabled:C===Xe||Xe===0,className:`${C===Xe||Xe===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(rd,{className:`w-3 h-3 -rotate-90 ${C===Xe||Xe===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(kan,{volumeLeaderboardData:e,userData:s,currentPage:C,rowsPerPage:P}):c==="pnl"?i.jsx(Tan,{pnlLeaderboardData:n,userData:o,currentPage:C,rowsPerPage:P}):i.jsx(i.Fragment,{})})]})]})]}),i.jsx(dp,{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."})]}),Q?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:Q})]}),i.jsx("button",{className:"p-2 rounded-xl border border-white/10 transition hover:bg-white/10",onClick:()=>V(Q),children:i.jsx("img",{src:hM,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:hM,alt:"Copy referral url",className:"w-4 h-4"})})]})]}):null,!Q&&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(dp,{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:I,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:_A,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:(Ne==null?void 0:Ne.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((Ne==null?void 0:Ne.overall_pos_value)??(Ne==null?void 0:Ne.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((Ne==null?void 0:Ne.calculated_xp)??(Ne==null?void 0:Ne.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"})})]})]}),!Ne&&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:te,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:!Ne,children:"Download image"}),i.jsx("a",{href:Le,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 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:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.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:"m19.5 8.25-7.5 7.5-7.5-7.5"}))}const Dan=m.forwardRef(Lan);function Ban({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 $an=m.forwardRef(Ban);function Uan({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 YY=m.forwardRef(Uan);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:"m4.5 15.75 7.5-7.5 7.5 7.5"}))}const Han=m.forwardRef(zan);function Van({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 Wan=m.forwardRef(Van);function qan({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 eze=m.forwardRef(qan),kCe=[{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 Gan(...e){return e.filter(Boolean).join(" ")}const Uce=({scrollToFeatures:e,scrollToHowItWorks:t,scrollToFAQ:n})=>i.jsxs(c8e,{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(MD,{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:gyt,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(Qre,{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(Ran,{"aria-hidden":"true",className:"block size-6 group-data-[open]:hidden"}),i.jsx(eze,{"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:kCe.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:Gan(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(Zre,{className:"sm:hidden",children:i.jsx("div",{className:"space-y-1 px-2 pb-3 pt-2",children:kCe.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))})})]}),Kan=()=>{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(_y,{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)tn.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{tn.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:xyt,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:oyt,alt:"Copy trade Hyperliquid wallets with Dextrabot platform and customizable risk settings",className:"w-full h-auto max-w-[728px] mx-auto"})})})})]})})})})},Yan=()=>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(Y7,{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:lyt,cssInfo:"w-[348px] h-[348px]",imgCss:"absolute bottom-0 left-0"}),i.jsx(Y7,{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:uyt,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(Y7,{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:dyt,cssInfo:"w-[348px] h-[348px]",imgCss:"absolute bottom-[20px] w-[294px] h-[204px]"}),i.jsx(Y7,{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:cyt,cssInfo:"w-[348px] h-[348px]",imgCss:"absolute bottom-0 -left-1"})]})]}),i.jsx(Y7,{title:"Analyze Wallet",description:"Track performance metrics, open positions, and trading patterns",icon:fyt,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"})]})]})}),Y7=({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})]}),Xan=()=>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(XY,{title:"Discover",description:"Find profitable wallets using our advanced filters",icon:hyt,altInfo:"Discover profitable Hyperliquid wallets using Dextrabot's advanced filtering system"}),i.jsx(XY,{title:"Analyze",description:"Examine detailed metrics and trading patterns",icon:pyt,altInfo:"Examine detailed PnL metrics and win rate statistics for Hyperliquid trading strategies"}),i.jsx(XY,{title:"Copy Trade",description:"Set your risk parameters and start automating",icon:myt,altInfo:"Set custom take profit and stop loss parameters for automated copy trading on Hyperliquid"})]})]})}),XY=({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]"})]}),TCe=({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"})}),Qan=()=>{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(c8e,{as:"div",className:"my-4 first:pt-0 last:pb-0 rounded-2xl bg-[#161616]",children:i.jsxs("dt",{children:[i.jsxs(Qre,{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(TCe,{"aria-hidden":"true",className:"size-6 group-data-[open]:hidden"}),i.jsx(TCe,{"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(Zre,{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))})]})})},Zan=({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"})})})]}),Jan=({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"})})})]}),eon=({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"})}),zce=()=>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(Jan,{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(eon,{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(Zan,{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."]})]}),ton=()=>{const e=m.useRef(null),t=m.useRef(null),n=m.useRef(null);return i.jsxs(i.Fragment,{children:[i.jsx(No,{children:i.jsxs(Lo,{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(Uce,{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(Kan,{}),i.jsx("div",{ref:e,children:i.jsx(Yan,{})}),i.jsx("div",{ref:t,children:i.jsx(Xan,{})}),i.jsx("div",{ref:n,children:i.jsx(Qan,{})}),i.jsx(zce,{})]})]})};var Yx={},ICe;function non(){if(ICe)return Yx;ICe=1;var e=Yx.__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=Yx.__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=Yx.__setModuleDefault||(Object.create?function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}:function(d,f){d.default=f}),r=Yx.__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=Yx.__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(Yx,"__esModule",{value:!0});var a=r(ox()),o=VUe(),l=WUe(),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,P=N===void 0?{}:N,I=d.size,R=I===void 0?25:I,O=d.margin,U=O===void 0?2:O,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)},P),K=(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(K," ").concat(1/C,"s ").concat(V*.25,"s infinite linear"),animationFillMode:"both"}},he="".concat((0,o.cssValue)(R)," solid transparent"),Q="".concat((0,o.cssValue)(R)," solid ").concat(v),ie=function(V){return{width:0,height:0,borderRight:he,borderTop:V===0?he:Q,borderLeft:Q,borderBottom:V===0?Q: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 Yx.default=u,Yx}var ron=non();const son=Ii(ron),ion=()=>{const{setHyperToken:e,setHyperAddress:t}=m.useContext(Qr),[n]=WNe(),r=Wo(),s=n.get("temp_mobile_password");return m.useEffect(()=>{s?(async()=>{try{const o=await hs.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),tn.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{tn.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:Ki,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(son,{color:"#46eda1",size:30})]})},aon=()=>i.jsxs(i.Fragment,{children:[i.jsx(No,{children:i.jsxs(Lo,{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(Uce,{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(zce,{})]})]}),oon=()=>{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(No,{children:i.jsxs(Lo,{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(Uce,{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(zce,{})]})]})},UP=(e,t=2)=>Number(e).toLocaleString("en-US",{style:"currency",currency:"USD",maximumFractionDigits:t}),QY=(e,t=2)=>Number(e).toLocaleString("en-US",{maximumFractionDigits:t}),PCe=e=>`${(e*100).toFixed(2)}%`,ZY=e=>Math.floor((Date.now()-e)/864e5);function lon(){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(""),[P,I]=m.useState("tvl"),[R,O]=m.useState("desc"),[U,L]=m.useState(20),[z,X]=m.useState(1),ne=te=>(te.summary.name||"").trim()==="Hyperliquidity Provider (HLP)",J=()=>{r(!0),hs.get("https://stats-data.hyperliquid.xyz/Mainnet/vaults").then(te=>t(Array.isArray(te.data)?te.data:[])).finally(()=>r(!1))};m.useEffect(()=>J(),[]);const K=(te,ae)=>{var Ne;const fe=(Ne=te.pnls)==null?void 0:Ne.find(([me])=>me===ae);return fe?parseFloat(fe[1].slice(-1)[0]||0):0},re=m.useMemo(()=>{if(!e.length)return null;const te=e.reduce((fe,Ne)=>fe+ +Ne.summary.tvl,0),ae=e.reduce((fe,Ne)=>fe+(Ne.apr||0),0)/e.length;return{total:e.length,active:e.filter(fe=>!fe.summary.isClosed).length,tvl:te,avgApr:ae,profitable:e.filter(fe=>K(fe,"allTime")>0).length}},[e]),he=m.useMemo(()=>e.filter(te=>{const ae=+te.summary.tvl,fe=te.apr||0,Ne=K(te,"month"),me=K(te,"allTime"),we=ZY(te.summary.createTimeMillis),xe=(te.summary.name||"").toLowerCase()+(te.summary.vaultAddress||"").toLowerCase();return!(s&&ae<+s||o&&fe*100<+o||c&&Ne<+c||d&&me<+d||x&&we<+x||!v&&te.summary.isClosed||C&&!xe.includes(C.toLowerCase()))}),[e,s,o,c,d,x,v,C]),Q=(te,ae)=>{var fe;switch(ae){case"name":return((fe=te.summary.name)==null?void 0:fe.toLowerCase())||"";case"apr":return te.apr||0;case"tvl":return+te.summary.tvl;case"p30":return K(te,"month");case"pAll":return K(te,"allTime");case"days":return ZY(te.summary.createTimeMillis);default:return 0}},ie=m.useMemo(()=>[...he].sort((te,ae)=>{const fe=Q(te,P),Ne=Q(ae,P);return fe===Ne?0:R==="asc"?fe>Ne?1:-1:fe<Ne?1:-1}),[he,P,R]),oe=Math.max(1,Math.ceil(ie.length/U)),G=ie.slice((z-1)*U,z*U),V=(te,ae)=>i.jsx("th",{onClick:()=>I(te)||O(P===te?R==="asc"?"desc":"asc":"desc"),className:`px-3 py-2 cursor-pointer whitespace-nowrap ${P===te?"text-[#67FFBD]":""}`,children:ae},te);return n?i.jsx("div",{className:"flex justify-center items-center w-full py-10",children:i.jsx(QUe,{color:"#ffffff",size:40})}):i.jsxs(i.Fragment,{children:[i.jsx(No,{children:i.jsxs(Lo,{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",QY(re.total,0)],["Active Vaults",QY(re.active,0)],["Total TVL",UP(re.tvl,0)],["Average APR",PCe(re.avgApr)],["Profitable Vaults",QY(re.profitable,0)]].map(([te,ae])=>i.jsxs("div",{className:"bg-[#1c1c1c] rounded-lg p-4",children:[i.jsx("p",{className:"text-sm text-gray-400 mb-1",children:te}),i.jsx("p",{className:"text-xl font-semibold text-white",children:ae})]},te))}),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(([te,ae,fe])=>i.jsxs("div",{className:"flex flex-col",children:[i.jsx("label",{className:"text-sm text-gray-300 mb-1",children:te}),i.jsx("input",{type:"number",value:ae===0?"":ae,placeholder:"0",onChange:Ne=>fe(Ne.target.value===""?"":+Ne.target.value),className:"bg-[#303030] text-white rounded px-3 py-2 outline-none"})]},te)),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:te=>N(te.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:te=>w(te.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((te,ae)=>{const fe=+te.summary.tvl,Ne=te.apr||0,me=K(te,"month"),we=K(te,"allTime"),xe=ZY(te.summary.createTimeMillis),ye=te.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/${ye}`,target:"_blank",rel:"noopener noreferrer",className:"hover:text-[#67FFBD] font-bold text-white",children:te.summary.name||"Unnamed"}),i.jsx("a",{href:`/wallet-details/${ye}`,target:"_blank",rel:"noopener noreferrer",children:i.jsx("img",{src:Ki,className:"w-4 h-4"})}),ne(te)&&i.jsx("span",{className:"text-[#FF7173] ml-1",children:"(Protocol Vault)"})]}),i.jsx("td",{className:"px-3 py-2",children:UP(fe)}),i.jsx("td",{className:"px-3 py-2",children:PCe(Ne)}),i.jsx("td",{className:`px-3 py-2 ${me>=0?"text-[#67FFBD]":"text-[#FF7173]"}`,children:UP(me)}),i.jsx("td",{className:`px-3 py-2 ${we>=0?"text-[#67FFBD]":"text-[#FF7173]"}`,children:UP(we)}),i.jsx("td",{className:"px-3 py-2",children:xe})]},ye)})})]})}),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:te=>{L(+te.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(te=>i.jsx("option",{children:te},te))})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{onClick:()=>X(te=>Math.max(1,te-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(te=>Math.min(oe,te+1)),disabled:z===oe,className:"px-2 py-1 bg-[#1c1c1c] rounded disabled:opacity-40",children:"›"})]})]})]})]})}const Ah=({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(uU,{sortKey:t,state:n,className:""})]})})},con=({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(gb,{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:Vme,period:t}),i.jsx(gb,{title:"Long Positions",value:n!=null&&n.long_exposure?n==null?void 0:n.long_exposure:"--",info:"Long exposure",icon:mJ,period:t}),i.jsx(gb,{title:"Short Positions",value:n!=null&&n.short_exposure?n==null?void 0:n.short_exposure:"--",info:"Short exposure",icon:xJ,period:t}),i.jsx(gb,{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(gb,{title:"Total Notional",value:"--",info:"--",icon:Vme,period:t}),i.jsx(gb,{title:"Long Positions",value:"--",info:"Long exposure",icon:mJ,period:t}),i.jsx(gb,{title:"Short Positions",value:"--",info:"Short exposure",icon:xJ,period:t}),i.jsx(gb,{title:"Global Bias",value:"--",info:"L/S: --",icon:4,period:t})]})}),gb=({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(RRt,{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:`$${ect(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`})]}),Pne=({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"})]})})]}),uon=({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=K=>{var he;const re=(he=e.data)==null?void 0:he.filter(Q=>{var oe,G,V,te,ae;if(u!=="All"&&Q.majority_side!==u)return!1;const ie=(oe=x==null?void 0:x.trim())==null?void 0:oe.toLowerCase();return!(ie!==""&&!((V=(G=Q==null?void 0:Q.asset)==null?void 0:G.toLowerCase())!=null&&V.includes(ie)||(ae=(te=Q==null?void 0:Q.coin_name)==null?void 0:te.toLowerCase())!=null&&ae.includes(ie)))});return re==null?void 0:re.sort((Q,ie)=>{const oe=Q.asset?Q.asset.toUpperCase():"",G=ie.asset?ie.asset.toUpperCase():"",V=Q.majority_side==="LONG"?1:0,te=ie.majority_side==="LONG"?1:0,ae=Q.majority_side==="SHORT"?1:0,fe=ie.majority_side==="SHORT"?1:0,Ne=Q.maj_side_pnl==="Profit"?1:0,me=ie.maj_side_pnl==="Profit"?1:0,we=Q.maj_side_pnl==="Loss"?1:0,xe=ie.maj_side_pnl==="Loss"?1:0,ye=Ke=>{if(!Ke||typeof Ke!="string"||!Ke.includes("/"))return 0;const[ut,et]=Ke.split("/").map(tt=>Number(tt.trim()));return et!==0?ut/et:0},je=ye(Q.traders_l_s),Pe=ye(ie.traders_l_s),Re=Ke=>{var tt,Le;const ut=parseFloat((tt=Ke==null?void 0:Ke.asset_change24h)==null?void 0:tt.markPx),et=parseFloat((Le=Ke==null?void 0:Ke.asset_change24h)==null?void 0:Le.prevDayPx);return!ut||!et||isNaN(ut)||isNaN(et)||et===0?-1/0:(ut-et)/et*100},Xe=Ke=>{var et;const ut=parseFloat((et=Ke==null?void 0:Ke.asset_change24h)==null?void 0:et.markPx);return isNaN(ut)?0:ut};return K==="asset"?oe<G?-1:oe>G?1:0:K==="-asset"?oe>G?-1:oe<G?1:0:K==="-total_notional"?ie.total_notional-Q.total_notional:K==="total_notional"?Q.total_notional-ie.total_notional:K==="-price"?Xe(ie)-Xe(Q):K==="price"?Xe(Q)-Xe(ie):K==="-long_notional"?ie.long_notional-Q.long_notional:K==="long_notional"?Q.long_notional-ie.long_notional:K==="-short_notional"?ie.short_notional-Q.short_notional:K==="short_notional"?Q.short_notional-ie.short_notional:K==="-total_long_pnl"?ie.total_long_pnl-Q.total_long_pnl:K==="total_long_pnl"?Q.total_long_pnl-ie.total_long_pnl:K==="-total_short_pnl"?ie.total_short_pnl-Q.total_short_pnl:K==="total_short_pnl"?Q.total_short_pnl-ie.total_short_pnl:K==="-majority_side"?te-V:K==="majority_side"?fe-ae:K==="-l_s_ratio"?ie.l_s_ratio-Q.l_s_ratio:K==="l_s_ratio"?Q.l_s_ratio-ie.l_s_ratio:K==="-long_ratio"?ie.long_ratio-Q.long_ratio:K==="long_ratio"?Q.long_ratio-ie.long_ratio:K==="-short_ratio"?ie.short_ratio-Q.short_ratio:K==="short_ratio"?Q.short_ratio-ie.short_ratio:K==="-maj_side_notional"?ie.maj_side_notional-Q.maj_side_notional:K==="maj_side_notional"?Q.maj_side_notional-ie.maj_side_notional:K==="-maj_side_pnl"?me-Ne:K==="maj_side_pnl"?xe-we:K==="-traders_l_s"?Pe-je:K==="traders_l_s"?je-Pe:K==="-open_interest"?ie.open_interest-Q.open_interest:K==="open_interest"?Q.open_interest-ie.open_interest:K==="-change_24h"?Re(ie)-Re(Q):K==="change_24h"?Re(Q)-Re(ie):0})},C=m.useRef(null),N=()=>{C.current&&(C.current.scrollLeft-=100)},P=()=>{C.current&&(C.current.scrollLeft+=100)},I=()=>{C.current&&(C.current.scrollTop+=200)},R=()=>{C.current&&(C.current.scrollTop-=200)},O=K=>{var re;K.key==="Escape"&&(g(""),(re=v.current)==null||re.blur())},U=({coin:K,price:re,prevPricesRef:he})=>{const[Q,ie]=m.useState("text-white");return m.useEffect(()=>{if(!K||re==null||isNaN(re))return;const oe=parseFloat(re),G=he.current[K]??0;oe>G?ie("text-[#1DE6A3]"):oe<G&&ie("text-[#FF7173]"),he.current[K]=oe;const V=setTimeout(()=>{ie("text-white")},800);return()=>clearTimeout(V)},[re,K]),i.jsx(Xx,{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?Ww(re):re}`,textColor:Q})},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=K=>K>=376&&K<500?4:K>=500&&K<640?5:K>=640&&K<768?6:K>=768&&K<1024?7:K>=1024&&K<1280?9:K>=1280&&K<1540?11:K>=1540&&K<1700||K>=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(con,{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:K=>g(K.target.value),onKeyDown:O,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:$a,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(JY,{title:"All",set_click:()=>d("All"),tableSortButton:u}),i.jsx(JY,{title:"LONG",set_click:()=>d("LONG"),tableSortButton:u}),i.jsx(JY,{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(Qa,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),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 block lg:hidden",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Qa,{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(Qa,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),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",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Qa,{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(Ah,{title:"Coin",sortKey:"asset",sortOption:l,setSortOption:c,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[120px] px-1",children:i.jsx(Ah,{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(Ah,{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(Ah,{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(Ah,{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(Ah,{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(Ah,{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(Ah,{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(Ah,{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(Ah,{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(Ah,{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(Ah,{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(Ba,{})})})}):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(Ul,{})})})}):((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(jUe,{})})})}):(J=w(l))==null?void 0:J.map((K,re)=>{var he,Q,ie,oe,G,V,te,ae,fe,Ne,me,we,xe,ye,je,Pe,Re,Xe;return i.jsx(Ae.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/${K==null?void 0:K.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[K==null?void 0:K.asset]||((he=K==null?void 0:K.asset)==null?void 0:he.split("/")[0])}.svg`||dummyImage,alt:K==null?void 0:K.asset,className:"rounded-full w-5 h-5 min-w-5 min-h-5 bg-gray-700",loading:"lazy",onError:Ke=>hm(Ke)}),i.jsx(Xx,{info:K!=null&&K.asset?K==null?void 0:K.asset:"--",textColor:"text-white"}),i.jsx("div",{className:"flex justify-center items-center rounded",children:i.jsx("img",{src:bm,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:`${K.majority_side=="LONG"?"text-[#67ffbd] bg-[#67ffbd]/20":K.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:K.majority_side=="LONG"?i.jsx(Fs,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):K.majority_side=="SHORT"?i.jsx(Fs,{className:"text-[#FF797C] w-3 h-3"}):i.jsx(Fs,{className:"text-[#67FFBD] rotate-180 w-3 h-3"})})}),i.jsx("div",{className:" text-[11px] font-semibold font-manrope leading-[8px] tracking-wide",children:K.majority_side?K.majority_side:"--"})]})})}),i.jsx("td",{className:"px-1",children:i.jsx(U,{coin:K==null?void 0:K.asset,price:(Q=K==null?void 0:K.asset_change24h)==null?void 0:Q.markPx,prevPricesRef:f})}),i.jsx("td",{className:"px-1",children:i.jsx(don,{info:((ie=K==null?void 0:K.asset_change24h)==null?void 0:ie.markPx)-((oe=K==null?void 0:K.asset_change24h)==null?void 0:oe.prevDayPx)?((G=K==null?void 0:K.asset_change24h)==null?void 0:G.markPx)-((V=K==null?void 0:K.asset_change24h)==null?void 0:V.prevDayPx)>0?"+"+Math.abs(parseFloat(((te=K==null?void 0:K.asset_change24h)==null?void 0:te.markPx)-((ae=K==null?void 0:K.asset_change24h)==null?void 0:ae.prevDayPx)).toFixed(5)):"-"+Math.abs(parseFloat(((fe=K==null?void 0:K.asset_change24h)==null?void 0:fe.markPx)-((Ne=K==null?void 0:K.asset_change24h)==null?void 0:Ne.prevDayPx)).toFixed(5)):z(),info_2:(((me=K==null?void 0:K.asset_change24h)==null?void 0:me.markPx)-((we=K==null?void 0:K.asset_change24h)==null?void 0:we.prevDayPx))/((xe=K==null?void 0:K.asset_change24h)==null?void 0:xe.prevDayPx)*100,color_1:`${((ye=K==null?void 0:K.asset_change24h)==null?void 0:ye.markPx)-((je=K==null?void 0:K.asset_change24h)==null?void 0:je.prevDayPx)>=0?"text-[#1DE6A3]":"text-[#FF7173]"}`,color_2:`${(((Pe=K==null?void 0:K.asset_change24h)==null?void 0:Pe.markPx)-((Re=K==null?void 0:K.asset_change24h)==null?void 0:Re.prevDayPx))/((Xe=K==null?void 0:K.asset_change24h)==null?void 0:Xe.prevDayPx)*100>0?"text-[#1DE6A3]":"text-[#FF7173]"}`})}),i.jsx("td",{className:"px-1",children:i.jsx(Xx,{info:(K==null?void 0:K.total_long_pnl)==null||isNaN(parseFloat(K==null?void 0:K.total_long_pnl))?"--":`$${td(Math.abs(K==null?void 0:K.total_long_pnl))}`,textColor:`${(K==null?void 0:K.total_long_pnl)==null||isNaN(parseFloat(K==null?void 0:K.total_long_pnl))||(K==null?void 0:K.total_long_pnl)==0?"text-white":(K==null?void 0:K.total_long_pnl)>0?"text-[#1DE6A3]":"text-[#FF7173]"}`})}),i.jsx("td",{className:"px-1",children:i.jsx(Xx,{info:(K==null?void 0:K.total_short_pnl)==null||isNaN(parseFloat(K==null?void 0:K.total_short_pnl))?"--":`$${td(Math.abs(K==null?void 0:K.total_short_pnl))}`,textColor:`${(K==null?void 0:K.total_short_pnl)==null||isNaN(parseFloat(K==null?void 0:K.total_short_pnl))||(K==null?void 0:K.total_short_pnl)==0?"text-white":(K==null?void 0:K.total_short_pnl)>0?"text-[#1DE6A3]":"text-[#FF7173]"}`})}),i.jsx("td",{className:"px-1",children:i.jsx(Xx,{info:(K==null?void 0:K.long_notional)==null||isNaN(parseFloat(K==null?void 0:K.long_notional))?"--":`$${td(K==null?void 0:K.long_notional)}`,textColor:"text-white"})}),i.jsx("td",{className:"px-1",children:i.jsx(Xx,{info:(K==null?void 0:K.short_notional)==null||isNaN(parseFloat(K==null?void 0:K.short_notional))?"--":`$${td(K==null?void 0:K.short_notional)}`,textColor:"text-white"})}),i.jsx("td",{className:"px-1",children:i.jsx(Xx,{info:(K==null?void 0:K.total_notional)==null||isNaN(parseFloat(K==null?void 0:K.total_notional))?"--":`$${td(K==null?void 0:K.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(Pne,{data_1:K!=null&&K.long_ratio?parseFloat(K==null?void 0:K.long_ratio).toFixed(2):0,data_2:K!=null&&K.short_ratio?parseFloat(K==null?void 0:K.short_ratio).toFixed(2):0,margin:"false"})})})}),i.jsx("td",{className:"px-1",children:i.jsx(Xx,{info:K!=null&&K.traders_l_s?K==null?void 0:K.traders_l_s:"--",textColor:"text-white"})}),i.jsx("td",{className:"pr-4",children:i.jsx(Xx,{info:(K==null?void 0:K.open_interest)==null||isNaN(parseFloat(K==null?void 0:K.open_interest))?"--":`$${td(K==null?void 0:K.open_interest)}`,textColor:"text-white"})})]})},re)})})]})})]})]})})},Xx=({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})}),don=({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})}),JY=({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}),fon=()=>{ts();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(Qr),[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}],P=parseInt(localStorage.getItem("ticker_period")),I=!isNaN(P)&&N[P]?N[P].value:N[1].value,[R,O]=m.useState(I),U=z=>{O(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 K=JSON.parse(J==null?void 0:J.data);if(K.channel==="webData2"){const he=K.data,Q=he.assetCtxs,ie=(re=he.meta)==null?void 0:re.universe;if(Array.isArray(Q)&&Array.isArray(ie)){const oe=Q.map((G,V)=>{var te;return{...G,name:((te=ie[V])==null?void 0:te.name)??null}});x(G=>{if(!G||!Array.isArray(G.data))return G;const V=G.data.map(te=>{const ae=oe.find(fe=>fe.name===te.asset);return ae?{...te,asset_change24h:ae}:te});return{...G,data:V}})}else console.error("missing assetCtxs or universe:",{assetCtxs:Q,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,K;const X=window.localStorage.getItem("hyperToken"),ne=window.localStorage.getItem("hyperAddress");if(!(!X||!ne))try{const re=await _i(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((K=re==null?void 0:re.mushboomer_counts)==null?void 0:K.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(No,{children:i.jsx(Lo,{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(uon,{data:f,loading:g,error:w,period:R,periods:N,handlePeriodChange:U})})})]})},Hce=m.createContext({});function Vce(e){const t=m.useRef(null);return t.current===null&&(t.current=e()),t.current}const Wce=typeof window<"u",tze=Wce?m.useLayoutEffect:m.useEffect,hU=m.createContext(null),zP=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function hon(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 pon=40;function nze(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=zP.reduce((I,R)=>(I[R]=hon(a),I),{}),{setup:l,read:c,resolveKeyframes:u,preUpdate:d,update:f,preRender:x,render:g,postRender:v}=o,w=()=>{const I=Mc.useManualTiming?s.timestamp:performance.now();n=!1,Mc.useManualTiming||(s.delta=r?1e3/60:Math.max(Math.min(I-s.timestamp,pon),1)),s.timestamp=I,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:zP.reduce((I,R)=>{const O=o[R];return I[R]=(U,L=!1,z=!1)=>(n||C(),O.schedule(U,L,z)),I},{}),cancel:I=>{for(let R=0;R<zP.length;R++)o[zP[R]].cancel(I)},state:s,steps:o}}const{schedule:Mo,cancel:Xy,state:Yc,steps:eX}=nze(typeof requestAnimationFrame<"u"?requestAnimationFrame:ll,!0);let CO;function mon(){CO=void 0}const tf={now:()=>(CO===void 0&&tf.set(Yc.isProcessing||Mc.useManualTiming?Yc.timestamp:performance.now()),CO),set:e=>{CO=e,queueMicrotask(mon)}},rze=e=>t=>typeof t=="string"&&t.startsWith(e),qce=rze("--"),xon=rze("var(--"),Gce=e=>xon(e)?gon.test(e.split("/*")[0].trim()):!1,gon=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,i8={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},B_={...i8,transform:e=>Oc(0,1,e)},HP={...i8,default:1},d9=e=>Math.round(e*1e5)/1e5,Kce=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function bon(e){return e==null}const yon=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Yce=(e,t)=>n=>!!(typeof n=="string"&&yon.test(n)&&n.startsWith(e)||t&&!bon(n)&&Object.prototype.hasOwnProperty.call(n,t)),sze=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,a,o,l]=r.match(Kce);return{[e]:parseFloat(s),[t]:parseFloat(a),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},von=e=>Oc(0,255,e),tX={...i8,transform:e=>Math.round(von(e))},cw={test:Yce("rgb","red"),parse:sze("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+tX.transform(e)+", "+tX.transform(t)+", "+tX.transform(n)+", "+d9(B_.transform(r))+")"};function won(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 Fne={test:Yce("#"),parse:won,transform:cw.transform},mT=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Eb=mT("deg"),W0=mT("%"),ci=mT("px"),Con=mT("vh"),Son=mT("vw"),FCe={...W0,parse:e=>W0.parse(e)/100,transform:e=>W0.transform(e*100)},zC={test:Yce("hsl","hue"),parse:sze("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+W0.transform(d9(t))+", "+W0.transform(d9(n))+", "+d9(B_.transform(r))+")"},Ll={test:e=>cw.test(e)||Fne.test(e)||zC.test(e),parse:e=>cw.test(e)?cw.parse(e):zC.test(e)?zC.parse(e):Fne.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?cw.transform(e):zC.transform(e),getAnimatableNone:e=>{const t=Ll.parse(e);return t.alpha=0,Ll.transform(t)}},Non=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Aon(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Kce))==null?void 0:t.length)||0)+(((n=e.match(Non))==null?void 0:n.length)||0)>0}const ize="number",aze="color",jon="var",Eon="var(",OCe="${}",_on=/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 $_(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let a=0;const l=t.replace(_on,c=>(Ll.test(c)?(r.color.push(a),s.push(aze),n.push(Ll.parse(c))):c.startsWith(Eon)?(r.var.push(a),s.push(jon),n.push(c)):(r.number.push(a),s.push(ize),n.push(parseFloat(c))),++a,OCe)).split(OCe);return{values:n,split:l,indexes:r,types:s}}function oze(e){return $_(e).values}function lze(e){const{split:t,types:n}=$_(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===ize?a+=d9(s[o]):l===aze?a+=Ll.transform(s[o]):a+=s[o]}return a}}const kon=e=>typeof e=="number"?0:Ll.test(e)?Ll.getAnimatableNone(e):e;function Ton(e){const t=oze(e);return lze(e)(t.map(kon))}const Qy={test:Aon,parse:oze,createTransformer:lze,getAnimatableNone:Ton};function nX(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 Ion({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=nX(c,l,e+1/3),a=nX(c,l,e),o=nX(c,l,e-1/3)}return{red:Math.round(s*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function GL(e,t){return n=>n>0?t:e}const Ho=(e,t,n)=>e+(t-e)*n,rX=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},Pon=[Fne,cw,zC],Fon=e=>Pon.find(t=>t.test(e));function MCe(e){const t=Fon(e);if(!t)return!1;let n=t.parse(e);return t===zC&&(n=Ion(n)),n}const RCe=(e,t)=>{const n=MCe(e),r=MCe(t);if(!n||!r)return GL(e,t);const s={...n};return a=>(s.red=rX(n.red,r.red,a),s.green=rX(n.green,r.green,a),s.blue=rX(n.blue,r.blue,a),s.alpha=Ho(n.alpha,r.alpha,a),cw.transform(s))},One=new Set(["none","hidden"]);function Oon(e,t){return One.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Mon(e,t){return n=>Ho(e,t,n)}function Xce(e){return typeof e=="number"?Mon:typeof e=="string"?Gce(e)?GL:Ll.test(e)?RCe:Don:Array.isArray(e)?cze:typeof e=="object"?Ll.test(e)?RCe:Ron:GL}function cze(e,t){const n=[...e],r=n.length,s=e.map((a,o)=>Xce(a)(a,t[o]));return a=>{for(let o=0;o<r;o++)n[o]=s[o](a);return n}}function Ron(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Xce(e[s])(e[s],t[s]));return s=>{for(const a in r)n[a]=r[a](s);return n}}function Lon(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 Don=(e,t)=>{const n=Qy.createTransformer(t),r=$_(e),s=$_(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?One.has(e)&&!s.values.length||One.has(t)&&!r.values.length?Oon(e,t):dx(cze(Lon(r,s),s.values),n):GL(e,t)};function uze(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Ho(e,t,n):Xce(e)(e,t)}const Bon=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Mo.update(t,n),stop:()=>Xy(t),now:()=>Yc.isProcessing?Yc.timestamp:tf.now()}},dze=(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)})`},KL=2e4;function Qce(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<KL;)t+=n,r=e.next(t);return t>=KL?1/0:t}function $on(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(Qce(r),KL);return{type:"keyframes",ease:a=>r.next(s*a).value/t,duration:il(s)}}const Uon=5;function fze(e,t,n){const r=Math.max(t-Uon,0);return BD(n-e(r),t-r)}const nl={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},LCe=.001;function zon({duration:e=nl.duration,bounce:t=nl.bounce,velocity:n=nl.velocity,mass:r=nl.mass}){let s,a,o=1-t;o=Oc(nl.minDamping,nl.maxDamping,o),e=Oc(nl.minDuration,nl.maxDuration,il(e)),o<1?(s=u=>{const d=u*o,f=d*e,x=d-n,g=Mne(u,o),v=Math.exp(-f);return LCe-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=Mne(Math.pow(u,2),o);return(-s(u)+LCe>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=Von(s,a,l);if(e=zl(e),isNaN(c))return{stiffness:nl.stiffness,damping:nl.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:e}}}const Hon=12;function Von(e,t,n){let r=n;for(let s=1;s<Hon;s++)r=r-e(r)/t(r);return r}function Mne(e,t){return e*Math.sqrt(1-t*t)}const Won=["duration","bounce"],qon=["stiffness","damping","mass"];function DCe(e,t){return t.some(n=>e[n]!==void 0)}function Gon(e){let t={velocity:nl.velocity,stiffness:nl.stiffness,damping:nl.damping,mass:nl.mass,isResolvedFromDuration:!1,...e};if(!DCe(e,qon)&&DCe(e,Won))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,a=2*Oc(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:nl.mass,stiffness:s,damping:a}}else{const n=zon(e);t={...t,...n,mass:nl.mass},t.isResolvedFromDuration=!0}return t}function YL(e=nl.visualDuration,t=nl.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}=Gon({...n,velocity:-il(n.velocity||0)}),v=x||0,w=u/(2*Math.sqrt(c*d)),C=o-a,N=il(Math.sqrt(c/d)),P=Math.abs(C)<5;r||(r=P?nl.restSpeed.granular:nl.restSpeed.default),s||(s=P?nl.restDelta.granular:nl.restDelta.default);let I;if(w<1){const O=Mne(N,w);I=U=>{const L=Math.exp(-w*N*U);return o-L*((v+w*N*C)/O*Math.sin(O*U)+C*Math.cos(O*U))}}else if(w===1)I=O=>o-Math.exp(-N*O)*(C+(v+N*C)*O);else{const O=N*Math.sqrt(w*w-1);I=U=>{const L=Math.exp(-w*N*U),z=Math.min(O*U,300);return o-L*((v+w*N*C)*Math.sinh(z)+O*C*Math.cosh(z))/O}}const R={calculatedDuration:g&&f||null,next:O=>{const U=I(O);if(g)l.done=O>=f;else{let L=O===0?v:0;w<1&&(L=O===0?zl(v):fze(I,O,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 O=Math.min(Qce(R),KL),U=dze(L=>R.next(O*L).value,O,30);return O+"ms "+U},toTransition:()=>{}};return R}YL.applyToOptions=e=>{const t=$on(e,100,YL);return e.ease=t.ease,e.duration=zl(t.duration),e.type="keyframes",e};function Rne({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 P=z=>-w*Math.exp(-z/r),I=z=>N+P(z),R=z=>{const X=P(z),ne=I(z);x.done=Math.abs(X)<=u,x.value=x.done?N:ne};let O,U;const L=z=>{g(x.value)&&(O=z,U=YL({keyframes:[x.value,v(x.value)],velocity:fze(I,z,x.value),damping:s,stiffness:a,restDelta:u,restSpeed:d}))};return L(0),{calculatedDuration:null,next:z=>{let X=!1;return!U&&O===void 0&&(X=!0,R(z),L(z)),O!==void 0&&z>=O?U.next(z-O):(!X&&R(z),x)}}}function Kon(e,t,n){const r=[],s=n||Mc.mix||uze,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]||ll:t;l=dx(c,l)}r.push(l)}return r}function Yon(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const a=e.length;if(ES(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=Kon(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=Y0(e[f],e[f+1],d);return l[f](x)};return n?d=>u(Oc(e[0],e[a-1],d)):u}function Xon(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Y0(0,t,r);e.push(Ho(n,1,s))}}function Qon(e){const t=[0];return Xon(t,e.length-1),t}function Zon(e,t){return e.map(n=>n*t)}function Jon(e,t){return e.map(()=>t||dse).splice(0,e.length-1)}function f9({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=b8e(r)?r.map(HO):HO(r),a={done:!1,value:t[0]},o=Zon(n&&n.length===t.length?n:Qon(t),e),l=Yon(o,t,{ease:Array.isArray(s)?s:Jon(t,s)});return{calculatedDuration:e,next:c=>(a.value=l(c),a.done=c>=e,a)}}const eln=e=>e!==null;function Zce(e,{repeat:t,repeatType:n="loop"},r,s=1){const a=e.filter(eln),l=s<0||t&&n!=="loop"&&t%2===1?0:a.length-1;return!l||r===void 0?a[l]:r}const tln={decay:Rne,inertia:Rne,tween:f9,keyframes:f9,spring:YL};function hze(e){typeof e.type=="string"&&(e.type=tln[e.type])}class Jce{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 nln=e=>e/100;class eue extends Jce{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!==tf.now()&&this.tick(tf.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;hze(t);const{type:n=f9,repeat:r=0,repeatDelay:s=0,repeatType:a,velocity:o=0}=t;let{keyframes:l}=t;const c=n||f9;c!==f9&&typeof l[0]!="number"&&(this.mixKeyframes=dx(nln,uze(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=Qce(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),P=this.playbackSpeed>=0?N<0:N>s;this.currentTime=Math.max(N,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let I=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)),I=Oc(0,1,ne)*l}const O=P?{done:!1,value:d[0]}:R.next(I);a&&(O.value=a(O.value));let{done:U}=O;!P&&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!==Rne&&(O.value=Zce(d,this.options,C,this.speed)),w&&w(O.value),L&&this.finish(),O}then(t,n){return this.finished.then(t,n)}get duration(){return il(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+il(t)}get time(){return il(this.currentTime)}set time(t){var n;t=zl(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(tf.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=il(this.currentTime))}play(){var s,a;if(this.isStopped)return;const{driver:t=Bon,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(tf.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 rln(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const uw=e=>e*180/Math.PI,Lne=e=>{const t=uw(Math.atan2(e[1],e[0]));return Dne(t)},sln={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Lne,rotateZ:Lne,skewX:e=>uw(Math.atan(e[1])),skewY:e=>uw(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Dne=e=>(e=e%360,e<0&&(e+=360),e),BCe=Lne,$Ce=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),UCe=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),iln={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:$Ce,scaleY:UCe,scale:e=>($Ce(e)+UCe(e))/2,rotateX:e=>Dne(uw(Math.atan2(e[6],e[5]))),rotateY:e=>Dne(uw(Math.atan2(-e[2],e[0]))),rotateZ:BCe,rotate:BCe,skewX:e=>uw(Math.atan(e[4])),skewY:e=>uw(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Bne(e){return e.includes("scale")?1:0}function $ne(e,t){if(!e||e==="none")return Bne(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=iln,s=n;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=sln,s=l}if(!s)return Bne(t);const a=r[t],o=s[1].split(",").map(oln);return typeof a=="function"?a(o):o[a]}const aln=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return $ne(n,t)};function oln(e){return parseFloat(e.trim())}const a8=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],o8=new Set(a8),zCe=e=>e===i8||e===ci,lln=new Set(["x","y","z"]),cln=a8.filter(e=>!lln.has(e));function uln(e){const t=[];return cln.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const c3={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})=>$ne(t,"x"),y:(e,{transform:t})=>$ne(t,"y")};c3.translateX=c3.x;c3.translateY=c3.y;const u3=new Set;let Une=!1,zne=!1,Hne=!1;function pze(){if(zne){const e=Array.from(u3).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=uln(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)})}zne=!1,Une=!1,u3.forEach(e=>e.complete(Hne)),u3.clear()}function mze(){u3.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(zne=!0)})}function dln(){Hne=!0,mze(),pze(),Hne=!1}class tue{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?(u3.add(this),Une||(Une=!0,Mo.read(mze),Mo.resolveKeyframes(pze))):(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])}rln(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),u3.delete(this)}cancel(){this.state==="scheduled"&&(u3.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const fln=e=>e.startsWith("--");function hln(e,t,n){fln(t)?e.style.setProperty(t,n):e.style[t]=n}const pln=oA(()=>window.ScrollTimeline!==void 0),mln={};function xln(e,t){const n=oA(e);return()=>mln[t]??n()}const xze=xln(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Pj=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,HCe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Pj([0,.65,.55,1]),circOut:Pj([.55,0,1,.45]),backIn:Pj([.31,.01,.66,-.59]),backOut:Pj([.33,1.53,.69,.99])};function gze(e,t){if(e)return typeof e=="function"?xze()?dze(e,t):"ease-out":fse(e)?Pj(e):Array.isArray(e)?e.map(n=>gze(n,t)||HCe.easeOut):HCe[e]}function gln(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=gze(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 bze(e){return typeof e=="function"&&"applyToOptions"in e}function bln({type:e,...t}){return bze(e)&&xze()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class yln extends Jce{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,ES(typeof t.type!="string");const u=bln(t);this.animation=gln(n,r,s,u,a),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const d=Zce(s,this.options,l,this.speed);this.updateMotionValue?this.updateMotionValue(d):hln(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 il(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+il(t)}get time(){return il(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=zl(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&&pln()?(this.animation.timeline=t,ll):n(this)}}const yze={anticipate:ose,backInOut:ase,circInOut:use};function vln(e){return e in yze}function wln(e){typeof e.ease=="string"&&vln(e.ease)&&(e.ease=yze[e.ease])}const VCe=10;class Cln extends yln{constructor(t){wln(t),hze(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 eue({...o,autoplay:!1}),c=zl(this.finishedTime??this.time);n.setWithVelocity(l.sample(c-VCe).value,l.sample(c).value,VCe),l.stop()}}const WCe=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Qy.test(e)||e==="0")&&!e.startsWith("url("));function Sln(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 Nln(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=WCe(s,t),l=WCe(a,t);return!o||!l?!1:Sln(e)||(n==="spring"||bze(n))&&r}function Vne(e){e.duration=0,e.type="keyframes"}const Aln=new Set(["opacity","clipPath","filter","transform"]),jln=oA(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Eln(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 jln()&&n&&Aln.has(n)&&(n!=="transform"||!u)&&!c&&!r&&s!=="mirror"&&a!==0&&o!=="inertia"}const _ln=40;class kln extends Jce{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=tf.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)||tue;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=tf.now(),Nln(t,a,o,l)||((Mc.instantAnimations||!c)&&(d==null||d(Zce(t,r,n))),t[0]=t[t.length-1],Vne(r),r.repeat=0);const x={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>_ln?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},g=!u&&Eln(x)?new Cln({...x,element:x.motionValue.owner.current}):new eue(x);g.finished.then(()=>this.notifyFinished()).catch(ll),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(),dln()),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 Tln=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Iln(e){const t=Tln.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function vze(e,t,n=1){const[r,s]=Iln(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const o=a.trim();return RD(o)?parseFloat(o):o}return Gce(s)?vze(s,t,n+1):s}function nue(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const wze=new Set(["width","height","top","left","right","bottom",...a8]),Pln={test:e=>e==="auto",parse:e=>e},Cze=e=>t=>t.test(e),Sze=[i8,ci,W0,Eb,Son,Con,Pln],qCe=e=>Sze.find(Cze(e));function Fln(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||DD(e):!0}const Oln=new Set(["brightness","contrast","saturate","opacity"]);function Mln(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Kce)||[];if(!r)return e;const s=n.replace(r,"");let a=Oln.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+s+")"}const Rln=/\b([a-z-]*)\(.*?\)/gu,Wne={...Qy,getAnimatableNone:e=>{const t=e.match(Rln);return t?t.map(Mln).join(" "):e}},GCe={...i8,transform:Math.round},Lln={rotate:Eb,rotateX:Eb,rotateY:Eb,rotateZ:Eb,scale:HP,scaleX:HP,scaleY:HP,scaleZ:HP,skew:Eb,skewX:Eb,skewY:Eb,distance:ci,translateX:ci,translateY:ci,translateZ:ci,x:ci,y:ci,z:ci,perspective:ci,transformPerspective:ci,opacity:B_,originX:FCe,originY:FCe,originZ:ci},rue={borderWidth:ci,borderTopWidth:ci,borderRightWidth:ci,borderBottomWidth:ci,borderLeftWidth:ci,borderRadius:ci,radius:ci,borderTopLeftRadius:ci,borderTopRightRadius:ci,borderBottomRightRadius:ci,borderBottomLeftRadius:ci,width:ci,maxWidth:ci,height:ci,maxHeight:ci,top:ci,right:ci,bottom:ci,left:ci,padding:ci,paddingTop:ci,paddingRight:ci,paddingBottom:ci,paddingLeft:ci,margin:ci,marginTop:ci,marginRight:ci,marginBottom:ci,marginLeft:ci,backgroundPositionX:ci,backgroundPositionY:ci,...Lln,zIndex:GCe,fillOpacity:B_,strokeOpacity:B_,numOctaves:GCe},Dln={...rue,color:Ll,backgroundColor:Ll,outlineColor:Ll,fill:Ll,stroke:Ll,borderColor:Ll,borderTopColor:Ll,borderRightColor:Ll,borderBottomColor:Ll,borderLeftColor:Ll,filter:Wne,WebkitFilter:Wne},Nze=e=>Dln[e];function Aze(e,t){let n=Nze(e);return n!==Wne&&(n=Qy),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Bln=new Set(["auto","none","0"]);function $ln(e,t,n){let r=0,s;for(;r<e.length&&!s;){const a=e[r];typeof a=="string"&&!Bln.has(a)&&$_(a).values.length&&(s=e[r]),r++}if(s&&n)for(const a of t)e[a]=Aze(n,s)}class Uln extends tue{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(),Gce(u))){const d=vze(u,n.current);d!==void 0&&(t[c]=d),c===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!wze.has(r)||t.length!==2)return;const[s,a]=t,o=qCe(s),l=qCe(a);if(o!==l)if(zCe(o)&&zCe(l))for(let c=0;c<t.length;c++){const u=t[c];typeof u=="string"&&(t[c]=parseFloat(u))}else c3[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||Fln(t[s]))&&r.push(s);r.length&&$ln(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=c3[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]=c3[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 zln(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 jze=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Eze(e){return LD(e)&&"offsetHeight"in e}const KCe=30,Hln=e=>!isNaN(parseFloat(e));class Vln{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var a;const s=tf.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=tf.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Hln(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 lA);const r=this.events[t].add(n);return t==="change"?()=>{r(),Mo.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=tf.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>KCe)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,KCe);return BD(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 GN(e,t){return new Vln(e,t)}const{schedule:sue,cancel:wvn}=nze(queueMicrotask,!1),Rp={x:!1,y:!1};function _ze(){return Rp.x||Rp.y}function Wln(e){return e==="x"||e==="y"?Rp[e]?null:(Rp[e]=!0,()=>{Rp[e]=!1}):Rp.x||Rp.y?null:(Rp.x=Rp.y=!0,()=>{Rp.x=Rp.y=!1})}function kze(e,t){const n=zln(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function YCe(e){return!(e.pointerType==="touch"||_ze())}function qln(e,t,n={}){const[r,s,a]=kze(e,n),o=l=>{if(!YCe(l))return;const{target:c}=l,u=t(c,l);if(typeof u!="function"||!c)return;const d=f=>{YCe(f)&&(u(f),c.removeEventListener("pointerleave",d))};c.addEventListener("pointerleave",d,s)};return r.forEach(l=>{l.addEventListener("pointerenter",o,s)}),a}const Tze=(e,t)=>t?e===t?!0:Tze(e,t.parentElement):!1,iue=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Gln=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Kln(e){return Gln.has(e.tagName)||e.tabIndex!==-1}const SO=new WeakSet;function XCe(e){return t=>{t.key==="Enter"&&e(t)}}function sX(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Yln=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=XCe(()=>{if(SO.has(n))return;sX(n,"down");const s=XCe(()=>{sX(n,"up")}),a=()=>sX(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 QCe(e){return iue(e)&&!_ze()}function Xln(e,t,n={}){const[r,s,a]=kze(e,n),o=l=>{const c=l.currentTarget;if(!QCe(l))return;SO.add(c);const u=t(c,l),d=(g,v)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",x),SO.has(c)&&SO.delete(c),QCe(g)&&typeof u=="function"&&u(g,{success:v})},f=g=>{d(g,c===window||c===document||n.useGlobalTarget||Tze(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),Eze(l)&&(l.addEventListener("focus",u=>Yln(u,s)),!Kln(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),a}function Ize(e){return LD(e)&&"ownerSVGElement"in e}function Qln(e){return Ize(e)&&e.tagName==="svg"}const Mu=e=>!!(e&&e.getVelocity),Zln=[...Sze,Ll,Qy],Jln=e=>Zln.find(Cze(e)),aue=m.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function ZCe(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ecn(...e){return t=>{let n=!1;const r=e.map(s=>{const a=ZCe(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():ZCe(e[s],null)}}}}function tcn(...e){return m.useCallback(ecn(...e),e)}class ncn extends m.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,s=Eze(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 rcn({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(aue),c=tcn(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(ncn,{isPresent:t,childRef:a,sizeRef:o,children:m.cloneElement(e,{ref:c})})}const scn=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:a,mode:o,anchorX:l,root:c})=>{const u=Vce(icn),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(rcn,{isPresent:n,anchorX:l,root:c,children:e})),i.jsx(hU.Provider,{value:x,children:e})};function icn(){return new Map}function Pze(e=!0){const t=m.useContext(hU);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 VP=e=>e.key||"";function JCe(e){const t=[];return m.Children.forEach(e,n=>{m.isValidElement(n)&&t.push(n)}),t}const xT=({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]=Pze(o),f=m.useMemo(()=>JCe(e),[e]),x=o&&!u?[]:f.map(VP),g=m.useRef(!0),v=m.useRef(f),w=Vce(()=>new Map),[C,N]=m.useState(f),[P,I]=m.useState(f);tze(()=>{g.current=!1,v.current=f;for(let U=0;U<P.length;U++){const L=VP(P[U]);x.includes(L)?w.delete(L):w.get(L)!==!0&&w.set(L,!1)}},[P,x.length,x.join("-")]);const R=[];if(f!==C){let U=[...f];for(let L=0;L<P.length;L++){const z=P[L],X=VP(z);x.includes(X)||(U.splice(L,0,z),R.push(z))}return a==="wait"&&R.length&&(U=R),I(JCe(U)),N(f),null}const{forceRender:O}=m.useContext(Hce);return i.jsx(i.Fragment,{children:P.map(U=>{const L=VP(U),z=o&&!u?!1:f===P||x.includes(L),X=()=>{if(w.has(L))w.set(L,!0);else return;let ne=!0;w.forEach(J=>{J||(ne=!1)}),ne&&(O==null||O(),I(v.current),o&&(d==null||d()),r&&r())};return i.jsx(scn,{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)})})},Fze=m.createContext({strict:!1}),e4e={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"]},KN={};for(const e in e4e)KN[e]={isEnabled:t=>e4e[e].some(n=>!!t[n])};function acn(e){for(const t in e)KN[t]={...KN[t],...e[t]}}const ocn=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 XL(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||ocn.has(e)}let Oze=e=>!XL(e);function lcn(e){typeof e=="function"&&(Oze=t=>t.startsWith("on")?!XL(t):e(t))}try{lcn(require("@emotion/is-prop-valid").default)}catch{}function ccn(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(Oze(s)||n===!0&&XL(s)||!t&&!XL(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const pU=m.createContext({});function mU(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function U_(e){return typeof e=="string"||Array.isArray(e)}const oue=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],lue=["initial",...oue];function xU(e){return mU(e.animate)||lue.some(t=>U_(e[t]))}function Mze(e){return!!(xU(e)||e.variants)}function ucn(e,t){if(xU(e)){const{initial:n,animate:r}=e;return{initial:n===!1||U_(n)?n:void 0,animate:U_(r)?r:void 0}}return e.inherit!==!1?t:{}}function dcn(e){const{initial:t,animate:n}=ucn(e,m.useContext(pU));return m.useMemo(()=>({initial:t,animate:n}),[t4e(t),t4e(n)])}function t4e(e){return Array.isArray(e)?e.join(" "):e}const z_={};function fcn(e){for(const t in e)z_[t]=e[t],qce(t)&&(z_[t].isCSSVariable=!0)}function Rze(e,{layout:t,layoutId:n}){return o8.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!z_[e]||e==="opacity")}const hcn={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},pcn=a8.length;function mcn(e,t,n){let r="",s=!0;for(let a=0;a<pcn;a++){const o=a8[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=jze(l,rue[o]);if(!c){s=!1;const d=hcn[o]||o;r+=`${d}(${u}) `}n&&(t[o]=u)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function cue(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(o8.has(c)){o=!0;continue}else if(qce(c)){s[c]=u;continue}else{const d=jze(u,rue[c]);c.startsWith("origin")?(l=!0,a[c]=d):r[c]=d}}if(t.transform||(o||n?r.transform=mcn(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 uue=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Lze(e,t,n){for(const r in t)!Mu(t[r])&&!Rze(r,n)&&(e[r]=t[r])}function xcn({transformTemplate:e},t){return m.useMemo(()=>{const n=uue();return cue(n,t,e),Object.assign({},n.vars,n.style)},[t])}function gcn(e,t){const n=e.style||{},r={};return Lze(r,n,e),Object.assign(r,xcn(e,t)),r}function bcn(e,t){const n={},r=gcn(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 ycn={offset:"stroke-dashoffset",array:"stroke-dasharray"},vcn={offset:"strokeDashoffset",array:"strokeDasharray"};function wcn(e,t,n=1,r=0,s=!0){e.pathLength=1;const a=s?ycn:vcn;e[a.offset]=ci.transform(-r);const o=ci.transform(t),l=ci.transform(n);e[a.array]=`${o} ${l}`}function Dze(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:a=1,pathOffset:o=0,...l},c,u,d){if(cue(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&&wcn(f,s,a,o,!1)}const Bze=()=>({...uue(),attrs:{}}),$ze=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Ccn(e,t,n,r){const s=m.useMemo(()=>{const a=Bze();return Dze(a,t,$ze(r),e.transformTemplate,e.style),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};Lze(a,e.style,e),s.style={...a,...s.style}}return s}const Scn=["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 due(e){return typeof e!="string"||e.includes("-")?!1:!!(Scn.indexOf(e)>-1||/[A-Z]/u.test(e))}function Ncn(e,t,n,{latestValues:r},s,a=!1){const l=(due(e)?Ccn:bcn)(t,r,s,e),c=ccn(t,typeof e=="string",a),u=e!==m.Fragment?{...c,...l,ref:n}:{},{children:d}=t,f=m.useMemo(()=>Mu(d)?d.get():d,[d]);return m.createElement(e,{...u,children:f})}function n4e(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function fue(e,t,n,r){if(typeof t=="function"){const[s,a]=n4e(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]=n4e(r);t=t(n!==void 0?n:e.custom,s,a)}return t}function NO(e){return Mu(e)?e.get():e}function Acn({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:jcn(n,r,s,e),renderState:t()}}function jcn(e,t,n,r){const s={},a=r(e,{});for(const x in a)s[x]=NO(a[x]);let{initial:o,animate:l}=e;const c=xU(e),u=Mze(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"&&!mU(f)){const x=Array.isArray(f)?f:[f];for(let g=0;g<x.length;g++){const v=fue(e,x[g]);if(v){const{transitionEnd:w,transition:C,...N}=v;for(const P in N){let I=N[P];if(Array.isArray(I)){const R=d?I.length-1:0;I=I[R]}I!==null&&(s[P]=I)}for(const P in w)s[P]=w[P]}}}return s}const Uze=e=>(t,n)=>{const r=m.useContext(pU),s=m.useContext(hU),a=()=>Acn(e,t,r,s);return n?a():Vce(a)};function hue(e,t,n){var a;const{style:r}=e,s={};for(const o in r)(Mu(r[o])||t.style&&Mu(t.style[o])||Rze(o,e)||((a=n==null?void 0:n.getValue(o))==null?void 0:a.liveStyle)!==void 0)&&(s[o]=r[o]);return s}const Ecn=Uze({scrapeMotionValuesFromProps:hue,createRenderState:uue});function zze(e,t,n){const r=hue(e,t,n);for(const s in e)if(Mu(e[s])||Mu(t[s])){const a=a8.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[a]=e[s]}return r}const _cn=Uze({scrapeMotionValuesFromProps:zze,createRenderState:Bze}),kcn=Symbol.for("motionComponentSymbol");function HC(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Tcn(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):HC(n)&&(n.current=r))},[t])}const pue=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Icn="framerAppearId",Hze="data-"+pue(Icn),Vze=m.createContext({});function Pcn(e,t,n,r,s){var w,C;const{visualElement:a}=m.useContext(pU),o=m.useContext(Fze),l=m.useContext(hU),c=m.useContext(aue).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(Vze);d&&!d.projection&&s&&(d.type==="html"||d.type==="svg")&&Fcn(u.current,n,s,f);const x=m.useRef(!1);m.useInsertionEffect(()=>{d&&x.current&&d.update(n,l)});const g=n[Hze],v=m.useRef(!!g&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,g))&&((C=window.MotionHasOptimisedAnimation)==null?void 0:C.call(window,g)));return tze(()=>{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 Fcn(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:Wze(e.parent)),e.projection.setOptions({layoutId:s,layout:a,alwaysMeasureLayout:!!o||l&&HC(l),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:u})}function Wze(e){if(e)return e.options.allowProjection!==!1?e.projection:Wze(e.parent)}function iX(e,{forwardMotionProps:t=!1}={},n,r){n&&acn(n);const s=due(e)?_cn:Ecn;function a(l,c){let u;const d={...m.useContext(aue),...l,layoutId:Ocn(l)},{isStatic:f}=d,x=dcn(l),g=s(l,f);if(!f&&Wce){Mcn();const v=Rcn(d);u=v.MeasureLayout,x.visualElement=Pcn(e,g,d,r,v.ProjectionNode)}return i.jsxs(pU.Provider,{value:x,children:[u&&x.visualElement?i.jsx(u,{visualElement:x.visualElement,...d}):null,Ncn(e,l,Tcn(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[kcn]=e,o}function Ocn({layoutId:e}){const t=m.useContext(Hce).id;return t&&e!==void 0?t+"-"+e:e}function Mcn(e,t){m.useContext(Fze).strict}function Rcn(e){const{drag:t,layout:n}=KN;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 Lcn(e,t){if(typeof Proxy>"u")return iX;const n=new Map,r=(a,o)=>iX(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,iX(o,void 0,e,t)),n.get(o))})}function qze({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Dcn({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Bcn(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 aX(e){return e===void 0||e===1}function qne({scale:e,scaleX:t,scaleY:n}){return!aX(e)||!aX(t)||!aX(n)}function Iv(e){return qne(e)||Gze(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Gze(e){return r4e(e.x)||r4e(e.y)}function r4e(e){return e&&e!=="0%"}function QL(e,t,n){const r=e-n,s=t*r;return n+s}function s4e(e,t,n,r,s){return s!==void 0&&(e=QL(e,s,r)),QL(e,n,r)+t}function Gne(e,t=0,n=1,r,s){e.min=s4e(e.min,t,n,r,s),e.max=s4e(e.max,t,n,r,s)}function Kze(e,{x:t,y:n}){Gne(e.x,t.translate,t.scale,t.originPoint),Gne(e.y,n.translate,n.scale,n.originPoint)}const i4e=.999999999999,a4e=1.0000000000001;function $cn(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&&WC(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Kze(e,o)),r&&Iv(a.latestValues)&&WC(e,a.latestValues))}t.x<a4e&&t.x>i4e&&(t.x=1),t.y<a4e&&t.y>i4e&&(t.y=1)}function VC(e,t){e.min=e.min+t,e.max=e.max+t}function o4e(e,t,n,r,s=.5){const a=Ho(e.min,e.max,s);Gne(e,t,n,a,r)}function WC(e,t){o4e(e.x,t.x,t.scaleX,t.scale,t.originX),o4e(e.y,t.y,t.scaleY,t.scale,t.originY)}function Yze(e,t){return qze(Bcn(e.getBoundingClientRect(),t))}function Ucn(e,t,n){const r=Yze(e,n),{scroll:s}=t;return s&&(VC(r.x,s.offset.x),VC(r.y,s.offset.y)),r}const l4e=()=>({translate:0,scale:1,origin:0,originPoint:0}),qC=()=>({x:l4e(),y:l4e()}),c4e=()=>({min:0,max:0}),gl=()=>({x:c4e(),y:c4e()}),Kne={current:null},Xze={current:!1};function zcn(){if(Xze.current=!0,!!Wce)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Kne.current=e.matches;e.addEventListener("change",t),t()}else Kne.current=!1}const Hcn=new WeakMap;function Vcn(e,t,n){for(const r in t){const s=t[r],a=n[r];if(Mu(s))e.addValue(r,s);else if(Mu(a))e.addValue(r,GN(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,GN(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const u4e=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Wcn{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=tue,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=tf.now();this.renderScheduledAt<x&&(this.renderScheduledAt=x,Mo.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=xU(n),this.isVariantNode=Mze(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&&Mu(g)&&g.set(c[x])}}mount(t){var n;this.current=t,Hcn.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)),Xze.current||zcn(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Kne.current,(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),Xy(this.notifyUpdate),Xy(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=o8.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&Mo.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 KN){const n=KN[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):gl()}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<u4e.length;r++){const s=u4e[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=Vcn(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=GN(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"&&(RD(r)||DD(r))?r=parseFloat(r):!Jln(r)&&Qy.test(n)&&(r=Aze(t,n)),this.setBaseTarget(t,Mu(r)?r.get():r)),Mu(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=fue(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&&!Mu(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 lA),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){sue.render(this.render)}}class Qze extends Wcn{constructor(){super(...arguments),this.KeyframeResolver=Uln}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;Mu(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Zze(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 qcn(e){return window.getComputedStyle(e)}class Gcn extends Qze{constructor(){super(...arguments),this.type="html",this.renderInstance=Zze}readValueFromInstance(t,n){var r;if(o8.has(n))return(r=this.projection)!=null&&r.isProjecting?Bne(n):aln(t,n);{const s=qcn(t),a=(qce(n)?s.getPropertyValue(n):s[n])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Yze(t,n)}build(t,n,r){cue(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return hue(t,n,r)}}const Jze=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 Kcn(e,t,n,r){Zze(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(Jze.has(s)?s:pue(s),t.attrs[s])}class Ycn extends Qze{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=gl}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(o8.has(n)){const r=Nze(n);return r&&r.default||0}return n=Jze.has(n)?n:pue(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return zze(t,n,r)}build(t,n,r){Dze(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){Kcn(t,n,r,s)}mount(t){this.isSVGTag=$ze(t.tagName),super.mount(t)}}const Xcn=(e,t)=>due(e)?new Ycn(t):new Gcn(t,{allowProjection:e!==m.Fragment});function b4(e,t,n){const r=e.getProps();return fue(r,t,n!==void 0?n:r.custom,e)}const Yne=e=>Array.isArray(e);function Qcn(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,GN(n))}function Zcn(e){return Yne(e)?e[e.length-1]||0:e}function Jcn(e,t){const n=b4(e,t);let{transitionEnd:r={},transition:s={},...a}=n||{};a={...a,...r};for(const o in a){const l=Zcn(a[o]);Qcn(e,o,l)}}function eun(e){return!!(Mu(e)&&e.add)}function Xne(e,t){const n=e.getValue("willChange");if(eun(n))return n.add(t);if(!n&&Mc.WillChange){const r=new Mc.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function eHe(e){return e.props[Hze]}const tun=e=>e!==null;function nun(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(tun),a=t&&n!=="loop"&&t%2===1?0:s.length-1;return s[a]}const run={type:"spring",stiffness:500,damping:25,restSpeed:10},sun=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),iun={type:"keyframes",duration:.8},aun={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},oun=(e,{keyframes:t})=>t.length>2?iun:o8.has(e)?e.startsWith("scale")?sun(t[1]):run:aun;function lun({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 mue=(e,t,n,r={},s,a)=>o=>{const l=nue(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u=u-zl(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};lun(l)||Object.assign(d,oun(e,d)),d.duration&&(d.duration=zl(d.duration)),d.repeatDelay&&(d.repeatDelay=zl(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(Vne(d),d.delay===0&&(f=!0)),(Mc.instantAnimations||Mc.skipAnimations)&&(f=!0,Vne(d),d.delay=0),d.allowFlatten=!l.type&&!l.ease,f&&!a&&t.get()!==void 0){const x=nun(d.keyframes,l);if(x!==void 0){Mo.update(()=>{d.onUpdate(x),d.onComplete()});return}}return l.isSync?new eue(d):new kln(d)};function cun({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function tHe(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&&cun(u,d))continue;const g={delay:n,...nue(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=eHe(e);if(N){const P=window.MotionHandoffAnimation(N,d,Mo);P!==null&&(g.startTime=P,w=!0)}}Xne(e,d),f.start(mue(d,f,x,e.shouldReduceMotion&&wze.has(d)?{type:!1}:g,e,w));const C=f.animation;C&&c.push(C)}return o&&Promise.all(c).then(()=>{Mo.update(()=>{o&&Jcn(e,o)})}),c}function nHe(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 Qne(e,t,n={}){var c;const r=b4(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(tHe(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:x}=s;return uun(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 uun(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(Qne(c,t,{...o,delay:n+(typeof r=="function"?0:r)+nHe(e.variantChildren,c,r,s,a)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(l)}function dun(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(a=>Qne(e,a,n));r=Promise.all(s)}else if(typeof t=="string")r=Qne(e,t,n);else{const s=typeof t=="function"?b4(e,t,n.custom):t;r=Promise.all(tHe(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function rHe(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 fun=lue.length;function sHe(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?sHe(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<fun;n++){const r=lue[n],s=e.props[r];(U_(s)||s===!1)&&(t[r]=s)}return t}const hun=[...oue].reverse(),pun=oue.length;function mun(e){return t=>Promise.all(t.map(({animation:n,options:r})=>dun(e,n,r)))}function xun(e){let t=mun(e),n=d4e(),r=!0;const s=c=>(u,d)=>{var x;const f=b4(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=sHe(e.parent)||{},f=[],x=new Set;let g={},v=1/0;for(let C=0;C<pun;C++){const N=hun[C],P=n[N],I=u[N]!==void 0?u[N]:d[N],R=U_(I),O=N===c?P.isActive:null;O===!1&&(v=C);let U=I===d[N]&&I!==u[N]&&R;if(U&&r&&e.manuallyAnimateOnMount&&(U=!1),P.protectedKeys={...g},!P.isActive&&O===null||!I&&!P.prevProp||mU(I)||typeof I=="boolean")continue;const L=gun(P.prevProp,I);let z=L||N===c&&P.isActive&&!U&&R||C>v&&R,X=!1;const ne=Array.isArray(I)?I:[I];let J=ne.reduce(s(N),{});O===!1&&(J={});const{prevResolvedValues:K={}}=P,re={...K,...J},he=oe=>{z=!0,x.has(oe)&&(X=!0,x.delete(oe)),P.needsAnimating[oe]=!0;const G=e.getValue(oe);G&&(G.liveStyle=!1)};for(const oe in re){const G=J[oe],V=K[oe];if(g.hasOwnProperty(oe))continue;let te=!1;Yne(G)&&Yne(V)?te=!rHe(G,V):te=G!==V,te?G!=null?he(oe):x.add(oe):G!==void 0&&x.has(oe)?he(oe):P.protectedKeys[oe]=!0}P.prevProp=I,P.prevResolvedValues=J,P.isActive&&(g={...g,...J}),r&&e.blockInitialAnimation&&(z=!1);const Q=U&&L;z&&(!Q||X)&&f.push(...ne.map(oe=>{const G={type:N};if(typeof oe=="string"&&r&&!Q&&e.manuallyAnimateOnMount&&e.parent){const{parent:V}=e,te=b4(V,oe);if(V.enteringChildren&&te){const{delayChildren:ae}=te.transition||{};G.delay=nHe(V.enteringChildren,e,ae)}}return{animation:oe,options:G}}))}if(x.size){const C={};if(typeof u.initial!="boolean"){const N=b4(e,Array.isArray(u.initial)?u.initial[0]:u.initial);N&&N.transition&&(C.transition=N.transition)}x.forEach(N=>{const P=e.getBaseTarget(N),I=e.getValue(N);I&&(I.liveStyle=!0),C[N]=P??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=d4e()}}}function gun(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!rHe(t,e):!1}function pv(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function d4e(){return{animate:pv(!0),whileInView:pv(),whileHover:pv(),whileTap:pv(),whileDrag:pv(),whileFocus:pv(),exit:pv()}}class v2{constructor(t){this.isMounted=!1,this.node=t}update(){}}class bun extends v2{constructor(t){super(t),t.animationState||(t.animationState=xun(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();mU(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 yun=0;class vun extends v2{constructor(){super(...arguments),this.id=yun++}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 wun={animation:{Feature:bun},exit:{Feature:vun}};function H_(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function gT(e){return{point:{x:e.pageX,y:e.pageY}}}const Cun=e=>t=>iue(t)&&e(t,gT(t));function h9(e,t,n,r){return H_(e,t,Cun(n),r)}const iHe=1e-4,Sun=1-iHe,Nun=1+iHe,aHe=.01,Aun=0-aHe,jun=0+aHe;function dd(e){return e.max-e.min}function Eun(e,t,n){return Math.abs(e-t)<=n}function f4e(e,t,n,r=.5){e.origin=r,e.originPoint=Ho(t.min,t.max,e.origin),e.scale=dd(n)/dd(t),e.translate=Ho(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Sun&&e.scale<=Nun||isNaN(e.scale))&&(e.scale=1),(e.translate>=Aun&&e.translate<=jun||isNaN(e.translate))&&(e.translate=0)}function p9(e,t,n,r){f4e(e.x,t.x,n.x,r?r.originX:void 0),f4e(e.y,t.y,n.y,r?r.originY:void 0)}function h4e(e,t,n){e.min=n.min+t.min,e.max=e.min+dd(t)}function _un(e,t,n){h4e(e.x,t.x,n.x),h4e(e.y,t.y,n.y)}function p4e(e,t,n){e.min=t.min-n.min,e.max=e.min+dd(t)}function m9(e,t,n){p4e(e.x,t.x,n.x),p4e(e.y,t.y,n.y)}function Ih(e){return[e("x"),e("y")]}const oHe=({current:e})=>e?e.ownerDocument.defaultView:null,m4e=(e,t)=>Math.abs(e-t);function kun(e,t){const n=m4e(e.x,t.x),r=m4e(e.y,t.y);return Math.sqrt(n**2+r**2)}class lHe{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=lX(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,v=kun(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!v)return;const{point:w}=x,{timestamp:C}=Yc;this.history.push({...w,timestamp:C});const{onStart:N,onMove:P}=this.handlers;g||(N&&N(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),P&&P(this.lastMoveEvent,x)},this.handlePointerMove=(x,g)=>{this.lastMoveEvent=x,this.lastMoveEventInfo=oX(g,this.transformPagePoint),Mo.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=lX(x.type==="pointercancel"?this.lastMoveEventInfo:oX(g,this.transformPagePoint),this.history);this.startEvent&&v&&v(x,N),w&&w(x,N)},!iue(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const l=gT(t),c=oX(l,this.transformPagePoint),{point:u}=c,{timestamp:d}=Yc;this.history=[{...u,timestamp:d}];const{onSessionStart:f}=n;f&&f(t,lX(c,this.history)),this.removeListeners=dx(h9(this.contextWindow,"pointermove",this.handlePointerMove),h9(this.contextWindow,"pointerup",this.handlePointerUp),h9(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Xy(this.updatePoint)}}function oX(e,t){return t?{point:t(e.point)}:e}function x4e(e,t){return{x:e.x-t.x,y:e.y-t.y}}function lX({point:e},t){return{point:e,delta:x4e(e,cHe(t)),offset:x4e(e,Tun(t)),velocity:Iun(t,.1)}}function Tun(e){return e[0]}function cHe(e){return e[e.length-1]}function Iun(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=cHe(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>zl(t)));)n--;if(!r)return{x:0,y:0};const a=il(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 Pun(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Ho(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Ho(n,e,r.max):Math.min(e,n)),e}function g4e(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 Fun(e,{top:t,left:n,bottom:r,right:s}){return{x:g4e(e.x,n,s),y:g4e(e.y,t,r)}}function b4e(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 Oun(e,t){return{x:b4e(e.x,t.x),y:b4e(e.y,t.y)}}function Mun(e,t){let n=.5;const r=dd(e),s=dd(t);return s>r?n=Y0(t.min,t.max-r,e.min):r>s&&(n=Y0(e.min,e.max-s,t.min)),Oc(0,1,n)}function Run(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 Zne=.35;function Lun(e=Zne){return e===!1?e=0:e===!0&&(e=Zne),{x:y4e(e,"left","right"),y:y4e(e,"top","bottom")}}function y4e(e,t,n){return{min:v4e(e,t),max:v4e(e,n)}}function v4e(e,t){return typeof e=="number"?e:e[t]||0}const Dun=new WeakMap;class Bun{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=gl(),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(gT(f).point)},o=(f,x)=>{const{drag:g,dragPropagation:v,onDragStart:w}=this.getProps();if(g&&!v&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Wln(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),Ih(N=>{let P=this.getAxisMotionValue(N).get()||0;if(W0.test(P)){const{projection:I}=this.visualElement;if(I&&I.layout){const R=I.layout.layoutBox[N];R&&(P=dd(R)*(parseFloat(P)/100))}}this.originPoint[N]=P}),w&&Mo.postRender(()=>w(f,x)),Xne(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=$un(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=()=>Ih(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 lHe(t,{onSessionStart:a,onStart:o,onMove:l,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:oHe(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&&Mo.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||!WP(t,s,this.currentDirection))return;const a=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=Pun(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&&HC(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=Fun(r.layoutBox,t):this.constraints=!1,this.elastic=Lun(n),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Ih(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Run(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!HC(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const a=Ucn(r,s.root,this.visualElement.getTransformPagePoint());let o=Oun(s.layout.layoutBox,a);if(n){const l=n(Dcn(o));this.hasMutatedConstraints=!!l,l&&(o=qze(l))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Ih(d=>{if(!WP(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 Xne(this.visualElement,t),r.start(mue(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ih(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ih(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){Ih(n=>{const{drag:r}=this.getProps();if(!WP(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]-Ho(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!HC(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Ih(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();s[o]=Mun({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(),Ih(o=>{if(!WP(o,t,null))return;const l=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];l.set(Ho(c,u,s[o]))})}addListeners(){if(!this.visualElement.current)return;Dun.set(this.visualElement,this);const t=this.visualElement.current,n=h9(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();HC(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()),Mo.read(r);const o=H_(window,"resize",()=>this.scalePositionWithinConstraints()),l=s.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Ih(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=Zne,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:a,dragElastic:o,dragMomentum:l}}}function WP(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function $un(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Uun extends v2{constructor(t){super(t),this.removeGroupControls=ll,this.removeListeners=ll,this.controls=new Bun(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ll}unmount(){this.removeGroupControls(),this.removeListeners()}}const w4e=e=>(t,n)=>{e&&Mo.postRender(()=>e(t,n))};class zun extends v2{constructor(){super(...arguments),this.removePointerDownListener=ll}onPointerDown(t){this.session=new lHe(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:oHe(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:w4e(t),onStart:w4e(n),onMove:r,onEnd:(a,o)=>{delete this.session,s&&Mo.postRender(()=>s(a,o))}}}mount(){this.removePointerDownListener=h9(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 AO={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function C4e(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const X7={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ci.test(e))e=parseFloat(e);else return e;const n=C4e(e,t.target.x),r=C4e(e,t.target.y);return`${n}% ${r}%`}},Hun={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Qy.parse(e);if(s.length>5)return r;const a=Qy.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=Ho(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 cX=!1;class Vun extends m.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:a}=t;fcn(Wun),a&&(n.group&&n.group.add(a),r&&r.register&&s&&r.register(a),cX&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),AO.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:a}=this.props,{projection:o}=r;return o&&(o.isPresent=a,cX=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==a?o.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?o.promote():o.relegate()||Mo.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),sue.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;cX=!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 uHe(e){const[t,n]=Pze(),r=m.useContext(Hce);return i.jsx(Vun,{...e,layoutGroup:r,switchLayoutGroup:m.useContext(Vze),isPresent:t,safeToRemove:n})}const Wun={borderRadius:{...X7,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:X7,borderTopRightRadius:X7,borderBottomLeftRadius:X7,borderBottomRightRadius:X7,boxShadow:Hun};function qun(e,t,n){const r=Mu(e)?e:GN(e);return r.start(mue("",r,t,n)),r.animation}const Gun=(e,t)=>e.depth-t.depth;class Kun{constructor(){this.children=[],this.isDirty=!1}add(t){yk(this.children,t),this.isDirty=!0}remove(t){vk(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Gun),this.isDirty=!1,this.children.forEach(t)}}function Yun(e,t){const n=tf.now(),r=({timestamp:s})=>{const a=s-n;a>=t&&(Xy(r),e(a-t))};return Mo.setup(r,!0),()=>Xy(r)}const dHe=["TopLeft","TopRight","BottomLeft","BottomRight"],Xun=dHe.length,S4e=e=>typeof e=="string"?parseFloat(e):e,N4e=e=>typeof e=="number"||ci.test(e);function Qun(e,t,n,r,s,a){s?(e.opacity=Ho(0,n.opacity??1,Zun(r)),e.opacityExit=Ho(t.opacity??1,0,Jun(r))):a&&(e.opacity=Ho(t.opacity??1,n.opacity??1,r));for(let o=0;o<Xun;o++){const l=`border${dHe[o]}Radius`;let c=A4e(t,l),u=A4e(n,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||N4e(c)===N4e(u)?(e[l]=Math.max(Ho(S4e(c),S4e(u),r),0),(W0.test(u)||W0.test(c))&&(e[l]+="%")):e[l]=u}(t.rotate||n.rotate)&&(e.rotate=Ho(t.rotate||0,n.rotate||0,r))}function A4e(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Zun=fHe(0,.5,cse),Jun=fHe(.5,.95,ll);function fHe(e,t,n){return r=>r<e?0:r>t?1:n(Y0(e,t,r))}function j4e(e,t){e.min=t.min,e.max=t.max}function jh(e,t){j4e(e.x,t.x),j4e(e.y,t.y)}function E4e(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function _4e(e,t,n,r,s){return e-=t,e=QL(e,1/n,r),s!==void 0&&(e=QL(e,1/s,r)),e}function edn(e,t=0,n=1,r=.5,s,a=e,o=e){if(W0.test(t)&&(t=parseFloat(t),t=Ho(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=Ho(a.min,a.max,r);e===a&&(l-=t),e.min=_4e(e.min,t,n,l,s),e.max=_4e(e.max,t,n,l,s)}function k4e(e,t,[n,r,s],a,o){edn(e,t[n],t[r],t[s],t.scale,a,o)}const tdn=["x","scaleX","originX"],ndn=["y","scaleY","originY"];function T4e(e,t,n,r){k4e(e.x,t,tdn,n?n.x:void 0,r?r.x:void 0),k4e(e.y,t,ndn,n?n.y:void 0,r?r.y:void 0)}function I4e(e){return e.translate===0&&e.scale===1}function hHe(e){return I4e(e.x)&&I4e(e.y)}function P4e(e,t){return e.min===t.min&&e.max===t.max}function rdn(e,t){return P4e(e.x,t.x)&&P4e(e.y,t.y)}function F4e(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function pHe(e,t){return F4e(e.x,t.x)&&F4e(e.y,t.y)}function O4e(e){return dd(e.x)/dd(e.y)}function M4e(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class sdn{constructor(){this.members=[]}add(t){yk(this.members,t),t.scheduleRender()}remove(t){if(vk(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 idn(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 uX=["","X","Y","Z"],adn=1e3;let odn=0;function dX(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function mHe(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=eHe(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Mo,!(s||a))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&mHe(r)}function xHe({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=t==null?void 0:t()){this.id=odn++,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(udn),this.nodes.forEach(pdn),this.nodes.forEach(mdn),this.nodes.forEach(ddn)},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 Kun)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new lA),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=Ize(o)&&!Qln(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;Mo.read(()=>{f=window.innerWidth}),e(o,()=>{const g=window.innerWidth;g!==f&&(f=g,this.root.updateBlockedByResize=!0,d&&d(),d=Yun(x,250),AO.hasAnimatedSinceResize&&(AO.hasAnimatedSinceResize=!1,this.nodes.forEach(D4e)))})}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()||vdn,{onLayoutAnimationStart:w,onLayoutAnimationComplete:C}=u.getProps(),N=!this.targetLayout||!pHe(this.targetLayout,g),P=!f&&x;if(this.options.layoutRoot||this.resumeFrom||P||f&&(N||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const I={...nue(v,"layout"),onPlay:w,onComplete:C};(u.shouldReduceMotion||this.options.layoutRoot)&&(I.delay=0,I.type=!1),this.startAnimation(I),this.setAnimationOrigin(d,P)}else f||D4e(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(),Xy(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(xdn),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&&mHe(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(R4e);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(L4e);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(hdn),this.nodes.forEach(ldn),this.nodes.forEach(cdn)):this.nodes.forEach(L4e),this.clearAllSnapshots();const l=tf.now();Yc.delta=Oc(0,1e3/60,l-Yc.timestamp),Yc.timestamp=l,Yc.isProcessing=!0,eX.update.process(Yc),eX.preRender.process(Yc),eX.render.process(Yc),Yc.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,sue.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(fdn),this.sharedNodes.forEach(gdn)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Mo.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Mo.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!dd(this.snapshot.measuredBox.x)&&!dd(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=gl(),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&&!hHe(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;o&&this.instance&&(l||Iv(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)),wdn(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:o}=this.options;if(!o)return gl();const l=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(Cdn))){const{scroll:d}=this.root;d&&(VC(l.x,d.offset.x),VC(l.y,d.offset.y))}return l}removeElementScroll(o){var c;const l=gl();if(jh(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&&jh(l,o),VC(l.x,f.offset.x),VC(l.y,f.offset.y))}return l}applyTransform(o,l=!1){const c=gl();jh(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&&WC(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),Iv(d.latestValues)&&WC(c,d.latestValues)}return Iv(this.latestValues)&&WC(c,this.latestValues),c}removeTransform(o){const l=gl();jh(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!Iv(u.latestValues))continue;qne(u.latestValues)&&u.updateSnapshot();const d=gl(),f=u.measurePageBox();jh(d,f),T4e(l,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return Iv(this.latestValues)&&T4e(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!==Yc.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=Yc.timestamp,!this.targetDelta&&!this.relativeTarget){const g=this.getClosestProjectingParent();g&&g.layout&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=gl(),this.relativeTargetOrigin=gl(),m9(this.relativeTargetOrigin,this.layout.layoutBox,g.layout.layoutBox),jh(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=gl(),this.targetWithTransforms=gl()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),_un(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):jh(this.target,this.layout.layoutBox),Kze(this.target,this.targetDelta)):jh(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=gl(),this.relativeTargetOrigin=gl(),m9(this.relativeTargetOrigin,this.target,g.target),jh(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||qne(this.parent.latestValues)||Gze(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===Yc.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;jh(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,x=this.treeScale.y;$cn(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=gl());const{target:g}=o;if(!g){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(E4e(this.prevProjectionDelta.x,this.projectionDelta.x),E4e(this.prevProjectionDelta.y,this.projectionDelta.y)),p9(this.projectionDelta,this.layoutCorrected,g,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==x||!M4e(this.projectionDelta.x,this.prevProjectionDelta.x)||!M4e(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=qC(),this.projectionDelta=qC(),this.projectionDeltaWithTransform=qC()}setAnimationOrigin(o,l=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},f=qC();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const x=gl(),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,P=!!(w&&!N&&this.options.crossfade===!0&&!this.path.some(ydn));this.animationProgress=0;let I;this.mixTargetDelta=R=>{const O=R/1e3;B4e(f.x,o.x,O),B4e(f.y,o.y,O),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(m9(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox),bdn(this.relativeTarget,this.relativeTargetOrigin,x,O),I&&rdn(this.relativeTarget,I)&&(this.isProjectionDirty=!1),I||(I=gl()),jh(I,this.relativeTarget)),w&&(this.animationValues=d,Qun(d,u,this.latestValues,O,P,N)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=O},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&&(Xy(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Mo.update(()=>{AO.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=GN(0)),this.currentAnimation=qun(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(adn),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&&gHe(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||gl();const f=dd(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+f;const x=dd(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+x}jh(l,c),WC(l,d),p9(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new sdn),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&&dX("z",o,u,this.animationValues);for(let d=0;d<uX.length;d++)dX(`rotate${uX[d]}`,o,u,this.animationValues),dX(`skew${uX[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=NO(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=NO(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!Iv(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=idn(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 z_){if(d[v]===void 0)continue;const{correct:w,applyTo:C,isCSSVariable:N}=z_[v],P=f==="none"?d[v]:w(d[v],u);if(C){const I=C.length;for(let R=0;R<I;R++)o[C[R]]=P}else N?this.options.visualElement.renderState.vars[v]=P:o[v]=P}this.options.layoutId&&(o.pointerEvents=u===this?NO(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(R4e),this.root.sharedNodes.clear()}}}function ldn(e){e.updateLayout()}function cdn(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"?Ih(f=>{const x=o?t.measuredBox[f]:t.layoutBox[f],g=dd(x);x.min=r[f].min,x.max=x.min+g}):gHe(a,t.layoutBox,r)&&Ih(f=>{const x=o?t.measuredBox[f]:t.layoutBox[f],g=dd(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=qC();p9(l,r,t.layoutBox);const c=qC();o?p9(c,e.applyTransform(s,!0),t.measuredBox):p9(c,r,t.layoutBox);const u=!hHe(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=gl();m9(v,t.layoutBox,x.layoutBox);const w=gl();m9(w,r,g.layoutBox),pHe(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 udn(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 ddn(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function fdn(e){e.clearSnapshot()}function R4e(e){e.clearMeasurements()}function L4e(e){e.isLayoutDirty=!1}function hdn(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function D4e(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function pdn(e){e.resolveTargetDelta()}function mdn(e){e.calcProjection()}function xdn(e){e.resetSkewAndRotation()}function gdn(e){e.removeLeadSnapshot()}function B4e(e,t,n){e.translate=Ho(t.translate,0,n),e.scale=Ho(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function $4e(e,t,n,r){e.min=Ho(t.min,n.min,r),e.max=Ho(t.max,n.max,r)}function bdn(e,t,n,r){$4e(e.x,t.x,n.x,r),$4e(e.y,t.y,n.y,r)}function ydn(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const vdn={duration:.45,ease:[.4,0,.1,1]},U4e=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),z4e=U4e("applewebkit/")&&!U4e("chrome/")?Math.round:ll;function H4e(e){e.min=z4e(e.min),e.max=z4e(e.max)}function wdn(e){H4e(e.x),H4e(e.y)}function gHe(e,t,n){return e==="position"||e==="preserve-aspect"&&!Eun(O4e(t),O4e(n),.2)}function Cdn(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const Sdn=xHe({attachResizeListener:(e,t)=>H_(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),fX={current:void 0},bHe=xHe({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!fX.current){const e=new Sdn({});e.mount(window),e.setOptions({layoutScroll:!0}),fX.current=e}return fX.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Ndn={pan:{Feature:zun},drag:{Feature:Uun,ProjectionNode:bHe,MeasureLayout:uHe}};function V4e(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&&Mo.postRender(()=>a(t,gT(t)))}class Adn extends v2{mount(){const{current:t}=this.node;t&&(this.unmount=qln(t,(n,r)=>(V4e(this.node,r,"Start"),s=>V4e(this.node,s,"End"))))}unmount(){}}class jdn extends v2{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=dx(H_(this.node.current,"focus",()=>this.onFocus()),H_(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function W4e(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&&Mo.postRender(()=>a(t,gT(t)))}class Edn extends v2{mount(){const{current:t}=this.node;t&&(this.unmount=Xln(t,(n,r)=>(W4e(this.node,r,"Start"),(s,{success:a})=>W4e(this.node,s,a?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Jne=new WeakMap,hX=new WeakMap,_dn=e=>{const t=Jne.get(e.target);t&&t(e)},kdn=e=>{e.forEach(_dn)};function Tdn({root:e,...t}){const n=e||document;hX.has(n)||hX.set(n,{});const r=hX.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(kdn,{root:e,...t})),r[s]}function Idn(e,t,n){const r=Tdn(t);return Jne.set(e,n),r.observe(e),()=>{Jne.delete(e),r.unobserve(e)}}const Pdn={some:0,all:1};class Fdn extends v2{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:Pdn[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 Idn(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(Odn(t,n))&&this.startObserver()}unmount(){}}function Odn({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Mdn={inView:{Feature:Fdn},tap:{Feature:Edn},focus:{Feature:jdn},hover:{Feature:Adn}},Rdn={layout:{ProjectionNode:bHe,MeasureLayout:uHe}},Ldn={...wun,...Mdn,...Ndn,...Rdn},wo=Lcn(Ldn,Xcn);function xue({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,P]=m.useState(0),[I,R]=m.useState(320),[O,U]=m.useState("vol"),[L,z]=m.useState("desc"),[X,ne]=m.useState("all"),[J,K]=m.useState(()=>{try{const tt=localStorage.getItem("favCoins");return tt?new Set(JSON.parse(tt)):new Set}catch{return new Set}}),re=m.useRef(null),he=m.useRef(null),Q=150,ie={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"},oe=tt=>{var $e;const Le=($e=tt==null?void 0:tt.split("/")[0])==null?void 0:$e.replace("-USD","").replace("/USD","");return ie[Le]||Le},G=tt=>tt==null||isNaN(tt)?"--":Intl.NumberFormat(void 0,{notation:"compact",maximumFractionDigits:2}).format(Number(tt)),V=(tt,Le=6)=>tt==null||isNaN(tt)?"--":Number(tt).toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:Le}),te=tt=>{const Le=new Set(J);Le.has(tt)?Le.delete(tt):Le.add(tt),K(Le),localStorage.setItem("favCoins",JSON.stringify([...Le]))},ae=tt=>{O===tt?z(Le=>Le==="asc"?"desc":"asc"):(U(tt),z("desc"))},fe=m.useMemo(()=>((e==null?void 0:e.map(Le=>{const $e=Le.rawSymbol||Le.symbol||Le.coin||Le.ticker||"";let ht=Le.symbol||Le.coin||Le.ticker||$e,pt=Le.builder||Le.dex||"";if(Le.kind==="hip3"){const Ze=$e.indexOf(":");!pt&&Ze>=0&&(pt=$e.slice(0,Ze),ht=$e.slice(Ze+1))}const Kt=Le.lastPrice??Le.last??Le.markPrice??null,wt=Le.change24hPct??Le.chg24??null,nn=Le.volume??Le.vol??Le.dayNtlVlm??null,cn=Le.fundingRate??Le.funding??null,zn=Le.openInterest??Le.oi??null,Xt=Le.openInterestUsd??Le.oiUsd??(zn!=null&&Kt!=null?Number(zn)*Number(Kt):null),on=Le.leverage!=null?Le.leverage:Le.lev!=null?Le.lev:null,Zt=Le.kind||(pt?"hip3":"perp"),Ye=Le.coin||ht.replace(/-USDH$/,"").replace(/-USDC$/,"").replace(/-USD$/,"").replace(/\/USD$/,"");return{kind:Zt,builder:pt,dex:Le.dex||"",symbol:ht,rawSymbol:$e,last:Kt,chg24:wt,vol:nn,funding:cn,openInterest:Xt,leverage:on!=null&&isFinite(on)?Math.floor(on):null,coinForChange:Ye}}))??[]).filter(Le=>Le.symbol),[e]),Ne=m.useMemo(()=>{const tt=new Map;for(const Le of fe){const $e=Le.symbol.replace("-USD","").replace("/USD","");tt.set($e,Le)}return tt},[fe]),me=m.useMemo(()=>{if(a!=="pair")return[];const tt=fe.filter(nn=>nn.kind!=="hip3"),Le=tt.map(nn=>nn.symbol.replace("-USD","").replace("/USD","")),$e=Array.from(new Set(Le)),ht=Array.isArray(o)?new Set(o):null;let pt=Array.isArray(l)&&l.length?l:tt.slice().sort((nn,cn)=>Number(cn.vol||0)-Number(nn.vol||0)).slice(0,30).map(nn=>nn.symbol.replace("-USD","").replace("/USD",""));pt=pt.filter(nn=>$e.includes(nn));const Kt=[],wt=new Set;for(let nn=0;nn<pt.length;nn++){const cn=pt[nn];for(let zn=0;zn<$e.length;zn++){const Xt=$e[zn];if(!cn||!Xt||cn===Xt)continue;const on=`${cn}/${Xt}`;if(wt.has(on)||ht&&!ht.has(on))continue;wt.add(on);const Zt=Ne.get(cn),Ye=Ne.get(Xt),Ze=Zt&&Ye&&Number(Zt.last)>0&&Number(Ye.last)>0?Number(Zt.last)/Number(Ye.last):null,Ft=Zt&&Ye?Math.min(Number(Zt.vol||0),Number(Ye.vol||0)):null;if(Kt.push({kind:"pair",builder:"",dex:"",symbol:on,rawSymbol:on,last:Ze,chg24:null,vol:Ft,funding:null,openInterest:null,leverage:null,coinForChange:on}),Kt.length>=300)return Kt}}return Kt},[a,fe,o,l,Ne]),we=m.useMemo(()=>fe.some(tt=>tt.kind==="hip3"),[fe]);m.useEffect(()=>{a==="pair"&&(U("vol"),z("desc"),ne("perps"))},[a]),m.useEffect(()=>{!we&&X==="hip3"&&ne("all")},[we,X]),m.useEffect(()=>{a==="pair"&&(U("vol"),z("desc"),ne("perps"))},[a]);const xe=m.useMemo(()=>{const tt=g.trim().toLowerCase();let $e=a==="pair"?me.slice():fe.slice();a!=="pair"&&(X==="perps"?$e=$e.filter(pt=>pt.kind!=="hip3"):X==="hip3"&&($e=$e.filter(pt=>pt.kind==="hip3"))),tt&&($e=$e.filter(pt=>pt.symbol.toLowerCase().includes(tt)));const ht=pt=>pt==null||isNaN(Number(pt))?NaN:Number(pt);return $e.sort((pt,Kt)=>{const wt=J.has(pt.symbol)?1:0,nn=J.has(Kt.symbol)?1:0;if(wt!==nn)return nn-wt;const cn=ht(pt[O]),zn=ht(Kt[O]),Xt=isNaN(cn),on=isNaN(zn);return Xt&&on?pt.symbol.localeCompare(Kt.symbol):Xt?1:on?-1:cn===zn?pt.symbol.localeCompare(Kt.symbol):L==="asc"?cn-zn:zn-cn}),$e},[a,fe,me,g,J,O,L,X]),ye=()=>{const tt=he.current;if(!tt)return;const Le=tt.getBoundingClientRect(),$e=getComputedStyle(tt),ht=parseFloat($e.paddingLeft)||0,pt=document.documentElement.clientWidth,Kt=16,nn=Math.min(740,pt-Kt*2);let cn=Le.left+ht;cn+nn>pt-Kt&&(cn=pt-Kt-nn),cn<Kt&&(cn=Kt),R(nn),P(cn),C(Le.bottom+8)},je=()=>{ye(),d(!0),requestAnimationFrame(()=>x(!0))},Pe=()=>{x(!1),setTimeout(()=>d(!1),Q)};m.useEffect(()=>{const tt=$e=>$e.key==="Escape"&&u&&Pe(),Le=$e=>{var ht;return u&&!((ht=re.current)!=null&&ht.contains($e.target))&&Pe()};return document.addEventListener("keydown",tt),document.addEventListener("mousedown",Le),document.addEventListener("touchstart",Le,{passive:!0}),()=>{document.removeEventListener("keydown",tt),document.removeEventListener("mousedown",Le),document.removeEventListener("touchstart",Le)}},[u]),m.useLayoutEffect(()=>{if(!u)return;ye();const tt=()=>ye(),Le=()=>ye();return window.addEventListener("scroll",tt,!0),window.addEventListener("resize",Le),()=>{window.removeEventListener("scroll",tt,!0),window.removeEventListener("resize",Le)}},[u]);const Re=t&&t.length>8?"min-w-[120px]":t&&t.length>6?"min-w-[108px]":"min-w-[96px]",Xe=tt=>{tt.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>")},Ke=({active:tt,dir:Le})=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:`w-3 h-3 ml-1 ${tt?"text-white":"text-[#6a6a6a]"}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:Le==="asc"?i.jsx("path",{d:"M7 14l5-5 5 5"}):i.jsx("path",{d:"M7 10l5 5 5-5"})}),ut=m.useMemo(()=>a!=="pair"?t||"Select":t||"Select Pair",[a,t]),et=({children:tt})=>i.jsx("span",{className:"tabular-nums whitespace-nowrap",children:tt});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?Pe():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:ut}),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 tt=fe.find(Le=>a==="pair"?Le.symbol===t:Le.rawSymbol===t||Le.symbol===t||Le.coinForChange===t);return tt&&tt.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-[${Q}ms] ${f?"opacity-100":"opacity-0"}`,"aria-hidden":!0,onClick:Pe}),u&&i.jsx("div",{className:`fixed z-[60] transition-all duration-[${Q}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:I,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"&&we&&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(([tt,Le])=>i.jsx("button",{className:`px-2 py-1 rounded-md font-bold ${X===tt?"bg-[#262626] text-white":"text-[#8a8a8a]"}`,onClick:()=>ne(tt),children:Le},tt))}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:g,onChange:tt=>v(tt.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(Ke,{active:O==="last",dir:O==="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(Ke,{active:O==="chg24",dir:O==="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(Ke,{active:O==="vol",dir:O==="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(Ke,{active:O==="funding",dir:O==="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(Ke,{active:O==="openInterest",dir:O==="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..."})}):xe.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"})}):xe.map(tt=>{const Le=J.has(tt.symbol),$e=a==="pair"&&tt.symbol.includes("/"),[ht,pt]=$e?tt.symbol.split("/"):[null,null],Kt=`${tt.kind||"perp"}:${tt.builder||""}:${tt.rawSymbol||tt.symbol}`;return i.jsxs("tr",{className:"hover:bg-[#1b1b1b]/70 cursor-pointer",onClick:()=>{const wt=a==="pair"?tt.symbol:tt.kind==="hip3"&&tt.rawSymbol?tt.rawSymbol:tt.coinForChange;n(wt),Pe()},children:[i.jsx("td",{className:"align-middle",children:i.jsx("button",{onClick:wt=>{wt.stopPropagation(),te(tt.symbol)},className:`shrink-0 bg-transparent ${Le?"text-yellow-400":"text-[#9b9b9b]"} hover:text-yellow-400`,title:Le?"Unfavorite":"Favorite",children:Le?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:$e?i.jsxs(i.Fragment,{children:[i.jsx("img",{src:`${s}/${ht}.svg`,alt:ht,className:"rounded-full w-4 h-4 bg-gray-700",loading:"lazy",onError:Xe}),i.jsx("span",{className:"text-[#8a8a8a] text-xs",children:"/"}),i.jsx("img",{src:`${s}/${pt}.svg`,alt:pt,className:"rounded-full w-4 h-4 bg-gray-700",loading:"lazy",onError:Xe})]}):i.jsx("img",{src:tt.kind==="hip3"?`${s}/${tt.builder}:${tt.symbol.replace(/-USDC$/,"").replace(/-USDH$/,"")}.svg`:`${s}/${oe(tt.symbol)}.svg`,alt:tt.symbol,className:"rounded-full w-4 h-4 bg-gray-700",loading:"lazy",onError:Xe})}),i.jsx("span",{className:"font-semibold text-white",children:a==="pair"||tt.kind==="hip3"?tt.symbol:tt.symbol.replace(/-USD$/,"").replace(/\/USD$/,"")}),a!=="pair"&&i.jsxs("span",{className:"ml-1 inline-flex items-center gap-1",children:[tt.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:[tt.leverage,"x"]}),tt.kind==="hip3"&&tt.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:tt.builder})]})]})}),i.jsx("td",{className:"text-right text-white font-medium align-middle",children:i.jsx(et,{children:tt.last==null||tt.last===0?"--":V(tt.last)})}),a!=="pair"&&i.jsxs(i.Fragment,{children:[i.jsx("td",{className:"text-right font-medium align-middle",children:i.jsx(et,{children:tt.chg24==null||isNaN(Number(tt.chg24))||tt.last==null||tt.last===0?"--":(()=>{const wt=Number(tt.chg24),nn=Number(tt.last),cn=nn/(1+wt/100||1),zn=nn-cn,Xt=Math.abs(zn);let on;Xt>=1e3?on=0:Xt>=100?on=2:on=4;const Zt=zn>=0?"+":"-",Ye=Xt.toLocaleString(void 0,{minimumFractionDigits:on,maximumFractionDigits:on}),Ze=`${wt>0?"+":""}${wt.toFixed(2)}%`,Ft=wt>0?"#67FFBD":"#FF7173";return i.jsx("span",{style:{color:Ft},children:`${Zt}${Ye} / ${Ze}`})})()})}),i.jsx("td",{className:"text-right text-white font-medium align-middle",children:i.jsx(et,{children:G(tt.vol)})}),i.jsx("td",{className:"text-right text-white font-medium align-middle",children:i.jsx(et,{children:tt.funding==null||isNaN(Number(tt.funding))?"--":(Number(tt.funding)*100).toFixed(4)+"%"})}),i.jsx("td",{className:"text-right text-white font-medium align-middle",children:i.jsx(et,{children:tt.openInterest==null||isNaN(Number(tt.openInterest))?"--":"$"+G(tt.openInterest)})})]})]},Kt)})})]})})]})})]})}let qP=null;function Ddn(){return typeof window>"u"?null:(qP||(qP=new Audio("/success.mp3"),qP.volume=.9),qP)}function Bdn(){const e=Ddn();if(e)try{e.currentTime=0;const t=e.play();t&&typeof t.then=="function"&&t.catch(function(){})}catch{}}function $dn(){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 ere=null;function Udn(e){typeof e=="object"&&!Array.isArray(e)?ere=e:ere=null}async function zdn(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 q4e(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 G4e(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 pX(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 gue(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 Hdn(e){return gue(e).some(t=>{const n=String(t.status||t.s||"").toLowerCase();return n.includes("placed")||n.includes("resting")})}function Vdn(e){return gue(e).some(n=>{const r=String(n.status||n.s||"").toLowerCase();return r.includes("filled")||r.includes("success")||!!n.filled})}function GP(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 YN({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 P={"Content-Type":"application/json"},I=6,R=o?"Mainnet":"Testnet",O=async(ze,nt)=>{const mt=e+ze,$t=await fetch(mt,{method:"POST",headers:P,body:JSON.stringify(nt)});if(!$t.ok)throw new Error(`HTTP ${$t.status} on ${ze}`);return $t.json()},U=(ze,nt)=>{if(!ze||typeof ze!="object")return NaN;const mt=String(nt||"").trim();if(!mt)return NaN;const $t=mt.toUpperCase();if(ze[mt]!=null){const an=Number(ze[mt]);if(Number.isFinite(an))return an}if(ze[$t]!=null){const an=Number(ze[$t]);if(Number.isFinite(an))return an}const Pt=$t.indexOf("-");if(Pt>0){const an=$t.slice(0,Pt);if($t.slice(Pt+1)==="PERP"&&ze[an]!=null){const An=Number(ze[an]);if(Number.isFinite(An))return An}}const un=Object.keys(ze).find(an=>String(an).toUpperCase()===$t);if(un){const an=Number(ze[un]);if(Number.isFinite(an))return an}return NaN},L={allMids:async()=>O("/info",{type:"allMids",dex:s}),openOrders:async(ze=t)=>O("/info",{type:"openOrders",user:ze,dex:s}),frontendOpenOrders:async(ze=t)=>O("/info",{type:"frontendOpenOrders",user:ze,dex:s}),clearinghouseState:async(ze=t)=>O("/info",{type:"clearinghouseState",user:ze,dex:s}),meta:async()=>{if(N)return N;const ze=await O("/info",{type:"allPerpMetas"});return N=ze,ze},metaAndAssetCtxs:async()=>O("/info",{type:"metaAndAssetCtxs",dex:s}),twapHistory:async(ze=t)=>O("/info",{type:"twapHistory",user:ze,dex:s}),userTwapSliceFills:async(ze=t)=>O("/info",{type:"userTwapSliceFills",user:ze,dex:s}),userTwapSliceFillsByTime:async({user:ze=t,startTime:nt,endTime:mt,aggregateByTime:$t}={})=>{const Pt={type:"userTwapSliceFillsByTime",user:ze,startTime:nt,dex:s};return mt!=null&&(Pt.endTime=mt),$t!=null&&(Pt.aggregateByTime=!!$t),O("/info",Pt)}};async function z(ze){const nt=await X(),mt=String(ze).toUpperCase();for(let $t=0;$t<nt.length;$t++){const Pt=nt[$t];if(Array.isArray(Pt.universe)){const un=Pt.universe.findIndex(an=>an.name.toUpperCase()===mt);if(un!==-1){let an;return $t===0?an=un:an=1e5+$t*1e4+un,{entry:Pt.universe[un],index:an,block:Pt}}}}throw new Error(`Unknown perp symbol: ${ze}`)}const X=async()=>{if(N)return N;const ze=await L.meta();return N=ze,ze},ne=async ze=>(await z(ze)).index,J=async ze=>(await z(ze)).entry.szDecimals,K=ze=>{const[nt,mt=""]=String(ze).split(".");if(!mt)return nt;const $t=mt.replace(/0+$/,"");return $t.length?`${nt}.${$t}`:nt},re=async(ze,nt)=>{const mt=await J(ze),$t=Math.max(0,I-Number(mt)),Pt=Math.abs(Number(nt));if(!(Pt>0)||!Number.isFinite(Pt))return $t;const un=Pt>=1?Math.floor(Math.log10(Pt))+1:0,an=Math.max(0,5-un);return Math.min($t,an)},he=async(ze,nt)=>{const mt=await re(ze,nt);return Number((1/10**mt).toFixed(mt))},Q=async(ze,nt,mt)=>{const $t=await re(ze,nt),Pt=10**-$t,un=Number(nt),an=mt?Math.floor(un/Pt)*Pt:Math.ceil(un/Pt)*Pt;return K(Number(an).toFixed($t))},ie=async(ze,nt)=>{if(nt==null||!Number.isFinite(Number(nt)))throw new Error("price required");const mt=await re(ze,nt),$t=Number(nt),Pt=mt===0?Math.round($t):Math.round($t*10**mt)/10**mt;return K(Pt.toFixed(mt))},oe=async(ze,nt)=>{if(nt==null||!Number.isFinite(Number(nt)))throw new Error("size required");const mt=await J(ze);return K(Number(nt).toFixed(Number(mt)))},G=async(ze,nt,mt,$t=a)=>{let Pt=mt;if(Pt==null){let an=U(ere,ze);if(!Number.isFinite(an)){const xn=await L.allMids();an=U(xn,ze)}if(Pt=an,!Number.isFinite(Pt))throw new Error(`Mid price not available for ${ze}`)}const un=nt?Pt*(1+$t):Pt*(1-$t);return Q(ze,un,nt)},V=new Set(["usdSend","spotSend","usdClassTransfer","withdraw3","cDeposit","cWithdraw","approveBuilderFee"]),te=()=>({name:"HyperliquidSignTransaction",version:"1",chainId:parseInt(l,16),verifyingContract:"0x0000000000000000000000000000000000000000"}),ae=(ze,nt)=>{switch(ze.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(ze.destination).toLowerCase(),amount:String(ze.amount),time:nt}};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(ze.destination).toLowerCase(),token:ze.token,amount:String(ze.amount),time:nt}};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(ze.amount),toPerp:!!ze.toPerp,nonce:nt}};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(ze.destination).toLowerCase(),amount:String(ze.amount),time:nt}};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(ze.wei),nonce:nt}};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(ze.wei),nonce:nt}};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:ze.maxFeeRate.endsWith("%")?ze.maxFeeRate:`${ze.maxFeeRate}%`,builder:ze.builder.toLowerCase(),nonce:nt}};default:return null}},fe=ze=>{const nt=ru.from(ze),mt=nt.v>=27?nt.v:nt.v+27;return{r:nt.r,s:nt.s,v:mt}},Ne=async(ze,nt)=>{const mt=ae(ze,nt);if(!mt)throw new Error("Unsupported typed action");const $t=te(),Pt=Object.assign({},mt.types,{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}]}),un=(c()||"").trim();if(un){const An=await new Eae(un).signTypedData($t,mt.types,mt.message);return fe(An)}const an=$dn();if(an){await zdn(an,l);let xn=await an.request({method:"eth_accounts"});(!xn||!xn.length)&&(xn=await an.request({method:"eth_requestAccounts"}));const An=xn[0];if(!An)throw new Error("No connected account in wallet");if(String(An).toLowerCase()!==String(t).toLowerCase())throw new Error(`Connected wallet ${An} does not match HL address ${t}.`);const kn={domain:$t,types:Pt,primaryType:mt.primaryType,message:mt.message},yn=await an.request({method:"eth_signTypedData_v4",params:[An,JSON.stringify(kn)]});return fe(yn)}throw new Error("No signer for typed action")};let me={ts:0,fee:null};async function we(ze=!1){const nt=Date.now();if(!ze&&me.fee!=null&&nt-me.ts<C)return{builder_fee:me.fee};const{address:mt,token:$t}=G4e(f);if(!mt||!$t)return{builder_fee:null};const Pt=u+"/api/subscriber/check_account/",un=await q4e(Pt,{address:mt,token:$t}),an=(un==null?void 0:un.builder_fee)!=null?Number(un.builder_fee):null;return me={ts:nt,fee:an},{builder_fee:an}}async function xe(ze){if(ze.type!=="order")return ze;const{builder_fee:nt}=await we();return nt==null?ze:{...ze,builder:{b:d,f:Number(nt)}}}function ye(ze){return ze!=null&&ze.fromStart?ze.fromStart:pX(["dextra_from_start","from_start"])||x||null}function je(ze){return ze!=null&&ze.appType?ze.appType:pX(["dextra_app_type","app_type"])||g||null}async function Pe(ze,nt){if((nt==null?void 0:nt.leverage)!=null)return Number(nt.leverage);if(typeof w=="function"){const $t=await w(ze);if($t!=null)return Number($t)}const mt=pX([`leverage:${ze}`,`${ze}_leverage`,"dextra_leverage","hl_leverage","leverage"])||v;return mt!=null?Number(mt):null}async function Re(ze){const nt=await L.clearinghouseState(t),mt=((nt==null?void 0:nt.assetPositions)||[]).find(Pt=>{var un,an;return((an=(un=Pt==null?void 0:Pt.position)==null?void 0:un.coin)==null?void 0:an.toUpperCase())===String(ze).toUpperCase()});if(!mt)return null;const $t=Number(mt.position.szi||0);return{side:$t>=0?"long":"short",size:Math.abs($t)}}async function Xe({symbol:ze,isBuy:nt,usePosSide:mt,size:$t,price:Pt,telemetry:un,oid:an}){var Cn;if(!an&&an!==0)return;const{address:xn,token:An}=G4e(f);if(!xn||!An)return;const kn=typeof window<"u"?window.localStorage.getItem("hl:wallet_id"):null,yn=ze?await Pe(ze,un):null,Vn=mt&&((Cn=await Re(ze))==null?void 0:Cn.side)||(nt?"long":"short"),{builder_fee:Gn}=await we(),Rn={address:xn,token:An,order_params:{coin:String(ze),wallet_id:kn!=null?Number(kn):null,leverage:yn!=null?Number(yn):null,size:$t!=null?Number($t):null,from_start:ye(un),app_type:je(un),price:Pt!=null?Number(Pt):null,fee_amount:Gn!=null?Number(Gn):null,side:String(Vn),oid:Number(an)}},Yn=u+"/api/hyper/order_save/";try{await q4e(Yn,Rn)}catch{}}async function Ke(ze,nt){const mt=nt??Date.now(),$t=ze.type==="order"?await xe(ze):ze,Pt=V.has($t.type)?await Ne($t,mt):await n.sign($t,mt),un={action:$t,nonce:mt,signature:Pt,...r?{vaultAddress:r}:{}};return O("/exchange",un)}async function ut(ze,nt){var an;const mt=await Ke(ze),$t=gue(mt),Pt=Vdn(mt)||Hdn(mt)||(mt==null?void 0:mt.status)==="ok"||((an=mt==null?void 0:mt.response)==null?void 0:an.status)==="ok";let un=null;return Pt&&(Bdn(),un=GP(mt),un==null&&$t&&$t.length&&(un=GP($t))),await Xe({symbol:nt.symbol,isBuy:nt.isBuy,usePosSide:!!nt.usePosSide,size:nt.size,price:nt.price,telemetry:nt.telemetry,oid:un}),mt}const et=async({symbol:ze,isBuy:nt,size:mt,price:$t,tif:Pt="Gtc",reduceOnly:un=!1,cloid:an,builder:xn,telemetry:An}={})=>{const kn=await ne(ze),yn=await oe(ze,mt),Vn=await Q(ze,$t,!!nt),Rn={type:"order",orders:[{a:kn,b:!!nt,p:Vn,s:yn,r:!!un,t:{limit:{tif:Pt}},...an?{c:an}:{}}],grouping:"na",...xn?{builder:xn}:{}};return ut(Rn,{symbol:ze,isBuy:nt,size:yn,price:Vn,telemetry:An,usePosSide:!1})},tt=async({symbol:ze,isBuy:nt,size:mt,price:$t,tif:Pt="Gtc",reduceOnly:un=!1,tpPrice:an=null,slPrice:xn=null,triggerSlippage:An=.08,cloid:kn,builder:yn,telemetry:Vn}={})=>{const Gn=await ne(ze),Rn=await oe(ze,mt),Yn=[],Cn=await Q(ze,$t,!!nt);Yn.push({a:Gn,b:!!nt,p:Cn,s:Rn,r:!!un,t:{limit:{tif:Pt}},...kn?{c:kn}:{}});const rn=!nt;if(xn!=null&&xn!==""&&Number(xn)>0){const Jt=await ie(ze,xn),sn=await G(ze,rn,Number(Jt),An);Yn.push({a:Gn,b:rn,p:sn,s:Rn,r:!0,t:{trigger:{isMarket:!0,triggerPx:Jt,tpsl:"sl"}}})}if(an!=null&&an!==""&&Number(an)>0){const Jt=await ie(ze,an),sn=await G(ze,rn,Number(Jt),An);Yn.push({a:Gn,b:rn,p:sn,s:Rn,r:!0,t:{trigger:{isMarket:!0,triggerPx:Jt,tpsl:"tp"}}})}const Oe={type:"order",orders:Yn,grouping:Yn.length>1?"normalTpsl":"na",...yn?{builder:yn}:{}};return ut(Oe,{symbol:ze,isBuy:nt,size:Rn,price:Cn,telemetry:Vn,usePosSide:!1})},Le=async({symbol:ze,tpPrice:nt=null,slPrice:mt=null,size:$t=null,useLimitPx:Pt=!1,triggerSlippage:un=.1,telemetry:an}={})=>{const xn=await Re(ze);if(!xn)throw new Error(`No open position for ${ze}`);const An=await ne(ze),kn=await oe(ze,$t??xn.size),yn=xn.side==="short",Vn=[];let Gn=null;if(mt!=null&&Number(mt)>0){const Yn=await ie(ze,mt),Cn=Pt?Yn:await G(ze,yn,Number(Yn),un);Vn.push({a:An,b:yn,p:Cn,s:kn,r:!0,t:{trigger:{isMarket:!Pt,triggerPx:Yn,tpsl:"sl"}}}),Gn=Gn??Yn}if(nt!=null&&Number(nt)>0){const Yn=await ie(ze,nt),Cn=Pt?Yn:await G(ze,yn,Number(Yn),un);Vn.push({a:An,b:yn,p:Cn,s:kn,r:!0,t:{trigger:{isMarket:!Pt,triggerPx:Yn,tpsl:"tp"}}}),Gn=Gn??Yn}if(!Vn.length)throw new Error("TP/SL price required");return ut({type:"order",orders:Vn,grouping:"normalTpsl"},{symbol:ze,isBuy:yn,size:kn,price:Gn??0,telemetry:an,usePosSide:!0})},$e=async(ze={})=>(await Xt({filter:"tpsl",symbol:ze.symbol}),Le(ze)),ht=async(ze,nt,mt,{price:$t,slippage:Pt=a,cloid:un,tif:an="Ioc",reduceOnly:xn=!1,builder:An,telemetry:kn}={})=>{const yn=await G(ze,nt,$t,Pt);return et({symbol:ze,isBuy:nt,size:mt,price:yn,tif:"FrontendMarket",reduceOnly:xn,cloid:un,builder:An,telemetry:kn})},pt=async(ze,nt,{price:mt,slippage:$t=a,cloid:Pt,tif:un="Ioc",reduceOnly:an=!0,builder:xn,telemetry:An}={})=>{let kn,yn=nt;if(yn==null){const rn=await L.clearinghouseState(t),Oe=((rn==null?void 0:rn.assetPositions)||[]).find(sn=>{var Et,Xn;return((Xn=(Et=sn==null?void 0:sn.position)==null?void 0:Et.coin)==null?void 0:Xn.toUpperCase())===String(ze).toUpperCase()});if(!Oe)throw new Error(`No position found for ${ze}`);const Jt=parseFloat(Oe.position.szi);if(!Jt)throw new Error(`No open size on ${ze}`);yn=Math.abs(Jt),kn=Jt<0}else try{const rn=await L.clearinghouseState(t),Oe=((rn==null?void 0:rn.assetPositions)||[]).find(sn=>{var Et,Xn;return((Xn=(Et=sn==null?void 0:sn.position)==null?void 0:Et.coin)==null?void 0:Xn.toUpperCase())===String(ze).toUpperCase()});kn=(Oe?parseFloat(Oe.position.szi):0)<0}catch{kn=!1}const Vn=await G(ze,kn,mt,$t),Gn=await ne(ze),Rn=await oe(ze,yn),Cn={type:"order",orders:[{a:Gn,b:kn,p:Vn,s:Rn,r:!0,t:{limit:{tif:"FrontendMarket"}},...Pt?{c:Pt}:{}}],grouping:"na",...xn?{builder:xn}:{}};return ut(Cn,{symbol:ze,isBuy:kn,size:Rn,price:Vn,telemetry:An,usePosSide:!0})},Kt=async ze=>{const nt=await L.openOrders(t),mt=ze?nt.filter(an=>an.coin.toUpperCase()===String(ze).toUpperCase()):nt;if(!mt.length)return{status:"ok",response:{type:"cancel",data:{count:0}}};const $t=new Map;for(const an of mt)$t.has(an.coin)||$t.set(an.coin,await ne(an.coin));const un={type:"cancel",cancels:mt.map(an=>({a:$t.get(an.coin),o:Number(an.oid)}))};return Ke(un)},wt=async ze=>{const nt=ze==null?{type:"scheduleCancel"}:{type:"scheduleCancel",time:Date.now()+Math.max(5e3,Number(ze))};return Ke(nt)},nn=async({symbol:ze,isBuy:nt,size:mt,minutes:$t,randomize:Pt=!1,reduceOnly:un=!1}={})=>{var Gn,Rn,Yn,Cn,rn,Oe,Jt,sn;const an=await ne(ze),xn=await oe(ze,mt),kn={type:"twapOrder",twap:{a:an,b:!!nt,s:xn,r:!!un,m:Number($t),t:!!Pt}},yn=await Ke(kn),Vn=((Yn=(Rn=(Gn=yn==null?void 0:yn.response)==null?void 0:Gn.data)==null?void 0:Rn.status)==null?void 0:Yn.error)||((rn=(Cn=yn==null?void 0:yn.response)==null?void 0:Cn.data)==null?void 0:rn.error)||((Jt=(Oe=yn==null?void 0:yn.data)==null?void 0:Oe.status)==null?void 0:Jt.error)||((sn=yn==null?void 0:yn.data)==null?void 0:sn.error);if(Vn)throw new Error(Vn);return yn},cn=async({symbol:ze,twapId:nt}={})=>{const $t={type:"twapCancel",a:await ne(ze),t:Number(nt)};return Ke($t)},zn=async({symbol:ze,oid:nt,cloid:mt}={})=>{const $t=await ne(ze);if(nt!=null&&/^\d+$/.test(String(nt)))return Ke({type:"cancel",cancels:[{a:$t,o:Number(nt)}]});if(mt)return Ke({type:"cancelByCloid",cancels:[{asset:$t,cloid:String(mt)}]});throw new Error("cancelOrder requires a numeric oid or a cloid")},Xt=async({filter:ze="all",symbol:nt=null}={})=>{const mt=await L.openOrders(t),$t=Array.isArray(mt)?mt:[],Pt=kn=>{const yn=String(kn.orderType||kn.type||"").toLowerCase();return ze==="all"?!0:ze==="limit"?yn==="limit":ze==="tpsl"?yn.includes("take profit")||yn.includes("stop"):ze==="reduceOnly"?!!kn.reduceOnly:ze==="nonReduce"?!kn.reduceOnly:!1},un=$t.filter(kn=>(!nt||String(kn.coin).toUpperCase()===String(nt).toUpperCase())&&Pt(kn));if(!un.length)return{ok:!0,count:0};const an=new Map,xn=[];for(const kn of un){let yn=an.get(kn.coin);yn||(yn=await ne(kn.coin),an.set(kn.coin,yn)),xn.push({a:yn,o:Number(kn.oid)})}return Ke({type:"cancel",cancels:xn})},on=async()=>{const ze=await L.clearinghouseState(t),mt=(Array.isArray(ze==null?void 0:ze.assetPositions)?ze.assetPositions:[]).map($t=>$t==null?void 0:$t.position).filter($t=>Math.abs(Number(($t==null?void 0:$t.szi)||0))>0);for(const $t of mt){const Pt=$t.coin,un=Math.abs(Number($t.szi));await pt(Pt,un,{tif:"FrontendMarket",reduceOnly:!0})}return!0},Zt={usdTransfer:async(ze,nt)=>{const mt=Date.now(),$t={type:"usdSend",hyperliquidChain:R,signatureChainId:l,destination:String(ze).toLowerCase(),amount:String(nt),time:mt};return Ke($t)},spotTransfer:async(ze,nt,mt)=>{const $t=Date.now(),Pt={type:"spotSend",hyperliquidChain:R,signatureChainId:l,destination:String(ze).toLowerCase(),token:nt,amount:String(mt),time:$t};return Ke(Pt)},usdClassTransfer:async(ze,nt)=>{const mt=Date.now(),$t={type:"usdClassTransfer",hyperliquidChain:R,signatureChainId:l,amount:String(ze),toPerp:!!nt,nonce:mt};return Ke($t,mt)},withdraw:async(ze,nt)=>{const mt=Date.now(),$t={type:"withdraw3",hyperliquidChain:R,signatureChainId:l,destination:String(ze).toLowerCase(),amount:String(nt),time:mt};return Ke($t,mt)},cDeposit:async ze=>{const nt=Date.now(),mt={type:"cDeposit",hyperliquidChain:R,signatureChainId:l,wei:String(ze),nonce:nt};return Ke(mt,nt)},cWithdraw:async ze=>{const nt=Date.now(),mt={type:"cWithdraw",hyperliquidChain:R,signatureChainId:l,wei:String(ze),nonce:nt};return Ke(mt,nt)},approveBuilderFee:async({builder:ze,maxFeeRate:nt})=>{const mt=Date.now(),$t={type:"approveBuilderFee",hyperliquidChain:R,signatureChainId:l,builder:String(ze).toLowerCase(),maxFeeRate:String(nt),nonce:mt};return Ke($t,mt)}},Ye=(()=>{const ze="hl:pairs",nt=()=>{try{return JSON.parse(localStorage.getItem(ze)||"[]")}catch{return[]}},mt=xn=>{try{localStorage.setItem(ze,JSON.stringify(xn))}catch{}};return{read:nt,write:mt,get:xn=>nt().find(An=>An.id===xn)||null,add:xn=>{const An=nt();An.push(xn),mt(An)},upsert:xn=>{const An=nt().filter(kn=>kn.id!==xn.id);An.push(xn),mt(An)},remove:xn=>mt(nt().filter(An=>An.id!==xn))}})(),Ze=(ze="PAIR")=>`${ze}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;async function Ft(ze,nt,mt,$t,Pt){const un=[{symbol:nt.symbol,side:"long",size:Number(nt.size),oid:GP($t)??null},{symbol:mt.symbol,side:"short",size:Number(mt.size),oid:GP(Pt)??null}];return Ye.add({id:ze,createdAt:Date.now(),legs:un}),{pairId:ze,long:{oid:un[0].oid},short:{oid:un[1].oid}}}const dn=async({long:ze,short:nt,entrySlippage:mt=a,triggerSlippage:$t=.1,telemetry:Pt,pairId:un}={})=>{if(!(ze!=null&&ze.symbol)||!(nt!=null&&nt.symbol))throw new Error("pair requires long.symbol and short.symbol");if(!(Number(ze.size)>0)||!(Number(nt.size)>0))throw new Error("pair sizes must be > 0");const an=un||Ze(),[xn,An]=await Promise.all([placeMarketWithTPSL({symbol:ze.symbol,isBuy:!0,size:Number(ze.size),entrySlippage:mt,tpPrice:ze.tpPrice??null,slPrice:ze.slPrice??null,triggerSlippage:$t,telemetry:Pt,cloid:`${an}:L`}),placeMarketWithTPSL({symbol:nt.symbol,isBuy:!1,size:Number(nt.size),entrySlippage:mt,tpPrice:nt.tpPrice??null,slPrice:nt.slPrice??null,triggerSlippage:$t,telemetry:Pt,cloid:`${an}:S`})]);return Ft(an,ze,nt,xn,An)},Yt=async({long:ze,short:nt,triggerSlippage:mt=a,telemetry:$t,pairId:Pt}={})=>{if(!(ze!=null&&ze.symbol)||!(nt!=null&&nt.symbol))throw new Error("pair requires long.symbol and short.symbol");const un=Pt||Ze(),[an,xn]=await Promise.all([ze.tpPrice||ze.slPrice?tt({symbol:ze.symbol,isBuy:!0,size:Number(ze.size),price:Number(ze.price),tif:String(ze.tif||"Gtc"),reduceOnly:!!ze.reduceOnly,tpPrice:ze.tpPrice??null,slPrice:ze.slPrice??null,triggerSlippage:mt,telemetry:$t,cloid:`${un}:L`}):et({symbol:ze.symbol,isBuy:!0,size:Number(ze.size),price:Number(ze.price),tif:String(ze.tif||"Gtc"),reduceOnly:!!ze.reduceOnly,telemetry:$t,cloid:`${un}:L`}),nt.tpPrice||nt.slPrice?tt({symbol:nt.symbol,isBuy:!1,size:Number(nt.size),price:Number(nt.price),tif:String(nt.tif||"Gtc"),reduceOnly:!!nt.reduceOnly,tpPrice:nt.tpPrice??null,slPrice:nt.slPrice??null,triggerSlippage:mt,telemetry:$t,cloid:`${un}:S`}):et({symbol:nt.symbol,isBuy:!1,size:Number(nt.size),price:Number(nt.price),tif:String(nt.tif||"Gtc"),reduceOnly:!!nt.reduceOnly,telemetry:$t,cloid:`${un}:S`})]);return Ft(un,ze,nt,an,xn)},Bt=async({long:ze,short:nt,telemetry:mt,pairId:$t}={})=>{if(!(ze!=null&&ze.symbol)||!(nt!=null&&nt.symbol))throw new Error("pair requires long.symbol and short.symbol");const Pt=$t||Ze(),[un,an]=await Promise.all([nn({symbol:ze.symbol,isBuy:!0,size:Number(ze.size),minutes:Number(ze.minutes),randomize:!!ze.randomize,reduceOnly:!!ze.reduceOnly}),nn({symbol:nt.symbol,isBuy:!1,size:Number(nt.size),minutes:Number(nt.minutes),randomize:!!nt.randomize,reduceOnly:!!nt.reduceOnly})]);return Ft(Pt,ze,nt,un,an)};async function ot(ze){var Pt;const nt=await L.clearinghouseState(t),mt=((nt==null?void 0:nt.assetPositions)||[]).find(un=>{var an,xn;return((xn=(an=un==null?void 0:un.position)==null?void 0:an.coin)==null?void 0:xn.toUpperCase())===String(ze).toUpperCase()}),$t=Number(((Pt=mt==null?void 0:mt.position)==null?void 0:Pt.szi)||0);return{size:Math.abs($t),side:$t>=0?"long":"short"}}return{updateLeverage:async(ze,nt,mt)=>{var xn,An,kn,yn,Vn,Gn,Rn,Yn;const Pt={type:"updateLeverage",asset:await ne(ze),isCross:String(nt||"").toLowerCase()==="cross",leverage:Number(mt)},un=await Ke(Pt),an=((kn=(An=(xn=un==null?void 0:un.response)==null?void 0:xn.data)==null?void 0:An.status)==null?void 0:kn.error)||((Vn=(yn=un==null?void 0:un.response)==null?void 0:yn.data)==null?void 0:Vn.error)||((Rn=(Gn=un==null?void 0:un.data)==null?void 0:Gn.status)==null?void 0:Rn.error)||((Yn=un==null?void 0:un.data)==null?void 0:Yn.error)||((un==null?void 0:un.status)==="err"?un==null?void 0:un.response:null);if(an)throw new Error(String(an));return un},placeOrder:et,placeLimitWithTPSL:tt,placeTPSLForPosition:Le,replaceTPSLForPosition:$e,cancelAllOrders:Kt,scheduleCancel:wt,marketOpen:ht,marketClose:pt,placeMarketWithTPSL:async ze=>{const nt=await G(ze.symbol,ze.isBuy,null,ze.entrySlippage??a);return tt({...ze,price:Number(nt),tif:"FrontendMarket"})},placeTwapOrder:nn,cancelTwapOrder:cn,cancelOrder:zn,cancelOrdersFiltered:Xt,closeAllPositions:on,marketOpenPair:dn,limitOpenPair:Yt,twapOpenPair:Bt,marketClosePair:async({pairId:ze,slippage:nt=a,fraction:mt=1,telemetry:$t}={})=>{const Pt=Ye.get(ze);if(!Pt)throw new Error("Unknown pairId");const[un]=Pt.legs.filter(Cn=>Cn.side==="long"),[an]=Pt.legs.filter(Cn=>Cn.side==="short");if(!un||!an)throw new Error("Pair legs corrupted");const[xn,An]=await Promise.all([ot(un.symbol),ot(an.symbol)]),kn=Math.max(0,Math.min(xn.size,un.size)*Number(mt||1)),yn=Math.max(0,Math.min(An.size,an.size)*Number(mt||1)),Vn=[];if(kn>0&&Vn.push(pt(un.symbol,kn,{slippage:nt,reduceOnly:!0,telemetry:$t,cloid:`${ze}:L:CLOSE`})),yn>0&&Vn.push(pt(an.symbol,yn,{slippage:nt,reduceOnly:!0,telemetry:$t,cloid:`${ze}:S:CLOSE`})),!Vn.length)return{pairId:ze,message:"Nothing to close"};const Gn=await Promise.all(Vn),[Rn,Yn]=await Promise.all([ot(un.symbol),ot(an.symbol)]);return Rn.size===0&&Yn.size===0&&Ye.remove(ze),{pairId:ze,results:Gn}},pairs:{list:()=>Ye.read(),get:ze=>Ye.get(ze),remove:ze=>Ye.remove(ze)},info:L,transfers:Zt,utils:{getPerpAssetId:ne,getSzDecimals:J,toPxString:ie,toSzString:oe,withSlippagePx:G,trimZeros:K,getPxDecimalsAt:re,getTickSize:he,quantizePx:Q}}}const tre="https://api.hyperliquid.xyz/info",Wdn="wss://api.hyperliquid.xyz/ws";function qdn(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 qd={rows:[],subs:new Set,started:!1,ws:null,timer:null};function yHe(){for(const e of qd.subs)try{e(qd.rows)}catch{}}async function Gdn(){const t=await(await fetch(tre,{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 Kdn(){try{const t=await(await fetch(tre,{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(tre,{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=qdn(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 K4e(){try{const[e,t]=await Promise.all([Gdn(),Kdn()]);qd.rows=[...e,...t],yHe()}catch{}}function Ydn(){if(!qd.started){qd.started=!0,K4e(),qd.timer=setInterval(K4e,6e4);try{const e=new WebSocket(Wdn);qd.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||{};Udn(r);const s=qd.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}});qd.rows=s,yHe()},e.onclose=()=>{qd.ws=null}}catch{}}}function gU(){const[e,t]=m.useState(qd.rows);return m.useEffect(()=>{Ydn(),t(qd.rows);const n=r=>{t(r)};return qd.subs.add(n),()=>{qd.subs.delete(n)}},[]),e}const mX=({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(xT,{children:s&&i.jsx(wo.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})})]})},Xdn=({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}),P=m.useRef((n==null?void 0:n.markPx)||0),I=gU(),R=l.length?l:I,O=c==="hyperliquid"&&s==="pair",U={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};m.useEffect(()=>{if(!O&&(n==null?void 0:n.markPx)!=null){const fe=n.markPx.toString(),Ne=fe.includes(".")?fe.split(".")[1].length:0;r(Ne)}},[O,n==null?void 0:n.markPx]),m.useEffect(()=>{if(!O)return;let fe=!1;const Ne=async()=>{var me;try{const xe=await(await fetch("https://api-ui.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"allMids"})})).json(),ye=((me=xe==null?void 0:xe.data)==null?void 0:me.universe)||[],[je,Pe]=String(a).split("/"),Re=ye.find(Le=>(Le==null?void 0:Le.name)===je),Xe=ye.find(Le=>(Le==null?void 0:Le.name)===Pe),Ke=Number((Re==null?void 0:Re.markPx)||0),ut=Number((Xe==null?void 0:Xe.markPx)||0),et=Number((Re==null?void 0:Re.oraclePx)||0),tt=Number((Xe==null?void 0:Xe.oraclePx)||0);if(Ke>0&&ut>0){const Le=Ke/ut,$e=et>0&&tt>0?et/tt:null;N({last:Le,mark:Le,oracle:$e});const ht=Le.toString().includes(".")?Le.toString().split(".")[1].length:0;r(ht)}}catch{}fe||setTimeout(Ne,1500)};return Ne(),()=>{fe=!0}},[O,a]);function L(fe){const Ne=new Date,me=Ne.getTime(),we=Number(fe);if(Number.isFinite(we)&&we>me){const ut=Math.max(0,Math.floor((we-me)/1e3)),et=String(Math.floor(ut/3600)).padStart(2,"0"),tt=String(Math.floor(ut%3600/60)).padStart(2,"0"),Le=String(ut%60).padStart(2,"0");return`${et}:${tt}:${Le}`}Ne.setSeconds(Ne.getSeconds()+1);const xe=Date.UTC(Ne.getUTCFullYear(),Ne.getUTCMonth(),Ne.getUTCDate(),Ne.getUTCHours(),Ne.getUTCMinutes(),Ne.getUTCSeconds()),je=new Date(Date.UTC(Ne.getUTCFullYear(),Ne.getUTCMonth(),Ne.getUTCDate(),Ne.getUTCHours()+1,0,0,0)).getTime()-xe,Pe=Math.floor(je/1e3),Re=String(Math.floor(Pe/3600)).padStart(2,"0"),Xe=String(Math.floor(Pe%3600/60)).padStart(2,"0"),Ke=String(Pe%60).padStart(2,"0");return`${Re}:${Xe}:${Ke}`}m.useEffect(()=>{f(L(u));const fe=setInterval(()=>f(L(u)),1e3);return()=>clearInterval(fe)},[u]),m.useEffect(()=>{if(O){const fe=C.mark;if(!fe)return;const Ne=P.current;fe>Ne?w("text-[#1DE6A3]"):fe<Ne&&w("text-[#FF7173]"),g(fe);const me=setTimeout(()=>w("text-white"),800);return P.current=fe,()=>clearTimeout(me)}else{if(!(n!=null&&n.markPx))return;const fe=n.markPx,Ne=P.current;fe>Ne?w("text-[#1DE6A3]"):fe<Ne&&w("text-[#FF7173]"),g(fe);const me=setTimeout(()=>w("text-white"),800);return P.current=fe,()=>clearTimeout(me)}},[O,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 Ne=Number(fe);if(!Number.isFinite(Ne))return z();const me=Math.abs(Ne);let we=1;return me>=1e3?we=1:me>=100?we=2:me>=1?we=3:me>=.1?we=4:we=6,Ne.toLocaleString(void 0,{maximumFractionDigits:we})},J=fe=>fe==null||isNaN(fe)?z():fe>=1e3?Ww(fe):fe,K=fe=>{const Ne=Number(fe);if(!Number.isFinite(Ne))return z();const me=Math.abs(Ne),we=Ne>=0?"+":"-";if(!X)return`${we}${me.toFixed(5)}`;let xe=0;me<.1?xe=6:me<1?xe=4:me<10?xe=2:me<100&&(xe=1);const ye=me.toFixed(xe),je=xe>0?ye.replace(/\.?0+$/,""):ye;return`${we}${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,Q=re!=null?K(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,Ne]=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`||Wa,alt:"pair_a",className:"w-8 h-8 min-w-8 min-h-8 rounded-full bg-[#2a2a2a]",loading:"lazy",onError:me=>hm(me)}),i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${Ne||""}.svg`||Wa,alt:"pair_b",className:"w-8 h-8 min-w-8 min-h-8 rounded-full bg-[#2a2a2a] border border-[#0f0f0f]",loading:"lazy",onError:me=>hm(me)})]})},V=O?"pair":"single",te=O?a:e,ae=O?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:O?i.jsx(G,{}):i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${U[e]||(e==null?void 0:e.split("/")[0])}.svg`||Wa,alt:"token_image",className:"w-8 h-8 min-w-8 min-h-8 rounded-full",loading:"lazy",onError:fe=>hm(fe)})}),i.jsx(xue,{markets:R,value:te,onChange:ae,loading:!R.length,showIcon:!0,mode:V})]}),i.jsx("div",{className:"hidden lg:flex bg-[#101010]",children:O?i.jsx(i.Fragment,{}):i.jsxs(i.Fragment,{children:[i.jsx(dC,{title:i.jsx(mX,{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(dC,{title:i.jsx(mX,{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(dC,{title:"24h Change",widthValue:"120px",info:Q??z(),info_2:he,color_1:ie,color_2:oe}),i.jsx(dC,{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(dC,{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(dC,{title:i.jsx(mX,{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"})]})})},dC=({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}})]}),Qdn="wss://api.hyperliquid.xyz/ws",xX=new Map;function Y4e(e){const t=(e||"").toLowerCase();return t?(xX.has(t)||xX.set(t,{key:t,ws:null,ping:null,subs:new Set,connected:!1,connecting:!1}),xX.get(t)):null}function vHe(e){if(!e||e.connecting||e.connected)return;e.connecting=!0;const t=new WebSocket(Qdn);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(()=>vHe(e),1500)};t.onclose=n,t.onerror=n}function wHe(e,t){const n=Y4e(e);return n?(n.subs.add(t),vHe(n),()=>{const r=Y4e(e);if(r&&(r.subs.delete(t),!r.subs.size&&r.ws))try{r.ws.close()}catch{}}):()=>{}}const Zdn="https://api.hyperliquid.xyz/info",gX=new Map,Jdn=["xyz"];function efn(e){const t=(e==null?void 0:e.toLowerCase())||"";return t?(gX.has(t)||gX.set(t,{key:t,rows:[],count:void 0,loading:!0,emptyTimer:null,tpslByCoin:{},viewOrdersOnly:new Set,subs:new Set}),gX.get(t)):null}function CHe(e){e.subs.forEach(t=>{try{t({rows:e.rows,count:e.count,loading:e.loading,tpslByCoin:e.tpslByCoin,viewOrdersOnly:e.viewOrdersOnly})}catch{}})}function tfn(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 X4e(e,t){const n=tfn(t);e.rows=n,e.count=n.length,e.loading=!1,CHe(e)}function KP(e,t){if(Array.isArray(t)&&t.length>0){e.emptyTimer&&(clearTimeout(e.emptyTimer),e.emptyTimer=null),X4e(e,t);return}e.emptyTimer||(e.emptyTimer=setTimeout(()=>{e.emptyTimer=null,X4e(e,[])},1e3))}function YP(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,CHe(e)}function SHe(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 NHe(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=SHe(e),s=r.length>0;return{hasAssetPositions:n,assetPositions:t,hasOpenOrders:s,openOrders:r}}function nfn(e){if(!e||typeof e!="object")return{assetPositions:[],openOrders:[]};const{hasAssetPositions:t,assetPositions:n,hasOpenOrders:r,openOrders:s}=NHe(e);return{assetPositions:t?n:[],openOrders:r?s:[]}}function bue(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=efn(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=wHe(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)&&KP(s,u.assetPositions);const d=SHe(u);d.length&&YP(s,d);return}if(c==="webData2"||c==="webData3"){const u=l.data||{},{hasAssetPositions:d,assetPositions:f,hasOpenOrders:x,openOrders:g}=NHe(u);d&&KP(s,f),x&&YP(s,g)}});return(async()=>{try{const l=Jdn.map(f=>{const x={type:"clearinghouseState",user:r};return f&&(x.dex=f),x}),c=await Promise.all(l.map(f=>fetch(Zdn,{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}=nfn(f);Array.isArray(x)&&x.length&&u.push(...x),Array.isArray(g)&&g.length&&d.push(...g)}KP(s,u),YP(s,d)}catch{KP(s,[]),YP(s,[])}})(),()=>{s.subs.delete(a),o()}},[e]),t}function AHe(e){const{count:t}=bue(e);return t}const bX=new Map;function rfn(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,subs:new Set,emptyTimer:null}),bX.get(t)):null}function sfn(e){e.subs.forEach(t=>{try{t({rows:e.rows,count:e.count,loading:e.loading})}catch{}})}function ifn(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 yX(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 Q4e(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 vX(e,t){const n=ifn(t);e.rows=n,e.count=n.length,e.loading=!1,sfn(e)}function wX(e,t,n){if(t.length>0){e.emptyTimer&&(clearTimeout(e.emptyTimer),e.emptyTimer=null),vX(e,t);return}if(n===0){e.emptyTimer&&(clearTimeout(e.emptyTimer),e.emptyTimer=null),vX(e,[]);return}e.emptyTimer||(e.emptyTimer=setTimeout(()=>{e.emptyTimer=null,!(n>0)&&vX(e,[])},2e3))}function yue(e){const t=(e==null?void 0:e.toLowerCase())||"",n=AHe(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=rfn(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=wHe(t,c=>{if(!c)return;const u=c.channel,d=c.data||{};if(u==="openOrders"){const f=yX(d);wX(a,f,n);return}if(u==="user"){const f=d.state;if(!f||!Q4e(f))return;const x=yX(f);wX(a,x,n);return}if(u==="webData2"||u==="webData3"){if(!Q4e(d))return;const f=yX(d);wX(a,f,n);return}});return()=>{a.subs.delete(o),l()}},[t,n]),r}function afn(e){const{count:t}=yue(e);return t}const mv={"1m":"1","5m":"5","15m":"15","30m":"30","1h":"60","4h":"240","12h":"720","1d":"1D","1w":"1W","1M":"1M"},Fj={"1m":60,"5m":300,"15m":900,"30m":1800,"1h":3600,"4h":14400,"12h":43200,"1d":86400,"1w":604800,"1M":2592e3},XP={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"},ofn="wss://api.starknet.extended.exchange",CX="https://api.starknet.extended.exchange/api/v1",SX="https://express-proxy-delta.vercel.app/proxy?url=",lfn={"1m":"PT1M","5m":"PT5M","15m":"PT15M","30m":"PT30M","1h":"PT1H","4h":"PT4H","12h":"PT12H","1d":"PT24H","1w":"P7D","1M":"P30D"},cfn="https://mainnet.zklighter.elliot.ai/api/v1/candles",ufn="https://mainnet.zklighter.elliot.ai/api/v1/candlesticks",dfn=["tv.js","charting_library.standalone.js","charting_library.js"];let QP=null;function ffn(e="/charting_library/"){return typeof window>"u"?Promise.resolve(null):window.TradingView&&window.TradingView.widget?Promise.resolve(window.TradingView):QP||(QP=(async()=>{for(const t of dfn){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})(),QP)}const hfn="#133024",jHe="#67FFBD",pfn="#311621",EHe="#FF79AD",mfn={background:hfn,border:jHe},xfn={background:pfn,border:EHe},gfn="#67FFBD",bfn="rgba(103,255,189,0.12)",yfn="#67FFBD",vfn="#FF797C",wfn="rgba(255,121,124,0.12)",Cfn="#FF79AD",Sfn="#67FFBD",Nfn="rgba(103,255,189,0.08)",Afn="#67FFBD",Z4e="#FF79AD",J4e="rgba(255,121,173,0.08)",eSe="#FF79AD",x9=e=>{const t=String(e||"").trim().toUpperCase();return t==="SELL"||t==="SHORT"||t==="S"?"S":t==="BUY"||t==="LONG"||t==="B"?"B":""},jO="​",tSe="tv_chart_layout_v3",bb=e=>typeof e=="string"&&e.includes("/");function jfn(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 _He(e){const t=new Date(e);return Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())}function Efn(e){const t=new Date(e),n=_He(e),r=t.getUTCDay();return n-r*864e5}function _fn(e){const t=new Date(e);return Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),1)}function xv(e,t){if(t==="1d")return _He(e);if(t==="1w")return Efn(e);if(t==="1M")return _fn(e);const n=Fj[t]||60;return Math.floor(e/1e3/n)*n*1e3}function vue(e){return/limit/i.test(String(e.type||""))?Number(e.limitPx)||0:Number(e.triggerPx)||0}function kHe(e){return Number(e.sz??e.size??e.sizeCoin??e.coinSize??e.baseSize??e.qty??e.quantity??0)||0}function kfn(e,t){const n=x9(e.sideRaw||e.side),r=/take\s*profit/i.test(String(e.type||"")),s=/stop/i.test(String(e.type||"")),a=vue(e),o=kHe(e),l=e.coin||t||"",c=o>0?` (${o.toLocaleString(void 0,{maximumFractionDigits:6})}${l?" "+l:""})`:"";return r?jO+`TP ${n==="S"?">":"<"} ${a}${c}`:s?jO+`SL ${n==="S"?"<":">"} ${a}${c}`:jO+`Limit ${a}${c}`}function Tfn(e){const t=/take\s*profit/i.test(String(e.type||"")),n=/stop/i.test(String(e.type||"")),r=x9(e.sideRaw||e.side),s=r==="S"||r==="A";return n?{txt:vfn,bg:wfn,br:Cfn}:t?s?{txt:Z4e,bg:J4e,br:eSe}:{txt:gfn,bg:bfn,br:yfn}:s?{txt:Z4e,bg:J4e,br:eSe}:{txt:Sfn,bg:Nfn,br:Afn}}function nSe(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]===jO)});return{...r,sources:s}})})}}function Ifn(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}|${vue(e)}`)}function rSe(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 ZP(e,t,n){e.forEach(r=>{r&&(typeof r.then=="function"?r.then(s=>{s!=null&&rSe(t,n,s)}).catch(()=>{}):rSe(t,n,r))})}const Pfn=(()=>{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 NX({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([]),P=m.useRef([]),I=yue(s||"").rows,R=m.useRef(null),O=m.useRef(t),U=m.useRef(new Map),L=m.useRef(0),[z,X]=m.useState([]);m.useEffect(()=>{I.length>0&&(N.current=I)},[I]);let ne;I.length===0?(L.current+=1,L.current<=1?ne=N.current:ne=I):(L.current=0,ne=I);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=`${CX}/user/orders`,fe=`${SX}${encodeURIComponent(ae)}`,me=await(await fetch(fe,{headers:{"X-Api-Key":d}})).json().catch(()=>null);if(G)return;const xe=((me==null?void 0:me.data)&&Array.isArray(me.data)&&me.data||(Array.isArray(me)?me:[])).map((ye,je)=>{var Pe;return{id:ye.id??je,market:(ye.market||"").toUpperCase(),type:(ye.type||"").toUpperCase(),side:x9(ye.side)||(ye.side||"").toUpperCase(),sideRaw:x9(ye.side)||"B",status:(ye.status||"").toUpperCase(),limitPx:Number(ye.price)||null,triggerPx:((Pe=ye.trigger)==null?void 0:Pe.triggerPrice)!=null?Number(ye.trigger.triggerPrice):null,qty:Number(ye.qty)||null,takeProfit:ye.takeProfit||null,stopLoss:ye.stopLoss||null,reduceOnly:!!ye.reduceOnly,createdTime:ye.createdTime||null,updatedTime:ye.updatedTime||null}}).filter(ye=>ye.status==="NEW"||ye.status==="PARTIALLY_FILLED");X(xe)}catch{G||X([])}};V();const te=setInterval(V,1e4);return()=>{G=!0,clearInterval(te)}},[o,d]);const K=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=Pfn;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,Q=he&&mv[he]?he:t,ie=mv[Q]||"60";m.useEffect(()=>{I.length>0&&(P.current=I)},[I]),m.useEffect(()=>{if(!w)return;const G=x.current,V=G&&G.activeChart&&G.activeChart();if(!V)return;const te=mv[t]?mv[t]:Object.values(mv).includes(t)?t:ie,ae=R.current!==e,fe=O.current!==t;if(ae){R.current=e,O.current=t;const Ne=g.current;if(Ne&&typeof Ne.clearMarksCache=="function")try{Ne.clearMarksCache()}catch{}try{V.setSymbol(e,te,()=>{var me;try{V.requestMarksRefresh&&V.requestMarksRefresh(),(me=V.autoScaleAllSeries)==null||me.call(V)}catch{}})}catch{}}else if(fe){O.current=t;try{V.setResolution(te,()=>{var Ne;try{V.requestMarksRefresh&&V.requestMarksRefresh(),(Ne=V.autoScaleAllSeries)==null||Ne.call(V)}catch{}})}catch{}}},[e,t,w,ie]),m.useEffect(()=>{let G=!0;return(async()=>{const V=await ffn(r);if(!G||!V||!V.widget||!f.current)return;f.current.innerHTML="";let te=5;function ae(xe,ye,je,Pe,Re,Xe,Ke){let ut=xe||null,et=Ke||null,tt=null,Le=null,$e=null,ht=null,pt=null,Kt=null;const wt={},nn={},cn={},zn={};let Xt=!0,on=Xe,Zt=null,Ye=0;const Ze=rn=>+String(rn).slice(0,13);let Ft="1h",dn="",Yt=[],Bt=null,ot=null,De=null;const _t=rn=>lfn[rn]||"PT1M",ze=rn=>{if(Re)return Re;const Oe=String(rn||"");return!Oe||Oe.includes("/")?"":Oe.includes("-")?Oe:`${Oe}-USD`},nt=(rn,Oe)=>{if(!Oe)return;const Jt=zn[Oe]||[],sn=Jt[Jt.length-1];sn&&sn.time===rn.time?Jt[Jt.length-1]=rn:Jt.push(rn),Jt.length>2e3&&Jt.splice(0,Jt.length-2e3),zn[Oe]=Jt},mt=(rn,Oe,Jt)=>{const sn=zn[rn]||[];return sn.length?sn.filter(Et=>Number.isFinite(Et.time)&&Et.time/1e3>=Oe&&Et.time/1e3<=Jt):[]},$t=(rn,Oe,Jt)=>{const sn=Number(on);if(!Number.isFinite(sn)||sn<=0)return[];const Et=xv(Jt*1e3,rn);return Math.floor(Et/1e3)<Oe?[]:[{time:Et,open:sn,high:sn,low:sn,close:sn,volume:0}]};function Pt(){je==="hyperliquid"&&(tt||(tt=new WebSocket("wss://api-ui.hyperliquid.xyz/ws"),tt.onopen=()=>{pt&&tt&&tt.send(JSON.stringify({method:"subscribe",subscription:pt}))},tt.onmessage=rn=>{var sn;const Oe=(sn=JSON.parse(rn.data))==null?void 0:sn.data;if(!Oe||!Oe.c)return;const Jt={time:Ze(Oe.t),open:+Oe.o,high:+Oe.h,low:+Oe.l,close:+Oe.c,volume:Oe.v??0};Object.values(wt).forEach(Et=>Et(Jt))},tt.onclose=()=>{tt=null}))}function un(){je==="extended"&&(!Kt||Le||(Le=new WebSocket(Kt),Le.onmessage=rn=>{let Oe;try{Oe=JSON.parse(rn.data)}catch{return}const Jt=Array.isArray(Oe==null?void 0:Oe.data)?Oe.data:[];Jt.length&&Jt.forEach(sn=>{const Et={time:Ze(sn.T),open:+sn.o,high:+sn.h,low:+sn.l,close:+sn.c,volume:sn.v!=null?Number(sn.v):0};!Number.isFinite(Et.time)||!Number.isFinite(Et.open)||(nt(Et,Ft),Object.values(wt).forEach(Xn=>Xn(Et)))})},Le.onclose=()=>{Le=null}))}function an(rn,Oe,Jt){if(je!=="hyperliquid")return;if($e)try{$e.close()}catch{}if(ht)try{ht.close()}catch{}ot=null,De=null,$e=new WebSocket("wss://api-ui.hyperliquid.xyz/ws"),ht=new WebSocket("wss://api-ui.hyperliquid.xyz/ws"),$e.onopen=()=>{$e&&$e.send(JSON.stringify({method:"subscribe",subscription:{type:"candle",coin:rn,interval:Jt}}))},ht.onopen=()=>{ht&&ht.send(JSON.stringify({method:"subscribe",subscription:{type:"candle",coin:Oe,interval:Jt}}))};const sn=Et=>Xn=>{var ar;const gn=(ar=JSON.parse(Xn.data))==null?void 0:ar.data;if(!gn||!gn.c)return;const Dt={time:Ze(gn.t),open:+gn.o,high:+gn.h,low:+gn.l,close:+gn.c,volume:gn.v??0};if(Et==="A"?ot=Dt:De=Dt,!ot||!De)return;const en=xv(ot.time,Ft),In=xv(De.time,Ft);if(en!==In)return;const Qn={time:Math.max(ot.time,De.time),open:ot.open/De.open,high:ot.high/De.high,low:ot.low/De.low,close:ot.close/De.close,volume:0};Object.values(wt).forEach(hr=>hr(Qn))};$e.onmessage=sn("A"),ht.onmessage=sn("B"),$e.onclose=()=>{$e=null},ht.onclose=()=>{ht=null}}function xn(rn){const Oe=String(rn||"");return Oe==="BTC"||Oe==="ETH"?2:Oe.startsWith("1000")||Oe.includes("/")?4:3}async function An(rn,Oe,Jt,sn){const gn=(Fj[Oe]||60)*1e4,Dt=Math.max(Jt*1e3,sn*1e3-gn*1e3),{data:en}=await hs.post("https://api-ui.hyperliquid.xyz/info",{type:"candleSnapshot",req:{coin:rn,interval:Oe,startTime:Dt,endTime:sn*1e3}});return(Array.isArray(en)?en:en&&en.data?en.data:[]).map(Qn=>({time:Ze(Qn.t),open:+Qn.o,high:+Qn.h,low:+Qn.l,close:+Qn.c,volume:Qn.v??0})).sort((Qn,ar)=>Qn.time-ar.time)}async function kn(rn,Oe,Jt,sn,Et){const[Xn,gn]=await Promise.all([An(rn,Jt,sn,Et),An(Oe,Jt,sn,Et)]),Dt=[];let en=0,In=0;for(;en<Xn.length&&In<gn.length;){const Qn=xv(Xn[en].time,Ft),ar=xv(gn[In].time,Ft);Qn===ar?(Dt.push({time:Math.max(Xn[en].time,gn[In].time),open:Xn[en].open/gn[In].open,high:Xn[en].high/gn[In].high,low:Xn[en].low/gn[In].low,close:Xn[en].close/gn[In].close,volume:0}),en++,In++):Qn<ar?en++:In++}return Dt}async function yn(rn,Oe,Jt,sn){if(rn==null)return[];const Et=Fj[Oe]||60,Xn=Math.max(Et,sn-Jt),gn=Math.max(1,Math.ceil(Xn/Et)),Dt={market_id:rn,resolution:Oe,r:Oe,start_timestamp:Jt*1e3,end_timestamp:sn*1e3,start:Jt*1e3,end:sn*1e3,count_back:gn,limit:gn,set_timestamp_to_end:!0},en=hr=>{if(!hr)return null;if(Array.isArray(hr)){const[h,p,S,_,k,T]=hr;return{time:Ze(h),open:+p,high:+S,low:+_,close:+k,volume:Number(T??0)||0}}const Gt=hr.t??hr.time??hr.timestamp??hr.start_timestamp??hr.startTime??hr.start_time??0,$n=hr.o??hr.open,nr=hr.h??hr.high,Rt=hr.l??hr.low,En=hr.c??hr.close,Ee=hr.v??hr.volume??hr.V??0;return{time:Ze(Gt),open:+$n,high:+nr,low:+Rt,close:+En,volume:Number(Ee??0)||0}},In=hr=>hr.map(Gt=>en(Gt)).filter(Gt=>Gt&&Number.isFinite(Gt.time)&&Number.isFinite(Gt.open)&&Gt.time/1e3>=Jt&&Gt.time/1e3<=sn).sort((Gt,$n)=>Gt.time-$n.time),Qn=async hr=>{const{data:Gt}=await hs.get(hr,{params:Dt});return Gt?Array.isArray(Gt.c)?Gt.c:Array.isArray(Gt.data)?Gt.data:Array.isArray(Gt.candlesticks)?Gt.candlesticks:Array.isArray(Gt.candles)?Gt.candles:Array.isArray(Gt)?Gt:[]:[]};let ar=[];try{ar=await Qn(cfn)}catch{}if(!ar.length)try{ar=await Qn(ufn)}catch{}return In(ar)}async function Vn(rn,Oe,Jt,sn){if(!rn)return[];const Et=Fj[Oe]||60,Xn=Math.max(Et,sn-Jt),gn=Math.min(1e4,Math.max(1,Math.ceil(Xn/Et))),Dt=_t(Oe),en=`${CX}/info/candles/${rn}/trades?interval=${Dt}&limit=${gn}&endTime=${sn*1e3}`,In=`${SX}${encodeURIComponent(en)}`,{data:Qn}=await hs.get(In);return(Array.isArray(Qn==null?void 0:Qn.data)?Qn.data:[]).map(hr=>({time:Ze(hr.T),open:+hr.o,high:+hr.h,low:+hr.l,close:+hr.c,volume:hr.v!=null?Number(hr.v):0})).filter(hr=>Number.isFinite(hr.time)&&Number.isFinite(hr.open)&&hr.time/1e3>=Jt&&hr.time/1e3<=sn).sort((hr,Gt)=>hr.time-Gt.time)}async function Gn(rn,Oe,Jt){if(!ut)return[];if(bb(rn))return[];const{data:sn}=await hs.post("https://api.hyperliquid.xyz/info",{type:"userFills",user:ut,coin:rn,startTime:Oe*1e3,endTime:Jt*1e3});return(Array.isArray(sn)?sn:sn&&sn.data?sn.data:[]).filter(gn=>{const Dt=gn.coin||gn.asset||gn.symbol;return Dt?String(Dt).toUpperCase()===String(rn).toUpperCase():!0}).map(gn=>({t:+String(gn.time).slice(0,13),b:jfn(gn),px:Number(gn.px||gn.price),sz:Number(gn.sz||gn.size)})).filter(gn=>gn.t/1e3>=Oe&&gn.t/1e3<=Jt&&Number.isFinite(gn.px)&&gn.px>0)}async function Rn(rn,Oe,Jt){if(!et)return[];if(!rn)return[];const sn=`${CX}/user/trades`,Et=`${SX}${encodeURIComponent(sn)}`,{data:Xn}=await hs.get(Et,{headers:{"X-Api-Key":et}}),gn=Array.isArray(Xn==null?void 0:Xn.data)?Xn.data:Array.isArray(Xn)?Xn:[],Dt=String(rn||"").toUpperCase();return gn.filter(en=>String(en.market||"").toUpperCase()===Dt).map(en=>({t:+String(en.createdTime||en.time||en.paidTime||0).slice(0,13),b:x9(en.side)!=="S"})).filter(en=>en.t/1e3>=Oe&&en.t/1e3<=Jt&&Number.isFinite(en.t))}function Yn(rn){nn[rn]&&(clearInterval(nn[rn]),delete nn[rn])}function Cn(){Object.keys(nn).forEach(rn=>{Yn(rn)})}return{setWallet:rn=>{ut=rn||null,dn="",Yt=[],Bt=null},setExtendedApiKey:rn=>{et=rn||null,dn="",Yt=[],Bt=null},setExtendedFallbackPrice:rn=>{on=rn},clearMarksCache:()=>{dn="",Yt=[],Bt=null},onReady:rn=>rn({supported_resolutions:Object.values(mv),supports_group_request:!1,supports_marks:!0,supports_timescale_marks:!1,supports_time:!0}),resolveSymbol:(rn,Oe)=>{Zt=rn;const Jt=cn[rn]??xn(rn);cn[rn]=Jt,typeof ye=="function"&&ye(Jt),Oe({name:rn,ticker:rn,full_name:rn,description:bb(rn)?rn:rn+"/USD",type:"crypto",session:"24x7",timezone:re,exchange:je==="lighter"?"Lighter":je==="extended"?"Extended":"Hyperliquid",pricescale:Math.pow(10,Jt),minmov:1,has_intraday:!0,supported_resolutions:Object.values(mv),data_status:"streaming"})},getServerTime:rn=>rn(Math.floor(Date.now()/1e3)),getBars:async(rn,Oe,{from:Jt,to:sn},Et,Xn)=>{const gn=rn.ticker||rn.name,Dt=++Ye;try{const en=XP[Oe]||"1m";en&&(Ft=en);let In=[];if(je==="lighter")bb(gn)||(In=await yn(Pe,en,Jt,sn));else if(je==="extended"){if(!bb(gn)){const Qn=ze(gn);if(Qn&&Xt)try{In=await Vn(Qn,en,Jt,sn)}catch{Xt=!1}In.length||(In=mt(en,Jt,sn)),In.length||(In=$t(en,Jt,sn))}}else if(bb(gn)){const Qn=String(gn).split("/"),ar=Qn[0],hr=Qn[1];In=await kn(ar,hr,en,Jt,sn)}else In=await An(gn,en,Jt,sn);if(gn!==Zt||Dt!==Ye)return;Et(In,{noData:In.length===0})}catch(en){const In=en&&en.response&&en.response.status;if(je==="lighter"&&In===400){gn===Zt&&Dt===Ye&&Et([],{noData:!0});return}try{Xn(en&&en.message?en.message:"Datafeed error")}catch{}}},getMarks:async(rn,Oe,Jt,sn,Et)=>{const Xn=rn.ticker||rn.name;if(bb(Xn))return sn([]);const gn=XP[Et]||null;gn&&(Ft=gn);let Dt=Number(Oe),en=Number(Jt);const In=Math.floor(Date.now()/1e3);(!Number.isFinite(Dt)||!Number.isFinite(en)||en<=Dt||Dt<=0||en<=0)&&(en=In,Dt=en-30*24*3600);const Qn=je==="extended"?ze(Xn):Xn;if(je==="extended"&&!et)return sn([]);const ar=[je,Qn||Xn,Dt,en,Ft];je==="extended"&&ar.push(et||"no-key");const hr=ar.join("|");if(hr===dn&&Yt.length)return sn(Yt);if(Bt&&Bt.key===hr){const $n=await Bt.promise;return sn($n)}Bt={key:hr,promise:(async()=>{try{let $n=new Map;if(je==="hyperliquid"){const Rt=await Gn(Xn,Dt,en);$n=new Map;for(const En of Rt){const Ee=xv(En.t,Ft),h=Math.floor(Ee/1e3),p=En.b?"B":"S",S=h+"-"+p;$n.has(S)||$n.set(S,{time:h,isBuy:En.b})}}else if(je==="extended"){const Rt=await Rn(Qn,Dt,en);$n=new Map;for(const En of Rt){const Ee=xv(En.t,Ft),h=Math.floor(Ee/1e3),p=En.b?"B":"S",S=h+"-"+p;$n.has(S)||$n.set(S,{time:h,isBuy:En.b})}}const nr=Array.from($n.values()).map((Rt,En)=>({id:Rt.time+"-"+(Rt.isBuy?"B":"S")+"-"+En,time:Rt.time,color:Rt.isBuy?mfn:xfn,label:Rt.isBuy?"B":"S",labelFontColor:Rt.isBuy?jHe:EHe,text:Rt.isBuy?"Buy":"Sell",minSize:16,borderWidth:1,hoveredBorderWidth:2})).sort((Rt,En)=>Rt.time-En.time);return dn=hr,Yt=nr,Bt=null,nr}catch{return Bt=null,[]}})()};const Gt=await Bt.promise;sn(Gt)},getTimescaleMarks:(rn,Oe,Jt,sn)=>sn([]),subscribeBars:(rn,Oe,Jt,sn)=>{const Et=rn.ticker||rn.name,Xn=XP[Oe]||"1m";if(wt[sn]=Jt,Ft=Xn,je==="lighter"){Yn(sn);const gn=Fj[Ft]||60,Dt=Math.max(2e3,Math.min(15e3,Math.floor(gn*1e3/3)));let en=0;const In=async()=>{try{const Qn=Math.floor(Date.now()/1e3),ar=Qn-gn*500,hr=await yn(Pe,Ft,ar,Qn);if(!Array.isArray(hr)||!hr.length)return;const Gt=hr[hr.length-1];if(!Number.isFinite(Gt.time))return;if(Gt.time>en){en=Gt.time;const $n=wt[sn];$n&&$n(Gt)}}catch{}};In(),nn[sn]=setInterval(In,Dt);return}if(je==="extended"){if(bb(Et))return;const gn=ze(Et);if(!gn)return;const Dt=_t(Xn);if(Kt=`${ofn}/stream.extended.exchange/v1/candles/${encodeURIComponent(gn)}/trades?interval=${encodeURIComponent(Dt)}`,Le){try{Le.close()}catch{}Le=null}un();return}if(je==="hyperliquid")if(bb(Et)){const gn=String(Et).split("/"),Dt=gn[0],en=gn[1];an(Dt,en,Xn)}else{if(pt={type:"candle",coin:Et,interval:Xn},tt){try{tt.close()}catch{}tt=null}Pt()}},unsubscribeBars:rn=>{delete wt[rn],Yn(rn)},cleanup:()=>{try{tt&&tt.close()}catch{}try{Le&&Le.close()}catch{}try{$e&&$e.close()}catch{}try{ht&&ht.close()}catch{}Cn(),dn="",Yt=[],Bt=null,ot=null,De=null,Kt=null}}}const fe=ae(s||null,xe=>{te=xe},o,l,c,u,o==="extended"?d:null);g.current=fe;let Ne=null;if(typeof window<"u"){const xe=window.localStorage.getItem(tSe);if(xe)try{Ne=nSe(JSON.parse(xe))}catch{}}const me={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:xe=>Number(xe).toLocaleString("en-US",{minimumFractionDigits:te,maximumFractionDigits:te})},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}};Ne?me.saved_data=Ne:(me.symbol=e,me.interval=ie);const we=new window.TradingView.widget(me);x.current=we,we.onChartReady(()=>{const xe=we.activeChart(),ye=()=>{var Pe;try{(Pe=xe.autoScaleAllSeries)==null||Pe.call(xe)}catch{}},je=()=>{!we||!we.save||typeof window>"u"||we.save(Pe=>{try{const Re=nSe(Pe||{});window.localStorage.setItem(tSe,JSON.stringify(Re||{}))}catch{}})};if(!Ne)try{const Pe=Math.floor(Date.now()/1e3);xe.setVisibleRange({from:Pe-30*24*3600,to:Pe},{percentRightMargin:.2}),ye()}catch{}try{xe.setEntityMarksVisible(!0)}catch{}xe.onIntervalChanged().subscribe(null,Pe=>{try{const Re=XP[Pe]||Pe||ie;Re&&typeof window<"u"&&window.localStorage.setItem("tranding_chart_interval_time",Re)}catch{}try{xe.requestMarksRefresh()}catch{}je()}),we.subscribe("onAutoSaveNeeded",()=>{je()}),je(),C(!0)})})(),()=>{G=!1;const V=x.current,te=g.current;try{const ae=V&&V.activeChart&&V.activeChart();ae&&(ZP(v.current,V,ae),v.current.clear(),ZP(U.current,V,ae),U.current.clear())}catch{}try{te&&te.cleanup&&te.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 te=v.current;ZP(te,G,V),te.clear();const ae=Array.isArray(K)?K:[];if(!ae.length)return;const fe=V.getVisibleRange&&V.getVisibleRange(),Ne=Math.floor(Date.now()/1e3),me=fe&&fe.to||Ne,we=new Map;for(const xe of ae){const ye=vue(xe);if(!Number.isFinite(ye)||ye<=0)continue;const je=xe.sideRaw==="S"?"S":"B",Pe=/take\s*profit/i.test(String(xe.type||"")),Re=/stop/i.test(String(xe.type||"")),Ke=`${ye}|${je}|${Pe?"TP":Re?"SL":"L"}`,ut=kHe(xe);if(!we.has(Ke))we.set(Ke,{base:xe,px:ye,sz:ut});else{const et=we.get(Ke);et.sz+=ut}}we.forEach(({base:xe,px:ye,sz:je})=>{const Pe=Tfn(xe),Re={...xe,sz:je},Xe=kfn(Re,e),Ke={time:me,price:ye};try{const ut=V.createMultipointShape([Ke],{shape:"horizontal_line",text:Xe,lock:!0,disableSelection:!0,disableSave:!0,overrides:{linecolor:Pe.br,linewidth:1,linestyle:2,extendLeft:!0,extendRight:!0,showLabel:!0,textcolor:Pe.txt,fillBackground:!0,backgroundColor:Pe.bg,bold:!1,fontsize:11}}),et=Ifn(Re,e);v.current.set(et,ut)}catch{}})},[K,w,e,o]),m.useEffect(()=>{if(!w||K.length>0)return;const G=x.current,V=G&&G.activeChart&&G.activeChart();if(!V)return;let te=null;try{const we=V.getPanes&&V.getPanes();if(Array.isArray(we)&&we[0]){const xe=we[0].getRightPriceScales&&we[0].getRightPriceScales();Array.isArray(xe)&&xe[0]?te=xe[0]:we[0].getMainSourcePriceScale&&(te=we[0].getMainSourcePriceScale())}}catch{}const ae=U.current;if(ZP(ae,G,V),ae.clear(),!Array.isArray(a)){try{te&&te.setAutoScale(!0)}catch{}return}const fe=V.getVisibleRange&&V.getVisibleRange(),Ne=Math.floor(Date.now()/1e3),me=fe&&fe.to||Ne;if(a.forEach((we,xe)=>{const ye=Number(typeof we=="number"?we:we&&we.price);if(!Number.isFinite(ye)||ye<=0)return;const je=typeof we=="object"&&we?we.side:null,Pe=je==="buy"?"#1EC98A":je==="sell"?"#FF5C7A":"#444CFF";try{const Re=V.createMultipointShape([{time:me,price:ye}],{shape:"horizontal_line",lock:!0,disableSelection:!0,disableSave:!0,text:"",overrides:{linecolor:Pe,linewidth:1,linestyle:2,extendLeft:!0,extendRight:!0,showLabel:!1,fillBackground:!1}});ae.set(`grid-${e}-${xe}-${ye}`,Re)}catch{}}),te)try{te.setAutoScale(!0)}catch{}},[a,w,e,K.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 Ffn=({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(AX(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(AX(l));const ne=setInterval(()=>u(AX(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 K=setTimeout(()=>g("text-white"),700);return v.current=ne,()=>clearTimeout(K)},[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",P=ne=>{const J=Number(ne);if(!Number.isFinite(J))return null;const K=Math.abs(J);let re=1;return K>=1e3?re=1:K>=100?re=2:K>=1?re=3:K>=.1?re=4:re=6,J.toLocaleString(void 0,{maximumFractionDigits:re})},I=ne=>ne==null||isNaN(ne)?null:ne>=1e3?Ww(ne):ne,R=ne=>{const J=Number(ne);if(!Number.isFinite(J))return null;const K=Math.abs(J),re=J>=0?"+":"-";if(!o)return`${re}${K.toFixed(5)}`;let he=0;K<.1?he=6:K<1?he=4:K<10?he=2:K<100&&(he=1);const Q=K.toFixed(he),ie=he>0?Q.replace(/\.?0+$/,""):Q;return`${re}${ie}`},O=w!=null?R(w):null,U=d!=null?o?P(d):I(d):null,L=(e==null?void 0:e.dayNtlVlm)!=null?`$${Ww(Number(e.dayNtlVlm))}`:null,z=(e==null?void 0:e.oraclePx)!=null&&(e==null?void 0:e.openInterest)!=null?`$${Ww(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(xue,{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(Q7,{label:"Mid Price",value:U,tone:x}),i.jsx(Q7,{label:"24h Change",value:O,sub:C!=null?`${C>=0?"+":"-"}${Math.abs(C).toFixed(2)}%`:null,tone:N}),i.jsx(Q7,{label:"Vol 24h",value:L}),i.jsx(Q7,{label:"Open Interest",value:z}),i.jsx(Q7,{label:"Funding",value:X,sub:e!=null&&e.funding?c:null,tone:"text-[#50D2C1]"})]})})]})};function AX(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 Q7=({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(Ofn,{w:"90px"})}),n!=null&&i.jsx("span",{className:`text-[11px] leading-none ${r}`,children:n})]}),Ofn=({w:e="90px"})=>i.jsx("span",{className:"inline-block align-middle h-[12px] rounded skeleton-ticker-text short",style:{width:e}}),Mfn=({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(Op,{name:"Total Positions",info:t!=null&&t.total_notional?`$${td(t==null?void 0:t.total_notional)}`:"--",color:1}),i.jsx(Op,{name:"Traders",info:t!=null&&t.total_traders?`${td(t==null?void 0:t.total_traders)}`:"--",color:1,info_1:"true"}),i.jsx(Pne,{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(Op,{name:"Long",info:t!=null&&t.long_qty?`${Er(t==null?void 0:t.long_qty)} ${e}`:"--",color:2}),i.jsx(Op,{name:"Total",info:t!=null&&t.total_qty?`${Er(t==null?void 0:t.total_qty)} ${e}`:"--",color:1}),i.jsx(Op,{name:"Short",info:t!=null&&t.short_qty?`${Er(t==null?void 0:t.short_qty)} ${e}`:"--",color:3,info_1:"true"}),i.jsx(Pne,{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:mJ,alt:""})]}),i.jsx(Op,{name:"Total Notional",info:t!=null&&t.total_long_notional?`$${td(t==null?void 0:t.total_long_notional)}`:"--",color:1}),i.jsx(Op,{name:"Avg Entry",info:t!=null&&t.avg_long_entry?`$${Er(t==null?void 0:t.avg_long_entry)}`:"--",color:1}),i.jsx(Op,{name:"Total PnL",info:t!=null&&t.total_long_pnl?`$${td(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(sSe,{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:xJ,alt:""})]}),i.jsx(Op,{name:"Total Notional",info:t!=null&&t.total_short_notional?`$${td(t==null?void 0:t.total_short_notional)}`:"--",color:1}),i.jsx(Op,{name:"Avg Entry",info:t!=null&&t.avg_short_entry?`$${Er(t==null?void 0:t.avg_short_entry)}`:"--",color:1}),i.jsx(Op,{name:"Total PnL",info:t!=null&&t.total_short_pnl?`$${td(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(sSe,{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"]})]})]})]})]})}),Op=({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]`})]}),sSe=({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]`})}),Rfn="wss://api.hyperliquid.xyz/ws",Lfn="https://api.hyperliquid.xyz/info",ZL=e=>e==null?0:Number(e),JL=(e,t=6)=>isNaN(e)?"--":e.toLocaleString(void 0,{maximumFractionDigits:t}),Dfn=(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})},Bfn=e=>{if(e>=1)return e.toLocaleString();const t=Math.min(8,Math.max(0,-Math.floor(Math.log10(e))));return e.toFixed(t)},THe={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}}},$fn=e=>{if(!e)return null;const t=String(e).toUpperCase(),n=THe[t];return n?Object.values(n).map(s=>s.value).filter(s=>Number.isFinite(s)&&s>0).sort((s,a)=>s-a):null},Ufn=(e,t)=>{if(!e)return null;const n=String(e).toUpperCase(),r=THe[n];if(!r)return null;const s=Number(t)||0;return Object.values(r).find(l=>l.value===s)||null};function iSe(e,t,n){const r=new Map;for(const s of e||[]){const a=ZL(s.px),o=ZL(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 zfn(e){var o;const n=await fetch(Lfn,{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 Hfn(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 Vfn(e){const t=e.toFixed(18).replace(/0+$/g,"").replace(/\.$/,""),n=Number(t);return Number.isFinite(n)?n:0}function Wfn(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(Vfn),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 aSe(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 qfn(e){if(!e)return[];const t=String(e).trim(),n=$fn(t);if(n&&n.length)return n;const r=t.toUpperCase();try{const s=await zfn(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=Hfn(s);let c=Wfn(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:aSe(t)}catch(s){return console.error("getUiStepsForCoin error",t,s),aSe(t)}}function Gfn(e,t){const n=Ufn(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 Kfn(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 Yfn({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([]),P=(G,V)=>x==="USD"?G*V:G,I=x==="USD"?"USD":e,R=G=>{const V=s.current;V&&V.readyState===WebSocket.OPEN?V.send(JSON.stringify(G)):(a.current.push(G),O())},O=()=>{const G=s.current;if(G&&(G.readyState===WebSocket.OPEN||G.readyState===WebSocket.CONNECTING)||o.current)return;const V=new WebSocket(Rfn);s.current=V,V.onopen=()=>{l.current=0,a.current.splice(0,a.current.length).forEach(ae=>V.send(JSON.stringify(ae)))},V.onmessage=te=>{var Re;const ae=JSON.parse(te.data||"{}");if((ae==null?void 0:ae.channel)!=="l2Book")return;const fe=(ae==null?void 0:ae.data)??ae,Ne=(fe==null?void 0:fe.coin)??(ae==null?void 0:ae.coin);if(!Ne||Ne!==c.current)return;const me=(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 we,xe;if(Array.isArray(me))we=me[0]||[],xe=me[1]||[];else if(me)we=me.bs||me.bids||[],xe=me.as||me.asks||[];else return;const ye=Xe=>(Xe||[]).map(Ke=>{const ut=Number(Array.isArray(Ke)?Ke[0]:Ke.px),et=Number(Array.isArray(Ke)?Ke[1]:Ke.sz);return{px:ut,sz:et}}).filter(Ke=>Number.isFinite(Ke.px)&&Ke.px>0&&Number.isFinite(Ke.sz)&&Ke.sz>0),je=ye(we),Pe=ye(xe);f({bids:je,asks:Pe})},V.onclose=()=>{l.current=Math.min(l.current+1,6),o.current=setTimeout(()=>{o.current=null,O()},500*Math.pow(2,l.current))},V.onerror=()=>{try{V.close()}catch{}}},U=G=>{G&&(Kfn(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 O(),(async()=>{const V=await qfn(e);G||(N(V),w(V[0]??null))})(),()=>{G=!0}},[e]),m.useEffect(()=>{if(!e)return;const G=v||1,{nSigFigs:V,mantissa:te}=Gfn(G,e),ae={type:"l2Book",coin:e};V!=null&&(ae.nSigFigs=V),te!=null&&(ae.mantissa=te),U(ae)},[e,v]);const z=m.useMemo(()=>(d.bids||[]).map(G=>ZL(G.px)).filter(G=>Number.isFinite(G)&&G>0),[d]),X=m.useMemo(()=>(d.asks||[]).map(G=>ZL(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 K=m.useMemo(()=>{const G=Number(v)||1,V=iSe(d.bids,G,"bid").sort((ae,fe)=>fe.price-ae.price),te=iSe(d.asks,G,"ask").sort((ae,fe)=>ae.price-fe.price);return{bids:V,asksAsc:te}},[d,v]),re=m.useMemo(()=>{const G=K.asksAsc.slice(0,t);let V=0;return G.map(ae=>(V+=P(ae.size,ae.price),{...ae,total:V})).reverse()},[K,t,x]),he=m.useMemo(()=>{const G=K.bids.slice(0,t);let V=0;return G.map(te=>(V+=P(te.size,te.price),{...te,total:V}))},[K,t,x]),Q=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(lSe,{value:String(v??""),onChange:G=>w(Number(G)),items:(C||[]).map(G=>({key:String(G),label:Bfn(G)}))}),i.jsx(lSe,{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 (",I,")"]}),i.jsxs("span",{className:"uppercase text-right",children:["Total (",I,")"]})]}),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(oSe,{side:"ask",step:Number(v)||1,price:G.price,size:G.size!=null?P(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:Q?JL(Q.diff,4):"--"}),i.jsx("span",{className:"text-right",children:Q?`${JL(Q.pct,4)}%`:"--"})]}),he.map((G,V)=>i.jsx(oSe,{side:"bid",step:Number(v)||1,price:G.price,size:G.size!=null?P(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 oSe({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?"—":Dfn(t,o)}),i.jsx("span",{className:"text-center text-[#dcdada] hover:text-white",children:c?"—":JL(n,f?0:6)}),i.jsx("span",{className:"text-right text-[#a8a8a8] hover:text-white",children:c?"—":JL(r,f?0:6)})]})]})}function lSe({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 Xfn="wss://api.hyperliquid.xyz/ws",Qfn=e=>`https://app.hyperliquid.xyz/explorer/tx/${e}`,cSe=e=>e==null?0:Number(e),Zfn=(e,t=6)=>isNaN(e)?"--":e.toLocaleString(void 0,{maximumFractionDigits:t}),Jfn=e=>isNaN(e)?"--":e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:4}),ehn=e=>new Date(e).toLocaleTimeString([],{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"});function thn({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(Xfn),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],P=[],I=new Set;for(const R of N){const O=R.tid??`${R.hash??""}-${R.time??""}`;if(!I.has(O)&&(I.add(O),P.push(R),P.length>=t))break}return P.sort((R,O)=>(O.time||0)-(R.time||0)),P})},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=cSe(u.px),f=cSe(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:Jfn(d)}),i.jsx("div",{className:"text-right text-[#dcdada]",children:Zfn(f)}),i.jsx("div",{className:"text-right text-[#a8a8a8]",children:u.time?ehn(u.time):"--:--:--"}),i.jsx("div",{className:"flex justify-end",children:u.hash?i.jsx("a",{href:Qfn(u.hash),target:"_blank",rel:"noreferrer",className:"text-white hover:text-white opacity-70 hover:opacity-100",children:i.jsx(met,{className:"w-4 h-4 shrink-0"})}):null})]},(u.tid??u.hash)+String(u.time))})})]})}function nhn({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 P=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 ${P?"text-white":"text-[#a8a8a8] hover:text-white"}`,children:[P&&i.jsx(wo.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(xT,{mode:"wait",custom:w,children:i.jsxs(wo.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(Mfn,{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(Yfn,{coin:e,rows:9,onSelectPrice:o,onBest:l})}),u==="trades"&&i.jsx("div",{className:"h-full overflow-auto",children:i.jsx(thn,{coin:e})})]},u)})})]})})}const IHe="#101010",Po="#101010",Ma="#2b3640",Di="#929292",vi="#929292",Pg="#67FFBD",Oj="#FF7272",rhn="https://dextrabothypev2.nftinit.io",shn=[{key:"market",label:"Market"},{key:"limit",label:"Limit"},{key:"twap",label:"Twap"}];function ihn({mode:e,onModeChange:t,className:n=""}){const r=m.useMemo(()=>shn,[]),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 ${Ma}`},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":vi,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 y4({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 ${Ma}`},children:e})}function yb({label:e,value:t,onChange:n,right:r,clearZeroOnFocus:s=!0,restoreZeroOnBlur:a=!0}){const o=r?Ae.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:vi},children:e}),i.jsxs("div",{className:"flex items-center gap-2 h-[30px] px-2 rounded-lg",style:{background:Po,border:`1px solid ${Ma}`},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 JP({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:Po,color:Di},children:[a," ▾"]}),r&&i.jsx("div",{className:"absolute right-0 z-40 mt-1 min-w-[140px] rounded-md p-1",style:{background:Po,border:`1px solid ${Ma}`},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":Di},onClick:()=>{t(l.key),s(!1)},children:l.label},l.key))})]})}function gv({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:Di},children:t})]})}function uSe({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 dm({title:e,children:t}){return i.jsxs("div",{className:"w-[520px] max-w-[92vw]",style:{background:IHe,border:`1px solid ${Ma}`,borderRadius:16,padding:16},children:[e&&i.jsx("div",{className:"mb-3 text-sm font-semibold",style:{color:Di},children:e}),t]})}function F0({children:e,onClick:t}){return i.jsx("button",{onClick:t,className:"w-full h-[38px] rounded-xl font-semibold text-sm",style:{background:Pg,color:"#0f151a"},children:e})}function jX({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)":Po,border:`1px solid ${e?"#67FFBD":Ma}`,color:Di},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:vi},children:r})]})}function Jh({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?Na.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 Jp({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 nre(e=""){return e?`${e.slice(0,6)}...${e.slice(-4)}`:""}const EX="https://api.hyperliquid.xyz/info",ahn="wss://api.hyperliquid.xyz/ws",_X={accountValue:0,withdrawable:0,totalNtlPos:0,totalRawUsd:0,totalMarginUsed:0,crossMaintenanceMarginUsed:0,unrealizedPnl:0,crossAccountValue:0};function bT(e){const[t,n]=m.useState(_X),[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 P=!0;return n(_X),s([]),o({}),c({}),d({}),x(!1),e?((async()=>{try{const[I,R,O]=await Promise.all([fetch(EX,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"clearinghouseState",user:e})}),fetch(EX,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"spotClearinghouseState",user:e})}),fetch(EX,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"spotMeta"})})]);if(!P)return;const U=await I.json(),L=await R.json(),z=await O.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,K={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={},Q={};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),Q[G]={tokenId:oe.tokenId||null,evmContract:oe.evmContract||null})}),!P)return;n(K),s(re),o(he),c(Q)}catch{if(!P)return;n(_X),s([]),o({}),c({})}finally{P&&x(!0)}})(),()=>{P=!1}):(P&&x(!0),()=>{P=!1})},[e]),m.useEffect(()=>{if(!e)return;const P=new WebSocket(ahn);return g.current=P,P.onopen=()=>{[{method:"subscribe",subscription:{type:"user",user:e}},{method:"subscribe",subscription:{type:"webData2",user:e}}].forEach(I=>P.send(JSON.stringify(I))),v.current=setInterval(()=>{P.readyState===WebSocket.OPEN&&P.send(JSON.stringify({id:99,method:"ping"}))},3e4)},P.onmessage=I=>{var R,O,U,L,z,X;try{const ne=JSON.parse(I.data);if((ne==null?void 0:ne.channel)==="webData2"&&((R=ne==null?void 0:ne.data)!=null&&R.clearinghouseState)){const K=ne.data.clearinghouseState,re=(K==null?void 0:K.marginSummary)||{},he=(K==null?void 0:K.crossMarginSummary)||{},Q=Array.isArray(K==null?void 0:K.assetPositions)?K.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:(K==null?void 0:K.withdrawable)!=null?Number(K.withdrawable):ie.withdrawable,totalMarginUsed:Number((re==null?void 0:re.totalMarginUsed)||0),crossMaintenanceMarginUsed:Number((K==null?void 0:K.crossMaintenanceMarginUsed)||0),crossAccountValue:Number((he==null?void 0:he.accountValue)||0),unrealizedPnl:Q}))}if((ne==null?void 0:ne.channel)==="webData2"&&Array.isArray((O=ne==null?void 0:ne.data)==null?void 0:O.assetCtxs)){const K={};for(const re of ne.data.assetCtxs){const he=re==null?void 0:re.coin,Q=Number((re==null?void 0:re.midPx)??(re==null?void 0:re.markPx)??(re==null?void 0:re.px));he&&Number.isFinite(Q)&&(K[he]=Q)}Object.keys(K).length&&d(re=>({...re,...K}))}if((ne==null?void 0:ne.channel)==="user"&&((U=ne==null?void 0:ne.data)!=null&&U.state)){const K=ne.data.state,re=(K==null?void 0:K.marginSummary)||{},he=Array.isArray(K==null?void 0:K.assetPositions)?K.assetPositions.reduce((Q,ie)=>{var oe;return Q+Number(((oe=ie==null?void 0:ie.position)==null?void 0:oe.unrealizedPnl)||0)},0):void 0;n(Q=>({...Q,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 K=J.filter(re=>re&&re.coin).map(re=>({coin:String(re.coin),total:Number(re.total||0),hold:Number(re.hold||0)}));s(K)}}catch{}},P.onclose=()=>{v.current&&clearInterval(v.current)},P.onerror=()=>{},()=>{v.current&&clearInterval(v.current);try{P.close()}catch{}}},[e]);const w=m.useMemo(()=>({spot:r.reduce((I,R)=>{if(R.coin==="USDC")return I+Number(R.total||0);const O=u[R.coin];return I+(O?Number(R.total||0)*Number(O):0)},0),perps:t.accountValue}),[r,u,t.accountValue]),C=m.useMemo(()=>{const P=t.accountValue,I=t.unrealizedPnl,R=Number(t.crossAccountValue||0)>0?Number(t.crossAccountValue||0):Number(P||0),O=R>0?Number(t.crossMaintenanceMarginUsed||0)/R:0,U=Number(t.crossMaintenanceMarginUsed||0),L=P>0?t.totalNtlPos/P:0;return{balance:P,uPnl:I,cmr:O,maintenanceMargin:U,crossLeverage:L}},[t]);return{rows:m.useMemo(()=>{const P=[];return P.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(I=>{const R=Math.max(0,Number(I.total||0)-Number(I.hold||0)),O=u[I.coin],U=I.coin==="USDC"?Number(I.total||0):Number(O)?Number(I.total||0)*Number(O):null;P.push({id:`spot-${I.coin}`,kind:"spot",coin:I.coin,unit:I.coin,totalDisplay:I.total,totalSort:I.total,availableDisplay:R,availableSort:R,usdcValue:U})}),P},[t,r,u]),perps:t,spotBalances:r,tokenIdMap:a,tokenMetaMap:l,priceMap:u,accountEquity:w,perpsOverview:C,initialLoaded:f}}const ohn="https://dextrabothypev2.nftinit.io/api/wallet/request-agent",lhn="https://express-proxy-delta.vercel.app/proxy?url=",chn="https://api.starknet.extended.exchange/api/v1",PHe=e=>`${Number(e||0).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})} USDC`;function uhn({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}=bT(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":Di},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(XUe,{size:3,color:"#ffffff"}):C?i.jsxs("span",{className:"text-[11px]",children:["— ",PHe(w)]}):""]}),i.jsx("div",{className:"text-[11px]",style:{color:vi},children:nre(e.wallet_address)})]})}function yT({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:P}=ts();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 I=e&&e.length>0,R=I?e.find(X=>String(X.wallet_id)===String(t))||(t?null:e[0]):null,O=R&&R.wallet_address?`${R.wallet_name||`Wallet ${R.wallet_id}`} — ${nre(R.wallet_address)}`:R?R.wallet_name||`Wallet ${R.wallet_id}`:P?`MetaMask — ${nre(P)}`:"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?`${O} — ${PHe(U)}`:O,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")||"",K=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(ohn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:K,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")||"",K=localStorage.getItem("hyperToken")||"",re=localStorage.getItem("hyperAddress")||"";if(!(!J||!K||!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),K=String(ne.wallet_address||"").toLowerCase();try{window.localStorage.setItem(`${X}_selected_wallet_id`,J),window.localStorage.setItem(`${X}_selected_wallet_address`,K),window.dispatchEvent(new Event("localStorageUpdated")),window.dispatchEvent(new CustomEvent("hl_selected_wallet_changed",{detail:{id:J,address:K,mode:s}})),s==="hyper"&&l&&z(ne.wallet_id).catch(()=>{})}catch{}}else if(P){const ne="",J=String(P||"").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,P,l,z]),m.useEffect(()=>{if(s!=="extended")return;let X=!1;const ne=async J=>{var ie,oe,G;const K=J.wallet_id!=null?String(J.wallet_id):"";if(!K||w.current.has(K))return;const re=g[K];if(Number.isFinite(re)&&re>0)return;const he=J.available_balance??J.availableForTrade??J.available_for_trade??J.balance??J.available??null,Q=Number(he);if(Number.isFinite(Q)&&Q>0){v(V=>V[K]===Q?V:{...V,[K]:Q});return}if(J.wallet_api_key){w.current.add(K);try{const V=`${lhn}${encodeURIComponent(`${chn}/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,Ne=Number(fe);Number.isFinite(Ne)&&v(me=>me[K]===Ne?me:{...me,[K]:Ne})}catch{}finally{w.current.delete(K)}}};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:Po,border:`1px solid ${Ma}`,color:Di},children:[i.jsxs("span",{className:"truncate text-xs flex items-center gap-1",children:[L,f&&i.jsx(XUe,{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:Po,border:`1px solid ${Ma}`},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"})]}),I&&e.map(X=>{const ne=String(X.wallet_id)===String(t);return i.jsx(uhn,{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)}),!I&&i.jsx("div",{className:"px-3 py-2 text-xs",style:{color:vi},children:"No wallets"})]})]})}const kX=new Map;function dhn(e,t){const n=kX.get(e);if(n)return n;const r=Promise.resolve().then(t).finally(()=>kX.delete(e));return kX.set(e,r),r}const fhn=15e3,dSe=new Map;function FHe(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=dSe.get(d);if(x&&f-x.ts<fhn)return o(x.data),c(!1),x.data;c(!0);const g=await dhn(d,async()=>{const w=await(await fetch(`${rhn}/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 P,I,R;return{...N,balances:{eth:((P=N==null?void 0:N.balances)==null?void 0:P.eth)??0,usdc:((I=N==null?void 0:N.balances)==null?void 0:I.usdc)??0,hyper_usdc:((R=N==null?void 0:N.balances)==null?void 0:R.hyper_usdc)??0}}}),C});return o(g),dSe.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 XN({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,P)=>Math.max(N,Math.min(P,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 P=0;for(;P<d&&N>s[P+1];)P++;const I=s[P+1]-s[P]||1,R=(N-s[P])/I;return(P+R)/d*100},x=C=>{const P=u(Number(C)||0,0,100)/100*d,I=Math.min(d-1,Math.floor(P)),R=P-I,O=s[I]+(s[I+1]-s[I])*R;if(!o)return O;let U=s[0],L=1/0;for(const z of s){const X=Math.abs(z-O);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(am.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 P=N/d*100,I=g/100*d;return N<=I?null:i.jsx("div",{className:"absolute -translate-x-1/2 -translate-y-1/2 top-1/2",style:{left:`${P}%`},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(am.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 ${Ma}`},children:v})}),i.jsx(am.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 P=N/d*100;return i.jsxs("div",{className:"absolute -translate-x-1/2 text-[12px] text-[#CFCFCF]",style:{left:`${P}%`},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 fC=42161,eF=10,TX=[{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"}]}],t0={BTC:"bc1plaavkq4u7wj8cc8nhrm6rxkhz9ylurw2u6l42ne7gw4493hvacks8wct4q",ETH:"0xa1D7ad9f7065BeE7b0b3E2AC30C9ddAaD9A70C71",SOL:"HWzcDXaTB2mPXvQYQy2g6PCNaj4mhTPVNoJP8zVupHJs",XPL:"0xa1D7ad9f7065BeE7b0b3E2AC30C9ddAaD9A70C71",USDC_BRIDGE_2:"0x2Df1c51E09aECF9cacB7bc98cB1742757f163dF7"},bv={USDC:{kind:"usdc",chains:[{key:"Arbitrum",label:"Arbitrum"}],icon:"USDC",bridge:t0.USDC_BRIDGE_2},BTC:{kind:"address",chains:[{key:"Bitcoin",label:"Bitcoin"}],icon:"BTC",address:t0.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:t0.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:t0.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:t0.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:t0.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:t0.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:t0.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:t0.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:t0.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 hhn({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||bv[n].chains[0].key),d=bv[o],[f,x]=m.useState(""),[g,v]=m.useState(!1),[w,C]=m.useState(null),[N,P]=m.useState(!1);m.useEffect(()=>{e&&(l(n),u(r||bv[n].chains[0].key),x(""),v(!1),C(null),P(!1))},[e,n,r]);const I=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:O}=ts(),U=vA(),{switchChainAsync:L}=Hie(),z=g_e(),{writeContractAsync:X}=ugt(),ne=o==="USDC",J=ne&&c==="Arbitrum",K=ne&&c!=="Arbitrum",re=J&&U!==fC,{data:he}=wme({address:a,abi:TX,functionName:"decimals",chainId:fC,query:{enabled:J}}),Q=Number(he??6),{data:ie,refetch:oe}=wme({address:a,abi:TX,functionName:"balanceOf",args:[R??"0x0000000000000000000000000000000000000000"],chainId:fC,query:{enabled:J&&!!R}}),G=m.useMemo(()=>{try{return ie?Ek(ie,Q):"0.00"}catch{return"0.00"}},[ie,Q]),V=J&&Number(f||0)<eF;function te(xe,ye="error"){C({text:xe,type:ye})}function ae(xe){const ye=String((xe==null?void 0:xe.shortMessage)||(xe==null?void 0:xe.message)||xe||"");return ye.toLowerCase().includes("does not match the connection's chain")||ye.toLowerCase().includes("chain mismatch")||ye.toLowerCase().includes("connector chain")?"You're not on Arbitrum. Please switch to Arbitrum.":ye}async function fe(){try{if(!O)return te("Wallet is not connected");if(K)return te("The deposit bridge supports Arbitrum only");re&&await L({chainId:fC});const xe=String(f||"").trim();if(!xe||Number(xe)<=0)return te("Enter a valid amount");if(Number(xe)<eF)return te(`Minimum is ${eF} USDC`);const ye=imt(xe,Q);v(!0),C({type:"info",text:"Submitting transaction..."});const je=await X({address:a,abi:TX,functionName:"transfer",args:[bv.USDC.bridge,ye],chainId:fC});C({type:"info",text:"Waiting for confirmation..."}),await z.waitForTransactionReceipt({hash:je}),C({type:"success",text:"Deposit completed"}),x(""),oe==null||oe()}catch(xe){te(ae(xe),"error")}finally{v(!1)}}function Ne(xe){var ye;xe&&((ye=navigator.clipboard)==null||ye.writeText(xe),P(!0),setTimeout(()=>P(!1),1500))}const me=K?"Arbitrum Required":J?re?"Deposit":g?"Depositing...":"Deposit":"Done",we=g||K||J&&V;return i.jsx(Jh,{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:I,alt:o,className:"w-10 h-10",onError:xe=>{xe.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:xe=>{var je;const ye=xe.target.value;l(ye),u((je=bv[ye].chains[0])==null?void 0:je.key),C(null)},children:Object.keys(bv).map(xe=>i.jsx("option",{value:xe,children:xe},xe))}),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:xe=>{u(xe.target.value),C(null)},children:bv[o].chains.map(xe=>i.jsx("option",{value:xe.key,children:xe.label},xe.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:xe=>x(xe.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: ",eF," USDC"]})]}),ne&&i.jsx(i.Fragment,{children:K&&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:()=>Ne(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?K?void 0:re?async()=>{try{C(null),await L({chainId:fC}),C({type:"success",text:"Switched to Arbitrum"})}catch(xe){C({type:"error",text:ae(xe)})}}:fe:t,disabled:we,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:me})]})]})]})})}function phn(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 mhn(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 xhn=new TextEncoder,ghn=50;function bhn(e,t,n){xhn.encodeInto(e,t.subarray(n))}function yhn(e,t,n){e.length>ghn?bhn(e,t,n):mhn(e,t,n)}new TextDecoder;class tF{constructor(t,n){this.type=t,this.data=n}}class eD extends Error{constructor(t){super(t);const n=Object.create(eD.prototype);Object.setPrototypeOf(this,n),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:eD.name})}}function vhn(e,t,n){const r=n/4294967296,s=n;e.setUint32(t,r),e.setUint32(t+4,s)}function OHe(e,t,n){const r=Math.floor(n/4294967296),s=n;e.setUint32(t,r),e.setUint32(t+4,s)}function whn(e,t){const n=e.getInt32(t),r=e.getUint32(t+4);return n*4294967296+r}const Chn=-1,Shn=4294967296-1,Nhn=17179869184-1;function Ahn({sec:e,nsec:t}){if(e>=0&&t>=0&&e<=Nhn)if(t===0&&e<=Shn){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),OHe(r,4,e),n}}function jhn(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 Ehn(e){if(e instanceof Date){const t=jhn(e);return Ahn(t)}else return null}function _hn(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=whn(t,4),r=t.getUint32(0);return{sec:n,nsec:r}}default:throw new eD(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${e.length}`)}}function khn(e){const t=_hn(e);return new Date(t.sec*1e3+t.nsec/1e6)}const Thn={type:Chn,encode:Ehn,decode:khn};class rre{constructor(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(Thn)}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 tF(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 tF(o,a)}}}return t instanceof tF?t:null}decode(t,n,r){const s=n<0?this.builtInDecoders[-1-n]:this.decoders[n];return s?s(t,n,r):new tF(n,t)}}rre.defaultCodec=new rre;function Ihn(e){return e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer}function Phn(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):Ihn(e)?new Uint8Array(e):Uint8Array.from(e)}const Fhn=100,Ohn=2048;class wue{constructor(t){this.entered=!1,this.extensionCodec=(t==null?void 0:t.extensionCodec)??rre.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)??Fhn,this.initialBufferSize=(t==null?void 0:t.initialBufferSize)??Ohn,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 wue({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=phn(t);this.ensureBufferSizeToWrite(5+r),this.writeStringHeader(r),yhn(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=Phn(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),vhn(this.view,this.pos,t),this.pos+=8}writeI64(t){this.ensureBufferSizeToWrite(8),OHe(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 MHe(e,t){return new wue(t).encodeSharedRef(e)}const Mhn={name:"Exchange",version:"1",chainId:1337,verifyingContract:"0x0000000000000000000000000000000000000000"},Rhn={Agent:[{name:"source",type:"string"},{name:"connectionId",type:"bytes32"}]};function Lhn(e){if(typeof e!="string"||!e.includes("."))return String(e);const t=e.replace(/\.?0+$/,"");return t==="-0"?"0":t}function sre(e){if(!e||typeof e!="object")return e;if(Array.isArray(e))return e.map(sre);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]=sre(r):(n==="p"||n==="s")&&typeof r=="string"&&(t[n]=Lhn(r))}return t}function Dhn(e){return ps(e)}function Bhn(e,t,n){const r=sre(e),s=MHe(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(Dhn(t),s.length+9)),co(o)}function $hn(e,t){return{source:t?"a":"b",connectionId:e}}async function Uhn(e,t){const n=await e.signTypedData(t.domain,t.types,t.message),{r,s,v:a}=ru.from(n);return{r,s,v:a}}async function zhn(e,t,n,r,s){const a=Bhn(t,n,r),o=$hn(a,s);return Uhn(e,{domain:Mhn,types:Rhn,primaryType:"Agent",message:o})}function vT({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 Eae(a);return zhn(o,r,n,s,t)}}}function Hhn(e){return new Eae(e).address}function Vhn({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 Whn=({children:e})=>i.jsx("div",{className:"text-[12px] text-[#9B9B9B] font-inter mb-1 font-semibold",children:e}),qhn=({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 fSe(e,t=6){return Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}const IX=e=>e==="perps"?"Perps":"Spot";function RHe({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(Vhn,{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:IX(l)}),i.jsx(_ae,{className:"text-[#67FFBD]"}),i.jsx("span",{className:`${f==="perps"?"text-[#67FFBD] font-medium":"text-[#bdbdbd]"}`,children:IX(f)})]})}),i.jsxs("div",{className:"space-y-2 text-xs",children:[i.jsx(Whn,{children:"Amount (USDC)"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(qhn,{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:fSe(x,6)})]})]}),i.jsxs("div",{className:"text-[12px] text-[#9B9B9B]",children:["Available (",IX(l),"): ",fSe(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 hSe({label:e,children:t}){return i.jsxs("div",{className:"mb-3",children:[i.jsx("div",{className:"mb-1 text-[12px]",style:{color:vi},children:e}),i.jsx("div",{className:"flex items-center gap-2",children:t})]})}const PX=42161,Ghn="0xa4b1",pSe="Mainnet";function Khn(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 Yhn({open:e,onClose:t,perpsBalance:n=0,defaultDest:r=""}){const{address:s}=ts(),a=vA(),{switchChainAsync:o}=Hie(),{signTypedDataAsync:l}=cgt(),[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 P(){var R;try{const O=Number(c||0);if(!O||O<=1){w({type:"error",text:"Enter an amount greater than $1 (fee)."});return}if(O>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!==PX)try{await o({chainId:PX})}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:PX,verifyingContract:"0x0000000000000000000000000000000000000000"},X={"HyperliquidTransaction:Withdraw":[{name:"hyperliquidChain",type:"string"},{name:"destination",type:"string"},{name:"amount",type:"string"},{name:"time",type:"uint64"}]},ne={hyperliquidChain:pSe,destination:U,amount:String(O),time:L},J=await l({domain:z,types:X,primaryType:"HyperliquidTransaction:Withdraw",message:ne});w({type:"info",text:"Submitting..."});const K={action:{type:"withdraw3",signatureChainId:Ghn,hyperliquidChain:pSe,destination:U,amount:String(O),time:L},nonce:L,signature:Khn(J)},re=await fetch("https://api.hyperliquid.xyz/exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(K)}).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(O){w({type:"error",text:String((O==null?void 0:O.message)||O)})}finally{g(!1)}}const I=v&&i.jsx("div",{className:"p-2 rounded-lg text-[12px] mb-3",style:{border:`1px solid ${Ma}`,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(Jh,{open:e,onClose:t,children:i.jsxs(dm,{title:N,children:[I,i.jsxs(hSe,{label:"Amount",children:[i.jsxs("div",{className:"flex items-center gap-2 h-[36px] px-2 rounded-lg",style:{background:Po,border:`1px solid ${Ma}`,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:Di,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:vi},children:["MAX: ",C.toFixed(6)," USDC"]})]}),i.jsx(hSe,{label:"Destination Address",children:i.jsxs("div",{className:"flex items-center gap-2 h-[36px] px-2 rounded-lg",style:{background:Po,border:`1px solid ${Ma}`,width:"100%"},children:[i.jsx("input",{className:"min-w-0 flex-1 bg-transparent outline-none text-sm",placeholder:"0x...",style:{color:Di},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 ${Ma}`},children:"IMPORTANT: A $1 fee is deducted from each withdrawal."}),i.jsx("button",{onClick:P,disabled:x,className:"w-full h-[42px] mt-1 rounded-xl font-semibold text-sm disabled:opacity-60",style:{background:Pg,color:"#0f151a"},children:x?"Submitting...":"Withdraw"})]})})}function Xhn({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:Pg},children:[n,": ",e,"%"]}),i.jsxs("span",{className:"font-semibold",style:{color:Oj},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, ${Pg}80 0%, ${Pg}80 ${e}%, ${Oj}80 ${e}%, ${Oj}80 100%)`,border:`1px solid ${Ma}`}}),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:Pg,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:Pg},children:s?`${s.toLocaleString(void 0,{maximumFractionDigits:2})} USDC`:""}),i.jsx("span",{style:{color:Oj},children:a?`${a.toLocaleString(void 0,{maximumFractionDigits:2})} USDC`:""})]})]})}function Qhn(e){return _l({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 Zhn({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(Qhn,{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 FX="wss://api.hyperliquid.xyz/ws";function Z7(e,t=2){const n=Number(e||0),r={maximumFractionDigits:t,minimumFractionDigits:n===0?2:0};return n.toLocaleString(void 0,r)}function mSe(e){return Number(e||0).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}const xSe=e=>{const t=String(e||"").toUpperCase();return t==="GTC"?"Gtc":t==="IOC"?"Ioc":t==="ALO"?"Alo":"Gtc"};function Jhn(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 epn({book:e,side:t,sizeCoin:n,mid:r}){const s=Jhn(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 LHe={position:"bottom-right",style:{background:"#1e1e1e",color:"#fff",fontSize:12,border:"1px solid #2A2A2A"}},tpn="dextra-global-toast";function za(e,t){return tn.promise(e,t,{id:tpn,...LHe})}const J7=e=>Number(e||0);function npn(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 rpn(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 spn({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:J7(f)||1,longSize:J7(n??(g?0:v?w:0)),shortSize:J7(r??(g||v?0:w)),slippage:Number(o||0),takeProfit:l&&J7(c)>0?String(c):"",stopLoss:l&&J7(u)>0?String(u):""}}}async function OX({draft:e,responses:t,user:n}){const r=[];for(const o of Array.isArray(t)?t:[t])r.push(...npn(o));const s=r.length?await rpn(n,r):[];return{...e,exchangeOids:r,orderStatus:s}}function hC(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 gSe({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,P]=m.useState("USD"),[I,R]=m.useState(0),[O,U]=m.useState(!1),[L,z]=m.useState("GTC"),[X,ne]=m.useState(!1),[J,K]=m.useState(""),[re,he]=m.useState(""),[Q,ie]=m.useState(""),[oe,G]=m.useState(""),[V,te]=m.useState(!1),[ae,fe]=m.useState(!1),[Ne,me]=m.useState(!1),[we,xe]=m.useState("Cross"),[ye,je]=m.useState("Cross"),[Pe,Re]=m.useState(s),[Xe,Ke]=m.useState(!1),[ut,et]=m.useState(!1),[tt,Le]=m.useState(!1),[$e,ht]=m.useState("One-Way"),[pt,Kt]=m.useState(""),[wt,nn]=m.useState("USDC"),[cn,zn]=m.useState(0),[Xt,on]=m.useState(5),[Zt,Ye]=m.useState(!1),[Ze,Ft]=m.useState(0),[dn,Yt]=m.useState(!1),[Bt,ot]=m.useState(null),[De,_t]=m.useState(null),[ze,nt]=m.useState(null),[mt,$t]=m.useState(s),[Pt,un]=m.useState(null),[an,xn]=m.useState({address:null,token:null}),[An,kn]=m.useState(null),[yn,Vn]=m.useState(null),[Gn,Rn]=m.useState(null),[Yn,Cn]=m.useState(50),[rn,Oe]=m.useState(!1),[Jt,sn]=m.useState({bids:[],asks:[]}),[Et,Xn]=m.useState(!1),[gn,Dt]=m.useState(String(e)),[en,In]=m.useState(()=>{if(typeof window>"u")return"8";const vn=localStorage.getItem("hl_max_slip_pct");if(vn==null||vn==="")return"8";const Fn=Number(vn);return Number.isFinite(Fn)&&Fn>0?String(Fn):"8"}),[Qn,ar]=m.useState(""),[hr,Gt]=m.useState({}),[$n,nr]=m.useState([]),[Rt,En]=m.useState(!1),Ee=m.useRef(null),h=m.useRef(null),[p,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",p?"true":"false")},[p]);const W=m.useMemo(()=>Math.max(0,Number(en||0))/100,[en]),ee=vn=>String(vn||"").trim().toUpperCase(),ce="dextrabot.last_used_leverage",ue=()=>{try{return JSON.parse(localStorage.getItem(ce)||"{}")}catch{return{}}},ge=vn=>{const Fn=`leverage:${ee(vn)}`,lt=Number(localStorage.getItem(Fn));return Number.isFinite(lt)&&lt>0?lt:null},Se=vn=>{const Fn=ee(vn),lt=ue(),Ut=Number(lt==null?void 0:lt[Fn]);return Number.isFinite(Ut)&&Ut>0?Ut:ge(Fn)},ke=(vn,Fn)=>{var Wn;const lt=ee(vn),Ut=Math.max(1,Number(Fn)||1),tr=ue();tr[lt]=Ut,localStorage.setItem(ce,JSON.stringify(tr)),localStorage.setItem(`leverage:${lt}`,String(Ut)),(Wn=window.dispatchEvent)==null||Wn.call(window,new Event("localStorageUpdated"))},{isConnected:Me}=ts(),{openConnectModal:qe}=y5(),{setSignInConnectButtonOpen:Fe}=m.useContext(Qr),{address:at}=ts(),se=typeof window<"u"&&window.matchMedia("(max-width: 768px)").matches,Ue=!!(typeof window<"u"&&localStorage.getItem("hyperToken")&&(Me||se)),Be=m.useRef(null);m.useEffect(()=>{const vn=at?at.toLowerCase():null;if(Be.current&&Be.current!==vn&&typeof window<"u"){const Fn=window.localStorage;Fn.removeItem("hyperToken"),Fn.removeItem("hyperAddress"),Fn.removeItem("hyperTradeToken"),Fn.removeItem("hl_pk"),Fn.removeItem("hl:wallet_id"),Object.keys(Fn).forEach(lt=>{lt.startsWith("hl_pk:")&&Fn.removeItem(lt)}),window.dispatchEvent(new Event("localStorageUpdated"))}Be.current=vn,ot(null)},[at]),m.useEffect(()=>{const vn=(a==null?void 0:a.id)!=null?String(a.id):null;if(vn==null){ot(null);return}ot(Fn=>Fn!=null&&String(Fn)===vn?Fn:vn)},[a==null?void 0:a.id]),m.useEffect(()=>{Bt!=null&&localStorage.setItem("hl:wallet_id",String(Bt))},[Bt]);const _e=m.useRef(null);m.useEffect(()=>{l!=="pair"&&gn&&_e.current===gn&&ke(gn,Pe)},[Pe,gn,l]),m.useEffect(()=>{let vn,Fn=!0;function lt(){vn=new WebSocket(FX),vn.onopen=()=>{const Ut={method:"subscribe",subscription:{type:"l2Book",coin:String(e).toUpperCase()}};vn.send(JSON.stringify(Ut))},vn.onmessage=Ut=>{var Rs;if(!Fn)return;const tr=JSON.parse(Ut.data),Wn=((Rs=tr==null?void 0:tr.data)==null?void 0:Rs.levels)||(tr==null?void 0:tr.levels),Fr=(Wn==null?void 0:Wn.bs)||(Wn==null?void 0:Wn.bids)||[],Tr=(Wn==null?void 0:Wn.as)||(Wn==null?void 0:Wn.asks)||[],es=kt=>kt.map(or=>Array.isArray(or)?{px:Number(or[0]),sz:Number(or[1])}:{px:Number(or.px),sz:Number(or.sz)}).filter(or=>or.px>0&&or.sz>0);(Fr.length||Tr.length)&&sn({bids:es(Fr),asks:es(Tr)})}}return lt(),()=>{Fn=!1;try{vn&&vn.close()}catch{}}},[e]),m.useEffect(()=>{const vn=()=>{const Fn=typeof window<"u"?localStorage.getItem("hyperAddress"):null,lt=typeof window<"u"?localStorage.getItem("hyperToken"):null;xn({address:Fn,token:lt})};return vn(),window.addEventListener("localStorageUpdated",vn),window.addEventListener("storage",vn),()=>{window.removeEventListener("localStorageUpdated",vn),window.removeEventListener("storage",vn)}},[]);const rt=()=>{const vn=parseFloat(String(en).replace(",",".")),lt=Math.max(.01,Math.min(50,Number.isFinite(vn)?vn:8)).toString();In(lt),localStorage.setItem("hl_max_slip_pct",lt),Xn(!1)},{wallets:ct}=FHe(an.address,an.token,!0,{pollMs:5e3});m.useEffect(()=>{if(!ct||!ct.length||Bt&&ct.some(lt=>String(lt.wallet_id)===String(Bt)))return;const vn=ct.find(lt=>lt.confirmed)||ct[0];if(!vn)return;const Fn=String(vn.wallet_id);String(Bt)!==Fn&&(ot(Fn),o==null||o({id:Fn,address:vn.wallet_address}))},[ct,Bt,o]);const yt=m.useMemo(()=>(ct||[]).find(vn=>String(vn.wallet_id)===String(Bt))||null,[ct,Bt]);m.useEffect(()=>{n!=null&&n!==""&&(d("limit"),v(Number(n)))},[n]),m.useEffect(()=>{let vn=!0;En(!1);async function Fn(){try{const Ut=await(await fetch("https://api.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"metaAndAssetCtxs"})})).json(),tr=Array.isArray(Ut)?Ut[0]:Ut,Wn=(tr==null?void 0:tr.universe)||[],Fr=new Map(Wn.map(Rs=>{const kt=typeof Rs=="string"?Rs:(Rs==null?void 0:Rs.name)??(Rs==null?void 0:Rs[0])??"";return[ee(kt),typeof Rs=="string"?{name:kt}:Rs]}));if(l==="pair"){const[Rs,kt]=String(c||"").split("/").map(Hr=>Hr.trim()),or=Fr.get(ee(Rs)),Hn=Fr.get(ee(kt));if(vn){const Hr=(or==null?void 0:or.maxLeverage)??s,as=(Hn==null?void 0:Hn.maxLeverage)??s,ss=Math.max(1,Math.min(Hr,as));$t(ss),Re(ms=>Math.min(ms||1,ss)),_t(null),nt(null),un(null),Dt(null),En(!0)}return}const Tr=Fr.get(ee(e));if(!Tr){vn&&(_t(null),nt(null),$t(s),Re(Rs=>Math.min(Rs||1,s)),un(null),Dt(String(e)),En(!0));return}const es=(Tr==null?void 0:Tr.name)||String(e);if(vn){_t(0),nt((Tr==null?void 0:Tr.szDecimals)??0),$t((Tr==null?void 0:Tr.maxLeverage)??s),un((Tr==null?void 0:Tr.maintenanceMarginFraction)??(Tr==null?void 0:Tr.mmr)??null),Dt(es);const Rs=Se(es),kt=Rs!=null?Math.min((Tr==null?void 0:Tr.maxLeverage)??s,Math.max(1,Rs)):Math.min((Tr==null?void 0:Tr.maxLeverage)??s,Math.max(1,Pe||1));Re(kt),_e.current=es,En(!0)}}catch{vn&&(_t(null),nt(null),$t(s),Re(lt=>Math.min(lt||1,s)),un(null),Dt(String(e)),En(!0))}}return Fn(),()=>{vn=!1}},[e,s,l,c]);const Lt=f==="buy",ft=Lt?Pg:Oj,Tt=m.useMemo(()=>{var lt,Ut,tr,Wn;const vn=(Ut=(lt=Jt==null?void 0:Jt.bids)==null?void 0:lt[0])==null?void 0:Ut.px,Fn=(Wn=(tr=Jt==null?void 0:Jt.asks)==null?void 0:tr[0])==null?void 0:Wn.px;return Number.isFinite(vn)&&Number.isFinite(Fn)&&vn>0&&Fn>0?(Fn+vn)/2:null},[Jt]),Ge=m.useMemo(()=>{if(u==="limit"&&g!=="")return Number(g);const vn=Number(t||0);if(vn>0)return vn;if(Number(Tt||0)>0)return Number(Tt);const Fn=Number((hr||{})[e]||0);return Fn>0?Fn:0},[u,g,t,Tt,hr,e]),At=yt==null?void 0:yt.wallet_address,{accountEquity:Ot,perpsOverview:it,spotBalances:jt,perps:Nn}=bT(At),{rows:mn}=bue(At);m.useEffect(()=>{let vn=!1;async function Fn(){var Ut,tr,Wn,Fr;if(!At){vn||B({takerPct:null,makerPct:null});return}try{const es=await(await fetch("https://api.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"userFees",user:At.toLowerCase()})})).json();if(vn)return;const Rs=Number(es.userCrossRate??((Ut=es.feeSchedule)==null?void 0:Ut.cross)??NaN),kt=Number(es.userAddRate??((tr=es.feeSchedule)==null?void 0:tr.add)??NaN);if(!Number.isFinite(Rs)||!Number.isFinite(kt)){B({takerPct:null,makerPct:null});return}const or=Number(es.activeReferralDiscount??((Wn=es.feeSchedule)==null?void 0:Wn.referralDiscount)??0)||0,Hn=Number(((Fr=es.activeStakingDiscount)==null?void 0:Fr.discount)??0)||0,Hr=Math.max(0,1-or-Hn),as=Rs*Hr,ss=kt*Hr;B({takerPct:as*100,makerPct:ss*100})}catch{vn||B({takerPct:null,makerPct:null})}}Fn();const lt=setInterval(Fn,5*60*1e3);return()=>{vn=!0,clearInterval(lt)}},[At]);const ir=m.useMemo(()=>{const{takerPct:vn,makerPct:Fn}=T;if(vn==null||Fn==null)return"—";const lt=Ut=>Number(Ut).toLocaleString(void 0,{minimumFractionDigits:4,maximumFractionDigits:4});return`${lt(vn)}% / ${lt(Fn)}%`},[T]);m.useEffect(()=>{let vn=!1;async function Fn(){if(!(!At||l==="pair"))try{const Ut=await(await fetch("https://api.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"activeAssetData",user:At.toLowerCase(),coin:String(gn||e)})})).json();if(vn)return;const tr=Ut==null?void 0:Ut.leverage;if(!tr)return;const Wn=String(tr.type||"").toLowerCase()==="cross"?"Cross":"Isolated",Tr=Math.max(1,Math.min(mt||s,Number(tr.value||tr.leverage)||1));xe(Wn),je(Wn),Re(Tr)}catch{}}return Fn(),()=>{vn=!0}},[At,e,l,mt,s]),m.useEffect(()=>{if(!At)return;const vn=new WebSocket(FX);return Ee.current=vn,vn.onopen=()=>{vn.send(JSON.stringify({method:"subscribe",subscription:{type:"user",user:At}})),vn.send(JSON.stringify({method:"subscribe",subscription:{type:"webData2",user:At}})),h.current=setInterval(()=>{vn.readyState===WebSocket.OPEN&&vn.send(JSON.stringify({id:99,method:"ping"}))},3e4)},vn.onmessage=Fn=>{var lt,Ut,tr,Wn;try{const Fr=JSON.parse(Fn.data),Tr=(Fr==null?void 0:Fr.data)||{},es=(lt=Tr==null?void 0:Tr.meta)==null?void 0:lt.universe,Rs=Tr==null?void 0:Tr.allMids;if(Array.isArray(es)&&Array.isArray(Rs)&&es.length===Rs.length){const or={};for(let Hn=0;Hn<es.length;Hn++){const Hr=typeof es[Hn]=="string"?es[Hn]:((Ut=es[Hn])==null?void 0:Ut.name)||((tr=es[Hn])==null?void 0:tr[0]),as=Number(Rs[Hn]);Hr&&Number.isFinite(as)&&(or[Hr]=as)}Gt(Hn=>({...Hn,...or}))}const kt=Array.isArray((Wn=Tr==null?void 0:Tr.spotState)==null?void 0:Wn.balances)?Tr.spotState.balances:Array.isArray(Tr==null?void 0:Tr.balances)?Tr.balances:null;Array.isArray(kt)&&nr(kt.filter(or=>or&&or.coin).map(or=>({coin:String(or.coin),total:Number(or.total||0),hold:Number(or.hold||0)})))}catch{}},vn.onclose=()=>{h.current&&clearInterval(h.current)},()=>{h.current&&clearInterval(h.current);try{vn.close()}catch{}}},[At]),m.useEffect(()=>{if(!At){k([0,0]);return}k([0,0]);let vn=!0;const Fn=new WebSocket(FX);return Fn.onopen=()=>{Fn.send(JSON.stringify({method:"subscribe",subscription:{type:"activeAssetData",user:At.toLowerCase(),coin:String(e)}}))},Fn.onmessage=lt=>{if(vn)try{const Ut=JSON.parse(lt.data);if(Ut.channel==="activeAssetData"&&Ut.data){const tr=Ut.data.availableToTrade||[];k([Number(tr[0]||0),Number(tr[1]||0)])}}catch{}},Fn.onclose=()=>{vn&&k([0,0])},()=>{vn=!1;try{Fn.close()}catch{}}},[At,e]);const Sn=m.useMemo(()=>{const vn=(jt||[]).find(Fn=>Fn.coin==="USDC");return vn?Math.max(0,Number(vn.total||0)-Number(vn.hold||0)):0},[jt]),Bn=m.useMemo(()=>{if(!$n.length)return null;let vn=0;for(const Fn of $n){const lt=Number(Fn.total||0);if(lt>0)if(Fn.coin==="USDC")vn+=lt;else{const Ut=hr[Fn.coin];Number.isFinite(Ut)&&Ut>0&&(vn+=lt*Ut)}}return vn},[$n,hr]),rr=Number((Nn==null?void 0:Nn.accountValue)??0),ur=Number((Nn==null?void 0:Nn.totalMarginUsed)??0),_r=Math.max(0,rr-ur),Un=_r,Ln=_r<1;async function Kn({toPerp:vn,amount:Fn,available:lt}){var Ut;try{if(Oe(!0),!An){await za(Promise.reject(new Error("Trading is not ready (HL not initialized)")),{loading:"Validating...",success:"OK",error:Wn=>Wn.message});return}if(!Number(Fn)){await za(Promise.reject(new Error("Amount is invalid")),{loading:"Validating...",success:"OK",error:Wn=>Wn.message});return}if(Number(Fn)>Number(lt||0)){await za(Promise.reject(new Error("Amount exceeds available")),{loading:"Validating...",success:"OK",error:Wn=>Wn.message});return}const tr=An.transfers.usdClassTransfer(String(Fn),!!vn).then(Wn=>{if((Wn==null?void 0:Wn.status)==="ok")return"Transfer successful.";const Fr=typeof(Wn==null?void 0:Wn.response)=="string"?Wn.response:"Transfer failed";throw new Error(Fr)});await za(tr,{loading:`Transferring ${Fn} USDC ${vn?"Spot → Perps":"Perps → Spot"}...`,success:Wn=>Wn,error:Wn=>(Wn==null?void 0:Wn.message)||"Transfer failed"}),(Ut=window==null?void 0:window.dispatchEvent)==null||Ut.call(window,new Event("balances:refresh")),Ke(!1)}catch{}finally{Oe(!1)}}const Yr=(()=>{const vn=Number(w)||0;return N==="COIN"?vn:Ge?vn/Ge:0})(),os=Yr*(Ge||0),ds=Pe?os/Pe:0;function Je(vn){const Fn=Math.max(1,Number(Pe)||1),lt=Math.max(0,Number(Pt)||0),Ut=vn/Fn+vn*lt,tr=Un>0?Ut/Un*100:0;R(Math.max(0,Math.min(100,Math.round(tr))))}function bt(vn){R(vn);const Fn=Math.max(1,Number(Pe)||1),lt=Math.max(0,Number(Pt)||0),Ut=vn/100*Un,tr=1/Fn+lt,Wn=tr>0?Ut/tr:0;if(l==="pair"){ar(Wn?String(Wn.toFixed(2)):"");return}if(N==="USD")C(Wn?String(Wn.toFixed(2)):"");else{const Fr=Ge?Wn/Ge:0,Tr=ze??4;C(Fr?String(Fr.toFixed(Tr)):""),Je(Fr*Ge)}}function Tn(vn){const Fn=Math.max(1,Number(Pe)||1),lt=Math.max(0,Number(Pt)||0),Ut=vn/Fn+vn*lt,tr=Un>0?Ut/Un*100:0;Ft(Math.max(0,Math.min(100,Math.round(tr))))}function er(vn){const Fn=Math.max(0,Math.min(100,Number(vn)||0));Ft(Fn);const lt=Math.max(1,Number(Pe)||1),Ut=Math.max(0,Number(Pt)||0),tr=Fn/100*Un,Wn=1/lt+Ut,Fr=Wn>0?tr/Wn:0;if(wt==="COIN"){const Tr=Ge?Fr/Ge:0,es=ze??4;Kt(Tr?String(Tr.toFixed(es)):"")}else Kt(Fr?String(Fr.toFixed(2)):"")}function kr(vn){Kt(vn);const Fn=Number(vn)||0,Ut=(wt==="COIN"?Fn:Ge?Fn/Ge:0)*(Ge||0);Tn(Ut)}function Dr(vn){if(vn===wt)return;const Fn=Number(pt)||0;let lt="";if(vn==="USDC")lt=String(((Fn||0)*(Ge||0)).toFixed(2)),nn("USDC"),Kt(lt),Tn(Number(lt)||0);else if(!Ge)nn("COIN"),Kt(""),Tn(0);else{const Ut=ze??4;lt=String(((Fn||0)/Ge).toFixed(Ut)),nn("COIN"),Kt(lt),Tn((Number(lt)||0)*Ge)}}function Ur(vn){C(vn);const Fn=Number(vn)||0,Ut=(N==="COIN"?Fn:Ge?Fn/Ge:0)*(Ge||0);Je(Ut)}function cr(vn){const Fn=vn==="USDC"?"USD":vn;if(Fn===N)return;const lt=Number(w)||0;let Ut="";if(Fn==="USD")Ut=String(((lt||0)*(Ge||0)).toFixed(2)),P("USD"),C(Ut),Je(Number(Ut)||0);else if(!Ge)P("COIN"),C(""),Je(0);else{const tr=ze??4;Ut=String(((lt||0)/Ge).toFixed(tr)),P("COIN"),C(Ut),Je((Number(Ut)||0)*Ge)}}function Cr({entry:vn,side:Fn,notionalUSD:lt,maintenanceFrac:Ut,marginMode:tr,accountValueUSD:Wn,isolatedMarginUSD:Fr}){const Tr=Number(vn)||0,es=Math.abs(Number(lt)||0);if(!Tr||!es)return null;const Rs=Fn==="buy"?1:-1,kt=Math.max(0,Number(Ut)||0),or=es/Tr,Hn=es*kt;let Hr;tr==="Cross"?Hr=Wn-Hn:Hr=Fr-Hn;const as=1-kt*Rs;if(!or||!isFinite(as))return null;const ss=Tr-Rs*(Hr/or)/as;return Math.max(0,ss)}const ls=Number((it==null?void 0:it.balance)??0),yr=typeof Pt=="number"?Pt:.01,Jr=Yr>0&&Ge?Cr({entry:Ge,side:f,notionalUSD:os,maintenanceFrac:yr,marginMode:we,accountValueUSD:ls}):null;m.useEffect(()=>{Ur(w)},[N,Ge,Pe,Un]),m.useEffect(()=>{u==="twap"&&kr(pt)},[u,wt,pt,Ge,Pe,Un]);const Ks=m.useMemo(()=>epn({book:Jt,side:f,sizeCoin:Yr,mid:t}),[Jt,f,Yr,t]);m.useEffect(()=>{let vn=!1;async function Fn(){if(!(yt!=null&&yt.wallet_address)||!Bt){kn(null);return}const lt=vT({getPK:()=>typeof window<"u"?localStorage.getItem("hl_pk"):null,isMainnet:!0,vaultAddress:null}),Ut=YN({address:yt.wallet_address,signer:lt,dex:"",defaultSlippage:W});vn||kn(Ut)}return Fn(),()=>{vn=!0}},[Bt,yt==null?void 0:yt.wallet_address,W]);const Es=vn=>vn||vn===0?String(Math.trunc(Number(vn))):"",gr=Number(Ge||0),Vt=vn=>{ie(vn),Vn("pct");const Fn=Number(vn),lt=Math.max(1,Number(Pe)||1);if(!gr||!isFinite(Fn)){K("");return}const Ut=Fn/(lt*100),tr=Lt?gr*(1+Ut):gr*(1-Ut);K(Es(tr))};m.useEffect(()=>{X&&(K(""),he(""),ie(""),G(""),Vn(null),Rn(null))},[f]);const de=vn=>{K(vn),Vn("price");const Fn=Number(vn),lt=Math.max(1,Number(Pe)||1);if(!gr||!Fn){ie("");return}const Ut=Fn/gr,tr=Lt?(Ut-1)*lt*100:(1-Ut)*lt*100;ie(String(Number(tr).toFixed(2)))},st=vn=>{G(vn),Rn("pct");const Fn=Number(vn),lt=Math.max(1,Number(Pe)||1);if(!gr||!isFinite(Fn)){he("");return}const Ut=Fn/(lt*100),tr=Lt?gr*(1-Ut):gr*(1+Ut);he(Es(tr))},Ct=vn=>{he(vn),Rn("price");const Fn=Number(vn),lt=Math.max(1,Number(Pe)||1);if(!gr||!Fn){G("");return}const Ut=Fn/gr,tr=Lt?(1-Ut)*lt*100:(Ut-1)*lt*100;G(String(Number(tr).toFixed(2)))};m.useEffect(()=>{gr&&(X&&(yn==="pct"?Vt(Q):yn==="price"&&de(J)),Gn==="pct"?st(oe):Gn==="price"&&Ct(re))},[gr,Pe]);function vt(){var vn;(vn=window==null?void 0:window.dispatchEvent)==null||vn.call(window,new Event("balances:refresh"))}async function ln(vn){const Fn=()=>{typeof vn=="function"&&vn()};if(!Bt){await za(Promise.reject(new Error("Select a wallet")),{loading:"Validating...",success:"OK",error:Wn=>Wn.message}),Fn();return}if(!An){await za(Promise.reject(new Error("Please sign in to perform this action.")),{loading:"Validating...",success:"OK",error:Wn=>Wn.message}),Fn();return}const lt=String(we||"").toLowerCase().startsWith("iso")?"isolated":"cross",tr=Math.max(1,Math.min(mt||s,Number(Pe)||1));if(!Ir&&Math.abs(Kr||0)>0){const Wn=String(ye||"").toLowerCase().startsWith("iso")?"isolated":"cross";if(lt!==Wn){await za(new Promise(Fr=>Fr()),{loading:"Validating...",success:()=>{throw new Error("Cannot switch leverage type with open position.")},error:Fr=>Fr.message}),xe(ye),Fn();return}}try{if(l==="pair"){const[Wn,Fr]=String(c||"").split("/").map(es=>es.trim().toUpperCase()),Tr=Promise.all([An.updateLeverage(Wn,lt,tr),An.updateLeverage(Fr,lt,tr)]);await za(Tr,{loading:`Updating for ${Wn}/${Fr}...`,success:()=>"Updated",error:es=>(es==null?void 0:es.message)||"Failed to update leverage for pair"})}else{const Wn=gn||String(e).toUpperCase(),Fr=An.updateLeverage(Wn,lt,tr);await za(Fr,{loading:`Updating for ${Wn}...`,success:()=>"Updated",error:Tr=>(Tr==null?void 0:Tr.message)||"Failed to update leverage"}),je(we)}Fn()}catch{xe(ye),Fn()}}async function pn(){const[vn,Fn]=String(c||"").split("/").map(lt=>lt.trim().toUpperCase());try{if(!Bt){await za(Promise.reject(new Error("Select a wallet")),{loading:"Validating...",success:"OK",error:Hr=>Hr.message});return}if(!An){await za(Promise.reject(new Error("Trading is not ready (HL not initialized)")),{loading:"Validating...",success:"OK",error:Hr=>Hr.message});return}const lt=await An.info.allMids(),Ut=Number(lt[vn]||0),tr=Number(lt[Fn]||0);if(!(Ut>0&&tr>0)){await za(Promise.reject(new Error("Mid price not available for pair")),{loading:"Validating...",success:"OK",error:Hr=>Hr.message});return}const Wn=Math.max(1,Math.min(Number(Pe)||1,Number(mt)||1));Wn!==Pe&&(Re(Wn),tn.success(`Leverage adjusted to ${Wn}x`,LHe));let Fr=Number(Qn)>0?Number(Qn):I/100*Un*Wn;if(!(Fr>0)){await za(Promise.reject(new Error("Enter a valid total notional for pair")),{loading:"Validating...",success:"OK",error:Hr=>Hr.message});return}const Tr=Math.max(0,Math.min(100,Number(Yn)||0))/100,es=Fr*Tr,Rs=Fr-es,kt=es/Ut,or=Rs/tr,Hn=spn({longSymbol:vn,shortSymbol:Fn,longSize:kt,shortSize:or,orderType:u,reduceOnlyFlag:!!O,maxSlipVal:W,tpOnFlag:!1,tpVal:"",slVal:"",userAddr:(yt==null?void 0:yt.wallet_address)||at,lev:Wn,coinSym:"",isPairMode:!0,isBuySide:!0,sizeCoinVal:0});if(u==="market"){const Hr=O?An.marketClose(vn,void 0,{tif:"Ioc",reduceOnly:!0,slippage:W}):An.marketOpen(vn,!0,Number(kt),{tif:"Ioc",reduceOnly:!1,slippage:W}),as=O?An.marketClose(Fn,void 0,{tif:"Ioc",reduceOnly:!0,slippage:W}):An.marketOpen(Fn,!1,Number(or),{tif:"Ioc",reduceOnly:!1,slippage:W}),ss=(async()=>{const[ms,gs]=await Promise.all([Hr,as]);return await OX({draft:Hn,responses:[ms,gs],user:Hn.userAddress}),"Pair market placed"})();await za(ss,{loading:`Opening ${vn} long / ${Fn} short...`,success:ms=>ms,error:ms=>(ms==null?void 0:ms.message)||"Pair order failed"}),vt(),R(0),ar("");return}if(u==="limit"){const Hr=xSe(L),as=An.placeOrder({symbol:vn,isBuy:!0,size:Number(kt),price:Ut,tif:Hr,reduceOnly:!1}),ss=An.placeOrder({symbol:Fn,isBuy:!1,size:Number(or),price:tr,tif:Hr,reduceOnly:!1}),ms=(async()=>{const[gs,Ui]=await Promise.all([as,ss]);return await OX({draft:Hn,responses:[gs,Ui],user:Hn.userAddress}),"Pair limit placed"})();await za(ms,{loading:`Placing ${vn} long / ${Fn} short limits...`,success:gs=>gs,error:gs=>(gs==null?void 0:gs.message)||"Pair limit failed"}),vt(),R(0),ar("");return}if(u==="twap"){const Hr=Math.max(5,Math.min(1440,Number(cn||0)*60+Number(Xt||0))),as=An.placeTwapOrder({symbol:vn,isBuy:!0,size:Number(kt),minutes:Hr,randomize:!!Zt,reduceOnly:!!O}),ss=An.placeTwapOrder({symbol:Fn,isBuy:!1,size:Number(or),minutes:Hr,randomize:!!Zt,reduceOnly:!!O}),ms=(async()=>{const[gs,Ui]=await Promise.all([as,ss]);return await OX({draft:Hn,responses:[gs,Ui],user:Hn.userAddress}),"Pair TWAP started"})();await za(ms,{loading:"Starting pair TWAP...",success:gs=>gs,error:gs=>(gs==null?void 0:gs.message)||"Pair TWAP failed"}),vt(),R(0),ar("");return}await za(Promise.reject(new Error("Unsupported mode for pair")),{loading:"Validating...",success:"OK",error:Hr=>Hr.message})}catch{}}const dr=m.useMemo(()=>{const vn=Number(cn||0)*60+Number(Xt||0);return vn?Math.max(5,Math.min(1440,vn)):0},[cn,Xt]),jr=m.useMemo(()=>{if(!dr)return 0;const vn=Math.floor(dr*60/30);return Math.max(1,vn+1)},[dr]),pr=m.useMemo(()=>{const vn=Number(pt)||0;return vn>0?wt==="COIN"?vn:Ge?vn/Ge:0:0},[pt,wt,Ge]),fr=m.useMemo(()=>!jr||!(pr>0)?0:pr/jr,[pr,jr]),Kr=m.useMemo(()=>{const vn=String(e||"").toUpperCase();if(!mn||!mn.length)return 0;const Fn=mn.find(lt=>String(lt.coin||"").toUpperCase()===vn);return Fn?Number(Fn.size||0):0},[mn,e]);async function rs(){try{if(!Bt){await za(Promise.reject(new Error("Select a wallet")),{loading:"Validating...",success:"OK",error:Fn=>Fn.message});return}if(!An){await za(Promise.reject(new Error("Trading is not ready (HL not initialized)")),{loading:"Validating...",success:"OK",error:Fn=>Fn.message});return}if(l==="pair"){Yt(!0),await pn(),Yt(!1);return}const vn=Number(w)||0;if((u==="market"||u==="limit")&&vn<=0&&!(u==="market"&&O)){await za(Promise.reject(new Error("Enter a valid amount")),{loading:"Validating...",success:"OK",error:Fn=>Fn.message});return}if(Yt(!0),u==="market")if(O){const Fn=vn>0?hC(An.marketClose(e,Number(Yr),{tif:"Ioc",reduceOnly:!0,slippage:W})):hC(An.marketClose(e,void 0,{tif:"Ioc",reduceOnly:!0,slippage:W}));await za(Fn,{loading:`Closing ${e} position...`,success:lt=>lt,error:lt=>(lt==null?void 0:lt.message)||"Close failed"}),vt()}else{const Fn=X&&J!==""&&Number(J)>0,lt=X&&re!==""&&Number(re)>0,Ut=hC(Fn||lt?An.placeMarketWithTPSL({symbol:e,isBuy:Lt,size:Number(Yr),entrySlippage:W,tpPrice:Fn?Number(J):null,slPrice:lt?Number(re):null,triggerSlippage:.1}):An.marketOpen(e,Lt,Number(Yr),{tif:"Ioc",reduceOnly:!1,slippage:W}));await za(Ut,{loading:`Placing ${Lt?"Buy":"Sell"} market order...`,success:tr=>tr,error:tr=>(tr==null?void 0:tr.message)||"Order failed"}),vt(),R(0),C("")}else if(u==="limit"){const Fn=xSe(L),lt=X&&J!==""&&Number(J)>0,Ut=X&&re!==""&&Number(re)>0,tr=hC(lt||Ut?An.placeLimitWithTPSL({symbol:e,isBuy:Lt,size:Number(Yr),price:Number(g),tif:Fn,reduceOnly:O,tpPrice:lt?Number(J):null,slPrice:Ut?Number(re):null,triggerSlippage:W}):An.placeOrder({symbol:e,isBuy:Lt,size:Number(Yr),price:Number(g),tif:Fn,reduceOnly:O}));await za(tr,{loading:`Placing ${Lt?"Buy":"Sell"} limit order...`,success:Wn=>Wn,error:Wn=>(Wn==null?void 0:Wn.message)||"Order failed"}),vt(),R(0),C("")}else if(u==="twap"){const Fn=dr;if(!Fn){await za(Promise.reject(new Error("Enter a valid running time (min 5 minutes)")),{loading:"Validating...",success:"OK",error:Wn=>Wn.message}),Yt(!1);return}let lt=0;const Ut=Number(pt)||0;if(wt==="COIN")lt=Ut;else{if(!Ge){await za(Promise.reject(new Error("Price required to convert USD to size")),{loading:"Validating...",success:"OK",error:Wn=>Wn.message}),Yt(!1);return}lt=Ut/Ge}if(!(lt>0)){await za(Promise.reject(new Error("Enter a valid TWAP size")),{loading:"Validating...",success:"OK",error:Wn=>Wn.message}),Yt(!1);return}const tr=An.placeTwapOrder({symbol:e,isBuy:Lt,size:Number(lt),minutes:Fn,randomize:!!Zt,reduceOnly:!!O});await za(tr,{loading:`Starting TWAP for ${e}...`,success:()=>`TWAP started: ${Number(lt).toLocaleString(void 0,{maximumFractionDigits:ze??4})} ${e} over ${Fn}m`,error:Wn=>(Wn==null?void 0:Wn.message)||"TWAP failed"}),vt()}else{await za(Promise.reject(new Error("This mode is not wired to HyperSDK yet")),{loading:"Validating...",success:"OK",error:Fn=>Fn.message}),Yt(!1);return}}catch{}finally{Yt(!1)}}const Ir=l==="pair",[br,Zn]=String(c||"").split("/").map(vn=>vn.trim().toUpperCase()),xs=m.useMemo(()=>Ir?0:Number((Lt?_[0]:_[1])||0),[Ir,Lt,_]),Qs=Number(Ir?Qn||0:os||0),ai=u!=="twap"&&Qs<10,Pr=ai?"Order must have minimum value of $10.":Ln?"Not Enough Margin":dn?"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:IHe,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(y4,{onClick:()=>te(!0),children:we}),i.jsx(y4,{onClick:Rt?()=>fe(!0):void 0,children:Rt?`${Pe}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(y4,{onClick:()=>me(!0),children:$e})]}),i.jsx(Zhn,{skipConfirm:p,setSkipConfirm:S})]}),Ue&&i.jsx("div",{className:"mb-3",children:i.jsx(yT,{wallets:ct,value:Bt,selectedBalance:it==null?void 0:it.balance,onChange:vn=>{if(String(Bt)===String(vn))return;ot(vn);const Fn=(ct||[]).find(lt=>String(lt.wallet_id)===String(vn));o==null||o({id:String(vn),address:(Fn==null?void 0:Fn.wallet_address)||null})}})}),i.jsx(ihn,{mode:u,onModeChange:d,moreItems:[{key:"twap",label:"TWAP"}],className:"mb-3"}),!Ir&&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)":Po,color:f==="buy"?"rgb(15, 21, 26)":Di},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)":Po,color:f==="sell"?"rgb(15, 21, 26)":Di},children:"Sell / Short"})]})}),i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("div",{style:{color:vi},children:"Available to Trade"}),i.jsxs("div",{className:"text-white font-semibold",children:[xs.toLocaleString(void 0,{maximumFractionDigits:2})," ","USDC"]})]}),i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("div",{style:{color:vi},children:"Current Position"}),i.jsx("div",{className:"text-white font-semibold",children:Kr?`${Math.abs(Kr).toLocaleString(void 0,{maximumFractionDigits:ze??5})} ${e}`:`0.00000 ${e}`})]}),!Ir&&u==="limit"&&i.jsx("div",{className:"mb-3",children:i.jsx(yb,{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 ${Ma}`},onClick:()=>v(t??""),children:"Mid"})})}),!Ir&&(u==="market"||u==="limit")&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"mb-3",children:i.jsx(yb,{label:"Size",value:w,onChange:Ur,right:i.jsx(JP,{value:N,onChange:cr,items:[{key:"USD",label:"USDC"},{key:"COIN",label:e}]})})}),i.jsxs("div",{className:"flex items-center gap-3 mb-6 ",children:[i.jsx(XN,{value:I,onChange:bt,accent:ft}),i.jsxs("div",{className:"h-[30px] rounded-lg flex items-center px-2",style:{width:84,background:Po,border:`1px solid ${Ma}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right text-xs",inputMode:"numeric",value:I,onChange:vn=>bt(Math.max(0,Math.min(100,Number(vn.target.value)||0))),style:{color:Di,fontFeatureSettings:'"tnum"'}}),i.jsx("span",{style:{color:vi},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:O,onChange:vn=>U(vn.target.checked)}),"Reduce Only"]}),u==="limit"&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(xi,{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:vi},children:"TIF"})}),i.jsx(JP,{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:vn=>ne(vn.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:vn=>ne(vn.target.checked)}),"TP/SL"]}),X&&i.jsxs("div",{className:"grid grid-cols-2 gap-2 mb-3",children:[i.jsx(yb,{label:"TP",value:J,onChange:de}),i.jsx(yb,{label:"Gain %",value:Q,onChange:Vt,right:i.jsx("span",{style:{color:vi},children:"%"})}),i.jsx(yb,{label:"SL",value:re,onChange:Ct}),i.jsx(yb,{label:"Loss %",value:oe,onChange:st,right:i.jsx("span",{style:{color:vi},children:"%"})})]})]}),Ir&&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/${br}.svg`,alt:"Dextrabot - Terminal",className:"w-4 h-4 mr-2"}),br," 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/${Zn}.svg`,alt:"Dextrabot - Terminal",className:"w-4 h-4 mr-2"}),Zn," Short"]})]}),i.jsx("div",{className:"mb-3",children:i.jsx(Xhn,{value:Yn,onChange:Cn,leftLabel:br,rightLabel:Zn,leftUsd:Number(Qn||0)>0?Number(Qn)*Yn/100:0,rightUsd:Number(Qn||0)>0?Number(Qn)*(100-Yn)/100:0})}),i.jsx("div",{className:"mb-3",children:i.jsx(yb,{label:"Size (USD)",value:Qn,onChange:vn=>{ar(vn)},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 ${Ma}`},onClick:()=>{const vn=Un*(Number(Pe)||1);ar(String(vn.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:O,onChange:vn=>U(vn.target.checked)}),"Reduce Only"]}),u==="limit"&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{style:{color:vi},children:"TIF"}),i.jsx(JP,{value:L,onChange:z,items:[{key:"GTC",label:"GTC"},{key:"IOC",label:"IOC"},{key:"ALO",label:"ALO"}]})]})]})]}),u==="twap"&&!Ir&&i.jsxs(i.Fragment,{children:[i.jsx(yb,{label:"Total Size",value:pt,onChange:kr,right:i.jsx(JP,{value:wt,onChange:Dr,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(XN,{value:Ze,onChange:er,accent:ft}),i.jsxs("div",{className:"h-[30px] rounded-lg flex items-center px-2",style:{width:84,background:Po,border:`1px solid ${Ma}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right text-xs",inputMode:"numeric",value:Ze,onChange:vn=>er(Math.max(0,Math.min(100,Number(vn.target.value)||0))),style:{color:Di,fontFeatureSettings:'"tnum"'}}),i.jsx("span",{style:{color:vi},className:"ml-1",children:"%"})]})]}),i.jsx("div",{className:"mb-2 mt-3",style:{color:vi},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:Po,border:`1px solid ${Ma}`},children:i.jsx("input",{className:"w-full bg-transparent outline-none text-right",inputMode:"numeric",placeholder:"Hour(s)",value:cn===0?"":cn,onChange:vn=>{const Fn=vn.target.value.replace(/[^\d]/g,""),lt=Math.max(0,Math.min(24,Number(Fn)||0));zn(lt)},style:{color:cn?"#FFFFFF":vi,fontFeatureSettings:'"tnum"'}})}),i.jsx("div",{className:"h-[30px] px-2 rounded-lg flex items-center",style:{background:Po,border:`1px solid ${Ma}`},children:i.jsx("input",{className:"w-full bg-transparent outline-none text-right",inputMode:"numeric",placeholder:"Minute(s)",value:Xt===0?"":Xt,onFocus:()=>{Xt===5&&on(0)},onChange:vn=>{const Fn=vn.target.value.replace(/[^\d]/g,""),lt=Math.max(0,Math.min(59,Number(Fn)||0));on(lt)},style:{color:Xt?"#FFFFFF":vi,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:Zt,onChange:vn=>Ye(vn.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:O,onChange:vn=>U(vn.target.checked)}),"Reduce Only"]})]})]}),Ue?i.jsx("button",{onClick:rs,disabled:dn||!Bt||Ln||ai,className:"w-full h-[32px] rounded-xl font-bold transition-opacity mb-2 flex items-center justify-center disabled:opacity-60",style:{background:ft,color:"#0f151a"},children:Pr}):i.jsx(Jp,{onClick:()=>{qe==null||qe(),Fe(!0)}}),u==="twap"&&!Ir?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:[dr.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:jr.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:fr>0?`${fr.toLocaleString(void 0,{maximumFractionDigits:ze??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:ir})]})]}):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:Ir?"-":Jr?`$${Jr.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:Ir?`$${Number(Qn||0).toLocaleString(void 0,{maximumFractionDigits:2})}`:`$${(os||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:Ir?`$${(Number(Qn||0)/(Number(Pe)||1)||0).toLocaleString(void 0,{maximumFractionDigits:2})}`:`$${(ds||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:()=>Xn(!0),className:"text-[#67FFBD] hover:opacity-80 h-5 text-xs flex justify-center items-center",children:[`Est: ${Ks}% / `,`Max: ${Number(en||0).toFixed(2)}%`]})]})]}),Ue&&yt&&i.jsx("button",{onClick:()=>Le(!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"}),Ue&&yt&&i.jsxs("div",{className:"flex w-full gap-2 mt-2",children:[i.jsxs(uSe,{onClick:()=>Ke(!0),className:"flex-1",children:["Perps ",i.jsx(_ae,{className:"mx-1 text-xs"})," Spot"]}),i.jsx(uSe,{onClick:()=>et(!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(gv,{k:"Spot",v:`$${mSe(Bn??Number(Ot.spot||0))}`}),i.jsx(gv,{k:"Perps",v:`$${mSe(it.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(gv,{k:"Balance",v:`$${Z7(it.balance,2)}`}),i.jsx(gv,{k:"Unrealized PNL",v:i.jsxs("span",{style:{color:it.uPnl<0?"#FF7173":"#67FFBD"},children:["$",Z7(it.uPnl,2)]})}),i.jsx(gv,{k:"Cross Margin Ratio",v:i.jsxs("span",{style:{color:it.cmr>=.5?"#FF7173":"#67FFBD"},children:[Z7(it.cmr*100,2),"%"]}),link:!0}),i.jsx(gv,{k:"Maintenance Margin",v:`$${Z7(it.maintenanceMargin,2)}`}),i.jsx(gv,{k:"Cross Account Leverage",v:`${Z7(it.crossLeverage,2)}x`})]}),i.jsx(hhn,{open:tt,onClose:()=>Le(!1),initialAsset:"USDC",initialChain:"Arbitrum",toWalletAddress:(yt==null?void 0:yt.wallet_address)||""}),i.jsx(RHe,{open:Xe,onClose:()=>Ke(!1),perpsAvailable:_r,spotUsdcAvailable:Sn,onSubmit:Kn,loading:rn,initialToPerp:!1}),i.jsx(Yhn,{open:ut,onClose:()=>et(!1),perpsBalance:Number((it==null?void 0:it.balance)??0),defaultDest:at||""}),i.jsx(Jh,{open:ae,onClose:()=>fe(!1),children:i.jsxs(dm,{title:"Adjust Leverage",children:[i.jsxs("div",{className:"text-[12px] leading-5 mb-3",style:{color:vi},children:["Control the leverage used for ",Ir?`${br}/${Zn}`:e," ","positions. The maximum leverage is ",mt,"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:mt,step:1,value:Pe,onChange:vn=>Re(Number(vn.target.value)),className:"flex-1",style:{accentColor:Pg}}),i.jsxs("div",{className:"h-[36px] rounded-lg flex items-center px-2",style:{width:84,background:Po,border:`1px solid ${Ma}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right",inputMode:"numeric",value:Pe,onChange:vn=>Re(Math.max(1,Math.min(mt,Number(vn.target.value)||1))),style:{color:Di,fontFeatureSettings:'"tnum"'}}),i.jsx("span",{style:{color:vi},className:"ml-1",children:"x"})]})]}),i.jsx(F0,{onClick:()=>ln(()=>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(Jh,{open:Et,onClose:()=>Xn(!1),children:i.jsxs(dm,{title:"Adjust Max Slippage",children:[i.jsx("div",{className:"text-[12px] leading-5 mb-3",style:{color:vi},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:Po,border:`1px solid ${Ma}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right",type:"text",inputMode:"decimal",value:en,onChange:vn=>{const Fn=vn.target.value.replace(",",".");if(Fn===""){In("");return}/^\d*\.?\d*$/.test(Fn)&&In(Fn)},style:{color:Di,fontFeatureSettings:'"tnum"'}}),i.jsx("span",{style:{color:vi},className:"ml-1",children:"%"})]}),i.jsx(F0,{onClick:rt,children:"Confirm"})]})}),i.jsx(Jh,{open:V,onClose:()=>te(!1),children:i.jsxs(dm,{title:`${Ir?`${br}/${Zn}`:e} Margin Mode`,children:[i.jsx(jX,{active:we==="Cross",onClick:()=>xe("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(jX,{active:we==="Isolated",onClick:()=>xe("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(F0,{onClick:()=>ln(()=>te(!1)),children:"Confirm"})})]})}),i.jsx(Jh,{open:Ne,onClose:()=>me(!1),children:i.jsxs(dm,{title:"Position Mode",children:[i.jsx(jX,{active:$e==="One-Way",onClick:()=>ht("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(F0,{onClick:()=>me(!1),children:"Confirm"})})]})})]})}const vb=({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(Ai,{className:"text-[#c9c9c9] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(Oa,{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]`})]})]})},ipn=({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:$a,alt:"",className:"w-[14px] h-[14px] min-w-[14px] min-h-[14px]"})})]})]}),i.jsx(vb,{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(vb,{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(vb,{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(vb,{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(vb,{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(vb,{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(vb,{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(vb,{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})]})},DHe=m.createContext({key:"All",setKey:()=>{}});function apn({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(DHe.Provider,{value:s,children:e})}function w2(){return m.useContext(DHe)}function opn({className:e=""}){const{key:t,setKey:n}=w2(),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 lpn(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 cpn(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 Zg(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=>cpn(s,t));const r=n;return e.filter(s=>{const a=lpn(s);return a?a===r:!1})}const upn=({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}=w2(),{copyTradeWatchList:x,trackedWatchList:g,setSignModalOpen:v}=m.useContext(Qr),{address:w}=ts(),[C,N]=m.useState(!1),[P,I]=m.useState(null),[R,O]=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:""}),K=()=>{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((te,ae)=>{const fe=G[ae];return fe!==void 0&&fe!==""&&fe!==null&&te++,te},0))({...ne,walletFilter:z},[...Object.keys(ne),"walletFilter"]),Q=m.useMemo(()=>Zg(e,"positions",f),[e,f]),ie=async({walletAddress:G,isFollow:V,isScalper:te})=>{try{L(G);const ae=window.localStorage.getItem("hyperToken"),fe=window.localStorage.getItem("hyperAddress");if(!ae){v(!0);return}const Ne=V?"https://dextrabothypev2.nftinit.io/api/test_app/following/info/":"https://dextrabothypev2.nftinit.io/api/hyper/following/get_setting/",me=V?{address:w?w.toLowerCase():fe,token:ae,follow_address:G.toLowerCase()}:{address:w?w.toLowerCase():fe,token:ae},we=await fetch(Ne,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(me)});if(!we.ok)throw new Ul(`Server responded with status ${we.status}`);const xe=await we.json();xe.success?(I(Array.isArray(xe==null?void 0:xe.data)?[...xe.data].sort((ye,je)=>new Date(je.created_at||0)-new Date(ye.created_at||0)):xe==null?void 0:xe.data),O(te),N(!0)):tn.error(xe.error_message)}catch(ae){tn.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:te=>{te.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(te=>te.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(v5,{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(te=>te.wallet_address===(V==null?void 0:V.address))?i.jsx("img",{src:o5,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"}):i.jsx("img",{src:NA,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(Qx,{info:V!=null&&V.address?`${V.address.slice(0,5)}...${V.address.slice(-4)}`:"--",textColor:"text-white"}),i.jsx("img",{onClick:te=>{te.stopPropagation(),navigator.clipboard.writeText((V==null?void 0:V.address)||""),tn.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:Co,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(Fs,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):V.direction==="short"?i.jsx(Fs,{className:"text-[#FF797C] w-3 h-3"}):i.jsx(Fs,{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(Qx,{info:(V==null?void 0:V.notional)==null||isNaN(parseFloat(V==null?void 0:V.notional))?"--":`$${td(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(Qx,{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(Qx,{info:(V==null?void 0:V.entry_price)==null||isNaN(parseFloat(V==null?void 0:V.entry_price))?"--":`$${Ww(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(Qx,{info:(V==null?void 0:V.liq_price)==null||isNaN(parseFloat(V==null?void 0:V.liq_price))?"--":`$${Ww(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(Qx,{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(Qx,{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(Qx,{info:(V==null?void 0:V.account_value)==null||isNaN(parseFloat(V==null?void 0:V.account_value))?"--":`$${td(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(Qx,{info:(V==null?void 0:V.perp_equity)==null||isNaN(parseFloat(V==null?void 0:V.perp_equity))?"--":`$${td(V==null?void 0:V.perp_equity)}`,textColor:"text-white"})}];return i.jsxs(i.Fragment,{children:[i.jsx(w5,{open:C,setOpen:N,copyTradeData:P,copyTradeWallet:U,setCopyTradeWallet:L,isScalper:R,setCopyTradeData:I}),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(zf,{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(dpn,{title:"Reset Filter",set_click:()=>K(),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:()=>K(),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(ipn,{walletFilter:z,setWalletFilter:X,filterTerminal:ne,setFilterTerminal:J,resetFilters:K})]}),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(Ba,{})}):n&&!e?i.jsx("div",{className:"flex min-h-[26vh] sm:min-h-[66vh] flex-col justify-center items-center",children:i.jsx(Ul,{})}):(Q==null?void 0:Q.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:ac,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(Lu,{data:Q,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"})})]})]})]})},Qx=({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})}),dpn=({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 Pv(e,t=2){return Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}function bSe(e){return new Promise(t=>setTimeout(t,e))}function ySe(e){if(!e)return"";const t=String(e);return t.slice(0,6)+"..."+t.slice(-4)}function fpn({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 nF({children:e}){return i.jsx("div",{className:"text-[12px] text-[#9B9B9B] font-inter mb-1",children:e})}function vSe({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 wSe({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 hpn({children:e}){return i.jsx("div",{className:"grid grid-cols-2 gap-4",children:e})}function ppn({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 mpn({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 xpn(){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 gpn(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 bpn=e=>typeof e=="string"&&/^0x[0-9a-fA-F]{40}$/.test(e.trim());function ypn({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}),P=bpn(l),I=Number(g)>0&&Number(g)<=Number(w||0),R=!P||!I,O=l.length>0&&!P;return i.jsx(fpn,{open:e,onClose:t,title:"Send Tokens",children:i.jsxs("div",{className:"space-y-4 text-xs",children:[i.jsxs("div",{children:[i.jsx(nF,{children:"Destination"}),i.jsx(vSe,{value:l,onChange:c,placeholder:"Enter Hyperliquid account address (0x…)",invalid:O})]}),i.jsxs(hpn,{children:[i.jsxs("div",{children:[i.jsx(nF,{children:"From Account"}),i.jsx(wSe,{value:u,onChange:U=>d(U),options:[{value:"perps",label:"Perps Account"},{value:"spot",label:"Spot Account"}]})]}),i.jsxs("div",{children:[i.jsx(nF,{children:"Token"}),i.jsx(wSe,{value:f,onChange:x,options:o,disabled:u==="perps"})]})]}),i.jsxs("div",{children:[i.jsx(nF,{children:"Amount"}),i.jsxs("div",{className:"flex items-center",children:[i.jsx(vSe,{value:g,onChange:v,placeholder:"0.0"}),i.jsx(ppn,{onMax:C})]}),i.jsxs("div",{className:"mt-1 text-[12px] text-[#9B9B9B]",children:["Available: ",Pv(w,6)," ",f]})]}),i.jsx(mpn,{onClick:N,disabled:R,loading:a,children:"Send"})]})})}const vpn={name:"Exchange",version:"1",chainId:1337,verifyingContract:"0x0000000000000000000000000000000000000000"},wpn={Agent:[{name:"source",type:"string"},{name:"connectionId",type:"bytes32"}]};function Cpn(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]=Cpn(r))}return t}function Spn(e,t,n){const r=ire(e),s=MHe(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(ps(t),s.length+9)),co(o)}function Npn(e,t){return{source:t?"a":"b",connectionId:e}}function Apn(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 jpn(e,t){const n=xpn();if(!n)throw new Error("No injected provider");return await gpn(n,"0xa4b1"),await n.request({method:"eth_signTypedData_v4",params:[e,JSON.stringify(t)]})}function Epn({addr:e,isMainnet:t=!0,vaultAddress:n=null}){return{sign:async(r,s)=>{const a=Spn(r,n,s),o={domain:vpn,types:wpn,primaryType:"Agent",message:Npn(a,t)},l=await jpn(e,o);return Apn(l)}}}const CSe=e=>e?`${e.slice(0,6)}...${e.slice(-4)}`:"-";function _pn({walletAddress:e,listHeight:t=560}){const{address:n}=ts(),{latestPnL:r}=m.useContext(Qr),[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=bT(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?Hhn(ie).toLowerCase():null,G=n?n.toLowerCase():null,V=s?s.toLowerCase():null,te=ie&&oe&&V&&oe===V;return{mode:te?"local":!te&&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(te=>({...te,transfer:!0,transferInitToPerp:G}))};return window.addEventListener("balances:open-transfer",ie),()=>window.removeEventListener("balances:open-transfer",ie)},[]);const P=m.useMemo(()=>{try{if(!s)return null;if(N.mode==="local"){const ie=vT({getPK:()=>typeof window<"u"?localStorage.getItem("hl_pk"):null,isMainnet:!0,vaultAddress:null});return YN({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=Epn({addr:N.mmAddr,isMainnet:!0,vaultAddress:null});return YN({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 I=m.useMemo(()=>c||[],[c]),R=m.useMemo(()=>{const ie=I.find(oe=>oe.coin==="USDC");return ie?Math.max(0,Number(ie.total||0)-Number(ie.hold||0)):0},[I]),O=()=>{const ie=N.mode==="local"?N.localAddr:N.mode==="metamask"?N.mmAddr:null;return ie?N.targetAddr?ie!==N.targetAddr?(tn.error(`Connected wallet ${ySe(ie)} does not match selected account ${ySe(N.targetAddr)}. Switch wallet or change the selected account.`,{id:"addr-mismatch",duration:6e3}),!1):!0:(tn.error("Target account is missing.",{id:"target-missing"}),!1):(tn.error("Wallet not connected or signer unavailable.",{id:"signer-missing"}),!1)},U=()=>{tn.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:te})=>{var ae;try{if(C(!0),!P)throw new Error("SDK not ready");if(!O())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(te||0))throw new Error("Amount exceeds available balance");let Ne;if(ie==="perps")Ne=await P.transfers.usdTransfer(fe,V);else{const me=u[oe];if(!me)throw new Error(`TokenId not found for ${oe}`);const we=`${oe}:${me}`;Ne=await P.transfers.spotTransfer(fe,we,String(V))}if((Ne==null?void 0:Ne.status)==="ok")tn.success("Send successful.",{id:"send-success"}),await bSe(600),(ae=window==null?void 0:window.dispatchEvent)==null||ae.call(window,new Event("balances:refresh"));else{const me=typeof(Ne==null?void 0:Ne.response)=="string"?Ne.response:JSON.stringify(Ne);me&&me.toLowerCase().includes("must deposit")?U():tn.error(`Send failed: ${me||"Unknown error"}`,{id:"send-error"})}}catch(fe){const Ne=(fe==null?void 0:fe.message)||"Send failed";Ne.toLowerCase().includes("must deposit")?U():tn.error(Ne,{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),!P)throw new Error("SDK not ready");if(!O())return;if(!Number(oe))throw new Error("Amount is invalid");if(Number(oe)>Number(G||0))throw new Error("Amount exceeds available balance");const te=await P.transfers.usdClassTransfer(String(oe),!!ie);if((te==null?void 0:te.status)==="ok")tn.success("Transfer successful.",{id:"transfer-success"}),await bSe(600),(V=window==null?void 0:window.dispatchEvent)==null||V.call(window,new Event("balances:refresh"));else{const ae=typeof(te==null?void 0:te.response)=="string"?te.response:JSON.stringify(te);ae&&ae.toLowerCase().includes("must deposit")?U():tn.error(`Transfer failed: ${ae||"Unknown error"}`,{id:"transfer-error"})}}catch(te){const ae=(te==null?void 0:te.message)||"Transfer failed";ae.toLowerCase().includes("must deposit")?U():tn.error(ae,{id:"transfer-error"})}finally{C(!1),v(te=>({...te,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 K=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}),I.forEach(te=>{const ae=String(te.coin),fe=Number(te.total||0),Ne=Number(te.hold||0),me=Math.max(0,fe-Ne);let we=null;ae==="USDC"&&(we=fe);const xe=f[ae];we==null&&Number.isFinite(xe)&&(we=xe*fe),ie.push({id:`SPOT_${ae}`,kind:"spot",coin:ae,unit:ae,usdcValue:we,totalDisplay:fe,availableDisplay:me,totalSort:fe,availableSort:me})}),ie},[l,I,f]),he=m.useMemo(()=>ne?re.filter(ie=>{if(ie.kind==="perps")return!0;const oe=K(ie);return oe!=null?oe>=X:Number(ie.totalDisplay??0)>=1e-6}):re,[re,ne,K]),Q=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:[Pv(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),te=G?`Available balance to open positions ignoring open orders. ${Pv(V,2)} USDC is availableto withdraw.`:void 0;return i.jsxs("span",{className:"text-white underline-offset-2",title:te,children:[Pv(oe.availableDisplay)," ",i.jsx("span",{className:"text-[#9B9B9B]",children:oe.unit})]})}},{key:"usdcValue",label:"USDC Value",sortable:!0,sortValue:ie=>{const oe=K(ie);return oe??-1},render:(ie,oe)=>{const G=K(oe);return i.jsxs("span",{className:"text-white",children:[G!=null?Pv(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),te=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"?"-":`$${Pv(Math.abs(G),2)}`," ",i.jsx("span",{className:"text-[#9B9B9B]",children:te==null?"":`(${Pv(Math.abs(te),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(k6t,{}),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(_ae,{}),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,te=(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:CSe(V)})}if(te){const ae=`https://arbiscan.io/token/${te}`;return i.jsx("a",{href:ae,target:"_blank",rel:"noreferrer",className:"text-white bg-transparent -ml-2",children:CSe(te)})}return i.jsx("span",{className:"text-[#9B9B9B] -ml-2",children:"-"})}}],[r==null?void 0:r.all,l,K,d]);return x?i.jsxs(i.Fragment,{children:[i.jsx(Lu,{data:he,columns:Q,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(ypn,{open:g.send,onClose:()=>v(ie=>({...ie,send:!1})),perpsAvailable:l==null?void 0:l.withdrawable,spotBalances:I,onSubmit:L,loading:w}),i.jsx(RHe,{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 kpn={position:"bottom-right",style:{background:"#1e1e1e",color:"#fff",fontSize:12,border:"1px solid #2A2A2A"}},Tpn="dextra-global-toast";function MX(e,t){return tn.promise(e,t,{id:Tpn,...kpn})}async function RX(e){const t=vT({getPK:()=>typeof window<"u"?localStorage.getItem("hl_pk"):null,isMainnet:!0,vaultAddress:null});return YN({address:e,signer:t,dex:""})}function xo(e,t=6){return Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}function Ipn(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""}function Cue({open:e,onClose:t,title:n,width:r=720,children:s}){return e?Na.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 Fg=({children:e})=>i.jsx("div",{className:"text-[11px] text-[#9B9B9B] mb-1",children:e}),are=({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]"}),LX=({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]}),BHe=({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(Yy,{size:14,color:"#FFF"}):null,i.jsx("span",{children:e})]});function Ppn({open:e,onClose:t,row:n,onConfirm:r,initialTab:s="limit",busy:a=!1}){const[o,l]=Ae.useState(s),[c,u]=Ae.useState(n!=null&&n.markPrice?String(n.markPrice):""),[d,f]=Ae.useState(100),x=Ae.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);Ae.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}))},P=o==="market"?"Market Close":"Limit Close",I=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(Cue,{open:e,onClose:a?()=>{}:t,title:P,width:500,children:i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{className:"text-[12px] text-[#9B9B9B]",children:I}),i.jsxs("div",{className:"flex items-center justify-between text-[11px]",children:[i.jsx(Fg,{children:"Size"}),i.jsxs("div",{className:"text-[#CFCFCF]",children:[xo(g)," ",n==null?void 0:n.coin]})]}),o==="market"?i.jsxs("div",{className:"grid gap-3",children:[i.jsxs("div",{children:[i.jsx(Fg,{children:"Price"}),i.jsx(LX,{right:"",children:i.jsx("span",{className:"text-white",children:"Market"})})]}),i.jsxs("div",{children:[i.jsx(Fg,{children:"Size"}),i.jsx(LX,{right:"USDC",children:xo(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(Fg,{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(are,{value:c,onChange:u,placeholder:"0.0"})]}),i.jsxs("div",{children:[i.jsx(Fg,{children:"Size"}),i.jsx(LX,{right:"USDC",children:xo(w*(C||v),2)})]})]}),i.jsx(XN,{value:d,onChange:f,accent:"#67FFBD",trackBg:"rgba(255,255,255,0.12)",marks:[0,25,50,75,100],snap:!0}),i.jsx(BHe,{onClick:N,disabled:o==="limit"&&!c,loading:a,children:o==="market"?"Market Close":"Confirm"})]})})}function Fpn({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(Cue,{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," ",xo(a)]}),i.jsxs("div",{className:"text-[#FF797C]",children:[o," ",xo(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(Yy,{size:14,color:"#FFF"}):"Reverse"})]})]})})}const SSe=({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 Opn({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),P=Number((n==null?void 0:n.entryPrice)||0),I=Number((n==null?void 0:n.markPrice)??0),R=Math.abs(Number((n==null?void 0:n.size)||0)),O=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(!P)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),te=(O==="Long"?G/P-1:1-G/P)*100*V;return z(L(te),2)},ne=oe=>{var ae;if(!P)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),te=(O==="Long"?1-G/P:G/P-1)*100*V;return z(L(te),2)},J=oe=>{var fe;const G=Number(oe);if(!Number.isFinite(G)||!P)return"";const V=Number(((fe=n==null?void 0:n.leverage)==null?void 0:fe.value)||1),te=G/(V*100),ae=O==="Long"?P*(1+te):P*(1-te);return z(ae,4)},K=oe=>{var fe;const G=Number(oe);if(!Number.isFinite(G)||!P)return"";const V=Number(((fe=n==null?void 0:n.leverage)==null?void 0:fe.value)||1),te=G/(V*100),ae=O==="Long"?P*(1-te):P*(1+te);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,(O==="Long"?Number(o)-I:I-Number(o))*R):0,he=c&&R?Math.max(0,(O==="Long"?I-Number(c):Number(c)-I)*R):0,Q=()=>{a==null||a({id:n==null?void 0:n.id,coin:n==null?void 0:n.coin,side:O,tpPrice:o?Number(o):null,slPrice:c?Number(c):null,configureAmount:v,useLimitPx:C}),t()};return i.jsx(Cue,{open:e,onClose:t,title:`TP/SL for Position - ${(n==null?void 0:n.coin)||"--"} - ${U||O||"--"}`,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:[xo(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:xo(P,4)})]}),i.jsxs("div",{className:"flex justify-between text-[#9B9B9B]",children:[i.jsx("span",{children:"Mark Price"}),i.jsx("span",{className:"text-white",children:xo(I,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(Fg,{children:"TP Price"}),i.jsx(are,{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:["+$",xo(re,2)]})]}),i.jsxs("div",{children:[i.jsx(Fg,{children:"Gain"}),i.jsx(SSe,{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(Fg,{children:"SL Price"}),i.jsx(are,{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:["-$",xo(he,2)]})]}),i.jsxs("div",{children:[i.jsx(Fg,{children:"Loss"}),i.jsx(SSe,{value:x,onChange:oe=>{g(oe),u(oe?K(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(BHe,{onClick:Q,disabled:!o&&!c,children:"Confirm"})]})]})})}function Mpn({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&&Na.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(Yy,{size:12,color:"#FFF"})}):null]})]})}),document.body)]})}function Rpn({walletAddress:e,listHeight:t=560}){var me,we,xe,ye;const{isReferralCodeName:n}=m.useContext(Qr),{rows:r,tpslByCoin:s={},viewOrdersOnly:a}=bue(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}=w2(),[f,x]=m.useState({}),[g,v]=m.useState(null),[w,C]=m.useState(!1),[N,P]=m.useState({coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,referral:"",positionDistribution:0,pnl:0,closePx:0}),[I,R]=m.useState(null),O=m.useMemo(()=>u.find(je=>je.id===I)||null,[u,I]),[U,L]=m.useState(!1),[z,X]=m.useState("limit"),[ne,J]=m.useState(!1),[K,re]=m.useState(!1),[he,Q]=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:Pe,tpPrice:Re,slPrice:Xe,configureAmount:Ke,useLimitPx:ut})=>{var et;try{const tt=await RX(e);await MX(tt.replaceTPSLForPosition({symbol:Pe,tpPrice:Re??null,slPrice:Xe??null,useLimitPx:!!ut,triggerSlippage:.1}),{loading:`Placing TP/SL for ${Pe}...`,success:`TP/SL placed for ${Pe}`,error:Le=>`TP/SL failed: ${(Le==null?void 0:Le.message)||Le}`}),x(Le=>({...Le,[je]:{tp:Re||null,sl:Xe||null}})),(et=window.dispatchEvent)==null||et.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&&P(Pe=>({...Pe,referral:je}))}},[w,n,N.referral]);const te=m.useCallback(async je=>{re(!0);try{const Pe=await RX(e),Re=je.mode==="market"?Pe.marketClose(je.coin,je.size,{tif:"Ioc",reduceOnly:!0}):Pe.placeOrder({symbol:je.coin,isBuy:je.side==="Short",size:je.size,price:je.price,tif:"Gtc",reduceOnly:!0});await MX(Re,{loading:`Closing ${je.coin} ${je.mode}...`,success:`Closed ${je.coin} (${xo(je.size)} ${je.mode})`,error:Xe=>`Close failed: ${je.coin} • ${(Xe==null?void 0:Xe.message)||Xe}`}),L(!1)}finally{re(!1)}},[e]),ae=m.useMemo(()=>[{key:"coin",label:"Coin",sortable:!0,sortValue:Pe=>Pe.coin||"",render:(Pe,Re)=>{var ut;const Xe=Wo(),Ke=()=>Xe(`/terminal/hyperliquid/${Re.coin}`);return i.jsxs("div",{onPointerDown:Ke,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:sa,className:"w-5 h-5 mr-2",alt:Re.coin}),i.jsx("span",{children:Pe.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:[xo(((ut=Re.leverage)==null?void 0:ut.value)??0,0),"x"]})})})]})}},{key:"size",label:"Size",sortable:!0,sortValue:Pe=>Math.abs(Pe.size),render:(Pe,Re)=>i.jsxs("span",{className:`font-medium ${Re.type==="Long"?"text-[#67ffbd]":"text-[#ff787b]"}`,children:[xo(Math.abs(Pe))," ",Re.coin.replace("xyz:","")]})},{key:"positionValue",label:"Pos. Val.",sortable:!0,sortValue:Pe=>Pe.positionValue,render:Pe=>i.jsxs("span",{className:"text-white font-semibold",children:["$",xo(Pe,2)]})},{key:"entryPrice",label:"Entry Price",sortable:!0,sortValue:Pe=>Pe.entryPrice,render:Pe=>i.jsxs("span",{className:"text-white font-semibold",children:["$",xo(Pe,4)]})},{key:"markPrice",label:"Mark Price",sortable:!0,sortValue:Pe=>Pe.markPrice,render:Pe=>i.jsxs("span",{className:"text-white font-semibold",children:["$",xo(Pe,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:Pe=>Pe.pnl,render:(Pe,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:["$",xo(Math.abs(Re.pnl),2)," ",i.jsxs("span",{className:"text-[#9B9B9B]",children:["(",xo(Math.abs(Re.roe),1),"%)"]})]}),i.jsx("button",{onClick:Xe=>{var ut;Xe.stopPropagation();const Ke=n||window.localStorage.getItem("refcode")||"";P({coin:Re.coin,type:Re.type.toUpperCase(),leverage:((ut=Re.leverage)==null?void 0:ut.value)||0,roe:Re.roe||0,entryPrice:Number(Re.entryPrice||0),markPrice:Number(Re.markPrice||0),referral:Ke,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:bm,alt:"",className:"w-[14px] h-[14px] min-w-[14px] min-h-[14px]"})})]})},{key:"liquidationPx",label:"Liq. Price",sortable:!0,sortValue:Pe=>Pe.liquidationPx??-1,render:Pe=>Pe==null?i.jsx("span",{className:"text-[#979797]",children:"--"}):i.jsx("span",{className:"text-white font-semibold",children:xo(Pe,0)})},{key:"marginUsed",label:"Margin",headerTooltip:"For isolated positions margin includes unrealized pnl.",sortable:!0,sortValue:Pe=>Pe.marginUsed,render:(Pe,Re)=>{var ut;const Xe=Re.marginUsed,Ke=(ut=Re.leverage)!=null&&ut.type?Ipn(Re.leverage.type):null;return i.jsxs("span",{className:"text-white font-semibold",children:["$",xo(Xe,2)," ",Ke?i.jsxs("span",{className:"text-[#9B9B9B]",children:["(",Ke,")"]}):null]})}},{key:"funding",label:"Funding",headerTooltip:"Net funding payments since the position was opened. Hover for all-time and since changed.",sortable:!0,sortValue:Pe=>Pe.funding,render:Pe=>i.jsxs("span",{className:Number(Pe)<=0?"text-[#67FFBD] font-semibold":"text-[#FF797C] font-semibold",children:["$",xo(Math.abs(Pe),4)]})},{key:"close",label:i.jsx(Mpn,{selectedRow:O,onOpenCloseModal:async Pe=>{if(O){if(X(Pe),Pe==="market"&&ie()){await te({mode:"market",id:O==null?void 0:O.id,coin:O==null?void 0:O.coin,side:O==null?void 0:O.type,size:Math.abs(Number((O==null?void 0:O.size)||0))});return}L(!0)}},onOpenReverse:()=>O&&J(!0),onCloseAll:async()=>{Q(!0);try{const Pe=await RX(e);await MX(Pe.closeAllPositions(),{loading:"Closing all positions...",success:"Closed all positions",error:Re=>`Close all failed: ${(Re==null?void 0:Re.message)||Re}`})}finally{Q(!1)}},busyCloseAll:he}),sortable:!1,align:"start",render:(Pe,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 te({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:(Pe,Re)=>{const Xe=s==null?void 0:s[Re.coin],Ke=Xe&&(Xe.tp||Xe.sl),ut=a instanceof Set?a.has(Re.coin):!1,et=f[Re.id];return Ke?i.jsxs("div",{className:"flex items-center justify-end gap-2 text-[#CFCFCF]",children:[i.jsxs("span",{className:"text-[#CFCFCF]",children:[Xe.tp?xo(Xe.tp,0):"--"," /"," ",Xe.sl?xo(Xe.sl,0):"--"]}),i.jsx("button",{onClick:()=>v(Re),className:"opacity-80 hover:opacity-100 bg-transparent p-0",children:"✎"})]}):ut?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"})}):et&&(et.tp||et.sl)?i.jsxs("div",{className:"flex items-center justify-end gap-2 text-[#CFCFCF]",children:[i.jsxs("span",{className:"text-[#CFCFCF]",children:[et.tp?xo(et.tp,0):"--"," /"," ",et.sl?xo(et.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:"-- / -- ✎"})})}}],[O,n,f,s,a,e,he,te]),fe=g?((me=s==null?void 0:s[g.coin])==null?void 0:me.tp)??((we=f[g.id])==null?void 0:we.tp)??null:null,Ne=g?((xe=s==null?void 0:s[g.coin])==null?void 0:xe.sl)??((ye=f[g.id])==null?void 0:ye.sl)??null:null;return i.jsxs(i.Fragment,{children:[i.jsx(Lu,{data:Zg(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 ${I===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(Opn,{open:!!g,onClose:()=>v(null),row:g,initialTp:fe,initialSl:Ne,onSubmit:V}),i.jsx(Ppn,{open:U&&!!O,onClose:()=>L(!1),row:O,initialTab:z,onConfirm:te,busy:K}),i.jsx(Fpn,{open:ne&&!!O,onClose:()=>J(!1),row:O,onConfirm:je=>{J(!1),console.log("REVERSE CONFIRM",je)}}),i.jsx(pT,{open:w,setOpen:C,data:N,setTradeInfo:P})]})}async function NSe(e){const t=vT({getPK:()=>typeof window<"u"?localStorage.getItem("hl_pk"):null,isMainnet:!0,vaultAddress:null});return YN({address:e,signer:t,dex:""})}function ore(e,t=2,n=!0){return Number(e||0).toLocaleString(void 0,{minimumFractionDigits:n?0:t,maximumFractionDigits:t})}function Lpn(e,t=2){return`${Number(e||0).toLocaleString(void 0,{minimumFractionDigits:t,maximumFractionDigits:t})} USDC`}function Dpn(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 Bpn(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 $pn({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 Upn(e){return typeof(e==null?void 0:e.type)=="string"&&e.type.toLowerCase()==="limit"}function zpn(e){return typeof e=="string"&&e.toLowerCase().includes("stop")}function Hpn(e){return typeof e=="string"&&e.toLowerCase().includes("take profit")}function Vpn(e){return e==="B"?"Long":"Short"}function Wpn(e){return e==="B"?"Short":"Long"}function ej({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 rF({title:e,order:t,parentRawSide:n}){const r=!!t,s=r?t.side?Vpn(t.side):Wpn(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(ej,{k:"Order Type",v:t.orderType||"--"}),i.jsx(ej,{k:"Side",v:s}),i.jsx(ej,{k:"Amount",v:`${t.sz}`}),i.jsx(ej,{k:"Trigger",v:t.triggerCondition&&t.triggerCondition!=="N/A"?t.triggerCondition:"N/A"}),i.jsx(ej,{k:"Price",v:a?`$${ore(t.limitPx,3)}`:"Market"})]}):i.jsx("div",{className:"text-[#9B9B9B]",children:"—"})]})}function qpn({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(Yy,{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&&Na.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 Gpn({walletAddress:e,listHeight:t=560,onCancelOrder:n,onBulkCancel:r}){const{rows:s,loading:a}=yue(e),[o,l]=m.useState(!1),[c,u]=m.useState(null),[d,f]=m.useState(null),[x,g]=m.useState(null),{key:v}=w2(),[w,C]=m.useState(new Set),[N,P]=m.useState(!1),I=V=>w.has(V),R=V=>C(te=>new Set([...te,V])),O=V=>C(te=>{const ae=new Set(te);return ae.delete(V),ae}),U=m.useCallback(async V=>{await(await NSe(e)).cancelOrder({symbol:V.coin,oid:V.oid})},[e]),L=m.useCallback(async V=>{await(await NSe(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,K=m.useCallback(async V=>{const te=V.oid;if(!I(te)){R(te);try{await tn.promise(Promise.resolve(ne(V)),{loading:`Cancelling: ${V.coin} #${te}...`,success:`Cancelled: ${V.coin} #${te}`,error:ae=>`Cancel failed: ${V.coin} #${te} • ${(ae==null?void 0:ae.message)||ae}`},{position:"bottom-right",style:{background:"#1e1e1e",color:"#fff",fontSize:12}})}finally{O(te)}}},[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){P(!0);try{await tn.promise(Promise.resolve(J(V)),{loading:`Bulk cancelling: ${re(V)}...`,success:`Bulk cancelled: ${re(V)}`,error:te=>`Bulk cancel failed: ${re(V)} • ${(te==null?void 0:te.message)||te}`},{position:"bottom-right",style:{background:"#1e1e1e",color:"#fff",fontSize:12}})}finally{P(!1)}}},[J]),Q=m.useCallback(V=>{const te=Array.isArray(V==null?void 0:V.children)?V.children:[],ae=te.find(Ne=>Hpn(Ne.orderType))||null,fe=te.find(Ne=>zpn(Ne.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:Dpn(V)})},{key:"type",label:"Type",sortable:!0,width:"120px",sortValue:V=>V.type||"",render:(V,te)=>i.jsx("span",{className:"text-white",children:te.type||"--"})},{key:"coin",label:"Coin",sortable:!0,sortValue:V=>V.coin||"",render:(V,te)=>{const ae=(te.side==="B",te.reduceOnly?"text-[#FF797C]":"text-[#67FFBD]"),fe=Wo(),Ne=()=>fe(`/terminal/hyperliquid/${te.coin}`);return i.jsxs("div",{onPointerDown:Ne,className:"flex items-center font-medium cursor-pointer hover:opacity-80",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${X(te.coin)}.svg`,onError:sa,className:"w-5 h-5 mr-2",alt:te.coin}),i.jsx("span",{className:ae,children:te.coin.replace("xyz:","")||"--"})]})}},{key:"side",label:"Direction",sortable:!0,sortValue:V=>V.side==="B"?1:0,render:(V,te)=>{const ae=Bpn(te),fe=te.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:Lpn(V,2)})},{key:"price",label:"Price",sortable:!0,sortValue:V=>V.limitPx,render:(V,te)=>{if(te.price==="Market")return i.jsx("span",{className:"text-white font-semibold",children:"Market"});const ae=typeof te.pxDecimals=="number"?te.pxDecimals:3;return i.jsx("span",{className:"text-white font-semibold",children:ore(te.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,te)=>te.triggerPx&&te.triggerPx!=="N/A"?i.jsx("span",{className:"text-white font-semibold",children:te.type==="Stop Market"?`Price Below ${te.triggerPx}`:te.type==="Take Profit Market"?`Price Above ${te.triggerPx}`:te.triggerPx}):i.jsx("span",{children:"N/A"})},{key:"tp_sl",label:"TP/SL",sortable:!1,render:(V,te)=>{const ae=Array.isArray(te.children)&&te.children.length>0;return Upn(te)&&ae?i.jsx("button",{onClick:fe=>{fe.stopPropagation(),Q(te)},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(qpn,{onBulkCancel:he,busy:N}),sortable:!1,render:(V,te)=>{const ae=I(te.oid);return i.jsx("button",{onClick:fe=>{fe.stopPropagation(),ae||K(te)},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(Yy,{size:12,color:"#FF797C"}):"×"})}}],[Q,K,he,N,w]),oe=(d?1:0)+(x?1:0),G=c?`${c.coin} • TP/SL for Limit @ ${ore(c.limitPx,3)}`:"Take Profit / Stop Loss";return i.jsxs(i.Fragment,{children:[i.jsx(Lu,{data:Zg(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($pn,{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(rF,{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(rF,{title:"Order B",order:d,parentRawSide:c==null?void 0:c.side}),i.jsx(rF,{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(rF,{title:"",order:d,parentRawSide:c==null?void 0:c.side})]})]})]})]})}async function Kpn(e){const t=vT({getPK:()=>typeof window<"u"?localStorage.getItem("hl_pk"):null,isMainnet:!0,vaultAddress:null});return YN({address:e,signer:t,dex:""})}const Ypn="wss://api.hyperliquid.xyz/ws",$He="https://api.hyperliquid.xyz/info";function yv(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 DX(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 BX(e){return e?"Yes":"No"}function UHe(e,t){const n=Number(t||0);return n?Number(e||0)/n:null}const $X=new Map;function zHe(e){const t=(e==null?void 0:e.toLowerCase())||"";return t?($X.has(t)||$X.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}),$X.get(t)):null}function Z3(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 EO(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 Xpn(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 HHe(e){if(e.booting||e.connected)return;e.booting=!0,EO(e);const t=new WebSocket(Ypn);e.ws=t,t.onopen=()=>{e.connected=!0,!e.hydratedActive&&e.activeRows.length===0&&(e.loadingActive=!0,Z3(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}=Xpn(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=UHe(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,Z3(e)}}catch{}},t.onclose=()=>{EO(e),setTimeout(()=>HHe(e),1500)},t.onerror=()=>{EO(e)},e.booting=!1}async function VHe(e){try{e.loadingHistory=!0,Z3(e);const n=await(await fetch($He,{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=UHe(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,Z3(e)}}function Qpn(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 WHe(e){try{e.loadingFills=!0,Z3(e);const n=await(await fetch($He,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"userTwapSliceFills",user:e.key})})).json();e.fillRows=Qpn(n||[])}catch{e.fillRows=[]}finally{e.loadingFills=!1,Z3(e)}}function Zpn(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=zHe(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}),HHe(s),VHe(s),WHe(s),()=>{s.subs.delete(a),s.subs.size===0&&EO(s)}},[t]),n}function Jpn(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 emn(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 _O(e=""){const t=e.toLowerCase();return t.includes("long")||t==="buy"}function kO(e=""){const t=e.toLowerCase();return t.includes("short")||t==="sell"}function tmn(e=""){return _O(e)&&!kO(e)?3:_O(e)&&kO(e)?2:kO(e)&&!_O(e)?1:0}function nmn({walletAddress:e}){const{activeRows:t,historyRows:n,fillRows:r,loadingActive:s,loadingHistory:a,loadingFills:o,hydratedActive:l}=Zpn(e),c=emn(1e3),u=m.useMemo(()=>t.map(re=>({...re,runtimeMs:Math.max(0,c-Number(re.timestamp||0))})),[t,c]),{key:d}=w2(),[f,x]=m.useState(new Set),g=re=>f.has(re),v=re=>x(he=>new Set([...he,re])),w=re=>x(he=>{const Q=new Set(he);return Q.delete(re),Q}),C=async re=>{const he=re.twapId??Number(re.id);if(!g(he)){v(he);try{const Q=await Kpn(e);await tn.promise(Q.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=zHe(e);if(ie){const oe=String(he);ie.activeRows=ie.activeRows.filter(G=>String(G.twapId??G.id)!==oe),ie.hydratedActive=!0,Z3(ie),VHe(ie),WHe(ie)}}finally{w(he)}}},[N,P]=m.useState("active"),[I,R]=m.useState("active"),O=["active","history","fills"],U=O.indexOf(N)>O.indexOf(I)?"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,Q)=>re?i.jsxs("div",{className:"px-3 py-6 flex items-center gap-2 text-[#9B9B9B]",children:[i.jsx(Yy,{size:14,color:"#9B9B9B"}),i.jsx("span",{children:Q})]}):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 Q=he.side==="A"||he.side==="Buy"?"text-[#FF797C]":"text-[#67FFBD]",ie=Wo(),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:sa,className:"w-5 h-5 mr-2",alt:he.coin}),i.jsx("span",{className:`font-bold ${Q}`,children:re||"--"})]})}},{key:"sz",label:"Size",sortable:!0,sortValue:re=>re.sz,render:(re,he)=>{const Q=he.side==="A"||he.side==="Buy"?"text-[#FF797C]":"text-[#67FFBD]";return i.jsxs("span",{className:Q,children:[yv(re)," ",he.coin]})}},{key:"executedSz",label:"Executed Size",sortable:!0,sortValue:re=>re.executedSz,render:(re,he)=>{const Q=he.side==="A"||he.side==="Buy"?"text-[#FF797C]":"text-[#67FFBD]";return re&&Number(re)!==0?i.jsxs("span",{className:Q,children:[yv(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:tj(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:[Jpn(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:BX(re)})},{key:"timestamp",label:"Creation Time",sortable:!0,sortValue:re=>re.timestamp,render:re=>i.jsx("span",{className:"text-white font-semibold",children:DX(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 Q=he.twapId??Number(he.id),ie=g(Q);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(Yy,{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:DX(re)})},{key:"coin",label:"Coin",sortable:!0,sortValue:re=>re.coin||"",render:(re,he)=>{const Q=he.side==="A"||he.side==="Buy"?"text-[#FF797C]":"text-[#67FFBD]",ie=Wo(),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:sa,className:"w-5 h-5 mr-2",alt:he.coin}),i.jsx("span",{className:`font-bold ${Q}`,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:[yv(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:[yv(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:tj(re,0)}):"--"},{key:"totalMinutes",label:"Total Runtime",sortable:!0,sortValue:re=>re.totalMinutes,render:re=>i.jsxs("span",{className:"text-white font-semibold",children:[yv(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:BX(re)})},{key:"randomize",label:"Randomize",sortable:!0,sortValue:re=>re.randomize?1:0,render:re=>i.jsx("span",{className:"text-white font-semibold",children:BX(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:DX(he.time)})},{key:"coin",label:"Coin",sortable:!0,sortValue:re=>re.coin||"",render:(re,he)=>{const Q=he.side==="A"||he.side==="Buy"?"text-[#FF797C]":"text-[#67FFBD]",ie=Wo(),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:sa,className:"w-5 h-5 mr-2",alt:he.coin}),i.jsx("span",{className:`font-bold ${Q}`,children:re||"--"})]})}},{key:"dir",label:"Direction",sortable:!0,sortValue:re=>tmn(re.dir),render:re=>i.jsx("span",{className:`${kO(re)?"text-[#FF6B6B]":_O(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:["$",tj(re,0)]}):"--"},{key:"sz",label:"Size",sortable:!0,sortValue:re=>re.sz,render:re=>i.jsx("span",{className:"text-white font-semibold",children:yv(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:["$",tj(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:yv(re)})},{key:"closedPnl",label:"Closed PnL",sortable:!0,sortValue:re=>re.closedPnl-re.fee,render:(re,he)=>{const Q=Number(he.closedPnl||0)-Number(he.fee||0),ie=Q>0,oe=Q<0;return i.jsxs("span",{className:`${ie?"text-[#67FFBD] font-semibold":oe?"text-[#FF797C] font-semibold":"text-white font-semibold"}`,children:["$",tj(Math.abs(Q))]})}},{key:"oid",label:"Order ID",sortable:!0,sortValue:re=>re.oid,render:re=>i.jsx("span",{className:"text-[#979797] font-semibold",children:re||"--"})}],[]),K=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),P(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(wo.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:[K,i.jsx("div",{className:"flex-1 min-h-0 relative",children:i.jsx(xT,{mode:"wait",custom:U,children:i.jsx(wo.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(Lu,{data:Zg(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(Lu,{data:Zg(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(Lu,{data:Zg(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 rmn="wss://api.hyperliquid.xyz/ws",smn="https://api-ui.hyperliquid.xyz/info",imn={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"},amn=e=>imn[e]||e;function omn(e,t=6){return Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}function nj(e,t=2){return`$${Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}`}function lre(e){return e==="Open Long"||e==="Close Short"||e==="Short > Long"}function cre(e){return e==="Open Short"||e==="Close Long"||e==="Long > Short"}function lmn(e){return lre(e)?1:cre(e)?0:-1}function cmn(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 umn(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 UX=new Map;function dmn(e,t=!0){const n=(e==null?void 0:e.toLowerCase())||"";if(!n)return null;UX.has(n)||UX.set(n,{key:n,rows:[],loading:!0,ws:null,ping:null,subs:new Set,booting:!1,connected:!1,hydrated:!1,aggregateByTime:t});const r=UX.get(n);return r.aggregateByTime=t,r}function ure(e){e.subs.forEach(t=>t({rows:e.rows,loading:e.loading}))}function TO(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 qHe(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 fmn(e){try{e.loading=!0,ure(e);const n=await(await fetch(smn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({aggregateByTime:!!e.aggregateByTime,type:"userFills",user:e.key})})).json();e.rows=qHe(n||[]),e.hydrated=!0}catch{e.rows=[]}finally{e.loading=!1,ure(e)}}function ASe(e,t){const n=(t==null?void 0:t.fills)||t||[];if(!Array.isArray(n)||!n.length)return;const r=qHe(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,ure(e)}async function GHe(e){if(e.booting||e.connected)return;e.booting=!0,TO(e);const t=new WebSocket(rmn);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"&&ASe(e,a==null?void 0:a.data),(a==null?void 0:a.channel)==="user"&&((r=a==null?void 0:a.data)!=null&&r.fills)&&ASe(e,(s=a==null?void 0:a.data)==null?void 0:s.fills)}catch{}},t.onclose=()=>{TO(e),setTimeout(()=>GHe(e),1500)},t.onerror=()=>{TO(e)},e.booting=!1}function hmn(e,t){const n=(e==null?void 0:e.toLowerCase())||"",[r,s]=m.useState({rows:[],loading:!0});return m.useEffect(()=>{const a=dmn(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}),fmn(a),GHe(a),()=>{a.subs.delete(o),a.subs.size===0&&TO(a)}},[n,t]),r}function pmn({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}=hmn(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}=w2(),{isReferralCodeName:d}=m.useContext(Qr),[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 O=typeof window<"u"?window.localStorage.getItem("hyperAddress"):null,U=typeof window<"u"?window.localStorage.getItem("hyperToken"):null;if(!O||!U||!R||R.length===0)return null;try{const{data:L}=await hs.post("https://dextrabothypev2.nftinit.io/api/hyper/order/get_leverage_with_oids/",{address:O,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(O=>({...O,referral:R}))}},[f,d,g.referral]);const P=m.useMemo(()=>[{key:"time",label:"Time",sortable:!0,sortValue:R=>R.time,render:(R,O)=>i.jsx("button",{onClick:()=>l(U=>U==="date"?"relative":"date"),className:"text-left text-white bg-transparent font-semibold",children:c.current==="date"?umn(O.time):cmn(O.time)})},{key:"coin",label:"Coin",sortable:!0,sortValue:R=>R.coin||"",render:(R,O)=>{const U=Wo(),L=()=>U(`/terminal/hyperliquid/${O.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/${amn(O.coin)}.svg`,onError:sa,className:"w-5 h-5 mr-2",alt:O.coin}),i.jsx("span",{className:`font-bold ${cre(O.dir)?"text-[#FF6B6B]":lre(O.dir)?"text-[#67FFBD]":"text-white"}`,children:R||"--"})]})}},{key:"dir",label:"Direction",sortable:!0,sortValue:R=>lmn(R.dir),render:R=>i.jsx("span",{className:`font-semibold ${cre(R)?"text-[#FF6B6B]":lre(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:nj(R)})},{key:"sz",label:"Size",sortable:!0,sortValue:R=>R.sz,render:(R,O)=>i.jsxs("span",{className:"text-white font-semibold",children:[omn(R)," ",i.jsx("span",{className:"text-[#9B9B9B]",children:O.coin})]})},{key:"tradeValue",label:"Trade Value",sortable:!0,sortValue:R=>R.px*R.sz,render:(R,O)=>i.jsxs("span",{className:"text-white font-semibold",children:[nj(O.px*O.sz)," ",i.jsx("span",{className:"text-[#9B9B9B]",children:"USDC"})]})},{key:"fee",label:"Fee",sortable:!0,sortValue:R=>R.fee,render:(R,O)=>i.jsxs("span",{className:"text-white font-semibold",children:[nj(R)," ",i.jsx("span",{className:"text-[#9B9B9B]",children:O.feeToken||"USDC"})]})},{key:"netPnl",label:"Closed PnL",sortable:!0,sortValue:R=>R.closedPnl-R.fee,render:(R,O)=>{const U=Number(O.closedPnl||0),L=Number(O.fee||0),z=U-L,X=z>0,ne=z<0,J=!!U,K=Number(O.px||0)*Number(O.sz||0),re=K>0?z/K*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?nj(0):`${z<0?"-":""}${nj(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 Q=0;const ie=O.oid;if(ie){const oe=w.get(String(ie));if(oe!=null)Q=oe;else{const G=await N([ie]);typeof G=="number"&&!Number.isNaN(G)&&(Q=G)}}v({coin:O.coin||"",type:(O.dir||"").toUpperCase(),leverage:Q,roe:re,entryPrice:Number(O.px||0),markPrice:Number(O.px||0),referral:he,positionDistribution:0,pnl:Number(z||0),closePx:Number(O.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:bm,alt:"",className:"w-[14px] h-[14px] min-w-[14px] min-h-[14px]"})})]})}}],[o,d,N,w]),I=m.useMemo(()=>Zg(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(Lu,{data:I,loading:a,columns:P,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(pT,{open:f,setOpen:x,data:g,setTradeInfo:v,pnlTitle:""})]})}const mmn="https://api.hyperliquid.xyz/info";function xmn(e,t=6){return Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}function jSe(e,t=4){return`$${Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}`}function gmn(e){return`${(Number(e||0)*100).toLocaleString(void 0,{maximumFractionDigits:6})}%`}function bmn(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 ymn(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 vmn({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}=w2(),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(mmn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"userFunding",user:e,startTime:v})})).json(),P=(Array.isArray(C)?C:Array.isArray(C==null?void 0:C.data)?C.data:[]).map((I,R)=>{const O=(I==null?void 0:I.delta)||{},U=Number((O==null?void 0:O.szi)||0),L=Number((O==null?void 0:O.fundingRate)||0),z=Number((O==null?void 0:O.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:`${I.time||R}-${O.coin||""}-${R}`,time:Number((I==null?void 0:I.time)||0),coin:(O==null?void 0:O.coin)||"",rate:Number((O==null?void 0:O.fundingRate)||0),size:U,amount:z,token:"USDC",side:X}}).sort((I,R)=>R.time-I.time);x&&s(P)}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"?ymn(g.time):bmn(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=Wo(),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:sa,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:[xmn(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?jSe(0):`${x<0?"-":""}${jSe(Math.abs(x))}`})}},{key:"rate",label:"Rate",sortable:!0,sortValue:x=>x.rate,render:x=>i.jsx("span",{className:"text-white font-semibold",children:gmn(x)})}],[]);return i.jsx(Lu,{data:Zg(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 sF(e,t=6){return Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}function wmn(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 Cmn(e){return e.side==="B"?e.reduceOnly?"Close Short":"Open Long":e.side==="A"?e.reduceOnly?"Close Long":"Open Short":e.side||"-"}function dre(e){return e==="Open Long"||e==="Close Short"||e==="Short > Long"}function fre(e){return e==="Open Short"||e==="Close Long"||e==="Long > Short"}function Smn(e){return dre(e)?1:fre(e)?0:-1}function Nmn({walletAddress:e,listHeight:t=560}){const[n,r]=m.useState([]),[s,a]=m.useState(!1),{key:o}=w2();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:Cmn(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":`${sF(Number(v.limitPx||0),2)} USD`,reduceOnly:!!v.reduceOnly,trigger:v.triggerCondition&&v.triggerCondition!=="N/A"?`${v.triggerCondition} @ ${sF(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:wmn(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=Wo(),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:sa,className:"w-5 h-5 mr-2",alt:u.coin}),i.jsx("span",{className:`font-bold ${fre(u.sideText)?"text-[#FF6B6B]":dre(u.sideText)?"text-[#67FFBD]":"text-white"}`,children:c})]})}},{key:"sideText",label:"Side",sortable:!0,sortValue:c=>Smn(c.sideText),render:c=>i.jsx("span",{className:`font-semibold ${fre(c)?"text-[#FF6B6B]":dre(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:sF(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:sF(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(Lu,{data:Zg(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 Amn="https://dextrabothypev2.nftinit.io/api/hyper/gridbot/list/",jmn="https://dextrabothypev2.nftinit.io/api/hyper/gridbot/update/",Emn="https://dextrabothypev2.nftinit.io/api/hyper/gridbot/update/",_mn="https://dextrabothypev2.nftinit.io/api/hyper/extended_bot/update/";function ESe(e,t=4){const n=Number(e||0);return Number.isFinite(n)?n.toLocaleString(void 0,{maximumFractionDigits:t}):"--"}function kmn(e,t=2){const n=Number(e||0);return Number.isFinite(n)?`$${n.toLocaleString(void 0,{maximumFractionDigits:t})}`:"--"}const Tmn={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"},rj=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 Tmn[e]||e},Imn=e=>e&&e.length>10?`${e.slice(0,6)}...${e.slice(-4)}`:e||"--";function IO({walletAddress:e,sourceMarket:t="hyper"}){var U,L;const{botSlotsInfo:n,refreshBotSlots:r}=m.useContext(Qr)||{},[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=Wo();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(Amn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:ne,token:J})})).json(),Q=(Array.isArray(re==null?void 0:re.data)?re.data:Array.isArray(re)?re:[]).filter(ie=>t?ie.source_market===t:!0);z&&a(Q)}catch{z&&(a([]),tn.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||{},K=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:K.lower??null,upper:K.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",K=ne.status==="Active";if(J!==K)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 K,re,he;if(!z||!z.raw||typeof window>"u")return;const ne=window.localStorage.getItem("hyperAddress"),J=window.localStorage.getItem("hyperToken");if(!ne||!J){tn.error("Please sign in to manage bots");return}try{u(z.id);const Q={is_deleted:X,bot_params:z.raw.bot_params||{}},ie=String(((K=z.raw)==null?void 0:K.source_market)||"").toLowerCase().includes("lighter")?Emn:String(((re=z.raw)==null?void 0:re.source_market)||"").toLowerCase().includes("extended")?_mn:jmn,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:Q})})).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)}tn.success(X?"Bot stopped":"Bot started"),a(V=>V.map(te=>te.id===z.id?{...te,is_deleted:X}:te)),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(Q){tn.error(Q.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,K)=>{var oe,G,V,te;const re=((oe=J==null?void 0:J.raw)==null?void 0:oe.wallet_id)??(J==null?void 0:J.walletId),he=((G=K==null?void 0:K.raw)==null?void 0:G.wallet_id)??(K==null?void 0:K.walletId);if(re&&he&&String(re)===String(he))return!0;const Q=((J==null?void 0:J.walletAddress)||((V=J==null?void 0:J.raw)==null?void 0:V.wm_address)||"").toLowerCase(),ie=((K==null?void 0:K.walletAddress)||((te=K==null?void 0:K.raw)==null?void 0:te.wm_address)||"").toLowerCase();return!!(Q&&ie&&Q===ie)};if(!X){if(w.some(K=>{var re,he;return K.id!==z.id&&K.status==="Active"&&((re=K.raw)==null?void 0:re.source_market)===((he=z.raw)==null?void 0:he.source_market)&&ne(K,z)})){tn.error("You already have an active bot on this wallet. Please add an account.");return}g(z);return}C(z,X)},P=()=>g(null),I=()=>{x&&(C(x,!1),g(null))},R=z=>{var re,he,Q;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",K={sourceMarket:ne,coin:X,botParams:((he=z.raw)==null?void 0:he.bot_params)||{},walletId:(Q=z.raw)==null?void 0:Q.wallet_id,isActive:J};if(typeof window<"u"){try{window.localStorage.setItem("gridbot:pending_selection",JSON.stringify(K))}catch{}window.dispatchEvent(new CustomEvent("gridbotSelectFromTasks",{detail:K}))}v(ne==="hyper"?`/terminal/hyperliquid/${rj(X)}#gridbot`:ne==="lighter"?`/terminal/lighter/${rj(X)}#gridbot`:`/terminal/extended/${rj(X)}#gridbot`)},O=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=Wo(),J=String(((re=X.raw)==null?void 0:re.source_market)||X.market||t||"").toLowerCase();J.includes("lighter")||J.includes("extended");const K=()=>ne(`/terminal/${J}/${rj(X.coin)}${X.status==="Active"||X.status==="Stopped"?"#gridbot":""}`);return i.jsxs("div",{onPointerDown:K,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/${rj(z)}.svg`,onError:sa,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?Imn(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:ESe(z)})},{key:"upper",label:"Upper",sortable:!0,render:z=>z==null?"--":i.jsx("span",{className:"text-[#FF797C] font-semibold",children:ESe(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?kmn(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:K=>K.stopPropagation(),onMouseDown:K=>K.stopPropagation(),children:[i.jsx("button",{type:"button",onPointerDown:K=>{K.preventDefault(),K.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:K=>{K.preventDefault(),K.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(Lu,{data:w,loading:o,columns:O,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(dp,{isOpen:!!x,onClose:P,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:P,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:I,className:"h-9 rounded-xl bg-[#67FFBD] px-4 text-[12px] font-semibold text-black transition hover:brightness-105",children:"Start Bot"})]})]})})]})}function Pmn(){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 Fmn(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(Qr),[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 Ne=window.localStorage.getItem("hl_selected_wallet_address");w(Ne||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,P]=m.useState(()=>C);m.useEffect(()=>{C&&P(C)},[C]);const I=C||N||null,[R,O]=m.useState({address:null,token:null}),[U,L]=m.useState(!1);m.useEffect(()=>{const fe=()=>{const Ne=typeof window<"u"?localStorage.getItem("hyperAddress"):null,me=typeof window<"u"?localStorage.getItem("hyperToken"):null;O({address:Ne,token:me}),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,Ne)=>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(Ne)}),i.jsx("div",{className:"w-[220px]",children:i.jsx(Jp,{onClick:()=>g(!0)})})]}):fe,K=`terminalTabs:${typeof window<"u"?window.location.pathname:"tt"}`,[re,he]=m.useState(()=>typeof window>"u"?"balances":localStorage.getItem(K)||"balances"),Q=AHe(I),ie=afn(I),oe=[{k:"balances",t:"Balances"},{k:"positions",t:`Positions${z&&Number.isFinite(Q)?` (${Q})`:""}`},{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(Ne=>Ne.k).includes(re)||he("balances")},[oe,re]),m.useEffect(()=>{typeof window<"u"&&localStorage.setItem(K,re)},[re,K]),m.useEffect(()=>{const fe=Ne=>{var xe;const me=(xe=Ne==null?void 0:Ne.detail)==null?void 0:xe.tab,we=oe.map(ye=>ye.k);me&&we.includes(me)&&he(me)};return window.addEventListener("terminal:setTab",fe),()=>window.removeEventListener("terminal:setTab",fe)},[oe]);const G=fe=>{he(fe)},V=(I||"no-wallet").toLowerCase();let te;re==="balances"?te=i.jsx(_pn,{walletAddress:I}):re==="positions"?te=i.jsx(Rpn,{walletAddress:I,coin:f}):re==="open"?te=i.jsx(Gpn,{walletAddress:I}):re==="twap"?te=i.jsx(nmn,{walletAddress:I}):re==="trades"?te=i.jsx(pmn,{walletAddress:I}):re==="funding"?te=i.jsx(vmn,{walletAddress:I}):re==="orders"?te=i.jsx(Nmn,{walletAddress:I}):re==="bots"?te=i.jsx(IO,{walletAddress:I,sourceMarket:x}):re==="all"?te=i.jsx(upn,{data:t,loading:n,error:r,isDigits:s,period:a,periods:o,handlePeriodChange:l}):te=i.jsx("div",{className:"h-full"});const ae=re==="all"?te:ne(te,re);return i.jsx(apn,{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 Ne=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 ${Ne?"text-white":"text-[#929292] hover:text-white"}`,children:[Ne&&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(Pmn,{}):i.jsx(opn,{})})]})}),i.jsx("div",{className:"flex-1 min-h-0 relative",children:i.jsx("div",{className:"absolute inset-0",children:ae})})]})},V)}function Sue(){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 Omn="https://dextrabothypev2.nftinit.io/api/hyper/get_farming_coins/?app=extended",Mmn="https://dextrabothypesocketv2.nftinit.io/",Rmn='J5a5j28NeLpQbf"=h',Lmn=6e4,Dmn=e=>{if(e==null||e==="")return null;const t=Number(e);return Number.isFinite(t)?t:null},Zx=(...e)=>{for(const t of e){const n=Dmn(t);if(n!=null)return n}return null},KHe=e=>String(e||"").trim().toUpperCase(),Bmn=e=>KHe(e).replace(/-USD$/,"").replace(/\/USD$/,"");function $mn(e,t){var N;if(!e||typeof e!="object")return null;const n=KHe(e.value||e.symbol||e.market||e.coin||e.label),r=Bmn(e.label||e.assetName||e.uiName||n);if(!n&&!r)return null;const s=e.marketStats||{},a=Zx(s.lastPrice,s.markPrice,s.indexPrice,e.lastPrice,e.markPrice,e.last),o=Zx(s.markPrice,e.markPrice,s.lastPrice,e.lastPrice,a),l=Zx(e.volume,s.dailyVolume,e.vol),c=Zx(s.fundingRate,e.fundingRate,e.funding),u=Zx(s.openInterestBase,e.openInterestBase),d=Zx(s.openInterest,e.openInterestUsd,e.openInterest),f=Zx((N=e==null?void 0:e.tradingConfig)==null?void 0:N.maxLeverage,e.maxLeverage,e.leverage,e.max_leverage);let x=null;const g=Zx(s.dailyPriceChange,e.dailyPriceChange);if(g!=null&&a!=null){const P=a-g;P&&(x=g/P*100)}if(x==null){const P=Zx(s.dailyPriceChangePercentage,e.dailyPriceChangePercentage,e.change24hPct,e.chg24);P!=null&&(x=Math.abs(P)<=1?P*100:P)}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 Yd={rows:[],subs:new Set,started:!1,socket:null,timer:null};function Umn(){for(const e of Yd.subs)try{e(Yd.rows)}catch{}}function YHe(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 XHe(e){const t=e.map((n,r)=>$mn(n,r)).filter(n=>n&&n.symbol);return t.length?(Yd.rows=t,Umn(),!0):!1}function _Se(e){const t=YHe(e);return t.length?XHe(t):!1}async function kSe(){try{const t=await(await fetch(Omn)).json(),n=YHe(t);if(!n.length)return;XHe(n)}catch{}}function zmn(){if(!Yd.started){Yd.started=!0,kSe(),Yd.timer=setInterval(()=>{Yd.socket&&Yd.socket.connected||kSe()},Lmn);try{const e=Ny(Mmn);Yd.socket=e;const t=()=>{try{e.emit("extended_feed_subscribe",{password:Rmn},r=>_Se(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(_Se(a))return}})}catch{}}}function Nue(){const[e,t]=m.useState(Yd.rows);return m.useEffect(()=>{zmn();const n=r=>t(r);return Yd.subs.add(n),Yd.rows.length&&t(Yd.rows),()=>{Yd.subs.delete(n)}},[]),e}const Hmn=["arithmetic","geometric"];function Vmn(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 TSe({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 ISe({coin:e,midPrice:t,selectedPrice:n,wallet:r,onLevelsChange:s}){const a=Sue(),[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,P]=m.useState("arithmetic"),[I,R]=m.useState(""),[O,U]=m.useState(0),[L,z]=m.useState(10),[X,ne]=m.useState(!1),[J,K]=m.useState(!1),[re,he]=m.useState(!1),[Q,ie]=m.useState(50),[oe,G]=m.useState([]),[V,te]=m.useState(!1),[ae,fe]=m.useState(0),[Ne,me]=m.useState(!1),[we,xe]=m.useState(!1),[ye,je]=m.useState(0),[Pe,Re]=m.useState(!1),[Xe,Ke]=m.useState(0),[ut,et]=m.useState(!1),[tt,Le]=m.useState(!0),[$e,ht]=m.useState(!1),[pt,Kt]=m.useState(()=>r&&r.id&&r.address?{id:r.id,address:r.address}:{id:null,address:null}),wt=m.useRef(!1),{refreshBotSlots:nn,botSlotsInfo:cn}=m.useContext(Qr),zn=m.useCallback(async()=>{try{const k=window.localStorage.getItem("hyperToken"),T=window.localStorage.getItem("hyperAddress");if(!k||!T){Le(!1),ht(!0);return}const B=await _i(T.toLowerCase(),k);Le(!!(B!=null&&B.farming_tools))}catch{Le(!1)}finally{ht(!0)}},[]);m.useEffect(()=>{nn==null||nn(),zn()},[nn,zn]);const Xt=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]),on=Number((Xt==null?void 0:Xt.total_slot_count)||0),Zt=Number((Xt==null?void 0:Xt.using_extra_slot_count)||0)+Number((Xt==null?void 0:Xt.using_subs_slot_count)||0),Ye=on+Zt,Ze=Xt?on<=0:!1,Ft=Ze;m.useEffect(()=>{r&&r.id&&r.address&&Kt(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 dn=m.useMemo(()=>a.find(k=>k.symbol===e),[a,e]),Yt=dn&&dn.raw&&dn.raw.last_trade_price!=null&&Number(dn.raw.last_trade_price)||0;m.useEffect(()=>{let k=!1;async function T(){try{const W=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_farming_coins/?app=lighter_fr")).json().catch(()=>null);if(!W||k)return;const ee=Array.isArray(W)&&W||Array.isArray(W.data)&&W.data||Array.isArray(W.coins)&&W.coins||[],ce=String(e||"").toUpperCase(),ue=ee.find(Se=>String(Se.value||Se.label||Se.symbol||Se.coin||"").toUpperCase()===ce),ge=ue&&ue.maxLeverage!=null?Number(ue.maxLeverage):null;!k&&ge!=null&&Number.isFinite(ge)&&ge>0&&(ie(ge),z(Se=>{const ke=Number(Se)||1;return Math.min(ge,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"),W=window.localStorage.getItem("hyperToken");if(!B||!W){k||G([]);return}te(!0);try{const ce=await(await fetch("https://dextrabothypev2.nftinit.io/api/wallet/list-lighter",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:B,token:W})})).json().catch(()=>null);if(!ce||k)return;let ue=[];Array.isArray(ce)?ue=ce:Array.isArray(ce.data)?ue=ce.data:ce&&ce.wallet_id!=null&&(ue=[ce]);const ge=await Promise.all(ue.map(async Se=>{let ke=null;if(Se.available_balance!=null){const Me=Number(Se.available_balance);Number.isFinite(Me)&&(ke=Me)}else if(Se.balance!=null){const Me=Number(Se.balance);Number.isFinite(Me)&&(ke=Me)}try{if(Se.wallet_address){const qe=await(await fetch(`https://mainnet.zklighter.elliot.ai/api/v1/account?by=l1_address&value=${encodeURIComponent(Ec(Se.wallet_address))}`)).json().catch(()=>null),Fe=qe&&Array.isArray(qe.accounts)&&qe.accounts.length>0&&qe.accounts[0];if(Fe&&Fe.available_balance!=null){const at=Number(Fe.available_balance);Number.isFinite(at)&&(ke=at)}}}catch{}return{wallet_id:Se.wallet_id,wallet_address:Se.wallet_address,wallet_name:Se.wallet_name||`Wallet ${Se.wallet_id}`,available_balance:ke}}));if(k)return;G(ge),Kt(Se=>{if(Se&&Se.id)return Se;const ke=ge[0];return ke?{id:ke.wallet_id,address:ke.wallet_address}:Se})}catch{k||G([])}finally{k||te(!1)}}return T(),()=>{k=!0}},[]);const Bt=m.useMemo(()=>{if(!pt||!pt.id)return null;const k=oe.find(B=>String(B.wallet_id)===String(pt.id));if(!k||k.available_balance==null)return null;const T=Number(k.available_balance);return Number.isFinite(T)?T:null},[oe,pt]),ot=(k,T,B)=>{const W=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 ee=Number(k.gridCount);x(ee),v(String(ee))}if((k.gridType==="geometric"||k.gridType==="arithmetic")&&P(k.gridType),k.investment&&k.investment.leverage!=null&&Number.isFinite(Number(k.investment.leverage))){const ee=Number(k.investment.leverage);z(ee)}if(k.investment&&k.investment.collateral!=null&&Number.isFinite(Number(k.investment.collateral))){const ee=Number(k.investment.collateral);if(R(String(ee)),T&&T>0&&ee>0){const ce=ee/T*100;U(Math.max(0,Math.min(100,ce)))}else U(0)}else R(""),U(0);ne(W)};m.useEffect(()=>{if(typeof window>"u")return;if(!e||!(pt!=null&&pt.id)||!(pt!=null&&pt.address)){ne(!1);return}let k=!1;function T(){c(""),d(""),x(2),v("2"),P("arithmetic"),R(""),U(0),z(10),C("")}async function B(){K(!0);try{const W=window.localStorage.getItem("hyperToken");if(!W){k||(ne(!1),T(),K(!1));return}const ee={address:localStorage.getItem("hyperAddress"),token:W,wallet_id:Number(pt.id),source_market:"lighter",coin:String(e||"").toUpperCase()},ue=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/gridbot/info/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ee)})).json().catch(()=>null);if(k)return;if(wt.current){wt.current=!1,K(!1);return}const ge=ue&&ue.data?ue.data:ue;ge&&typeof ge=="object"&&ge.is_deleted===!1&&ge.bot_params&&ge.bot_params?ot(ge.bot_params,Bt,!0):(ne(!1),T())}catch{if(k)return;ne(!1),c(""),d(""),x(2),v("2"),P("arithmetic"),R(""),U(0),z(10),C("")}finally{k||K(!1)}}return B(),()=>{k=!0}},[e,pt==null?void 0:pt.id,pt==null?void 0:pt.address,ye]);const De=m.useMemo(()=>Vmn(l,u,f,N),[l,u,f,N]),_t=m.useMemo(()=>{if(!De.length)return[];const k=Number(l),T=Number(u),B=Number.isFinite(k)&&Number.isFinite(T)?(k+T)/2:null;return De.map(W=>({price:W,side:B==null?null:W>=B?"sell":"buy"}))},[De,l,u]);m.useEffect(()=>{typeof s=="function"&&s(_t)},[_t,s]);const ze=k=>{const T=Number(k);if(!(T>0))return;const W=T*.01;c((T-W).toFixed(2)),d((T+W).toFixed(2))};m.useEffect(()=>{const k=T=>{const B=T&&T.detail&&T.detail.sourceMarket;B&&B!=="lighter"||je(W=>W+1)};return window.addEventListener("gridbotUpdated",k),()=>{window.removeEventListener("gridbotUpdated",k)}},[]),m.useEffect(()=>{const k=T=>{const B=T&&T.detail;if(!B)return;const W=B.sourceMarket||B.source_market;if(W&&W!=="lighter"||String(B.coin||"").toUpperCase()!==String(e||"").toUpperCase())return;const ce=B.botParams||{};if(wt.current=!0,ot(ce,Bt,B.isActive),B.isActive===!0?ne(!0):B.isActive===!1&&ne(!1),B.walletId&&oe&&oe.length){const ue=oe.find(ge=>String(ge.wallet_id)===String(B.walletId));ue&&Kt({id:ue.wallet_id,address:ue.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(wt.current=!0,ot(T.botParams||{},Bt,T.isActive),T.isActive===!0?ne(!0):T.isActive===!1&&ne(!1),T.walletId&&oe&&oe.length){const B=oe.find(W=>String(W.wallet_id)===String(T.walletId));B&&Kt({id:B.wallet_id,address:B.wallet_address})}try{window.localStorage.removeItem("gridbot:pending_selection")}catch{}}},[e,oe,Bt]),m.useEffect(()=>{if(l||u)return;const k=Yt>0?Yt:Number(t||n||0);!Number.isFinite(k)||k<=0||ze(k)},[Yt,t,n,l,u]);const nt=m.useMemo(()=>{if(Yt>0)return Yt;const k=Number(t||0);if(k>0)return k;const T=Number(n||0);if(T>0)return T;const B=Number(l),W=Number(u);return Number.isFinite(B)&&Number.isFinite(W)&&W>B?(B+W)/2:0},[Yt,t,n,l,u]),mt=nt,$t=m.useMemo(()=>{const k=Math.max(1,Number(L)||1);return Math.min(Q,k)},[L,Q]),Pt=Number(I)||0,un=Pt*$t,an=De.length,xn=nt>0?nt:Yt,An=xn>0&&an>0&&un>0?Number((un/an/xn).toFixed(5)):0,kn=Number.isFinite(dn==null?void 0:dn.sizeDecimals)?dn.sizeDecimals:4,yn=Number.isFinite(dn==null?void 0:dn.priceDecimals)?dn.priceDecimals:4,Vn=yn,Gn=(dn==null?void 0:dn.minBaseAmount)??0,Rn=(dn==null?void 0:dn.minQuoteAmount)??0,Yn=An>0?Number(An.toFixed(kn)):0,Cn=Yn>0&&Gn>0&&Yn<Gn,rn=Yn>0&&Rn>0&&De.length>0&&De.some(k=>k*Yn<Rn),Oe=nt>0&&un>0&&Pt>0?TSe({entry:nt,side:"buy",notionalUSD:un,maintenanceFrac:.01,marginMode:"Cross",accountValueUSD:Pt,isolatedMarginUSD:Pt}):null,Jt=nt>0&&un>0&&Pt>0?TSe({entry:nt,side:"sell",notionalUSD:un,maintenanceFrac:.01,marginMode:"Cross",accountValueUSD:Pt,isolatedMarginUSD:Pt}):null,sn=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(mt>0){if(k>mt)return`Lower price cannot be above mark price (${mt.toFixed(yn)}).`;if(T<mt)return`Upper price cannot be below mark price (${mt.toFixed(yn)}).`}return""},[l,u,mt,yn]),Et=m.useMemo(()=>{const k=Number(l),T=Number(u);return!(!Number.isFinite(k)||!Number.isFinite(T)||!(T>k)||mt>0&&(k>mt||T<mt))},[l,u,mt]),Xn=an>1&&Et&&Pt>0&&$t>0&&(pt==null?void 0:pt.id)&&(pt==null?void 0:pt.address),gn=ae>0,Dt=!!w,en=Cn||rn,In=$e&&!tt,Qn=Xn&&!J&&!re&&!V&&!gn&&!Dt&&!en&&!Ze&&!In,ar=re||J||V||Dt?!1:X||In?!0:en||gn||Ze?!1:Xn,hr=re||J||V?!0:X||In?!1:en||gn||Ze||Dt?!0:!Xn,Gt=X||re||J,$n=Q&&Q>0;m.useEffect(()=>{if(!ae)return;const k=setInterval(()=>{fe(T=>T>1?T-1:0)},1e3);return()=>clearInterval(k)},[ae]);const nr=()=>{if(Gt)return;const k=Yt>0?Yt:nt>0?nt:Number(t||n||0);!Number.isFinite(k)||k<=0||ze(k)},Rt=k=>{if(Gt)return;const T=Math.max(0,Math.min(100,Number(k)||0));if(U(T),!Bt||Bt<=0){T===0&&R("");return}const B=Bt*T/100;R(B&&Number.isFinite(B)?String(B.toFixed(2)):"")},En=k=>{if(Gt)return;R(k);const T=Number(k);if(!Bt||!Number.isFinite(T)||T<=0||Bt<=0){U(0);return}const B=T/Bt*100;U(Math.max(0,Math.min(100,B)))},Ee=async()=>{if(!Qn||typeof window>"u"||!(pt!=null&&pt.address)||!(pt!=null&&pt.id))return;const k=De.filter(ke=>Number.isFinite(ke));if(k.length<2)return;const T=k[0],B=k[k.length-1],W=(T+B)/2,ee=k.length,ce=window.localStorage.getItem("hyperToken");if(!ce)return;const ue=Yn,ge={symbol:String(e||"").toUpperCase(),gridType:N==="geometric"?"geometric":"arithmetic",direction:o,priceRange:{lower:Number(T.toFixed(Vn)),upper:Number(B.toFixed(Vn)),middle:Number(W.toFixed(Vn))},gridCount:ee,gridPrices:k.map(ke=>Number(ke.toFixed(Vn))),investment:{collateral:Pt,leverage:$t,totalInvestment:un,qtyPerOrder:ue},liquidationPrices:{long:Oe?Number(Oe.toFixed(2)):null,short:Jt?Number(Jt.toFixed(2)):null},marginMode:"Cross",currentPrice:nt||null,timestamp:new Date().toISOString()},Se={address:localStorage.getItem("hyperAddress"),token:ce,wallet_id:Number(pt.id),source_market:"lighter",bot_params:ge,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(Se)})).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.";tn.error(Fe);return}ne(!0),typeof window<"u"&&window.dispatchEvent(new CustomEvent("gridbotUpdated",{detail:{sourceMarket:"lighter"}})),nn==null||nn(),tn.success("Grid bot started.")}catch{tn.error("An error occurred while starting the grid bot.")}finally{he(!1)}},h=async()=>{if(typeof window>"u"||!(pt!=null&&pt.address)||!(pt!=null&&pt.id))return;const k=window.localStorage.getItem("hyperToken");if(!k)return;const T={address:localStorage.getItem("hyperAddress"),token:k,wallet_id:Number(pt.id),source_market:"lighter",coin:String(e||"").toUpperCase()};he(!0);try{const W=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(!(W&&(W.success===!0||W.status==="ok"||W.status==="success"))){const ce=W&&(W.error_message||W.message||W.detail)||"Grid bot could not be stopped.";tn.error(ce);return}ne(!1),fe(10),typeof window<"u"&&window.dispatchEvent(new CustomEvent("gridbotUpdated",{detail:{sourceMarket:"lighter"}})),nn==null||nn(),tn.success("Grid bot has been stopped.")}catch{tn.error("An error occurred while stopping the grid bot.")}finally{he(!1)}},p=()=>{if(In){et(!0);return}ar&&(X?h():xe(!0))},S=async()=>{Qn&&(xe(!1),await Ee())},_=In?"Subscribe / 0.12 ETH":re?X?"Stopping...":"Starting...":X?"Stop":gn?`Stopping ${ae}s`:"Start";return i.jsxs(i.Fragment,{children:[ut&&i.jsx(JUe,{open:ut,setOpen:et,checkAccountCopy:zn,roleType:"farming"}),Pe&&i.jsx(m5,{open:Pe,setOpen:Re,oldSlotCount:Xe,checkAccountLighter:nn,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(yT,{wallets:oe,value:pt&&pt.id?String(pt.id):"",onChange:k=>{const T=oe.find(B=>String(B.wallet_id)===String(k));T&&Kt({id:T.wallet_id,address:T.wallet_address})},selectedBalance:Bt,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(s5,{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:Ye?`${Zt}/${Ye}`:Xt?"0/0":"--"})})]}),i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsx("div",{className:"text-[11px] text-[#7C7C7C]",children:Ze?"No slots left. Get more to start new grid bots.":""}),Ft&&i.jsx("button",{type:"button",onClick:()=>{Ke(on),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:nr,disabled:Gt,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=>{Gt||c(k.target.value)},className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"0",inputMode:"decimal",disabled:Gt})})]}),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=>{Gt||d(k.target.value)},className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"0",inputMode:"decimal",disabled:Gt})})]})]}),mt>0&&i.jsxs("div",{className:"text-[11px] text:white/40 text-white/40",children:["Mark Price: ",mt.toFixed(yn)]}),sn&&i.jsx("div",{className:"text-[11px] text-[#FF7173]",children:sn})]}),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(Gt)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:Gt})}),i.jsx("div",{className:"relative",children:i.jsx("select",{value:N,onChange:k=>{Gt||P(k.target.value)},className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 text-[12px] outline-none",disabled:Gt,children:Hmn.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:"," ",De.length>1?(De[1]-De[0]).toFixed(Vn):"--"]})]}),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:I,onChange:k=>En(k.target.value),className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"USDC",inputMode:"decimal",disabled:Gt}),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(y4,{onClick:$n&&!Gt?()=>me(!0):void 0,children:$n?`${$t}x`:"--"})})]}),i.jsxs("div",{className:"flex items-center gap-3 mt-3 pb-6",children:[i.jsx(XN,{value:O,onChange:k=>Rt(k),accent:"#67FFBD"}),i.jsxs("div",{className:"h-[30px] rounded-lg flex items-center px-2",style:{width:84,background:Po,border:`1px solid ${Ma}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right text-xs",inputMode:"numeric",value:O,onChange:k=>Rt(Math.max(0,Math.min(100,Number(k.target.value)||0))),style:{color:Di,fontFeatureSettings:'"tnum"'},disabled:Gt}),i.jsx("span",{style:{color:vi},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,": ",`${Q}x`]}),i.jsxs("span",{children:["Total:"," ",un>0?`${un.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.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:Jt?`$${Jt.toLocaleString(void 0,{maximumFractionDigits:2})}`:"--"})]}),i.jsx("button",{type:"button",onClick:p,disabled:hr,className:`w-full h-[32px] rounded-xl font-bold text-[13px] flex items-center justify-center transition-opacity ${hr?"bg-[#303030] text-white/40 cursor-not-allowed opacity-70":In?"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:_}),Cn&&i.jsxs("div",{className:"mt-2 text-[11px] text-[#FF7173] text-center",children:["Quantity per order is below min size (",Gn," ",e,")."]}),rn&&i.jsxs("div",{className:"mt-2 text-[11px] text-[#FF7173] text-center",children:["Your order size is below minimum order size of $",Rn.toFixed(2),"."]})]})]})]}),i.jsx(Jh,{open:Ne,onClose:()=>me(!1),children:i.jsxs(dm,{title:"Adjust Leverage",children:[i.jsxs("div",{className:"text-[12px] leading-5 mb-3",style:{color:vi},children:["Control the leverage used for ",e," grid bot positions. The maximum leverage is ",Q,"x."]}),i.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[i.jsx("input",{type:"range",min:1,max:Q||1,step:1,value:L,onChange:k=>z(Math.max(1,Math.min(Q||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:Po,border:`1px solid ${Ma}`},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(Q||1,T));z(B)}}),i.jsx("span",{className:"text-[11px] text-white/40 ml-1",children:"x"})]})]}),i.jsx(F0,{onClick:()=>me(!1),children:"Confirm"})]})}),i.jsx(Jh,{open:we,onClose:()=>xe(!1),children:i.jsxs(dm,{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 ",$t,"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:vi},children:"Price Range"}),i.jsx("div",{className:"font-medium",style:{color:Di},children:Number.isFinite(Number(l))&&Number.isFinite(Number(u))?`${Number(l).toFixed(Vn)} - ${Number(u).toFixed(Vn)} USDC`:"--"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:vi},children:"Number of Grids"}),i.jsx("div",{className:"font-medium",style:{color:Di},children:an||"--"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:vi},children:"Mode"}),i.jsx("div",{className:"font-medium",style:{color:Di},children:N==="geometric"?"Geometric":"Arithmetic"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:vi},children:"Qty Per Order"}),i.jsx("div",{className:"font-medium",style:{color:Di},children:Yn>0?`${Yn} ${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:Di},children:"Total Investment"}),i.jsx("span",{className:"font-semibold text-[#67FFBD]",children:un>0?`${un.toFixed(2)} USDC`:"--"})]})}),i.jsx("div",{className:"mt-4",children:i.jsx(F0,{onClick:S,disabled:re,children:re?"Starting...":"Confirm"})})]})})]})}const Wmn=["arithmetic","geometric"],qmn=6,QHe="https://api.hyperliquid.xyz/info",Gmn=10,Kmn=10*60*1e3;let wb={data:null,ts:0,promise:null};async function Ymn(){const e=Date.now();if(wb.data&&e-wb.ts<Kmn)return wb.data;if(wb.promise)return wb.promise;const t=fetch(QHe,{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 wb={data:r,ts:Date.now(),promise:null},r}).catch(n=>{throw wb.promise=null,n});return wb.promise=t,t}function Xmn(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 PSe({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 zX(e){const t=String(e||""),n=t.indexOf(":");return n>0?t.slice(0,n).toLowerCase():"hl"}function Qmn(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 Zmn(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 FSe({coin:e,midPrice:t,selectedPrice:n,wallet:r,onWalletChange:s,onLevelsChange:a}){const o=gU(),[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(""),[P,I]=m.useState("arithmetic"),[R,O]=m.useState(""),[U,L]=m.useState(0),[z,X]=m.useState(10),[ne,J]=m.useState(!1),[K,re]=m.useState(!1),[he,Q]=m.useState(!1),[ie,oe]=m.useState(50),[G,V]=m.useState(0),[te,ae]=m.useState(!1),[fe,Ne]=m.useState(!1),[me,we]=m.useState(()=>r&&r.id&&r.address?{id:r.id,address:r.address}:{id:null,address:null}),[xe,ye]=m.useState({address:null,token:null}),[je,Pe]=m.useState(null),[Re,Xe]=m.useState(null),[Ke,ut]=m.useState(""),[et,tt]=m.useState(""),[Le,$e]=m.useState(""),[ht,pt]=m.useState(""),[Kt,wt]=m.useState(!1),[nn,cn]=m.useState(!1),[zn,Xt]=m.useState(!1),[on,Zt]=m.useState(!1),[Ye,Ze]=m.useState(0),Ft=()=>{u(""),f(""),g(2),w("2"),I("arithmetic"),O(""),L(0),X(10),N(""),ut(""),tt(""),$e(""),pt(""),wt(!1),cn(!1),Xt(!1),Zt(!1)},{address:dn,isConnected:Yt}=ts();Yt&&(typeof window<"u"&&window.localStorage.getItem("hyperToken"));const{wallets:Bt,loading:ot}=FHe(xe.address,xe.token,!0,{pollMs:5e3}),De=m.useRef(!1),_t=ot&&(!Bt||Bt.length===0);m.useEffect(()=>{r&&r.id&&r.address&&we(ct=>ct.id===r.id&&ct.address&&ct.address.toLowerCase()===r.address.toLowerCase()?ct:{id:r.id,address:r.address})},[r==null?void 0:r.id,r==null?void 0:r.address]),m.useEffect(()=>{const ct=()=>{const yt=typeof window<"u"?window.localStorage.getItem("hyperAddress"):null,Lt=typeof window<"u"?window.localStorage.getItem("hyperToken"):null;ye({address:yt,token:Lt})};return ct(),window.addEventListener("localStorageUpdated",ct),window.addEventListener("storage",ct),()=>{window.removeEventListener("localStorageUpdated",ct),window.removeEventListener("storage",ct)}},[]),m.useEffect(()=>{if(me.id||!Bt||!Bt.length)return;const ct=Bt.find(Lt=>Lt.confirmed)||Bt[0];if(!ct)return;const yt={id:ct.wallet_id,address:ct.wallet_address};we(yt),typeof s=="function"&&s({id:String(yt.id),address:yt.address})},[Bt,me.id,s]),m.useEffect(()=>{e&&(Ft(),J(!1))},[e]);const ze=m.useMemo(()=>o.find(ct=>ct.symbol===e),[o,e]),nt=ze&&ze.raw&&ze.raw.last_trade_price!=null&&Number(ze.raw.last_trade_price)||0;m.useEffect(()=>{let ct=!1;async function yt(){if(e)try{const ft=await(await fetch(QHe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"allPerpMetas"})})).json().catch(()=>null);if(!ft||ct)return;let Tt=null;for(const At of ft)if(Array.isArray(At==null?void 0:At.universe)){for(const Ot of At.universe)if(String(Ot.name||"").toUpperCase()===String(e||"").toUpperCase()){Tt=Ot;break}}if(!Tt||!Number.isFinite(Tt.maxLeverage))return;const Ge=Number(Tt.maxLeverage);oe(Ge),X(At=>Math.min(Ge,Math.max(1,At)))}catch{}}return yt(),()=>{ct=!0}},[e]),m.useEffect(()=>{let ct=!1;async function yt(){try{const ft=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_farming_coins/?app=hyper_fr")).json().catch(()=>null);if(!ft||ct)return;const Tt=Array.isArray(ft)&&ft||Array.isArray(ft.data)&&ft.data||Array.isArray(ft.coins)&&ft.coins||[],Ge=String(e||"").toUpperCase(),At=Tt.find(it=>String(it.value||it.label||it.symbol||it.coin||"").toUpperCase()===Ge),Ot=At&&At.maxLeverage!=null?Number(At.maxLeverage):null;!ct&&Ot!=null&&Number.isFinite(Ot)&&Ot>0&&(oe(Ot),X(it=>Math.min(Ot,Math.max(1,Number(it)||1))))}catch{}}return e&&yt(),()=>{ct=!0}},[e]);const mt=(me==null?void 0:me.address)||(dn?dn.toLowerCase():null),{perpsOverview:$t}=bT(mt),Pt=m.useMemo(()=>{if(!$t||$t.balance==null)return null;const ct=Number($t.balance);return Number.isFinite(ct)?ct:null},[$t]),un=(ct,yt)=>{var Sn,Bn,rr,ur;const Lt=ct.priceRange||{},ft=Array.isArray(ct.gridPrices)?ct.gridPrices:[];let Tt=Lt.lower,Ge=Lt.upper;(!Number.isFinite(Tt)||!Number.isFinite(Ge))&&ft.length>=2&&(Tt=ft[0],Ge=ft[ft.length-1]),Number.isFinite(Tt)?u(String(Tt)):u(""),Number.isFinite(Ge)?f(String(Ge)):f("");let At=ct.gridCount;Number.isFinite(At)||ft.length>=2&&(At=ft.length),Number.isFinite(At)?(g(At),w(String(At))):(g(2),w("2"));let Ot=ct.gridType;Ot!=="geometric"&&Ot!=="arithmetic"&&(Ot="arithmetic"),I(Ot);const it=ct.investment||{};if(it&&it.leverage!=null&&Number.isFinite(Number(it.leverage))&&X(Number(it.leverage)),it&&it.collateral!=null&&Number.isFinite(Number(it.collateral))){const _r=Number(it.collateral);if(O(String(_r)),yt&&yt>0&&_r>0){const Un=_r/yt*100;L(Math.max(0,Math.min(100,Un)))}else L(0)}else O(""),L(0);const jt=ct.trailing_up??((Sn=ct==null?void 0:ct.trailing)==null?void 0:Sn.up),Nn=ct.trailing_down??((Bn=ct==null?void 0:ct.trailing)==null?void 0:Bn.down),mn=ct.sl_up??((rr=ct==null?void 0:ct.sl)==null?void 0:rr.up),ir=ct.sl_down??((ur=ct==null?void 0:ct.sl)==null?void 0:ur.down);ut(jt!=null&&Number.isFinite(Number(jt))?String(jt):""),tt(Nn!=null&&Number.isFinite(Number(Nn))?String(Nn):""),$e(mn!=null&&Number.isFinite(Number(mn))?String(mn):""),pt(ir!=null&&Number.isFinite(Number(ir))?String(ir):""),wt(jt!=null&&Number.isFinite(Number(jt))),cn(Nn!=null&&Number.isFinite(Number(Nn))),Xt(mn!=null&&Number.isFinite(Number(mn))),Zt(ir!=null&&Number.isFinite(Number(ir)))};m.useEffect(()=>{if(typeof window>"u")return;if(!e||!(me!=null&&me.id)||!(me!=null&&me.address)){J(!1),Ft();return}let ct=!1;async function yt(){re(!0);try{const Lt=window.localStorage.getItem("hyperToken");if(!Lt){ct||(J(!1),Ft(),re(!1));return}const ft={address:window.localStorage.getItem("hyperAddress"),token:Lt,wallet_id:Number(me.id),source_market:"hyper",coin:String(e||"").toUpperCase()},Ge=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/gridbot/info/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ft)})).json().catch(()=>null);if(ct)return;if(De.current){De.current=!1,re(!1);return}const At=Ge&&Ge.data?Ge.data:Ge;At&&typeof At=="object"&&At.is_deleted===!1&&At.bot_params&&At.bot_params?(un(At.bot_params,Pt),J(!0)):(J(!1),Ft(),u(""),f(""))}catch{J(!1),Ft(),u(""),f("")}finally{ct||re(!1)}}return yt(),()=>{ct=!0}},[e,me==null?void 0:me.id,me==null?void 0:me.address,Ye]),m.useEffect(()=>{if(typeof window>"u")return;const ct=window.localStorage.getItem("gridbot:pending_selection");if(!ct)return;let yt=null;try{yt=JSON.parse(ct)}catch{yt=null}if(!(!yt||yt.sourceMarket&&yt.sourceMarket!=="hyper"||String(yt.coin||"").toUpperCase()!==String(e||"").toUpperCase())){if(De.current=!0,un(yt.botParams||{},Pt),yt.isActive===!0?J(!0):yt.isActive===!1&&J(!1),yt.walletId&&Bt&&Bt.length){const Lt=Bt.find(ft=>String(ft.wallet_id)===String(yt.walletId));if(Lt){const ft={id:Lt.wallet_id,address:Lt.wallet_address};we(ft),typeof s=="function"&&s({id:String(ft.id),address:ft.address})}}try{window.localStorage.removeItem("gridbot:pending_selection")}catch{}}},[e,Bt,s,Pt]),m.useEffect(()=>{const ct=yt=>{const Lt=yt&&yt.detail&&yt.detail.sourceMarket;Lt&&Lt!=="hyper"||Ze(ft=>ft+1)};return window.addEventListener("gridbotUpdated",ct),()=>{window.removeEventListener("gridbotUpdated",ct)}},[]),m.useEffect(()=>{const ct=yt=>{const Lt=yt&&yt.detail;if(!Lt)return;const ft=Lt.sourceMarket||Lt.source_market;if(ft&&ft!=="hyper"||String(Lt.coin||"").toUpperCase()!==String(e||"").toUpperCase())return;const Ge=Lt.botParams||{};if(un(Ge,Pt),De.current=!0,Lt.isActive===!0?J(!0):Lt.isActive===!1&&J(!1),Lt.walletId&&Bt&&Bt.length){const At=Bt.find(Ot=>String(Ot.wallet_id)===String(Lt.walletId));if(At){const Ot={id:At.wallet_id,address:At.wallet_address};we(Ot),typeof s=="function"&&s({id:String(Ot.id),address:Ot.address})}}};return window.addEventListener("gridbotSelectFromTasks",ct),()=>{window.removeEventListener("gridbotSelectFromTasks",ct)}},[e,Bt,s]);const an=m.useMemo(()=>Xmn(c,d,x,P),[c,d,x,P]),xn=m.useMemo(()=>{if(!an.length)return[];const ct=Number(c),yt=Number(d),Lt=Number.isFinite(ct)&&Number.isFinite(yt)?(ct+yt)/2:null;return an.map(ft=>({price:ft,side:Lt==null?null:ft>=Lt?"sell":"buy"}))},[an,c,d]);m.useEffect(()=>{typeof a=="function"&&a(xn)},[xn,a]);const An=ct=>{const yt=Number(ct);if(!(yt>0))return;const Lt=yt*.01;u((yt-Lt).toFixed(2)),f((yt+Lt).toFixed(2))},kn=m.useMemo(()=>{if(nt>0)return nt;const ct=Number(t||0);if(ct>0)return ct;const yt=Number(n||0);if(yt>0)return yt;const Lt=Number(c),ft=Number(d);return Number.isFinite(Lt)&&Number.isFinite(ft)&&ft>Lt?(Lt+ft)/2:0},[nt,t,n,c,d]);m.useEffect(()=>{let ct=!1;async function yt(){const Lt=Qmn(e);if(!Lt){Pe(null),Xe(null);return}try{const ft=await Ymn();let Tt=null;e:for(const Ge of ft)if(Array.isArray(Ge==null?void 0:Ge.universe)){for(const At of Ge.universe)if(String((At==null?void 0:At.name)||"").toUpperCase()===Lt){const it=Number(At.szDecimals);Number.isFinite(it)&&(Tt=it);break e}}if(ct)return;Tt!=null?Pe(Tt):(Pe(null),Xe(null))}catch{Pe(null),Xe(null)}}return e?yt():(Pe(null),Xe(null)),()=>{ct=!0}},[e]),m.useEffect(()=>{if(!Number.isFinite(je)){Xe(null);return}const ct=Zmn(kn,je);Xe(ct)},[kn,je]);const yn=kn,Vn=m.useMemo(()=>Math.min(ie,Math.max(1,Number(z)||1)),[z,ie]),Gn=Number(R)||0,Rn=Gn*Vn,Yn=an.length,Cn=kn>0?kn:nt,rn=Cn>0&&Yn>0&&Rn>0?Number((Rn/Yn/Cn).toFixed(5)):0,Oe=Number.isFinite(je)?je:Number.isFinite(ze==null?void 0:ze.sizeDecimals)?ze.sizeDecimals:4,Jt=m.useMemo(()=>{if(Number.isFinite(Re))return Re;const ct=Number.isFinite(Oe)?Number(Oe):4,yt=Math.max(0,qmn-ct),Lt=Math.abs(Number(kn||0));if(!(Lt>0)||!Number.isFinite(Lt))return yt;const ft=Lt>=1?Math.floor(Math.log10(Lt))+1:0,Tt=Math.max(0,5-ft);return Math.min(yt,Tt)},[Re,Oe,kn]),sn=Jt,Et=(ze==null?void 0:ze.minBaseAmount)??0,Xn=(ze==null?void 0:ze.minQuoteAmount)??0,gn=rn>0?Number(rn.toFixed(Oe)):0,Dt=gn>0&&Et>0&&gn<Et,en=gn>0&&Xn>0&&an.length>0&&an.some(ct=>ct*gn<Xn),In=m.useMemo(()=>{if(gn<=0||an.length===0)return 0;let ct=1/0;for(const yt of an){if(!(yt>0))continue;const Lt=yt*gn;Lt<ct&&(ct=Lt)}return ct===1/0?0:ct},[gn,an]),Qn=gn<=0||In<Gmn,ar=kn>0&&Rn>0&&Gn>0?PSe({entry:kn,side:"buy",notionalUSD:Rn,maintenanceFrac:.01,marginMode:"Cross",accountValueUSD:Gn,isolatedMarginUSD:Gn}):null,hr=kn>0&&Rn>0&&Gn>0?PSe({entry:kn,side:"sell",notionalUSD:Rn,maintenanceFrac:.01,marginMode:"Cross",accountValueUSD:Gn,isolatedMarginUSD:Gn}):null,Gt=m.useMemo(()=>{if(!c&&!d)return"";const ct=Number(c),yt=Number(d);if(!Number.isFinite(ct)||!Number.isFinite(yt))return"";if(!(yt>ct))return"Upper price must be greater than lower price.";if(yn>0){if(ct>yn)return`Lower price cannot be above mark price (${yn.toFixed(Jt)}).`;if(yt<yn)return`Upper price cannot be below mark price (${yn.toFixed(Jt)}).`}return""},[c,d,yn,Jt]),$n=m.useMemo(()=>{const ct=Number(c),yt=Number(d);return!(!Number.isFinite(ct)||!Number.isFinite(yt)||!(yt>ct)||yn>0&&(ct>yn||yt<yn))},[c,d,yn]),nr=Number(c),Rt=Number(d),En=Number(Ke),Ee=Number(et),h=Number(Le),p=Number(ht),S=Kt&&(Ke===""||!Number.isFinite(En)||!(En>Rt)),_=nn&&(et===""||!Number.isFinite(Ee)||!(Ee<nr));m.useEffect(()=>{Kt||ut(""),nn||tt("")},[Kt,nn]),m.useEffect(()=>{zn||$e(""),on||pt("")},[zn,on]);const k=zn&&(Le===""||!Number.isFinite(h)||!Kt&&Number.isFinite(Rt)&&!(h>Rt)||Kt&&Number.isFinite(En)&&!(h>En)),T=on&&(ht===""||!Number.isFinite(p)||!nn&&Number.isFinite(nr)&&!(p<nr)||nn&&Number.isFinite(Ee)&&!(p<Ee)),B=Yn>1&&$n&&Gn>0&&Vn>0&&(me==null?void 0:me.id)&&(me==null?void 0:me.address),W=G>0,ee=!!C,ce=Dt||en,ue=S||_||k||T,ge=B&&!K&&!he&&!_t&&!W&&!ee&&!ce&&!Qn&&!ue,Se=he||K||_t||ee||ce||Qn||W||ue?!1:ne?!0:B,ke=ne||he||K||_t;m.useEffect(()=>{if(!G)return;const ct=setInterval(()=>V(yt=>yt>1?yt-1:0),1e3);return()=>clearInterval(ct)},[G]);const Me=()=>{if(ke)return;const ct=nt>0?nt:kn>0?kn:Number(t||n||0);!Number.isFinite(ct)||ct<=0||An(ct)},qe=ct=>{if(ke)return;const yt=Math.max(0,Math.min(100,Number(ct)||0));if(L(yt),!Pt||Pt<=0){yt===0&&O("");return}const Lt=Pt*yt/100;O(Lt&&Number.isFinite(Lt)?String(Lt.toFixed(2)):"")},Fe=ct=>{if(ke)return;O(ct);const yt=Number(ct);if(!Pt||!Number.isFinite(yt)||yt<=0||Pt<=0){L(0);return}const Lt=yt/Pt*100;L(Math.max(0,Math.min(100,Lt)))},at=async()=>{if(!ge||typeof window>"u"||!(me!=null&&me.address)||!(me!=null&&me.id))return;const ct=an.filter(Nn=>Number.isFinite(Nn));if(ct.length<2)return;const yt=ct[0],Lt=ct[ct.length-1],ft=(yt+Lt)/2,Tt=ct.length,Ge=window.localStorage.getItem("hyperToken");if(!Ge)return;if(Kt&&S){tn.error("Trailing Up is invalid.");return}if(nn&&_){tn.error("Trailing Down is invalid.");return}if(zn&&k){const Nn=Kt?"SL Up must be greater than Trailing Up.":"SL Up must be greater than Upper price.";tn.error(Nn);return}if(on&&T){const Nn=nn?"SL Down must be less than Trailing Down.":"SL Down must be less than Lower price.";tn.error(Nn);return}const At=gn,Ot=zX(e),it={symbol:String(e||"").toUpperCase(),dex:Ot,gridType:P==="geometric"?"geometric":"arithmetic",direction:l,priceRange:{lower:Number(yt.toFixed(sn)),upper:Number(Lt.toFixed(sn)),middle:Number(ft.toFixed(sn))},gridCount:Tt,gridPrices:ct.map(Nn=>Number(Nn.toFixed(sn))),investment:{collateral:Gn,leverage:Vn,totalInvestment:Rn,qtyPerOrder:At},liquidationPrices:{long:ar?Number(ar.toFixed(2)):null,short:hr?Number(hr.toFixed(2)):null},trailing_up:Kt&&!S?Number(En.toFixed(sn)):null,trailing_down:nn&&!_?Number(Ee.toFixed(sn)):null,sl_up:zn&&!k?Number(h.toFixed(sn)):null,sl_down:on&&!T?Number(p.toFixed(sn)):null,marginMode:"Cross",currentPrice:kn||null,timestamp:new Date().toISOString()},jt={address:window.localStorage.getItem("hyperAddress"),token:Ge,wallet_id:Number(me.id),source_market:"hyper",...Ot?{dex:Ot}:{},bot_params:it,coin:String(e||"").toUpperCase()};Q(!0);try{const mn=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/gridbot/save/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(jt)})).json().catch(()=>null);if(!(mn&&(mn.success===!0||mn.status==="ok"||mn.status==="success"))){const Sn=mn&&(mn.error_message||mn.message||mn.detail)||"Grid bot failed to start.";tn.error(Sn);return}J(!0),typeof window<"u"&&window.dispatchEvent(new CustomEvent("gridbotUpdated",{detail:{sourceMarket:"hyper"}})),tn.success("Grid bot started.")}catch{tn.error("An error occurred while starting the grid bot.")}finally{Q(!1)}},se=async()=>{if(typeof window>"u"||!(me!=null&&me.address)||!(me!=null&&me.id))return;const ct=window.localStorage.getItem("hyperToken");if(!ct)return;const yt=zX(e),Lt={address:window.localStorage.getItem("hyperAddress"),token:ct,wallet_id:Number(me.id),source_market:"hyper",...yt?{dex:yt}:{},coin:String(e||"").toUpperCase()};Q(!0);try{const Tt=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/gridbot/stop/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Lt)})).json().catch(()=>null);if(!(Tt&&(Tt.success===!0||Tt.status==="ok"||Tt.status==="success"))){const At=Tt&&(Tt.error_message||Tt.message||Tt.detail)||"Grid bot could not be stopped.";tn.error(At);return}J(!1),V(10),typeof window<"u"&&window.dispatchEvent(new CustomEvent("gridbotUpdated",{detail:{sourceMarket:"hyper"}})),tn.success("Grid bot has been stopped.")}catch{tn.error("An error occurred while stopping the grid bot.")}finally{Q(!1)}},Ce=()=>{Se&&(ne?se():Ne(!0))},Ue=async()=>{ge&&(Ne(!1),await at())},Be=he?ne?"Stopping...":"Starting...":ne?"Stop":W?`Stopping ${G}s`:"Start",_e=["xyz","vntl","flx"].includes(zX(e))?"Isolated":"Cross",rt=!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(yT,{wallets:Bt,value:me&&me.id?String(me.id):"",onChange:ct=>{const yt=(Bt||[]).find(Lt=>String(Lt.wallet_id)===String(ct))||null;if(yt){const Lt={id:yt.wallet_id,address:yt.wallet_address};we(Lt),typeof s=="function"&&s({id:String(Lt.id),address:Lt.address})}},selectedBalance:Pt})]}),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:ct=>{ke||u(ct.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:ct=>{ke||f(ct.target.value)},className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"0",inputMode:"decimal",disabled:ke})})]})]}),yn>0&&i.jsxs("div",{className:"text-[11px] text-white/40",children:["Mark Price: ",yn.toFixed(Jt)]}),Gt&&i.jsx("div",{className:"text-[11px] text-[#FF7173]",children:Gt})]}),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:ct=>{if(ke)return;const yt=ct.target.value.replace(/[^\d]/g,"");if(w(yt),N(""),yt==="")return;const Lt=Number(yt);if(Number.isFinite(Lt)){if(Lt<2){N("The minimum number of grids must be 2.");return}if(Lt>120){N("The maximum number of grids is 120.");return}if(Lt%2!==0){N("The number of grids must be even.");return}g(Lt)}},className:"bg-transparent outline-none flex-1 text-[13px]",inputMode:"numeric",disabled:ke})}),i.jsx("div",{className:"relative",children:i.jsx("select",{value:P,onChange:ct=>{ke||I(ct.target.value)},className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 text-[12px] outline-none",disabled:ke,children:Wmn.map(ct=>i.jsx("option",{value:ct,className:"bg-[#101010]",children:ct[0].toUpperCase()+ct.slice(1)},ct))})})]}),i.jsx("div",{className:"text-[11px] text-white/40",children:C&&i.jsx("div",{className:"text-[11px] text-[#FF7173] mt-1",children:C})})]}),rt,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:ct=>Fe(ct.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(y4,{onClick:ie&&ie>0&&!ke?()=>ae(!0):void 0,children:ie&&ie>0?`${Vn}x`:"--"})})]}),i.jsxs("div",{className:"flex items-center gap-3 !mt-4 pb-6",children:[i.jsx(XN,{value:U,onChange:ct=>qe(ct),accent:"#67FFBD"}),i.jsxs("div",{className:"h-[30px] rounded-lg flex items-center px-2",style:{width:84,background:Po,border:`1px solid ${Ma}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right text-xs",inputMode:"numeric",value:U,onChange:ct=>qe(Math.max(0,Math.min(100,Number(ct.target.value)||0))),style:{color:Di,fontFeatureSettings:'"tnum"'},disabled:ke}),i.jsx("span",{style:{color:vi},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:"," ",Rn>0?`${Rn.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:"," ",gn>0?`${gn} ${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:ar?`$${ar.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:hr?`$${hr.toLocaleString(void 0,{maximumFractionDigits:2})}`:"--"})]}),i.jsx("button",{type:"button",onClick:Ce,disabled:!Se,className:`w-full h-[32px] rounded-xl font-bold text-[13px] flex items-center justify-center transition-opacity ${Se?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:Be}),Dt&&i.jsxs("div",{className:"mt-2 text-[11px] text-[#FF7173] text-center",children:["Quantity per order is below min size (",Et," ",e,")."]}),en&&i.jsxs("div",{className:"mt-2 text-[11px] text-[#FF7173] text-center",children:["Your order size is below minimum order size of $",Xn.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."}),rt]})]})]}),i.jsx(Jh,{open:te,onClose:()=>ae(!1),children:i.jsxs(dm,{title:"Adjust Leverage",children:[i.jsxs("div",{className:"text-[12px] leading-5 mb-3",style:{color:vi},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:ct=>X(Math.max(1,Math.min(ie||1,Number(ct.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:Po,border:`1px solid ${Ma}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right text-white",inputMode:"numeric",value:z,onChange:ct=>{const yt=Number(ct.target.value)||1,Lt=Math.max(1,Math.min(ie||1,yt));X(Lt)}}),i.jsx("span",{className:"text-[11px] text-white/40 ml-1",children:"x"})]})]}),i.jsx(F0,{onClick:()=>ae(!1),children:"Confirm"})]})}),i.jsx(Jh,{open:fe,onClose:()=>Ne(!1),children:i.jsxs(dm,{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 ",Vn,"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:vi},children:"Price Range"}),i.jsx("div",{className:"font-medium",style:{color:Di},children:Number.isFinite(Number(c))&&Number.isFinite(Number(d))?`${Number(c).toFixed(sn)} - ${Number(d).toFixed(sn)} USDC`:"--"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:vi},children:"Number of Grids"}),i.jsx("div",{className:"font-medium",style:{color:Di},children:Yn||"--"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:vi},children:"Mode"}),i.jsx("div",{className:"font-medium",style:{color:Di},children:P==="geometric"?"Geometric":"Arithmetic"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:vi},children:"Qty Per Order"}),i.jsx("div",{className:"font-medium",style:{color:Di},children:gn>0?`${gn} ${e}`:"--"})]}),rt,rt,rt,rt]}),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:Di},children:"Total Investment"}),i.jsx("span",{className:"font-semibold text-[#67FFBD]",children:Rn>0?`${Rn.toFixed(2)} USDC`:"--"})]})}),i.jsx("div",{className:"mt-4",children:i.jsx(F0,{onClick:Ue,disabled:he,children:he?"Starting...":"Confirm"})})]})})]})}const Jmn=["arithmetic","geometric"],e0n=10,t0n="https://express-proxy-delta.vercel.app/proxy?url=",n0n="https://api.starknet.extended.exchange/api/v1";function r0n(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,P)=>{const I=o*Math.pow(C,P),R=I>0?x/I:0;return{index:P,price:I,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 P=o+g*N;return{index:N,price:P,qty:w,order_size_usd:x}})}function OSe({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 s0n(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 MSe({coin:e,midPrice:t,selectedPrice:n,wallet:r,onWalletChange:s,onLevelsChange:a}){var Yr,os,ds;const{setSignInConnectButtonOpen:o}=m.useContext(Qr),l=Nue();m.useState("short");const[c,u]=m.useState("neutral"),[d,f]=m.useState(""),[x,g]=m.useState(""),[v,w]=m.useState(2),[C,N]=m.useState("2"),[P,I]=m.useState(""),[R,O]=m.useState("arithmetic"),[U,L]=m.useState(""),[z,X]=m.useState(0),[ne,J]=m.useState(10),[K,re]=m.useState(!1),[he,Q]=m.useState(!1),[ie,oe]=m.useState(!1),[G,V]=m.useState(50),[te,ae]=m.useState(0),[fe,Ne]=m.useState(!1),[me,we]=m.useState(!1),[xe,ye]=m.useState(()=>r&&r.id&&r.address?{id:r.id,address:r.address,apiKey:r.apiKey}:{id:null,address:null,apiKey:null}),[je,Pe]=m.useState({address:null,token:null}),[Re,Xe]=m.useState(null),[Ke,ut]=m.useState(""),[et,tt]=m.useState(""),[Le,$e]=m.useState(""),[ht,pt]=m.useState(""),[Kt,wt]=m.useState(!1),[nn,cn]=m.useState(!1),[zn,Xt]=m.useState(!1),[on,Zt]=m.useState(!1),[Ye,Ze]=m.useState(0),Ft=m.useRef(null),dn=m.useRef(!1),Yt=Je=>{const bt=Number(Je);if(!Number.isFinite(bt)||bt<=0)return{num:null,str:""};const Tn=bt>=3?bt*.99:bt,er=Number(Tn.toFixed(2));return{num:Number.isFinite(er)?er:null,str:Number.isFinite(er)?String(bt.toFixed(2)):""}},Bt=()=>{f(""),g(""),w(2),N("2"),O("arithmetic"),L(""),X(0),J(10),I(""),u("neutral"),ut(""),tt(""),$e(""),pt(""),wt(!1),cn(!1),Xt(!1),Zt(!1),Ft.current=null,dn.current=!1},{address:ot,isConnected:De}=ts(),ze=!(De&&!!(typeof window<"u"&&window.localStorage.getItem("hyperToken"))),[nt,mt]=m.useState([]),[$t,Pt]=m.useState(!1),un=m.useRef(!1),an=$t&&(!nt||nt.length===0);m.useEffect(()=>{r&&r.id&&r.address&&ye(Je=>Je.id===r.id&&Je.address&&Je.address.toLowerCase()===r.address.toLowerCase()?Je:{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 Je=()=>{const bt=typeof window<"u"?window.localStorage.getItem("hyperAddress"):null,Tn=typeof window<"u"?window.localStorage.getItem("hyperToken"):null;Pe({address:bt,token:Tn})};return Je(),window.addEventListener("localStorageUpdated",Je),window.addEventListener("storage",Je),()=>{window.removeEventListener("localStorageUpdated",Je),window.removeEventListener("storage",Je)}},[]),m.useEffect(()=>{if(!je.address||!je.token){mt([]);return}let Je=!1;return(async()=>{try{Pt(!0);const er=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:je.address.toLowerCase(),token:je.token,balance:"true"})})).json().catch(()=>({}));if(Je)return;if(er!=null&&er.success&&Array.isArray(er.data)){const kr=er.data.map((Dr,Ur)=>({...Dr,wallet_id:Dr.wallet_id??Dr.id??Ur,wallet_address:Dr.wallet_address||"",wallet_name:Dr.wallet_name||Dr.name||`Extended Wallet ${Ur+1}`,wallet_api_key:Dr.wallet_api_key||Dr.api_key||null}));mt(kr)}else mt([])}catch(Tn){Je||(console.error("Extended wallet list error",Tn),mt([]))}finally{Je||Pt(!1)}})(),()=>{Je=!0}},[je.address,je.token]),m.useEffect(()=>{if(xe.id||!nt||!nt.length)return;const Je=nt.find(Tn=>Tn.confirmed)||nt[0];if(!Je)return;const bt={id:Je.wallet_id,address:Je.wallet_address,apiKey:Je.wallet_api_key};ye(bt),typeof s=="function"&&s({id:String(bt.id),address:bt.address,apiKey:bt.apiKey})},[nt,xe.id,s]),m.useEffect(()=>{if(!(xe!=null&&xe.id)||!(nt!=null&&nt.length))return;const Je=nt.find(er=>String(er.wallet_id)===String(xe.id));if(!Je||!(xe.apiKey!==Je.wallet_api_key||!xe.address&&Je.wallet_address))return;const Tn={id:Je.wallet_id,address:Je.wallet_address,apiKey:Je.wallet_api_key};ye(Tn),typeof s=="function"&&s({id:String(Tn.id),address:Tn.address,apiKey:Tn.apiKey})},[xe==null?void 0:xe.id,xe==null?void 0:xe.apiKey,xe==null?void 0:xe.address,nt,s]),m.useEffect(()=>{e&&(Bt(),re(!1))},[e]);const xn=m.useMemo(()=>{if(!e)return null;const Je=String(e).toUpperCase(),bt=Je.replace(/-USD$/,"");return l.find(Tn=>{const er=String((Tn==null?void 0:Tn.symbol)||"").toUpperCase(),kr=String((Tn==null?void 0:Tn.rawSymbol)||"").toUpperCase();return er===Je||kr===Je||er===bt||kr===bt})||null},[l,e]),An=m.useMemo(()=>{const Je=xn==null?void 0:xn.marketStats,bt=(Je==null?void 0:Je.markPrice)??(Je==null?void 0:Je.lastPrice)??(Je==null?void 0:Je.indexPrice)??(xn==null?void 0:xn.markPrice)??(xn==null?void 0:xn.lastPrice)??(xn==null?void 0:xn.last)??null,Tn=Number(bt);return Number.isFinite(Tn)?Tn:0},[xn]);m.useEffect(()=>{var Tn;const Je=((Tn=xn==null?void 0:xn.tradingConfig)==null?void 0:Tn.maxLeverage)??(xn==null?void 0:xn.maxLeverage)??(xn==null?void 0:xn.leverage),bt=Number(Je);!Number.isFinite(bt)||bt<=0||(V(bt),J(er=>Math.min(bt,Math.max(1,Number(er)||1))))},[xn]);const kn=(xe==null?void 0:xe.address)||(ot?ot.toLowerCase():null),{perpsOverview:yn}=bT(kn),Vn=m.useMemo(()=>{const Je=nt.find(Dr=>String(Dr.wallet_id)===String(xe==null?void 0:xe.id)),bt=(Je==null?void 0:Je.available_balance)??(Je==null?void 0:Je.balance)??null,Tn=Number(bt);if(!(xe!=null&&xe.apiKey))return Number.isFinite(Tn)?Tn:null;const er=Number(Re==null?void 0:Re.availableForTrade);if(Number.isFinite(er))return er;if(Number.isFinite(Tn))return Tn;if(!yn||yn.balance==null)return null;const kr=Number(yn.balance);return Number.isFinite(kr)?kr:null},[Re,yn,xe==null?void 0:xe.apiKey,xe==null?void 0:xe.id,nt]);m.useEffect(()=>{if(!(xe!=null&&xe.apiKey)){Xe(null);return}let Je=!1;const bt=async()=>{var er,kr,Dr;try{const Ur=`${t0n}${encodeURIComponent(`${n0n}/user/balance`)}`,Cr=await(await fetch(Ur,{headers:{"X-Api-Key":xe.apiKey}})).json().catch(()=>null);if(!Je){const ls=((er=Cr==null?void 0:Cr.data)==null?void 0:er.availableForTrade)??(Cr==null?void 0:Cr.availableForTrade)??((kr=Cr==null?void 0:Cr.data)==null?void 0:kr.available_balance)??(Cr==null?void 0:Cr.available_balance)??((Dr=Cr==null?void 0:Cr.data)==null?void 0:Dr.available)??(Cr==null?void 0:Cr.available),yr=Number(ls);Xe({availableForTrade:Number.isFinite(yr)&&yr>=0?yr:null,raw:Cr})}}catch{Je||Xe(null)}};bt();const Tn=setInterval(bt,2e4);return()=>{Je=!0,clearInterval(Tn)}},[xe==null?void 0:xe.apiKey]);const Gn=(Je,bt)=>{var dr,jr,pr,fr;const Tn=Je.priceRange||{},kr=(Array.isArray(Je.gridPrices)?Je.gridPrices:[]).map(Kr=>Kr&&typeof Kr=="object"&&Kr.price!=null?Number(Kr.price):Number(Kr)).filter(Kr=>Number.isFinite(Kr));let Dr=Tn.lower,Ur=Tn.upper;(!Number.isFinite(Dr)||!Number.isFinite(Ur))&&kr.length>=2&&(Dr=kr[0],Ur=kr[kr.length-1]),Number.isFinite(Dr)?f(String(Dr)):f(""),Number.isFinite(Ur)?g(String(Ur)):g("");let cr=Je.gridType;cr!=="geometric"&&cr!=="arithmetic"&&(cr="arithmetic"),O(cr);const Cr=Je.grid_side_mode??Je.gridSideMode??Je.gridSide??Je.sideMode??null,ls=String(Cr||"").toLowerCase(),yr=Je.grid_count_base??Je.gridCountBase??Je.grid_count_input??Je.gridCountInput??null,Jr=Number(yr);let Ks=Je.gridCount;Number.isFinite(Ks)||kr.length>=2&&(Ks=kr.length);const Es=ls&&ls!=="neutral"&&Number.isFinite(Jr)?Jr:Ks;Number.isFinite(Es)?(w(Es),N(String(Es))):(w(2),N("2")),u(ls==="short"||ls==="short_only"?"short":ls==="long"||ls==="long_only"?"long":"neutral");const gr=Je.investment||{};gr&&gr.leverage!=null&&Number.isFinite(Number(gr.leverage))&&J(Number(gr.leverage));const Vt=gr.wallet_balance??gr.walletBalance??gr.balance??gr.available_balance??gr.availableBalance??null,de=(gr==null?void 0:gr.collateral_input)??(gr==null?void 0:gr.collateralInput)??(gr==null?void 0:gr.collateral)??(gr==null?void 0:gr.collateral_used)??(gr==null?void 0:gr.collateralUsed)??(gr==null?void 0:gr.collateralEffective)??null,st=Number(de);if(gr&&Number.isFinite(st)){const{num:Kr,str:rs}=Yt(st);L(rs),Ft.current=Kr;const Ir=gr.percentChosen!=null?Number(gr.percentChosen):gr.percent!=null?Number(gr.percent):null,br=Ir!=null&&Number.isFinite(Ir),Zn=Number(Vt);if(br)X(Math.max(0,Math.min(100,Ir))),dn.current=!1;else{const xs=Number.isFinite(Zn)&&Zn>0?Zn:bt;if(xs&&xs>0&&Kr>0){const Qs=Kr/xs*100;X(Math.max(0,Math.min(100,Qs))),dn.current=!1}else X(0),dn.current=Kr>0}}else L(""),X(0),Ft.current=null,dn.current=!1;const Ct=Je.trailing_up??((dr=Je==null?void 0:Je.trailing)==null?void 0:dr.up),vt=Je.trailing_down??((jr=Je==null?void 0:Je.trailing)==null?void 0:jr.down),ln=Je.sl_up??((pr=Je==null?void 0:Je.sl)==null?void 0:pr.up),pn=Je.sl_down??((fr=Je==null?void 0:Je.sl)==null?void 0:fr.down);ut(Ct!=null&&Number.isFinite(Number(Ct))?String(Ct):""),tt(vt!=null&&Number.isFinite(Number(vt))?String(vt):""),$e(ln!=null&&Number.isFinite(Number(ln))?String(ln):""),pt(pn!=null&&Number.isFinite(Number(pn))?String(pn):""),wt(Ct!=null&&Number.isFinite(Number(Ct))),cn(vt!=null&&Number.isFinite(Number(vt))),Xt(ln!=null&&Number.isFinite(Number(ln))),Zt(pn!=null&&Number.isFinite(Number(pn)))};m.useEffect(()=>{if(!dn.current)return;const Je=Number(Ft.current),bt=Number(Vn);if(!Number.isFinite(Je)||Je<=0||!Number.isFinite(bt)||bt<=0)return;const Tn=Je/bt*100;X(Math.max(0,Math.min(100,Tn))),dn.current=!1},[Vn]),m.useEffect(()=>{if(typeof window>"u")return;if(!e||!(xe!=null&&xe.id)||!(xe!=null&&xe.address)){re(!1),Bt();return}let Je=!1;async function bt(){Q(!0);try{const Tn=window.localStorage.getItem("hyperToken");if(!Tn){Je||(re(!1),Bt(),Q(!1));return}const er={address:window.localStorage.getItem("hyperAddress"),token:Tn,wallet_id:Number(xe.id),source_market:"extended",coin:String(e||"").toUpperCase()},Dr=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/extended_bot/info/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(er)})).json().catch(()=>null);if(Je)return;if(un.current){un.current=!1,Q(!1);return}const Ur=Dr&&Dr.data?Dr.data:Dr,Cr=(Array.isArray(Ur)?Ur:[Ur]).filter(Boolean).filter(yr=>yr&&typeof yr=="object"&&String(yr.coin||"").toUpperCase()===String(e||"").toUpperCase()&&String(yr.wallet_id||"")===String(xe.id||"")),ls=Cr.find(yr=>yr&&typeof yr=="object"&&yr.is_deleted===!1&&yr.bot_params)||Cr.find(yr=>yr&&typeof yr=="object"&&yr.is_deleted!==!0&&yr.bot_params)||null;if(ls){if(ls.wallet_id&&String(ls.wallet_id)!==String(xe.id)){const yr=nt.find(Jr=>String(Jr.wallet_id)===String(ls.wallet_id));if(yr){const Jr={id:yr.wallet_id,address:yr.wallet_address,apiKey:yr.wallet_api_key};ye(Jr),typeof s=="function"&&s({id:String(Jr.id),address:Jr.address,apiKey:Jr.apiKey})}}Gn(ls.bot_params,Vn),re(!0)}else re(!1),Bt(),f(""),g("")}catch{re(!1),Bt(),f(""),g("")}finally{Je||Q(!1)}}return bt(),()=>{Je=!0}},[e,xe==null?void 0:xe.id,xe==null?void 0:xe.address,Ye,nt,s]),m.useEffect(()=>{if(typeof window>"u")return;const Je=window.localStorage.getItem("gridbot:pending_selection");if(!Je)return;let bt=null;try{bt=JSON.parse(Je)}catch{bt=null}if(!(!bt||bt.sourceMarket&&bt.sourceMarket!=="extended"||String(bt.coin||"").toUpperCase()!==String(e||"").toUpperCase())){if(un.current=!0,Gn(bt.botParams||{},Vn),bt.isActive===!0?re(!0):bt.isActive===!1&&re(!1),bt.walletId&&nt&&nt.length){const Tn=nt.find(er=>String(er.wallet_id)===String(bt.walletId));if(Tn){const er={id:Tn.wallet_id,address:Tn.wallet_address,apiKey:Tn.wallet_api_key};ye(er),typeof s=="function"&&s({id:String(er.id),address:er.address,apiKey:er.apiKey})}}try{window.localStorage.removeItem("gridbot:pending_selection")}catch{}}},[e,nt,s,Vn]),m.useEffect(()=>{const Je=bt=>{const Tn=bt&&bt.detail&&bt.detail.sourceMarket;Tn&&Tn!=="extended"||Ze(er=>er+1)};return window.addEventListener("gridbotUpdated",Je),()=>{window.removeEventListener("gridbotUpdated",Je)}},[]),m.useEffect(()=>{const Je=bt=>{const Tn=bt&&bt.detail;if(!Tn)return;const er=Tn.sourceMarket||Tn.source_market;if(er&&er!=="extended"||String(Tn.coin||"").toUpperCase()!==String(e||"").toUpperCase())return;const Dr=Tn.botParams||{};if(Gn(Dr,Vn),un.current=!0,Tn.isActive===!0?re(!0):Tn.isActive===!1&&re(!1),Tn.walletId&&nt&&nt.length){const Ur=nt.find(cr=>String(cr.wallet_id)===String(Tn.walletId));if(Ur){const cr={id:Ur.wallet_id,address:Ur.wallet_address,apiKey:Ur.wallet_api_key};ye(cr),typeof s=="function"&&s({id:String(cr.id),address:cr.address,apiKey:cr.apiKey})}}};return window.addEventListener("gridbotSelectFromTasks",Je),()=>{window.removeEventListener("gridbotSelectFromTasks",Je)}},[e,nt,s]);const Rn=m.useMemo(()=>Math.min(G,Math.max(1,Number(ne)||1)),[ne,G]),Yn=(()=>{const Je=Number(U);return!Number.isFinite(Je)||Je<=0?0:Je>=3?Je*.99:Je})(),Cn=Number(U)||0,rn=m.useMemo(()=>{const Je=Number(d),bt=Number(x);return!Number.isFinite(Je)||!Number.isFinite(bt)?null:(Je+bt)/2},[d,x]),Oe=m.useMemo(()=>{if(An>0)return An;const Je=Number(t||0);if(Je>0)return Je;const bt=Number(n||0);return bt>0?bt:rn!=null&&rn>0?rn:0},[An,t,n,rn]),Jt=Number.isFinite(Oe)&&Oe>0?Oe:rn,sn=m.useMemo(()=>r0n(d,x,v,Yn,R,Rn),[d,x,v,Yn,R,Rn]),Et=m.useMemo(()=>{const Je=sn.map((ls,yr)=>{const Jr=Number(ls==null?void 0:ls.price);return Number.isFinite(Jr)?{index:Number.isFinite(ls==null?void 0:ls.index)?ls.index:yr,price:Jr}:null}).filter(Boolean);if(!Je.length)return[];const bt=Yn*Rn,Tn=Number.isFinite(Jt)&&Jt>0?Jt:null;let er=0,kr=0;if(Tn!=null)for(const ls of Je)ls.price>=Tn?kr+=1:er+=1;else er=Je.length;let Dr=Je.length;c==="long"?Dr=er+kr*2:c==="short"&&(Dr=kr+er*2),(!Number.isFinite(Dr)||Dr<=0)&&(Dr=Je.length);const Ur=Dr>0?bt/Dr:0,cr=rn??0,Cr=R==="geometric";return Je.map(ls=>{const yr=Cr?ls.price>0?Ur/ls.price:0:cr>0?Ur/cr:0;return{index:ls.index,price:ls.price,qty:yr,order_size_usd:Ur}})},[sn,Yn,Rn,rn,R,c,Jt]),Xn=m.useMemo(()=>Et.length?Et.map(Je=>({price:Je.price,side:Jt==null?null:Number(Je.price)>=Jt?"sell":"buy"})):[],[Et,Jt]);m.useEffect(()=>{typeof a=="function"&&a(Xn)},[Xn,a]);const gn=Je=>{const bt=Number(Je);if(!(bt>0))return;const Tn=bt*.01;f((bt-Tn).toFixed(2)),g((bt+Tn).toFixed(2))},Dt=Oe,en=Yn*Rn,In=Et.length,Qn=m.useMemo(()=>{if(!Et.length)return 0;let Je=0,bt=0;for(const Tn of Et){const er=Number(Tn==null?void 0:Tn.qty);Number.isFinite(er)&&(Je+=er,bt+=1)}return bt?Je/bt:0},[Et]),ar=Number(xn==null?void 0:xn.collateralAssetPrecision),hr=Number(xn==null?void 0:xn.assetPrecision),Gt=(Yr=xn==null?void 0:xn.tradingConfig)==null?void 0:Yr.minOrderSizeChange,$n=(()=>{const Je=Number(Gt);if(!Number.isFinite(Je))return null;const[,bt=""]=String(Gt).split(".");return Math.max(0,bt.length)})(),nr=Number.isFinite(ar)?ar:Number.isFinite(hr)?hr:4,Rt=$n!=null&&Number.isFinite($n)?$n:nr,En=Number((os=xn==null?void 0:xn.tradingConfig)==null?void 0:os.minPriceChange),Ee=m.useMemo(()=>Number.isFinite(En)&&En>0?En>=1?0:Math.min(8,Math.max(0,-Math.floor(Math.log10(En)))):s0n(Oe),[En,Oe]),h=Ee,p=Number(((ds=xn==null?void 0:xn.tradingConfig)==null?void 0:ds.minOrderSize)??0),S=0,_=Qn>0?Number(Qn.toFixed(Rt)):0,k=m.useMemo(()=>Et.some(Je=>Number(Je==null?void 0:Je.qty)>0),[Et]),T=k&&p>0&&Et.some(Je=>{const bt=Number(Je==null?void 0:Je.qty);return Number.isFinite(bt)?bt<p:!1}),B=k&&S>0,W=m.useMemo(()=>{if(!k||Et.length===0)return 0;let Je=1/0;for(const bt of Et){const Tn=Number(bt==null?void 0:bt.price),er=Number(bt==null?void 0:bt.qty);if(!Number.isFinite(Tn)||!Number.isFinite(er))continue;if(Tn<=0||er<=0){Je=0;break}const kr=Tn*er;kr<Je&&(Je=kr)}return Je===1/0?0:Je},[k,Et]),ee=k&&W<e0n,ce=Oe>0&&en>0&&Yn>0?OSe({entry:Oe,side:"buy",notionalUSD:en,maintenanceFrac:.01,marginMode:"Cross",accountValueUSD:Yn,isolatedMarginUSD:Yn}):null,ue=Oe>0&&en>0&&Yn>0?OSe({entry:Oe,side:"sell",notionalUSD:en,maintenanceFrac:.01,marginMode:"Cross",accountValueUSD:Yn,isolatedMarginUSD:Yn}):null,ge=m.useMemo(()=>{if(!d&&!x)return"";const Je=Number(d),bt=Number(x);if(!Number.isFinite(Je)||!Number.isFinite(bt))return"";if(!(bt>Je))return"Upper price must be greater than lower price.";if(Dt>0){if(Je>Dt)return`Lower price cannot be above mark price (${Dt.toFixed(Ee)}).`;if(bt<Dt)return`Upper price cannot be below mark price (${Dt.toFixed(Ee)}).`}return""},[d,x,Dt,Ee]),Se=m.useMemo(()=>{const Je=Number(d),bt=Number(x);return!(!Number.isFinite(Je)||!Number.isFinite(bt)||!(bt>Je)||Dt>0&&(Je>Dt||bt<Dt))},[d,x,Dt]),ke=Number(d),Me=Number(x),qe=Number(Ke),Fe=Number(et),at=Number(Le),se=Number(ht),Ce=Kt&&(Ke===""||!Number.isFinite(qe)||!(qe>Me)),Ue=nn&&(et===""||!Number.isFinite(Fe)||!(Fe<ke));m.useEffect(()=>{Kt||ut(""),nn||tt("")},[Kt,nn]),m.useEffect(()=>{zn||$e(""),on||pt("")},[zn,on]);const Be=zn&&(Le===""||!Number.isFinite(at)||!Kt&&Number.isFinite(Me)&&!(at>Me)||Kt&&Number.isFinite(qe)&&!(at>qe)),_e=on&&(ht===""||!Number.isFinite(se)||!nn&&Number.isFinite(ke)&&!(se<ke)||nn&&Number.isFinite(Fe)&&!(se<Fe)),rt=In>1&&Se&&Yn>0&&Rn>0&&(xe==null?void 0:xe.id)&&(xe==null?void 0:xe.address),ct=te>0,yt=!!P,Lt=T||B,ft=Ce||Ue||Be||_e,Tt=rt&&!he&&!ie&&!an&&!ct&&!yt&&!Lt&&!ee&&!ft,Ge=ie||he||an||yt||Lt||ee||ct||ft?!1:K?!0:rt,At=K||ie||he||an;m.useEffect(()=>{if(!te)return;const Je=setInterval(()=>ae(bt=>bt>1?bt-1:0),1e3);return()=>clearInterval(Je)},[te]);const Ot=()=>{if(At)return;const Je=An>0?An:Oe>0?Oe:Number(t||n||0);!Number.isFinite(Je)||Je<=0||gn(Je)},it=Je=>{if(At)return;dn.current=!1;const bt=Math.max(0,Math.min(100,Number(Je)||0));if(X(bt),!Vn||Vn<=0){bt===0&&L("");return}const Tn=Vn*bt/100;Yt(Tn),L(Number.isFinite(Tn)?Tn.toFixed(2):"")},jt=Je=>{if(At)return;dn.current=!1;const bt=Number(Je);if(L(Je),!Vn||!Number.isFinite(bt)||bt<=0||Vn<=0){X(0);return}const Tn=(bt>=3?bt*.99:bt)/Vn*100;X(Math.max(0,Math.min(100,Tn)))},Nn=async()=>{if(!Tt||typeof window>"u"||!(xe!=null&&xe.address)||!(xe!=null&&xe.id))return;const Je=Et.filter(Es=>Number.isFinite(Es==null?void 0:Es.price));if(Je.length<2)return;const bt=Je[0],Tn=Je[Je.length-1],er=Je.length,kr=er>1?er-1:0,Dr=R!=="geometric"&&kr>0?(Tn.price-bt.price)/kr:null,Ur=R==="geometric"&&kr>0?Math.pow(Tn.price/bt.price,1/kr):null,cr=(bt.price+Tn.price)/2,Cr=window.localStorage.getItem("hyperToken");if(!Cr)return;if(Kt&&Ce){tn.error("Trailing Up is invalid.");return}if(nn&&Ue){tn.error("Trailing Down is invalid.");return}if(zn&&Be){const Es=Kt?"SL Up must be greater than Trailing Up.":"SL Up must be greater than Upper price.";tn.error(Es);return}if(on&&_e){const Es=nn?"SL Down must be less than Trailing Down.":"SL Down must be less than Lower price.";tn.error(Es);return}const ls=_,yr=HX(e),Jr={symbol:String(e||"").toUpperCase(),dex:yr,gridType:R==="geometric"?"geometric":"arithmetic",direction:c,grid_side_mode:c,grid_count_base:v,priceRange:{lower:Number(bt.price.toFixed(h)),upper:Number(Tn.price.toFixed(h)),middle:Number(cr.toFixed(h))},gridCount:er,gridPrices:Je.map(Es=>({price:Number(Es.price.toFixed(h)),qty:Number(Number(Es.qty||0).toFixed(Rt))})),trailing_up_grid_prices:(()=>{if(!(Kt&&!Ce&&Number.isFinite(qe)))return[];const Es=[];if(R==="geometric"&&Ur&&Ur>0){let gr=Tn.price*Ur,Vt=0;for(;gr<=qe+1e-12&&Vt<500;){const de=(Oe>0,_);Es.push({price:Number(gr.toFixed(h)),qty:Number(de.toFixed(Rt))}),gr*=Ur,Vt+=1}}else if(Dr&&Dr>0)for(let gr=Tn.price+Dr,Vt=0;gr<=qe+1e-12&&Vt<500;gr+=Dr,Vt+=1)Es.push({price:Number(gr.toFixed(h)),qty:Number(_.toFixed(Rt))});return Es})(),trailing_down_grid_prices:(()=>{if(!(nn&&!Ue&&Number.isFinite(Fe)))return[];const Es=[];if(R==="geometric"&&Ur&&Ur>0){let gr=bt.price/Ur,Vt=0;for(;gr>=Fe-1e-12&&Vt<500;)Es.push({price:Number(gr.toFixed(h)),qty:Number(_.toFixed(Rt))}),gr/=Ur,Vt+=1}else if(Dr&&Dr>0)for(let gr=bt.price-Dr,Vt=0;gr>=Fe-1e-12&&Vt<500;gr-=Dr,Vt+=1)Es.push({price:Number(gr.toFixed(h)),qty:Number(_.toFixed(Rt))});return Es})(),investment:{collateral:Cn,collateralUsed:Yn,percentChosen:z,leverage:Rn,totalInvestment:Yn,qtyPerOrder:ls},liquidationPrices:{long:ce?Number(ce.toFixed(2)):null,short:ue?Number(ue.toFixed(2)):null},trailing_up:Kt&&!Ce?Number(qe.toFixed(h)):null,trailing_down:nn&&!Ue?Number(Fe.toFixed(h)):null,sl_up:zn&&!Be?Number(at.toFixed(h)):null,sl_down:on&&!_e?Number(se.toFixed(h)):null,marginMode:"Cross",currentPrice:Oe||null,timestamp:new Date().toISOString()},Ks={address:window.localStorage.getItem("hyperAddress"),token:Cr,wallet_id:Number(xe.id),source_market:"extended",bot_params:Jr,coin:String(e||"").toUpperCase()};oe(!0);try{const gr=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/extended_bot/save/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ks)})).json().catch(()=>null);if(!(gr&&(gr.success===!0||gr.status==="ok"||gr.status==="success"))){const de=gr&&(gr.error_message||gr.message||gr.detail)||"Grid bot failed to start.";tn.error(de);return}re(!0),typeof window<"u"&&window.dispatchEvent(new CustomEvent("gridbotUpdated",{detail:{sourceMarket:"extended"}})),tn.success("Grid bot started.")}catch{tn.error("An error occurred while starting the grid bot.")}finally{oe(!1)}},mn=async()=>{if(typeof window>"u"||!(xe!=null&&xe.address)||!(xe!=null&&xe.id))return;const Je=window.localStorage.getItem("hyperToken");if(!Je)return;HX(e);const bt={address:window.localStorage.getItem("hyperAddress"),token:Je,wallet_id:Number(xe.id),source_market:"extended",coin:String(e||"").toUpperCase()};oe(!0);try{const er=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/extended_bot/stop/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(bt)})).json().catch(()=>null);if(!(er&&(er.success===!0||er.status==="ok"||er.status==="success"))){const Dr=er&&(er.error_message||er.message||er.detail)||"Grid bot could not be stopped.";tn.error(Dr);return}re(!1),ae(10),typeof window<"u"&&window.dispatchEvent(new CustomEvent("gridbotUpdated",{detail:{sourceMarket:"extended"}})),tn.success("Grid bot has been stopped.")}catch{tn.error("An error occurred while stopping the grid bot.")}finally{oe(!1)}},ir=()=>{Ge&&(K?mn():we(!0))},Sn=async()=>{Tt&&(we(!1),await Nn())},Bn=ie?K?"Stopping...":"Starting...":K?"Stop":ct?`Stopping ${te}s`:"Start",rr=["xyz","vntl","flx"].includes(HX(e))?"Isolated":"Cross",ur=Kt&&!Ce,_r=nn&&!Ue,Un=zn&&!Be,Ln=on&&!_e,Kn=[{key:"neutral",label:"Neutral",activeClass:"bg-[#E6E6E6] text-[#101010] border-[#E6E6E6]"},{key:"short",label:"Short Only",activeClass:"bg-[#FF7173] text-[#0f151a] border-[#FF7173]"},{key:"long",label:"Long Only",activeClass:"bg-[#67FFBD] text-[#0f151a] border-[#67FFBD]"}];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(yT,{wallets:nt,mode:"extended",value:xe&&xe.id?String(xe.id):"",onChange:Je=>{const bt=(nt||[]).find(Tn=>String(Tn.wallet_id)===String(Je))||null;if(bt){const Tn={id:bt.wallet_id,address:bt.wallet_address,apiKey:bt.wallet_api_key};ye(Tn),typeof s=="function"&&s({id:String(Tn.id),address:Tn.address,apiKey:Tn.apiKey})}},selectedBalance:Vn})]}),i.jsxs("section",{className:"space-y-2",children:[i.jsx("span",{className:"text-xs text-white/70",children:"Grid Mode"}),i.jsx("div",{className:"grid grid-cols-3 gap-2",children:Kn.map(Je=>{const bt=c===Je.key;return i.jsx("button",{type:"button",onClick:()=>{At||u(Je.key)},disabled:At,"aria-pressed":bt,className:`h-8 rounded-lg border text-[11px] font-semibold transition-colors ${At?"opacity-60 cursor-not-allowed":"cursor-pointer"} ${bt?Je.activeClass:"bg-[#161616] text-white/60 border-[#292929] hover:text-white"}`,children:Je.label},Je.key)})})]}),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:At,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:d,onChange:Je=>{At||f(Je.target.value)},className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"0",inputMode:"decimal",disabled:At})})]}),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:x,onChange:Je=>{At||g(Je.target.value)},className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"0",inputMode:"decimal",disabled:At})})]})]}),Dt>0&&i.jsxs("div",{className:"text-[11px] text-white/40",children:["Mark Price: ",Dt.toFixed(Ee)]}),ge&&i.jsx("div",{className:"text-[11px] text-[#FF7173]",children:ge})]}),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:C,onChange:Je=>{if(At)return;const bt=Je.target.value.replace(/[^\d]/g,"");if(N(bt),I(""),bt==="")return;const Tn=Number(bt);if(Number.isFinite(Tn)){if(Tn<2){I("The minimum number of grids must be 2.");return}if(Tn>200){I("The maximum number of grids is 200.");return}if(Tn%2!==0){I("The number of grids must be even.");return}w(Tn)}},className:"bg-transparent outline-none flex-1 text-[13px]",inputMode:"numeric",disabled:At})}),i.jsx("div",{className:"relative",children:i.jsx("select",{value:R,onChange:Je=>{At||O(Je.target.value)},className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 text-[12px] outline-none",disabled:At,children:Jmn.map(Je=>i.jsx("option",{value:Je,className:"bg-[#101010]",children:Je[0].toUpperCase()+Je.slice(1)},Je))})})]}),i.jsx("div",{className:"text-[11px] text-white/40",children:P&&i.jsx("div",{className:"text-[11px] text-[#FF7173] mt-1",children:P})})]}),(c==="short"||c==="long")&&i.jsx("section",{className:"space-y-2",children:i.jsx("div",{className:"flex items-center gap-3 h-8 min-w-0",children:i.jsx(xi,{content:"Enable [Open a position on creation] to automatically open a position at market price when the grid is created.",children:i.jsxs("label",{className:"flex items-center gap-2 shrink-0 w-24",children:[i.jsx("input",{type:"checkbox",checked:!0,className:"accent-[#67FFBD]"}),i.jsx("span",{className:"text-[11px] select-none text-white/80 min-w-max",children:"Open a position on creation"})]})})})}),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:U,onChange:Je=>jt(Je.target.value),className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"USDC",inputMode:"decimal",disabled:At}),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(y4,{onClick:G&&G>0&&!At?()=>Ne(!0):void 0,children:G&&G>0?`${Rn}x`:"--"})})]}),i.jsxs("div",{className:"flex items-center gap-3 !mt-4 pb-6",children:[i.jsx(XN,{value:z,onChange:Je=>it(Je),accent:"#67FFBD"}),i.jsxs("div",{className:"h-[30px] rounded-lg flex items-center px-2",style:{width:84,background:Po,border:`1px solid ${Ma}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right text-xs",inputMode:"numeric",value:z,onChange:Je=>it(Math.max(0,Math.min(100,Number(Je.target.value)||0))),style:{color:Di,fontFeatureSettings:'"tnum"'},disabled:At}),i.jsx("span",{style:{color:vi},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,": ",`${G}x`]}),i.jsxs("span",{children:["Total:"," ",en>0?`${en.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:"," ",_>0?`${_} ${e}`:"--"]}),i.jsxs("span",{children:["Margin Mode: ",rr]})]})]}),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:ce?`$${ce.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:ue?`$${ue.toLocaleString(void 0,{maximumFractionDigits:2})}`:"--"})]}),ze?i.jsx(Jp,{onClick:()=>typeof o=="function"?o(!0):null}):i.jsx("button",{type:"button",onClick:ir,disabled:!Ge,className:`w-full h-[32px] rounded-xl font-bold text-[13px] flex items-center justify-center transition-opacity ${Ge?K?"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:Bn}),T&&i.jsxs("div",{className:"mt-2 text-[11px] text-[#FF7173] text-center",children:["Quantity per order is below min size (",p," ",e,")."]}),B,ee&&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."}),ft&&i.jsx("div",{className:"mt-2 text-[11px] text-[#FF7173] text-center",children:"Fix trailing/SL input errors to start."})]})]})]}),i.jsx(Jh,{open:fe,onClose:()=>Ne(!1),children:i.jsxs(dm,{title:"Adjust Leverage",children:[i.jsxs("div",{className:"text-[12px] leading-5 mb-3",style:{color:vi},children:["Control the leverage used for ",e," grid bot positions. The maximum leverage is ",G,"x."]}),i.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[i.jsx("input",{type:"range",min:1,max:G||1,step:1,value:ne,onChange:Je=>J(Math.max(1,Math.min(G||1,Number(Je.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:Po,border:`1px solid ${Ma}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right text-white",inputMode:"numeric",value:ne,onChange:Je=>{const bt=Number(Je.target.value)||1,Tn=Math.max(1,Math.min(G||1,bt));J(Tn)}}),i.jsx("span",{className:"text-[11px] text-white/40 ml-1",children:"x"})]})]}),i.jsx(F0,{onClick:()=>Ne(!1),children:"Confirm"})]})}),i.jsx(Jh,{open:me,onClose:()=>we(!1),children:i.jsxs(dm,{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:rr}),i.jsxs("span",{className:"px-2 py-0.5 rounded-full bg-[#FF71731a] text-[#FF7173]",children:["Leverage ",Rn,"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:vi},children:"Price Range"}),i.jsx("div",{className:"font-medium",style:{color:Di},children:Number.isFinite(Number(d))&&Number.isFinite(Number(x))?`${Number(d).toFixed(h)} - ${Number(x).toFixed(h)} USDC`:"--"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:vi},children:"Number of Grids"}),i.jsx("div",{className:"font-medium",style:{color:Di},children:In||"--"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:vi},children:"Mode"}),i.jsx("div",{className:"font-medium",style:{color:Di},children:R==="geometric"?"Geometric":"Arithmetic"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:vi},children:"Qty Per Order"}),i.jsx("div",{className:"font-medium",style:{color:Di},children:_>0?`${_} ${e}`:"--"})]}),ur&&i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:vi},children:"Trailing Up"}),i.jsxs("div",{className:"font-medium",style:{color:Di},children:[Number(Ke).toFixed(h)," USDC"]})]}),_r&&i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:vi},children:"Trailing Down"}),i.jsxs("div",{className:"font-medium",style:{color:Di},children:[Number(et).toFixed(h)," USDC"]})]}),Un&&i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:vi},children:"SL Up"}),i.jsxs("div",{className:"font-medium",style:{color:Di},children:[Number(Le).toFixed(h)," USDC"]})]}),Ln&&i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:vi},children:"SL Down"}),i.jsxs("div",{className:"font-medium",style:{color:Di},children:[Number(ht).toFixed(h)," USDC"]})]})]}),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:Di},children:"Total Investment"}),i.jsx("span",{className:"font-semibold text-[#67FFBD]",children:en>0?`${en.toFixed(2)} USDC`:"--"})]})}),i.jsx("div",{className:"mt-4",children:i.jsx(F0,{onClick:Sn,disabled:ie,children:ie?"Starting...":"Confirm"})})]})})]})}const QN="/assets/fee-animation-Cvx53PQy.mp4",i0n="wss://mainnet.zklighter.elliot.ai/stream",a0n="https://api.hyperliquid.xyz/info",tD=e=>e==null?0:Number(e),nD=(e,t=6)=>isNaN(e)?"--":e.toLocaleString(void 0,{maximumFractionDigits:t}),o0n=(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})},l0n=e=>{if(e>=1)return e.toLocaleString();const t=Math.min(8,Math.max(0,-Math.floor(Math.log10(e))));return e.toFixed(t)},c0n={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}}},u0n=e=>{if(!e)return null;const t=String(e).toUpperCase(),n=c0n[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 d0n(e){var o;const n=await fetch(a0n,{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 f0n(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 h0n(e){const t=e.toFixed(18).replace(/0+$/g,"").replace(/\.$/,""),n=Number(t);return Number.isFinite(n)?n:0}function p0n(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(h0n),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 RSe(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 m0n(e){if(!e)return[];const t=String(e).trim(),n=u0n(t);if(n&&n.length)return n;const r=t.toUpperCase();try{const s=await d0n(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=f0n(s);let c=p0n(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:RSe(t)}catch(s){return console.error("getUiStepsForCoin error",t,s),RSe(t)}}function LSe(e,t,n){const r=new Map;for(const s of e||[]){const a=tD(s.px),o=tD(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 x0n({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,P]=m.useState([]),I=(oe,G)=>g==="USD"?oe*G:oe,R=g==="USD"?"USD":t?String(t):"COIN";m.useEffect(()=>(d.current=!0,()=>{d.current=!1}),[]);const O=()=>{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),te=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:te})}))},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(i0n);a.current=V,V.onopen=()=>{l.current=0;const te={type:"subscribe",channel:`order_book/${String(oe)}`};try{V.send(JSON.stringify(te))}catch{}},V.onmessage=te=>{let ae;try{ae=JSON.parse(te.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 Ne=ae.order_book;if(!Ne)return;let me=c.current;(!me||typeof me!="object")&&(me={bids:new Map,asks:new Map},c.current=me),me.bids instanceof Map||(me.bids=new Map),me.asks instanceof Map||(me.asks=new Map);const we=(xe,ye)=>{const je=Array.isArray(Ne[xe])?Ne[xe]:[];if(je.length)for(const Pe of je){const Re=Number(Pe.price),Xe=Number(Pe.size);Number.isFinite(Re)&&(!Number.isFinite(Xe)||Xe<=0?ye.delete(Re):ye.set(Re,Xe))}};we("bids",me.bids),we("asks",me.asks),O()},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:[]}),P([]),C(null),e==null)return;U(e);let oe=!1;return(async()=>{const G=await m0n(t||"");oe||(P(G),C(G[0]??null))})(),()=>{oe=!0}},[e,t]);const L=m.useMemo(()=>(f.bids||[]).map(oe=>tD(oe.px)).filter(oe=>Number.isFinite(oe)&&oe>0),[f]),z=m.useMemo(()=>(f.asks||[]).map(oe=>tD(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=LSe(f.bids,oe,"bid").sort((te,ae)=>ae.price-te.price),V=LSe(f.asks,oe,"ask").sort((te,ae)=>te.price-ae.price);return{bids:G,asksAsc:V}},[f,w]),K=m.useMemo(()=>{const oe=J.asksAsc.slice(0,n);let G=0;return oe.map(te=>(G+=I(te.size,te.price),{...te,total:G})).reverse()},[J,n,g]),re=m.useMemo(()=>{const oe=J.bids.slice(0,n);let G=0;return oe.map(V=>(G+=I(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]),Q=Math.max(K.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(BSe,{value:String(w??""),onChange:oe=>C(Number(oe)),items:(N||[]).map(oe=>({key:String(oe),label:l0n(oe)}))}),i.jsx(BSe,{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:[K.map((oe,G)=>i.jsx(DSe,{side:"ask",step:Number(w)||1,price:oe.price,size:oe.size!=null?I(oe.size,oe.price):null,total:oe.total,widthPct:oe.total?Math.min(100,oe.total/Q*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?nD(he.diff,4):"--"}),i.jsx("span",{className:"text-right",children:he?`${nD(he.pct,4)}%`:"--"})]}),re.map((oe,G)=>i.jsx(DSe,{side:"bid",step:Number(w)||1,price:oe.price,size:oe.size!=null?I(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 DSe({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?"—":o0n(t,o)}),i.jsx("span",{className:"text-center text-[#dcdada] hover:text-white",children:c?"—":nD(n,f?0:6)}),i.jsx("span",{className:"text-right text-[#a8a8a8] hover:text-white",children:c?"—":nD(r,f?0:6)})]})]})}function BSe({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 Ju=e=>{const t=Number(e);return Number.isFinite(t)?t:0},$Se=(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})},USe=(e,t=6)=>isNaN(e)?"--":e.toLocaleString(void 0,{maximumFractionDigits:t}),g0n=(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})},b0n=e=>{if(e>=1)return e.toLocaleString();const t=Math.min(8,Math.max(0,-Math.floor(Math.log10(e))));return e.toFixed(t)},y0n={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}}},v0n=e=>{if(!e)return null;const t=String(e).toUpperCase(),n=y0n[t];return n?Object.values(n).map(s=>s.value).filter(s=>Number.isFinite(s)&&s>0).sort((s,a)=>s-a):null};function w0n(e){const t=e.toFixed(18).replace(/0+$/g,"").replace(/\.$/,""),n=Number(t);return Number.isFinite(n)?n:0}function C0n(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(w0n),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 zSe(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 S0n(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 N0n(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 A0n({apiBaseUrl:e,market:t,baseSymbol:n}){var s,a,o,l;const r=v0n(n);if(r&&r.length)return r;try{const c=await S0n(e,t),u=Ju((s=c==null?void 0:c.tradingConfig)==null?void 0:s.minPriceChange),d=Ju((a=c==null?void 0:c.marketStats)==null?void 0:a.lastPrice)||Ju((o=c==null?void 0:c.marketStats)==null?void 0:o.askPrice)||Ju((l=c==null?void 0:c.marketStats)==null?void 0:l.bidPrice);let f=C0n(d,u);return f=Array.from(new Set(f.filter(x=>Number.isFinite(x)&&x>0))).sort((x,g)=>x-g),f.length?f:zSe(n)}catch{return zSe(n)}}function HSe(e,t,n){const r=new Map;for(const s of e||[]){const a=Ju(s.px),o=Ju(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 j0n({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 Ne;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,P]=m.useState("COIN"),[I,R]=m.useState(null),[O,U]=m.useState([]),L=(me,we)=>N==="USD"?me*we:me,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 me=x.current;if(!((me==null?void 0:me.bids)instanceof Map)||!((me==null?void 0:me.asks)instanceof Map))return;const we=1024,xe=Array.from(me.bids.entries()).map(([je,Pe])=>({px:je,sz:Pe})).sort((je,Pe)=>Pe.px-je.px).slice(0,we),ye=Array.from(me.asks.entries()).map(([je,Pe])=>({px:je,sz:Pe})).sort((je,Pe)=>je.px-Pe.px).slice(0,we);C({bids:xe,asks:ye})}))},ne=(me,we)=>{const xe=x.current||{bids:new Map,asks:new Map};xe.bids=new Map,xe.asks=new Map,x.current=xe;for(const ye of me||[]){const je=Ju((ye==null?void 0:ye.p)??(ye==null?void 0:ye.price)),Pe=Ju((ye==null?void 0:ye.q)??(ye==null?void 0:ye.qty));if(!je||!Number.isFinite(Pe)||Pe<=1e-8)continue;const Re=Number(Pe.toFixed(12));Re>1e-8&&xe.bids.set(je,Re)}for(const ye of we||[]){const je=Ju((ye==null?void 0:ye.p)??(ye==null?void 0:ye.price)),Pe=Ju((ye==null?void 0:ye.q)??(ye==null?void 0:ye.qty));if(!je||!Number.isFinite(Pe)||Pe<=1e-8)continue;const Re=Number(Pe.toFixed(12));Re>1e-8&&xe.asks.set(je,Re)}},J=(me,we)=>{for(const xe of me||[]){const ye=Ju(xe==null?void 0:xe.p),je=Ju(xe==null?void 0:xe.q);if(!ye||!Number.isFinite(je)||je===0)continue;const Re=Ju(we.get(ye)||0)+je;if(Math.abs(Re)<=1e-8)we.delete(ye);else{const Xe=Number(Re.toFixed(12));Xe<=0?we.delete(ye):we.set(ye,Xe)}}},K=me=>{if(!me)return;const we=c.current;if(we&&(we.readyState===WebSocket.OPEN||we.readyState===WebSocket.CONNECTING))return;const xe=`${o}/stream.extended.exchange/v1/orderbooks/${encodeURIComponent(me)}`,ye=new WebSocket(xe);c.current=ye,ye.onopen=()=>{d.current=0,f.current=null},ye.onmessage=je=>{let Pe;try{Pe=JSON.parse(je.data||"{}")}catch{return}const Re=Number(Pe==null?void 0:Pe.seq);if(Number.isFinite(Re)){const $e=f.current;if($e!=null&&Re!==$e+1){try{ye.close()}catch{}return}f.current=Re}const Xe=String((Pe==null?void 0:Pe.type)||"").toUpperCase(),Ke=Pe==null?void 0:Pe.data;if(!Ke)return;const ut=Array.isArray(Ke)?Ke.find($e=>String($e==null?void 0:$e.m)===String(me)):Ke;if(!ut||String(ut==null?void 0:ut.m)!==String(me))return;const et=String((ut==null?void 0:ut.t)||Xe).toUpperCase(),tt=(ut==null?void 0:ut.b)||[],Le=(ut==null?void 0:ut.a)||[];if(et==="SNAPSHOT")ne(tt,Le);else if(et==="DELTA"){const $e=x.current;$e!=null&&$e.bids||($e.bids=new Map),$e!=null&&$e.asks||($e.asks=new Map),J(tt,$e.bids),J(Le,$e.asks)}else return;X()},ye.onclose=()=>{d.current=Math.min(d.current+1,6),!u.current&&(u.current=setTimeout(()=>{u.current=null,K(me)},500*Math.pow(2,d.current)))},ye.onerror=()=>{try{ye.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 me=!1;return(async()=>{try{const we=await N0n(a,e);if(me)return;ne(((we==null?void 0:we.bids)||[]).map(xe=>({price:xe.price,qty:xe.qty})),((we==null?void 0:we.asks)||[]).map(xe=>({price:xe.price,qty:xe.qty}))),X()}catch{}})(),K(e),(async()=>{const we=await A0n({apiBaseUrl:a,market:e,baseSymbol:t||e.split("-")[0]});me||(U(we),R(we[0]??null))})(),()=>{me=!0}},[e,t,a,o]);const re=m.useMemo(()=>(w.bids||[]).map(me=>Ju(me.px)).filter(me=>Number.isFinite(me)&&me>0),[w]),he=m.useMemo(()=>(w.asks||[]).map(me=>Ju(me.px)).filter(me=>Number.isFinite(me)&&me>0),[w]),Q=re.length?Math.max(...re):null,ie=he.length?Math.min(...he):null;m.useEffect(()=>{Q!=null&&ie!=null&&(s==null||s({bestBid:Q,bestAsk:ie,mid:(Q+ie)/2}))},[Q,ie,s]);const oe=m.useMemo(()=>{const me=Number(I)||1,we=HSe(w.bids,me,"bid").sort((ye,je)=>je.price-ye.price),xe=HSe(w.asks,me,"ask").sort((ye,je)=>ye.price-je.price);return{bids:we,asksAsc:xe}},[w,I]),G=m.useMemo(()=>{const me=oe.asksAsc.slice(0,n);let we=0;return me.map(ye=>(we+=L(ye.size,ye.price),{...ye,total:we})).reverse()},[oe,n,N]),V=m.useMemo(()=>{const me=oe.bids.slice(0,n);let we=0;return me.map(xe=>(we+=L(xe.size,xe.price),{...xe,total:we}))},[oe,n,N]),te=m.useMemo(()=>{if(Q==null||ie==null)return null;const me=Math.abs(ie-Q),we=(ie+Q)/2;return{diff:me,pct:we?me/we*100:0}},[Q,ie]),ae=Math.max(G.reduce((me,we)=>Math.max(me,we.total||0),0),1e-9),fe=Math.max(V.reduce((me,we)=>Math.max(me,we.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(WSe,{value:String(I??""),onChange:me=>R(Number(me)),items:(O||[]).map(me=>({key:String(me),label:b0n(me)}))}),i.jsx(WSe,{value:N,onChange:P,items:[{key:"USD",label:"USD"},{key:"COIN",label:t||((Ne=e==null?void 0:e.split("-"))==null?void 0:Ne[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((me,we)=>i.jsx(VSe,{side:"ask",step:Number(I)||1,price:me.price,size:me.size!=null?L(me.size,me.price):null,total:me.total,widthPct:me.total?Math.min(100,me.total/ae*100):0,onClick:()=>me.price!=null&&(r==null?void 0:r(me.price)),unit:N},`ask-${we}`)),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:te?USe(te.diff,4):"--"}),i.jsx("span",{className:"text-right",children:te?`${USe(te.pct,4)}%`:"--"})]}),V.map((me,we)=>i.jsx(VSe,{side:"bid",step:Number(I)||1,price:me.price,size:me.size!=null?L(me.size,me.price):null,total:me.total,widthPct:me.total?Math.min(100,me.total/fe*100):0,onClick:()=>me.price!=null&&(r==null?void 0:r(me.price)),unit:N},`bid-${we}`))]})})]})}function VSe({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?"—":g0n(t,o)}),i.jsx("span",{className:"text-center text-[#dcdada] hover:text-white",children:c?"—":$Se(n,x)}),i.jsx("span",{className:"text-right text-[#a8a8a8] hover:text-white",children:c?"—":$Se(r,x)})]})]})}function WSe({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 iF="#67FFBD",E0n={type:"spring",stiffness:260,damping:26,mass:1},ZHe=e=>{const t=Number(e);return Number.isFinite(t)?t:null},Jx=(...e)=>{for(const t of e){const n=ZHe(t);if(n!=null)return n}return null},_0n=e=>{const t=ZHe(e);return t==null?null:Math.abs(t)>1?t/100:t};function sj({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 aF({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(wo.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(wo.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:QN,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,preload:"auto",className:"w-full h-[260px] object-cover bg-black"},QN)]}),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:iF},children:"Early Access"}),i.jsxs("div",{className:"text-lg font-semibold",children:["Enter ",i.jsx("span",{style:{color:iF},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:iF},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:iF},children:a})]})]})]})]})}function k0n({data:e,loading:t,error:n,coin:r,setCoin:s,period:a,periods:o,handlePeriodChange:l}){var Qn,ar,hr,Gt,$n,nr;const c=Wo(),u=oc(),{exchange:d,coin:f}=t5(),{address:x,isConnected:g}=ts(),{setSignInConnectButtonOpen:v}=m.useContext(Qr),[w,C]=m.useState("single"),[N,P]=m.useState("BTC/ETH"),[I,R]=m.useState([]),[O,U]=m.useState(2),[L,z]=m.useState("1m"),[X,ne]=m.useState(null),[J,K]=m.useState(null),[re,he]=m.useState({}),[Q,ie]=m.useState({id:null,address:null}),[oe,G]=m.useState(!1),[V,te]=m.useState(!1),[ae,fe]=m.useState(()=>typeof window>"u"||window.location.hash==="#gridbot"?"grid":window.location.hash==="#trade"?"trade":"grid"),[Ne,me]=m.useState([]),[we,xe]=m.useState(()=>d==="lighter"?"lighter":d==="extended"?"extended":"hyperliquid"),[ye,je]=m.useState(()=>r||f||"BTC"),[Pe,Re]=m.useState(()=>d==="lighter"&&f||"BTC"),[Xe,Ke]=m.useState(()=>d==="extended"&&f||"BTC"),[ut,et]=m.useState(null),[tt,Le]=m.useState(!1),[$e,ht]=m.useState(null),[pt,Kt]=m.useState(!1),[wt,nn]=m.useState(null),[cn,zn]=m.useState(!1),[Xt,on]=m.useState({address:null,token:null}),[Zt,Ye]=m.useState(!1),[Ze,Ft]=m.useState(!1),[dn,Yt]=m.useState(!1),[Bt,ot]=m.useState(!1),[De,_t]=m.useState(""),[ze,nt]=m.useState(!1),[mt,$t]=m.useState(""),Pt=m.useRef(null),un=m.useRef(null),an=typeof window<"u"&&window.matchMedia("(max-width: 768px)").matches,xn=Rt=>z(Rt),An=gU(),kn=Sue(),yn=Nue(),Vn=we==="hyperliquid"?An:we==="lighter"?kn:yn,Gn=we==="hyperliquid"?!An.length:we==="lighter"?!kn.length:!yn.length,Rn=we==="hyperliquid"?ye:we==="lighter"?Pe:Xe,Yn=we==="hyperliquid"&&w==="pair"?N:Rn,Cn=we==="hyperliquid"&&w==="pair"&&N.split("/")[0]||ye,rn=m.useMemo(()=>we==="lighter"&&Rn?kn.find(Rt=>Rt.symbol===Rn):null,[we,kn,Rn]),Oe=(rn==null?void 0:rn.marketIndex)??(rn==null?void 0:rn.market_id)??(rn==null?void 0:rn.id)??((Qn=rn==null?void 0:rn.raw)==null?void 0:Qn.marketIndex)??((ar=rn==null?void 0:rn.raw)==null?void 0:ar.market_id)??((hr=rn==null?void 0:rn.raw)==null?void 0:hr.id)??null,Jt=m.useMemo(()=>{if(!Rn)return null;const Rt=String(Rn||"").toUpperCase(),En=Rt.replace(/-USD$/,"");return yn.find(Ee=>{const h=String((Ee==null?void 0:Ee.symbol)||"").toUpperCase(),p=String((Ee==null?void 0:Ee.rawSymbol)||"").toUpperCase();return h===Rt||p===Rt||h===En||p===En})||null},[yn,Rn]),sn=m.useMemo(()=>{if(Jt!=null&&Jt.rawSymbol)return Jt.rawSymbol;if(!Rn)return"";const Rt=String(Rn||"").toUpperCase();return Rt.includes("-")?Rt:`${Rt}-USD`},[Jt,Rn]),Et=m.useMemo(()=>Jt!=null&&Jt.symbol?Jt.symbol:Rn?String(Rn||"").toUpperCase().replace(/-USD$/,"").replace(/\/USD$/,""):"",[Jt,Rn]),Xn=m.useMemo(()=>{const Rt=(Jt==null?void 0:Jt.lastPrice)??(Jt==null?void 0:Jt.last);if(Rt!=null&&Number.isFinite(Number(Rt)))return Number(Rt);const En=Jt==null?void 0:Jt.marketStats,Ee=(En==null?void 0:En.lastPrice)??(En==null?void 0:En.markPrice)??(Jt==null?void 0:Jt.markPrice)??null;return Ee!=null&&Number.isFinite(Number(Ee))?Number(Ee):null},[Jt]);m.useEffect(()=>{u.hash==="#gridbot"?fe("grid"):u.hash==="#trade"?fe("trade"):u.hash||fe("grid")},[u.hash]),m.useEffect(()=>{d==="lighter"&&we!=="lighter"?xe("lighter"):d==="hyperliquid"&&we!=="hyperliquid"?xe("hyperliquid"):d==="extended"&&we!=="extended"&&xe("extended")},[d,we]),m.useEffect(()=>{d==="hyperliquid"?f&&f!==ye&&(je(f),s(f)):d==="lighter"?f&&f!==Pe&&Re(f):d==="extended"&&f&&f!==Xe&&Ke(f)},[d,f,ye,Pe,Xe,s]),m.useEffect(()=>{const Rt=()=>{if(typeof window>"u")return;const En=window.localStorage.getItem("hyperAddress"),Ee=window.localStorage.getItem("hyperToken");on({address:En,token:Ee})};return Rt(),window.addEventListener("localStorageUpdated",Rt),window.addEventListener("storage",Rt),()=>{window.removeEventListener("localStorageUpdated",Rt),window.removeEventListener("storage",Rt)}},[]);const gn=m.useMemo(()=>!Xt.address||!Xt.token?!1:an?!0:x?Xt.address.toLowerCase()===x.toLowerCase():!1,[Xt.address,Xt.token,x,an]);m.useEffect(()=>{if(!gn){Ye(!1),Ft(!1),Yt(!1),ot(!1),_t(""),$t("");return}if(Zt)return;let Rt=!1;return(async()=>{if(typeof window>"u")return;const Ee=window.localStorage.getItem("hyperToken"),h=window.localStorage.getItem("hyperAddress");if(!Ee||!h){Rt||(Ye(!0),Ft(!1),Yt(!1));return}ot(!0);try{const p=await _i(h.toLowerCase(),Ee);if(Rt)return;const S=(p==null?void 0:p.data)||p||{},_=(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),Yt(!T),Ye(!0)}catch{Rt||(Ft(!1),Yt(!1),Ye(!0))}finally{Rt||ot(!1)}})(),()=>{Rt=!0}},[gn,Zt]),m.useEffect(()=>{gn&&Ye(!1)},[we,gn]),m.useEffect(()=>{(we!=="lighter"||ae!=="grid")&&(_t(""),$t(""))},[we,ae]);const Dt=async()=>{var Rt,En,Ee,h;if(!De.trim()){tn.error("Please enter your alpha code");return}if(!Xt.address||!Xt.token){tn.error("Please sign in again");return}nt(!0),$t("");try{const p={address:Xt.address.toLowerCase(),token:Xt.token,alpha_code:De.trim(),source_market:we==="hyperliquid"?"hyper":"lighter",app_type:"grid_bot"},_=(await hs.post("https://dextrabothypev2.nftinit.io/api/subscriber/alpha_code/set/",p)).data||{};if(_.success){const k=_.message||"Alpha code added successfully";tn.success(k),$t(k),we==="hyperliquid"?Ft(!1):we==="lighter"&&Yt(!1),Ye(!0)}else{const k=_.error_message||_.message||"This alpha code is invalid";tn.error(k),$t(k)}}catch(p){const S=((En=(Rt=p==null?void 0:p.response)==null?void 0:Rt.data)==null?void 0:En.error_message)||((h=(Ee=p==null?void 0:p.response)==null?void 0:Ee.data)==null?void 0:h.message)||p.message||"Failed to validate alpha code";tn.error(S),$t(S)}finally{nt(!1)}};m.useEffect(()=>{we==="hyperliquid"?s(ye):we==="lighter"?!Pe&&kn.length>0&&Re(kn[0].symbol):we==="extended"&&!Xe&&yn.length>0&&Ke(yn[0].symbol)},[we,ye,Pe,Xe,kn,yn,s]),m.useEffect(()=>{if(we!=="extended"||!yn.length)return;const Rt=yn.some(En=>En.symbol===Xe);(!Xe||!Rt)&&Ke(yn[0].symbol)},[we,Xe,yn]),m.useEffect(()=>{if(!x){if(an&&Xt.address){ie(Rt=>Rt.address&&Rt.address.toLowerCase()===Xt.address.toLowerCase()?Rt:{id:null,address:Xt.address});return}ie(Rt=>Rt.address?{id:null,address:null}:Rt);return}ie(Rt=>Rt.address&&Rt.address.toLowerCase()===x.toLowerCase()?Rt:{id:null,address:x})},[x,Xt.address,an]),m.useEffect(()=>{if(we!=="hyperliquid"){if(Pt.current){try{Pt.current.close()}catch{}Pt.current=null}R([]),un.current=null;return}if(!Cn)return;const Rt=(En,Ee)=>{if(En)try{En.readyState===WebSocket.OPEN&&En.send(JSON.stringify(Ee))}catch(h){console.error("activeAssetCtx ws send error",h)}};if(Pt.current){const En=Pt.current;un.current&&un.current!==Cn&&Rt(En,{method:"unsubscribe",subscription:{type:"activeAssetCtx",coin:un.current}}),Rt(En,{method:"subscribe",subscription:{type:"activeAssetCtx",coin:Cn}})}else{const En=new WebSocket("wss://api-ui.hyperliquid.xyz/ws");Pt.current=En,En.onopen=()=>{Rt(En,{method:"subscribe",subscription:{type:"activeAssetCtx",coin:Cn}})},En.onmessage=Ee=>{var p;let h;try{h=JSON.parse(Ee.data)}catch(S){console.error("activeAssetCtx ws parse error",S);return}(p=h==null?void 0:h.data)!=null&&p.ctx&&R({...h.data.ctx,source:"hyperliquid"})},En.onclose=()=>{Pt.current===En&&(Pt.current=null)},En.onerror=Ee=>{console.error("activeAssetCtx ws error",Ee)}}un.current=Cn},[Cn,we]),m.useEffect(()=>()=>{Pt.current&&(Pt.current.close(),Pt.current=null)},[]),m.useEffect(()=>{if(we!=="lighter")return;if(!Rn){R([]);return}const Rt=kn.find(k=>k.symbol===Rn);if(!Rt||!Rt.raw){R([]);return}const En=Rt.raw,Ee=Number(En.last_trade_price??0)||0,h=Number(En.daily_price_change??0)||0,p=Number(En.daily_quote_token_volume??0)||0,S=Number(En.open_interest??0)||0,_=h&&Ee?Ee/(1+h/100):Ee;R({markPx:Ee,oraclePx:Ee,prevDayPx:_,dayNtlVlm:p,openInterest:S,funding:0,source:"lighter"})},[we,Rn,kn]),m.useEffect(()=>{if(we!=="extended")return;if(!Jt){R([]);return}const Rt=Jt.marketStats||{},En=Jx(Rt.markPrice,Rt.lastPrice,Rt.indexPrice,Jt.markPrice,Jt.lastPrice,Jt.last),Ee=Jx(Rt.indexPrice,Rt.markPrice,Rt.lastPrice,Jt.indexPrice,En),h=Jx(Rt.dailyPriceChange,Jt.dailyPriceChange),p=Jx(Rt.dailyPriceChangePercentage,Jt.dailyPriceChangePercentage,Jt.change24hPct,Jt.chg24),S=_0n(p);let _=null;if(En!=null){if(h!=null){const ue=En-h;Number.isFinite(ue)&&ue>0&&(_=ue)}if(_==null&&S!=null){const ue=1+S;if(Number.isFinite(ue)&&ue!==0){const ge=En/ue;Number.isFinite(ge)&&ge>0&&(_=ge)}}}const k=Jx(Rt.dailyVolume,Jt.volume,Jt.vol),T=Jx(Rt.openInterestBase,Jt.openInterestBase),B=Jx(Rt.openInterest,Jt.openInterestUsd,Jt.openInterest);let W=T;W==null&&B!=null&&Ee!=null&&Ee>0&&(W=B/Ee);const ee=Jx(Rt.fundingRate,Jt.fundingRate,Jt.funding),ce=Jx(Rt.nextFundingRate,Jt.nextFundingRate);R({markPx:En,oraclePx:Ee,prevDayPx:_,dayNtlVlm:k,openInterest:W,funding:ee,nextFundingTime:ce,source:"extended"})},[we,Jt]),m.useEffect(()=>{we==="hyperliquid"&&me([])},[we]),m.useEffect(()=>{we==="lighter"&&(ne(null),K(null))},[we]),m.useEffect(()=>{if(we!=="lighter"){et(null);return}if(!g||!x){et(null);return}let Rt=!1;return(async()=>{if(typeof window>"u")return;const Ee=Xt.address,h=Xt.token;if(!Ee||!h){Rt||et(null);return}if(Ee.toLowerCase()!==x.toLowerCase()){Rt||et(null);return}Le(!0);try{const p=await hs.post("https://dextrabothypev2.nftinit.io/api/wallet/list-lighter",{address:Ee,token:h});if(Rt)return;const S=p.data;let _=[];if(Array.isArray(S)?_=S:S&&Array.isArray(S.data)?_=S.data:S&&S.wallet_id!=null&&(_=[S]),!_.length)et(null);else{const k=_[0],T={id:k.wallet_id,address:k.wallet_address,name:k.wallet_name};et(T),ie({id:T.id,address:T.address})}}catch{Rt||et(null)}finally{Rt||Le(!1)}})(),()=>{Rt=!0}},[we,g,x,Xt.address,Xt.token]),m.useEffect(()=>{if(we!=="extended"){ht(null);return}const Rt=Xt.address,En=Xt.token;if(!Rt||!En){ht(null);return}if(!an&&x&&Rt.toLowerCase()!==x.toLowerCase()){ht(null);return}let Ee=!1;return(async()=>{Kt(!0);try{const p=await hs.post("https://dextrabothypev2.nftinit.io/api/wallet/list-extended",{address:Rt,token:En});if(Ee)return;const S=p.data;let _=[];if(Array.isArray(S)?_=S:S&&Array.isArray(S.data)?_=S.data:S&&S.wallet_id!=null&&(_=[S]),!_.length)ht(null);else{const k=_[0],T={id:k.wallet_id,address:k.wallet_address,name:k.wallet_name};ht(T),ie({id:T.id,address:T.address})}}catch{Ee||ht(null)}finally{Ee||Kt(!1)}})(),()=>{Ee=!0}},[we,Xt.address,Xt.token,x,an]),m.useEffect(()=>{if(we!=="hyperliquid"){nn(null);return}if(!g||!x){nn(null);return}let Rt=!1;return(async()=>{if(typeof window>"u")return;const Ee=Xt.address,h=Xt.token;if(!Ee||!h){Rt||nn(null);return}if(Ee.toLowerCase()!==x.toLowerCase()){Rt||nn(null);return}zn(!0);try{const p=await hs.post("https://dextrabothypev2.nftinit.io/api/wallet/confirmed-list",{address:Ee,token:h});if(Rt)return;const S=p.data;let _=!1;Array.isArray(S)?_=S.length>0:S&&Array.isArray(S.data)?_=S.data.length>0:S&&S.wallet_id!=null&&(_=!0),nn(_)}catch{Rt||nn(null)}finally{Rt||zn(!1)}})(),()=>{Rt=!0}},[we,g,x,Xt.address,Xt.token]);const en=Rt=>{if(w==="pair")return;const En=ae==="grid"?"#gridbot":"#trade";we==="hyperliquid"?(je(Rt),s(Rt),c(`/terminal/hyperliquid/${Rt}${En}`)):we==="lighter"?(Re(Rt),c(`/terminal/lighter/${Rt}${En}`)):(Ke(Rt),c(`/terminal/extended/${Rt}${En}`))},In=()=>{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 Rt=ye||r||"BTC";fe("grid"),xe("hyperliquid"),c(`/terminal/hyperliquid/${Rt}#gridbot`)},className:`px-3 py-1 rounded-full transition mr-2 ${we==="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(up,{className:"w-4 h-4 text-[#fff] mr-1"}),i.jsx("button",{onClick:()=>{const Rt=Pe||"BTC";fe("grid"),xe("lighter"),c(`/terminal/lighter/${Rt}#gridbot`)},className:`px-3 py-1 rounded-full transition ${we==="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 Rt=Xe||"BTC";fe("grid"),xe("extended"),c(`/terminal/extended/${Rt}#gridbot`)},className:`px-3 py-1 rounded-full transition ${we==="extended"?"bg-white text-black":"text:white/60 text-white/60 hover:text-white"}`,children:"Extended"})]})]})}),i.jsx(wo.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(wo.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(Ffn,{coin:Rn,data:(Gt=e.position_info)==null?void 0:Gt[0],setIsDigits:U,headerData:I,active:L,onCoinChange:en,markets:Vn,marketsLoading:Gn,mode:w,pairKey:N,onPairChange:P})})}),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(wo.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(Xdn,{coin:Rn,data:($n=e.position_info)==null?void 0:$n[0],setIsDigits:U,headerData:I,handleClick:xn,active:L,onCoinChange:en,mode:w,pairKey:N,onPairChange:P,markets:Vn,market:we})}),i.jsx("div",{className:"flex-1 min-h-0",children:we==="hyperliquid"?i.jsx(NX,{coin:Yn,interval:L,walletAddress:Q==null?void 0:Q.address,gridLines:ae==="grid"?Ne:[],market:"hyperliquid"},`hl-${Yn}-${L}`):we==="lighter"?i.jsx(NX,{coin:Rn,interval:"1h",walletAddress:Q==null?void 0:Q.address,gridLines:ae==="grid"?Ne:[],market:"lighter",lighterMarketId:Oe},`lighter-${Rn}-${L}-${Oe||"x"}`):i.jsx(NX,{coin:Rn,interval:L,walletAddress:Q==null?void 0:Q.address,gridLines:ae==="grid"?Ne:[],market:"extended",extendedMarket:sn,extendedLastPrice:Xn},`extended-${Rn}-${L}-${sn||"x"}`)})]}),i.jsxs(wo.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"})})})}),we==="hyperliquid"?i.jsx(nhn,{className:"w-full xl:h-full xl:min-h-0 overflow-y-auto",coin:r,data:t?[]:(nr=e.position_info)==null?void 0:nr[0],loading:t,period:a,periods:o,handlePeriodChange:l,onBookPrice:Rt=>ne(Rt),onBest:({mid:Rt})=>K(Rt)}):we==="lighter"?Oe!=null?i.jsx(x0n,{marketId:Oe,baseSymbol:Rn,rows:10,onSelectPrice:Rt=>ne(Rt),onBest:({mid:Rt})=>K(Rt)}):i.jsx(sj,{title:"Lighter Order Book",subtitle:"Select a market to see the order book"}):i.jsx(j0n,{market:sn,baseSymbol:Et||Rn,rows:10,onSelectPrice:Rt=>ne(Rt),onBest:({mid:Rt})=>K(Rt)})]}),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(wo.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 Rt=we==="hyperliquid"?ye||r||"BTC":we==="lighter"?Pe||"BTC":Xe||"BTC";me([]),fe("trade"),c(`/terminal/${we}/${Rt}#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 Rt=we==="hyperliquid"?ye||r||"BTC":we==="lighter"?Pe||"BTC":Xe||"BTC";fe("grid"),c(`/terminal/${we}/${Rt}#gridbot`)},className:`px-3 py-1 rounded-full transition ${ae==="grid"?"bg-white text-black":"text-white/60 hover:text-white"}`,children:we==="hyperliquid"?"HL Grid Bot":we==="lighter"?"Lighter Grid Bot":"Extended Grid Bot"}),we==="extended"&&i.jsx("button",{onClick:In,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"?we==="hyperliquid"?i.jsx(gSe,{coin:r,midPrice:J,selectedPrice:X,maxLeverage:re[r]||25,wallet:Q,onWalletChange:ie,uiMode:w,pairKey:N},`trade-${Q.address}`):we==="lighter"?i.jsx("div",{className:"h-[260px]",children:i.jsx(sj,{title:"Lighter Perp Trading",subtitle:"Coming Soon"})}):i.jsx("div",{className:"h-[260px]",children:i.jsx(sj,{title:"Extended Perp Trading",subtitle:"Coming Soon"})}):we==="hyperliquid"?cn||Bt?i.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs text-white/60",children:"Loading Hyperliquid account…"}):gn?Ze?i.jsx(aF,{code:De,onCodeChange:_t,onSubmit:Dt,loading:ze,checking:Bt,message:mt}):wt===!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(FSe,{coin:Rn,midPrice:J,selectedPrice:X,wallet:Q,onWalletChange:ie,onLevelsChange:me}):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(Jp,{onClick:()=>v(!0)})})]}):we==="lighter"?tt||Bt?i.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs text-white/60 py-6",children:"Loading Lighter account…"}):gn?dn?i.jsx(aF,{code:De,onCodeChange:_t,onSubmit:Dt,loading:ze,checking:Bt,message:mt}):ut?i.jsx(ISe,{coin:Rn,midPrice:J,selectedPrice:X,wallet:Q,onLevelsChange:me}):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(Jp,{onClick:()=>v(!0)})})]}):pt?i.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs text-white/60 py-6",children:"Loading Extended account…"}):gn?$e?i.jsx(MSe,{coin:Rn,midPrice:J,selectedPrice:X,wallet:Q,onLevelsChange:me}):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(Jp,{onClick:()=>v(!0)})})]})})]}),we==="lighter"&&gn&&i.jsx(wo.div,{className:"xl:hidden bg-[#101010] border border-[#292929] rounded-[16px] overflow-hidden",children:i.jsx(IO,{walletAddress:Q==null?void 0:Q.address,sourceMarket:"lighter"})}),i.jsx(wo.div,{className:"h-[500px] bg-[#101010] border border-[#292929] overflow-hidden rounded-[16px]",children:we==="hyperliquid"?i.jsx(Fmn,{data:e.positions_list,loading:t,error:n,isDigits:O,period:a,periods:o,handlePeriodChange:l,className:"h-full",minHeight:"min-h-0",walletAddress:Q==null?void 0:Q.address,coin:r,sourceMarket:"hyper"},`tabs-${Q.address}`):we==="lighter"?gn?i.jsx(IO,{walletAddress:Q==null?void 0:Q.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(Jp,{onClick:()=>v(!0)})})]}):i.jsx(IO,{walletAddress:Q==null?void 0:Q.address,sourceMarket:"extended"})})]}),i.jsxs(wo.div,{animate:{width:V?28:350},transition:E0n,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:()=>te(!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 Rt=we==="hyperliquid"?ye||r||"BTC":we==="lighter"?Pe||"BTC":Xe||"BTC";fe("trade"),me([]),c(`/terminal/${we}/${Rt}#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 Rt=we==="hyperliquid"?ye||r||"BTC":we==="lighter"?Pe||"BTC":Xe||"BTC";fe("grid"),c(`/terminal/${we}/${Rt}#gridbot`)},className:`px-3 py-1 rounded-full transition ${ae==="grid"?"bg-white text-black":"text-white/60 hover:text-white"}`,children:"Grid Bot"}),we==="extended"&&i.jsx("button",{onClick:In,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"?we==="hyperliquid"?i.jsx(gSe,{coin:r,midPrice:J,selectedPrice:X,maxLeverage:re[r]||25,wallet:Q,onWalletChange:ie,uiMode:w,pairKey:N}):we==="lighter"?i.jsx(sj,{title:"Lighter Perp Trading",subtitle:"Coming Soon"}):i.jsx(sj,{title:"Extended Perp Trading",subtitle:"Coming Soon"}):we==="hyperliquid"?cn||Bt?i.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs text-white/60",children:"Loading Hyperliquid account…"}):gn?Ze?i.jsx(aF,{code:De,onCodeChange:_t,onSubmit:Dt,loading:ze,checking:Bt,message:mt}):wt===!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(FSe,{coin:Rn,midPrice:J,selectedPrice:X,wallet:Q,onWalletChange:ie,onLevelsChange:me}):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(Jp,{onClick:()=>v(!0)})})]}):we==="lighter"?tt||Bt?i.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs text-white/60",children:"Loading Lighter account…"}):gn?dn?i.jsx(aF,{code:De,onCodeChange:_t,onSubmit:Dt,loading:ze,checking:Bt,message:mt}):ut?i.jsx(ISe,{coin:Rn,midPrice:J,selectedPrice:X,wallet:Q,onLevelsChange:me}):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(Jp,{onClick:()=>v(!0)})})]}):pt?i.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs text-white/60",children:"Loading Extended account…"}):gn?$e?i.jsx(MSe,{coin:Rn,midPrice:J,selectedPrice:X,wallet:Q,onLevelsChange:me}):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(Jp,{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:()=>te(!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 T0n=()=>{ts();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(Qr),{coin:x}=t5(),[g,v]=m.useState(x||"BTC"),w=gU();function C(te){return te?te.includes(":")?te.split(":")[1]:te:""}function N(te){if(!te)return"";if(te.includes(":")){const[ae,fe]=te.split(":");return`${fe} (${ae})`}return te}const P=C(g),I=w.find(te=>te.symbol===`${P}-USD`||te.symbol===`${P}-USDH`||te.symbol===`${P}-USDC`),R=(I==null?void 0:I.last)??(I==null?void 0:I.coin),U=`${R?(te=>{if(te==null||!isFinite(te))return"";const ae=Number(te),fe=Math.abs(ae),Ne=fe>=1e3?0:fe>=1?2:fe>=.1?6:7,me=ae.toFixed(Ne);return Number(me).toLocaleString(void 0,{maximumFractionDigits:Ne})})(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,K]=m.useState(null);m.useEffect(()=>{const te=document.querySelector("main > div");return te&&(te.style.background="#050505"),()=>{te&&(te.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")),Q=!isNaN(he)&&re[he]?re[he].value:re[1].value,[ie,oe]=m.useState(Q),G=te=>{oe(Number(te)),localStorage.setItem("ticker_period",re.findIndex(ae=>ae.value===Number(te)).toFixed(0))},V=async({coin:te,period:ae})=>{try{ne(!0);const fe=`https://dextradata.nftinit.io/api/hyper/terminal/v2/${te}/${ae}`,Ne=await fetch(fe);if(!Ne.ok)throw z([]),new Error("Network response was not ok");const me=await Ne.json();me!=null&&me.success?(z(me),ne(!1),window.localStorage.getItem("hyperToken")&&(d(),f())):(z([]),ne(!1),K(me==null?void 0:me.error_message))}catch(fe){K(fe.message),ne(!1)}};return m.useEffect(()=>{g&&ie&&V({coin:g,period:ie})},[g,ie]),m.useEffect(()=>{(async()=>{var Ne,me;const ae=window.localStorage.getItem("hyperToken"),fe=window.localStorage.getItem("hyperAddress");if(!(!ae||!fe))try{const we=await _i(fe.toLowerCase(),ae);we!=null&&we.success?(e(we==null?void 0:we.telegram_chat_id),t(we==null?void 0:we.subscriber_role),n(we==null?void 0:we.subs_expire_day),r((Ne=we==null?void 0:we.mushboomer_counts)==null?void 0:Ne.eth),a((me=we==null?void 0:we.mushboomer_counts)==null?void 0:me.sol),o(we==null?void 0:we.referral_code),l(we==null?void 0:we.refcode),s(we==null?void 0:we.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),c(""),u(""))}catch(we){console.error("Token verification error:",we)}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(No,{children:i.jsxs(Lo,{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(k0n,{data:L,loading:X,error:J,coin:g,setCoin:v,period:ie,periods:re,handlePeriodChange:G})})})]})},I0n="https://dextradata.nftinit.io/api/hyper/whale_stats/v2/",Eh=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)}`},eg=e=>e==null?"-":`${Number(e).toFixed(1)}%`,oF=e=>`calc(${e}%)`;function P0n({onData:e}){const[t,n]=m.useState(null);if(m.useEffect(()=>{let l=null;const c=()=>hs.get(I0n).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:Fyt,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(xi,{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:_0,alt:"Dextrabot - Whale Trades"})]})}),i.jsx("div",{className:"text-[20px] leading-[21px] tracking-[-0.2px] font-semibold",children:Eh(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:oF(r)},children:eg(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:oF(s)},children:eg(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:Eh(t.long.position)}),i.jsxs("span",{className:"text-[#909090]",children:["(",eg(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:Eh(t.short.position)}),i.jsxs("span",{className:"text-[#909090]",children:["(",eg(s),")"]})]})]})]}),i.jsx("div",{className:"h-px w-full bg-[#262626]"}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(xi,{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:_0,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:Eh(t.total_margin)}),i.jsx(xi,{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:["(",eg(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(tse,{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(Dl,{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:oF(a)},children:eg(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:oF(o)},children:eg(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:Eh(t.long.margin)}),i.jsxs("span",{children:["(",eg(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:Eh(t.short.margin)}),i.jsxs("span",{children:["(",eg(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(xi,{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:_0,alt:"Dextrabot - Whale Trades"})]})}),i.jsx("div",{className:"text-[20px] leading-[21px] tracking-[-0.2px] font-semibold",children:Eh(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"," ",Eh(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"," ",Eh(t.short.pnl)]})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(xi,{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:_0,alt:"Dextrabot - Whale Trades"})]})}),i.jsx("div",{className:"text-[20px] leading-[21px] tracking-[-0.2px] font-semibold",children:Eh(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"," ",Eh(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"," ",Eh(t.short.funding)]})]})]})]})]})}const ed={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]"}},V_=[{id:1,...ed[1],description:"$0 – $250 — Low-value frequent trader"},{id:2,...ed[2],description:"$250 – $10K — Small but active trader"},{id:3,...ed[3],description:"$10K – $50K — Consistent mid-size trader"},{id:4,...ed[4],description:"$50K – $100K — Aggressive high-leverage trader"},{id:5,...ed[5],description:"$100K – $500K — Influential swing trader"},{id:6,...ed[6],description:"$500K – $1M — Market-moving whale"},{id:7,...ed[7],description:"$1M – $5M — Mega whale, highly impactful"},{id:8,...ed[8],description:"≥ $5M — Rare leviathan with massive positions"}],Aue=e=>{if(e==null)return ed[6];const t=Number(e);if(!isNaN(t)&&ed[t])return ed[t];const n=Object.values(ed).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(ed).find(a=>r(a.label)===r(e))||ed[6]},F0n="https://dextradata.nftinit.io/api/hyper/trade/highVolumeTrades/",O0n=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`},pC=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)}`},M0n=e=>e<250?1:e<1e4?2:e<5e4?3:e<1e5?4:e<5e5?5:e<1e6?6:e<5e6?7:8,qSe=e=>Aue(M0n(e)),GSe=()=>{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 hs.post(F0n,{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=qSe((x==null?void 0:x.global_account_value)??0);return o===((v=V_.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=qSe(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:sa,className:"w-5 h-5"}),g.coin]})},{key:"activity",label:"Activity",width:"140px",render:(x,g)=>{var R,O,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=(O=g==null?void 0:g.position_details)==null?void 0:O.position)==null?void 0:U.leverage)==null?void 0:L.value,P=g.side==="Change Position"?w?"Short > Long":"Long > Short":v??"Position Close",I=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:[I&&i.jsx(Fs,{className:`w-3 h-3 ${w?"rotate-180 text-[#67ffbd]":"text-[#ff787b]"}`}),P]}),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=>pC(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?pC(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?pC(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,P;const v=(P=(N=g==null?void 0:g.position_details)==null?void 0:N.position)==null?void 0:P.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)?"-":pC(Math.abs(v)),!isNaN(v)&&i.jsx("img",{src:w?aE:oE,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?`${pC(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,P;const v=parseFloat((P=(N=g==null?void 0:g.position_details)==null?void 0:N.position)==null?void 0:P.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)?"-":`${pC(Math.abs(v))}`,!isNaN(v)&&i.jsx("img",{src:w?aE:oE,className:"ml-[6px] w-[9px] h-[8px]",alt:""})]})}},{key:"flags",label:i.jsx(xi,{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="",P=null;return w===null?(N="bg-[#747474]",P=d8e):w===!0?(N="bg-[#67FFBD]",P=u8e):(N="bg-[#FF9C9C]",P=f8e),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(P,{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:O0n(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(xi,{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:_0,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"}),V_.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(xi,{content:w,children:v})},x)})]})})})]}),i.jsx("div",{className:"pt-2 bg-[#101010] rounded-[16px]",children:i.jsx(Lu,{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")})})]})})},l8=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)},JHe=(e,t)=>Math.floor(e/Math.pow(10,t)%10),hre=(e,t)=>!(JHe(e,t)%2),Au=(e,t,n)=>{const r=e%t;return n&&JHe(e,n)%2===0?-r:r},J3=(e,t,n)=>t[e%n],R0n=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"},L0n=4,ro=80;function D0n(e,t){const n=l8(e),r=t&&t.length;return Array.from({length:L0n},(s,a)=>({color:J3(n+a,t,r),translateX:Au(n*(a+1),ro/2-(a+17),1),translateY:Au(n*(a+1),ro/2-(a+17),2),rotate:Au(n*(a+1),360),isSquare:hre(n,2)}))}const KSe=({name:e,colors:t,title:n,square:r,size:s,...a})=>{const o=D0n(e,t),l=m.useId();return i.jsxs("svg",{viewBox:"0 0 "+ro+" "+ro,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:ro,height:ro,children:i.jsx("rect",{width:ro,height:ro,rx:r?void 0:ro*2,fill:"#FFFFFF"})}),i.jsxs("g",{mask:`url(#${l})`,children:[i.jsx("rect",{width:ro,height:ro,fill:o[0].color}),i.jsx("rect",{x:(ro-60)/2,y:(ro-20)/2,width:ro,height:o[1].isSquare?ro:ro/8,fill:o[1].color,transform:"translate("+o[1].translateX+" "+o[1].translateY+") rotate("+o[1].rotate+" "+ro/2+" "+ro/2+")"}),i.jsx("circle",{cx:ro/2,cy:ro/2,fill:o[2].color,r:ro/5,transform:"translate("+o[2].translateX+" "+o[2].translateY+")"}),i.jsx("line",{x1:0,y1:ro/2,x2:ro,y2:ro/2,strokeWidth:2,stroke:o[3].color,transform:"translate("+o[3].translateX+" "+o[3].translateY+") rotate("+o[3].rotate+" "+ro/2+" "+ro/2+")"})]})]})},vv=90,B0n=5;function $0n(e,t){const n=l8(e),r=t&&t.length,s=Array.from({length:B0n},(o,l)=>J3(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 U0n=({name:e,colors:t,title:n,square:r,size:s,...a})=>{const o=$0n(e,t),l=Ae.useId();return i.jsxs("svg",{viewBox:"0 0 "+vv+" "+vv,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:vv,height:vv,children:i.jsx("rect",{width:vv,height:vv,rx:r?void 0:vv*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]})]})]})},z0n=64,wv=80;function H0n(e,t){const n=l8(e),r=t&&t.length;return Array.from({length:z0n},(s,a)=>J3(n%(a+1),t,r))}const V0n=({name:e,colors:t,title:n,square:r,size:s,...a})=>{const o=H0n(e,t),l=m.useId();return i.jsxs("svg",{viewBox:"0 0 "+wv+" "+wv,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:wv,height:wv,children:i.jsx("rect",{width:wv,height:wv,rx:r?void 0:wv*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]})]})]})},Jo=36;function W0n(e,t){const n=l8(e),r=t&&t.length,s=J3(n,t,r),a=Au(n,10,1),o=a<5?a+Jo/9:a,l=Au(n,10,2),c=l<5?l+Jo/9:l;return{wrapperColor:s,faceColor:R0n(s),backgroundColor:J3(n+13,t,r),wrapperTranslateX:o,wrapperTranslateY:c,wrapperRotate:Au(n,360),wrapperScale:1+Au(n,Jo/12)/10,isMouthOpen:hre(n,2),isCircle:hre(n,1),eyeSpread:Au(n,5),mouthSpread:Au(n,3),faceRotate:Au(n,10,3),faceTranslateX:o>Jo/6?o/2:Au(n,8,1),faceTranslateY:c>Jo/6?c/2:Au(n,7,2)}}const YSe=({name:e,colors:t,title:n,square:r,size:s,...a})=>{const o=W0n(e,t),l=m.useId();return i.jsxs("svg",{viewBox:"0 0 "+Jo+" "+Jo,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:Jo,height:Jo,children:i.jsx("rect",{width:Jo,height:Jo,rx:r?void 0:Jo*2,fill:"#FFFFFF"})}),i.jsxs("g",{mask:`url(#${l})`,children:[i.jsx("rect",{width:Jo,height:Jo,fill:o.backgroundColor}),i.jsx("rect",{x:"0",y:"0",width:Jo,height:Jo,transform:"translate("+o.wrapperTranslateX+" "+o.wrapperTranslateY+") rotate("+o.wrapperRotate+" "+Jo/2+" "+Jo/2+") scale("+o.wrapperScale+")",fill:o.wrapperColor,rx:o.isCircle?Jo:Jo/6}),i.jsxs("g",{transform:"translate("+o.faceTranslateX+" "+o.faceTranslateY+") rotate("+o.faceRotate+" "+Jo/2+" "+Jo/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})]})]})]})},q0n=4,Dd=80;function G0n(e,t){const n=l8(e),r=t&&t.length;return Array.from({length:q0n},(s,a)=>J3(n+a,t,r))}const K0n=({name:e,colors:t,title:n,square:r,size:s,...a})=>{const o=G0n(e,t),l=e.replace(/\s/g,""),c=m.useId();return i.jsxs("svg",{viewBox:"0 0 "+Dd+" "+Dd,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:Dd,height:Dd,children:i.jsx("rect",{width:Dd,height:Dd,rx:r?void 0:Dd*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:Dd/2,y1:0,x2:Dd/2,y2:Dd/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:Dd/2,y1:Dd/2,x2:Dd/2,y2:Dd,gradientUnits:"userSpaceOnUse",children:[i.jsx("stop",{stopColor:o[2]}),i.jsx("stop",{offset:1,stopColor:o[3]})]})]})]})},Y0n=3,bu=80;function X0n(e,t){const n=l8(e),r=t&&t.length;return Array.from({length:Y0n},(s,a)=>({color:J3(n+a,t,r),translateX:Au(n*(a+1),bu/10,1),translateY:Au(n*(a+1),bu/10,2),scale:1.2+Au(n*(a+1),bu/20)/10,rotate:Au(n*(a+1),360,1)}))}const eVe=({name:e,colors:t,title:n,square:r,size:s,...a})=>{const o=X0n(e,t),l=m.useId();return i.jsxs("svg",{viewBox:"0 0 "+bu+" "+bu,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:bu,height:bu,children:i.jsx("rect",{width:bu,height:bu,rx:r?void 0:bu*2,fill:"#FFFFFF"})}),i.jsxs("g",{mask:`url(#${l})`,children:[i.jsx("rect",{width:bu,height:bu,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+" "+bu/2+" "+bu/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+" "+bu/2+" "+bu/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"})]})})]})},Q0n={pixel:V0n,bauhaus:KSe,ring:U0n,beam:YSe,sunset:K0n,marble:eVe,geometric:YSe,abstract:KSe},tVe=({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=Q0n[e]||eVe;return i.jsx(l,{colors:t,name:n,title:r,size:s,square:a,...o})},lF="rgba(155,155,155,0.16)";function Z0n({row:e}){var f,x,g,v,w,C,N,P,I,R,O,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=(P=(N=e==null?void 0:e.position_details)==null?void 0:N.position)==null?void 0:P.entryPx,l=parseFloat((R=(I=e==null?void 0:e.position_details)==null?void 0:I.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(tVe,{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:sa,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(Fs,{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:lF},className:"h-px w-full"}),i.jsxs("div",{className:"flex divide-x",style:{divideColor:lF},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:lF},className:"h-px w-full"}),i.jsxs("div",{className:"flex divide-x",style:{divideColor:lF},children:[i.jsx(d,{label:"Size",value:isNaN(a)?"-":Er(Math.abs(a))}),i.jsx(d,{label:"Entry Price",value:`$${Er(((U=(O=e==null?void 0:e.position_details)==null?void 0:O.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?aE:oE,className:"ml-[6px] w-[9px] h-[8px]"})]})})]})]})}function J0n(){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 exn="https://dextradata.nftinit.io/api/hyper/trade/highVolumeTrades/",XSe=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`},VX=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)}`},txn=e=>e<250?1:e<1e4?2:e<5e4?3:e<1e5?4:e<5e5?5:e<1e6?6:e<5e6?7:8,QSe=e=>Aue(txn(e)),nxn=()=>{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=J0n(),f=m.useCallback(async(C=!1)=>{C&&r(!0);try{const N=await hs.post(exn,{limit:1e3,offset:0});if(N.data.success){const P=N.data.data.filter(I=>{var R;return!((R=I==null?void 0:I.typeDetail)!=null&&R.includes("Top100Wallet"))});t(P),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 P;if(!c)return!0;const N=QSe((C==null?void 0:C.global_account_value)??0);return c===((P=V_.find(I=>I.label===N.label))==null?void 0:P.id)}):e,[e,c]),g=[{key:"wallet",label:"Address",width:"235px",render:(C,N)=>{const P=(N==null?void 0:N.global_account_value)??0,I=QSe(P);return i.jsx(xi,{content:i.jsx(Z0n,{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:I.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] ${I.bg} ${I.txt}`,children:I.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:sa,className:"w-5 h-5"}),N.coin]})},{key:"activity",label:"Activity",width:"130px",render:(C,N)=>{var z,X,ne,J;const P=(z=N==null?void 0:N.position_details)==null?void 0:z.direction,I=P==="Long",R=P==="Short",O=(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"?I?"Short > Long":"Long > Short":P??"Position Close",L=P==="Long"||P==="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 ${I?"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(Fs,{className:`w-3 h-3 ${I?"rotate-180 text-[#67ffbd]":"text-[#ff787b]"}`}),U]}),O&&i.jsxs("div",{className:`inline-flex justify-center items-center px-2 py-1 h-6 rounded-[6px] text-[11px] font-medium
                ${I?"text-[#67ffbd] bg-[rgba(103,255,189,0.16)]":R?"text-[#ff787b] bg-[rgba(255,131,117,0.16)]":"text-[#8B8B8B] bg-transparent"}`,children:[O,"X"]})]})}},{key:"current_trade_value",label:"Trade",width:"70px",sortable:!0,render:C=>VX(C)},{key:"position_value",label:"Position",sortable:!0,width:"85px",sortValue:C=>{var N,P;return Number((P=(N=C==null?void 0:C.position_details)==null?void 0:N.position)==null?void 0:P.positionValue)},render:(C,N)=>{var P,I;return(I=(P=N==null?void 0:N.position_details)==null?void 0:P.position)!=null&&I.positionValue?VX(N.position_details.position.positionValue):"-"}},{key:"price",label:"Price",width:"80px",sortable:!0,sortValue:C=>{var N,P;return Number((P=(N=C==null?void 0:C.position_details)==null?void 0:N.position)==null?void 0:P.entryPx)},render:(C,N)=>{var P,I;return(I=(P=N==null?void 0:N.position_details)==null?void 0:P.position)!=null&&I.entryPx?VX(N.position_details.position.entryPx):"-"}},{key:"flags",label:i.jsx(xi,{content:"Quick view of this whale’s recent trading performance.",children:i.jsx("span",{children:"Last 5 T."})}),width:"90px",render:(C,N)=>{const P=N.last5Trade??[];return i.jsx("div",{className:"inline-flex h-[18px] px-[2px] py-[4px] justify-center items-center rounded-[6px] overflow-visible",children:P.slice(0,5).map((I,R)=>{let O="",U=null;return I===null?(O="bg-[#747474]",U=d8e):I===!0?(O="bg-[#67FFBD]",U=u8e):(O="bg-[#FF9C9C]",U=f8e),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] ${O} ${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 P;return i.jsx("div",{className:"text-gray-400",children:XSe(new Date((P=N.insert_date)==null?void 0:P.$date).getTime())})}}],v=m.useMemo(()=>d?g.slice(1):g,[g,d]),w=(C,N)=>{var z;const I=((z=C==null?void 0:C.position_details)==null?void 0:z.direction)==="Long",R=C.current_trade_value>=5e6,O=R?I?"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?I?"bg-[rgba(103,255,189,0.16)]":"bg-[rgba(255,131,117,0.16)]":N%2===0?"bg-[#191919]":"bg-transparent"} ${O} ${R?I?"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(xi,{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:_0,alt:"Dextrabot - Whale Trades"})]})}),i.jsxs("span",{className:"text-[#929292] text-[12px] font-medium",children:["Last updated ",XSe(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"}),V_.map(({id:C,label:N,emoji:P,description:I})=>{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(xi,{content:I,children:P})},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:Oyt,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(Lu,{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,P;return((N=C._id)==null?void 0:N.$oid)||((P=C.insert_date)==null?void 0:P.$date)},onVisibleRows:()=>{},onRowClick:C=>window.open(`/wallet-details/${C.wallet}`,"_blank")})]})]})]}),s&&i.jsxs(dp,{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(GSe,{})})})}),i.jsx("div",{className:" w-screen h-screen bg-[#101010] flex flex-col overflow-x-auto overflow-y-auto z-[9999]",children:i.jsx(GSe,{})})]})]})};function di(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 ZSe(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function bU(...e){return t=>{let n=!1;const r=e.map(s=>{const a=ZSe(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():ZSe(e[s],null)}}}}function ou(...e){return m.useCallback(bU(...e),e)}function _5(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,rxn(s,...t)]}function rxn(...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 Zy=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},sxn=Iy[" useInsertionEffect ".trim().toString()]||Zy;function yU({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,a,o]=ixn({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=axn(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 ixn({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),s=m.useRef(n),a=m.useRef(t);return sxn(()=>{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 axn(e){return typeof e=="function"}function W_(e){const t=oxn(e),n=m.forwardRef((r,s)=>{const{children:a,...o}=r,l=m.Children.toArray(a),c=l.find(cxn);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 oxn(e){const t=m.forwardRef((n,r)=>{const{children:s,...a}=n;if(m.isValidElement(s)){const o=dxn(s),l=uxn(a,s.props);return s.type!==m.Fragment&&(l.ref=r?bU(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 lxn=Symbol("radix.slottable");function cxn(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===lxn}function uxn(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 dxn(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 fxn=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Dc=fxn.reduce((e,t)=>{const n=W_(`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 nVe(e,t){e&&Na.flushSync(()=>e.dispatchEvent(t))}function rVe(e){const t=e+"CollectionProvider",[n,r]=_5(t),[s,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=w=>{const{scope:C,children:N}=w,P=Ae.useRef(null),I=Ae.useRef(new Map).current;return i.jsx(s,{scope:C,itemMap:I,collectionRef:P,children:N})};o.displayName=t;const l=e+"CollectionSlot",c=W_(l),u=Ae.forwardRef((w,C)=>{const{scope:N,children:P}=w,I=a(l,N),R=ou(C,I.collectionRef);return i.jsx(c,{ref:R,children:P})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",x=W_(d),g=Ae.forwardRef((w,C)=>{const{scope:N,children:P,...I}=w,R=Ae.useRef(null),O=ou(C,R),U=a(d,N);return Ae.useEffect(()=>(U.itemMap.set(R,{ref:R,...I}),()=>void U.itemMap.delete(R))),i.jsx(x,{[f]:"",ref:O,children:P})});g.displayName=d;function v(w){const C=a(e+"CollectionConsumer",w);return Ae.useCallback(()=>{const P=C.collectionRef.current;if(!P)return[];const I=Array.from(P.querySelectorAll(`[${f}]`));return Array.from(C.itemMap.values()).sort((U,L)=>I.indexOf(U.ref.current)-I.indexOf(L.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:o,Slot:u,ItemSlot:g},v,r]}var hxn=m.createContext(void 0);function sVe(e){const t=m.useContext(hxn);return e||t||"ltr"}function b1(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 pxn(e,t=globalThis==null?void 0:globalThis.document){const n=b1(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 mxn="DismissableLayer",pre="dismissableLayer.update",xxn="dismissableLayer.pointerDownOutside",gxn="dismissableLayer.focusOutside",JSe,iVe=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),vU=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...c}=e,u=m.useContext(iVe),[d,f]=m.useState(null),x=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=m.useState({}),v=ou(t,L=>f(L)),w=Array.from(u.layers),[C]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),N=w.indexOf(C),P=d?w.indexOf(d):-1,I=u.layersWithOutsidePointerEventsDisabled.size>0,R=P>=N,O=vxn(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=wxn(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 pxn(L=>{P===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&&(JSe=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),eNe(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=JSe)}},[d,x,n,u]),m.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),eNe())},[d,u]),m.useEffect(()=>{const L=()=>g({});return document.addEventListener(pre,L),()=>document.removeEventListener(pre,L)},[]),i.jsx(Dc.div,{...c,ref:v,style:{pointerEvents:I?R?"auto":"none":void 0,...e.style},onFocusCapture:di(e.onFocusCapture,U.onFocusCapture),onBlurCapture:di(e.onBlurCapture,U.onBlurCapture),onPointerDownCapture:di(e.onPointerDownCapture,O.onPointerDownCapture)})});vU.displayName=mxn;var bxn="DismissableLayerBranch",yxn=m.forwardRef((e,t)=>{const n=m.useContext(iVe),r=m.useRef(null),s=ou(t,r);return m.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),i.jsx(Dc.div,{...e,ref:s})});yxn.displayName=bxn;function vxn(e,t=globalThis==null?void 0:globalThis.document){const n=b1(e),r=m.useRef(!1),s=m.useRef(()=>{});return m.useEffect(()=>{const a=l=>{if(l.target&&!r.current){let c=function(){aVe(xxn,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 wxn(e,t=globalThis==null?void 0:globalThis.document){const n=b1(e),r=m.useRef(!1);return m.useEffect(()=>{const s=a=>{a.target&&!r.current&&aVe(gxn,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 eNe(){const e=new CustomEvent(pre);document.dispatchEvent(e)}function aVe(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?nVe(s,a):s.dispatchEvent(a)}var WX=0;function oVe(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??tNe()),document.body.insertAdjacentElement("beforeend",e[1]??tNe()),WX++,()=>{WX===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),WX--}},[])}function tNe(){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 qX="focusScope.autoFocusOnMount",GX="focusScope.autoFocusOnUnmount",nNe={bubbles:!1,cancelable:!0},Cxn="FocusScope",jue=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...o}=e,[l,c]=m.useState(null),u=b1(s),d=b1(a),f=m.useRef(null),x=ou(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(I){if(g.paused||!l)return;const R=I.target;l.contains(R)?f.current=R:_b(f.current,{select:!0})},C=function(I){if(g.paused||!l)return;const R=I.relatedTarget;R!==null&&(l.contains(R)||_b(f.current,{select:!0}))},N=function(I){if(document.activeElement===document.body)for(const O of I)O.removedNodes.length>0&&_b(l)};document.addEventListener("focusin",w),document.addEventListener("focusout",C);const P=new MutationObserver(N);return l&&P.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",C),P.disconnect()}}},[r,l,g.paused]),m.useEffect(()=>{if(l){sNe.add(g);const w=document.activeElement;if(!l.contains(w)){const N=new CustomEvent(qX,nNe);l.addEventListener(qX,u),l.dispatchEvent(N),N.defaultPrevented||(Sxn(_xn(lVe(l)),{select:!0}),document.activeElement===w&&_b(l))}return()=>{l.removeEventListener(qX,u),setTimeout(()=>{const N=new CustomEvent(GX,nNe);l.addEventListener(GX,d),l.dispatchEvent(N),N.defaultPrevented||_b(w??document.body,{select:!0}),l.removeEventListener(GX,d),sNe.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 P=w.currentTarget,[I,R]=Nxn(P);I&&R?!w.shiftKey&&N===R?(w.preventDefault(),n&&_b(I,{select:!0})):w.shiftKey&&N===I&&(w.preventDefault(),n&&_b(R,{select:!0})):N===P&&w.preventDefault()}},[n,r,g.paused]);return i.jsx(Dc.div,{tabIndex:-1,...o,ref:x,onKeyDown:v})});jue.displayName=Cxn;function Sxn(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(_b(r,{select:t}),document.activeElement!==n)return}function Nxn(e){const t=lVe(e),n=rNe(t,e),r=rNe(t.reverse(),e);return[n,r]}function lVe(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 rNe(e,t){for(const n of e)if(!Axn(n,{upTo:t}))return n}function Axn(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 jxn(e){return e instanceof HTMLInputElement&&"select"in e}function _b(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&jxn(e)&&t&&e.select()}}var sNe=Exn();function Exn(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=iNe(e,t),e.unshift(t)},remove(t){var n;e=iNe(e,t),(n=e[0])==null||n.resume()}}}function iNe(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function _xn(e){return e.filter(t=>t.tagName!=="A")}var kxn=Iy[" useId ".trim().toString()]||(()=>{}),Txn=0;function rD(e){const[t,n]=m.useState(kxn());return Zy(()=>{e||n(r=>r??String(Txn++))},[e]),e||(t?`radix-${t}`:"")}var Ixn=typeof document<"u",Pxn=function(){},PO=Ixn?m.useLayoutEffect:Pxn;function sD(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(!sD(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)&&!sD(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function cVe(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function aNe(e,t){const n=cVe(e);return Math.round(t*n)/n}function KX(e){const t=m.useRef(e);return PO(()=>{t.current=e}),t}function Fxn(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);sD(x,r)||g(r);const[v,w]=m.useState(null),[C,N]=m.useState(null),P=m.useCallback(G=>{G!==U.current&&(U.current=G,w(G))},[]),I=m.useCallback(G=>{G!==L.current&&(L.current=G,N(G))},[]),R=a||v,O=o||C,U=m.useRef(null),L=m.useRef(null),z=m.useRef(d),X=c!=null,ne=KX(c),J=KX(s),K=KX(u),re=m.useCallback(()=>{if(!U.current||!L.current)return;const G={placement:t,strategy:n,middleware:x};J.current&&(G.platform=J.current),BAe(U.current,L.current,G).then(V=>{const te={...V,isPositioned:K.current!==!1};he.current&&!sD(z.current,te)&&(z.current=te,Na.flushSync(()=>{f(te)}))})},[x,t,n,J,K]);PO(()=>{u===!1&&z.current.isPositioned&&(z.current.isPositioned=!1,f(G=>({...G,isPositioned:!1})))},[u]);const he=m.useRef(!1);PO(()=>(he.current=!0,()=>{he.current=!1}),[]),PO(()=>{if(R&&(U.current=R),O&&(L.current=O),R&&O){if(ne.current)return ne.current(R,O,re);re()}},[R,O,re,ne,X]);const Q=m.useMemo(()=>({reference:U,floating:L,setReference:P,setFloating:I}),[P,I]),ie=m.useMemo(()=>({reference:R,floating:O}),[R,O]),oe=m.useMemo(()=>{const G={position:n,left:0,top:0};if(!ie.floating)return G;const V=aNe(ie.floating,d.x),te=aNe(ie.floating,d.y);return l?{...G,transform:"translate("+V+"px, "+te+"px)",...cVe(ie.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:te}},[n,l,ie.floating,d.x,d.y]);return m.useMemo(()=>({...d,update:re,refs:Q,elements:ie,floatingStyles:oe}),[d,re,Q,ie,oe])}const Oxn=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?Wde({element:r.current,padding:s}).fn(n):{}:r?Wde({element:r,padding:s}).fn(n):{}}}},Mxn=(e,t)=>({...MAe(e),options:[e,t]}),Rxn=(e,t)=>({...RAe(e),options:[e,t]}),Lxn=(e,t)=>({...XQe(e),options:[e,t]}),Dxn=(e,t)=>({...LAe(e),options:[e,t]}),Bxn=(e,t)=>({...DAe(e),options:[e,t]}),$xn=(e,t)=>({...YQe(e),options:[e,t]}),Uxn=(e,t)=>({...Oxn(e),options:[e,t]});var zxn="Arrow",uVe=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...a}=e;return i.jsx(Dc.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"})})});uVe.displayName=zxn;var Hxn=uVe;function Vxn(e){const[t,n]=m.useState(void 0);return Zy(()=>{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 Eue="Popper",[dVe,c8]=_5(Eue),[Wxn,fVe]=dVe(Eue),hVe=e=>{const{__scopePopper:t,children:n}=e,[r,s]=m.useState(null);return i.jsx(Wxn,{scope:t,anchor:r,onAnchorChange:s,children:n})};hVe.displayName=Eue;var pVe="PopperAnchor",mVe=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,a=fVe(pVe,n),o=m.useRef(null),l=ou(t,o);return m.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:i.jsx(Dc.div,{...s,ref:l})});mVe.displayName=pVe;var _ue="PopperContent",[qxn,Gxn]=dVe(_ue),xVe=m.forwardRef((e,t)=>{var ye,je,Pe,Re,Xe,Ke;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=fVe(_ue,n),[N,P]=m.useState(null),I=ou(t,ut=>P(ut)),[R,O]=m.useState(null),U=Vxn(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],K=J.length>0,re={padding:ne,boundary:J.filter(Yxn),altBoundary:K},{refs:he,floatingStyles:Q,placement:ie,isPositioned:oe,middlewareData:G}=Fxn({strategy:"fixed",placement:X,whileElementsMounted:(...ut)=>OAe(...ut,{animationFrame:g==="always"}),elements:{reference:C.anchor},middleware:[Mxn({mainAxis:s+z,alignmentAxis:o}),c&&Rxn({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Lxn():void 0,...re}),c&&Dxn({...re}),Bxn({...re,apply:({elements:ut,rects:et,availableWidth:tt,availableHeight:Le})=>{const{width:$e,height:ht}=et.reference,pt=ut.floating.style;pt.setProperty("--radix-popper-available-width",`${tt}px`),pt.setProperty("--radix-popper-available-height",`${Le}px`),pt.setProperty("--radix-popper-anchor-width",`${$e}px`),pt.setProperty("--radix-popper-anchor-height",`${ht}px`)}}),R&&Uxn({element:R,padding:l}),Xxn({arrowWidth:L,arrowHeight:z}),x&&$xn({strategy:"referenceHidden",...re})]}),[V,te]=yVe(ie),ae=b1(v);Zy(()=>{oe&&(ae==null||ae())},[oe,ae]);const fe=(ye=G.arrow)==null?void 0:ye.x,Ne=(je=G.arrow)==null?void 0:je.y,me=((Pe=G.arrow)==null?void 0:Pe.centerOffset)!==0,[we,xe]=m.useState();return Zy(()=>{N&&xe(window.getComputedStyle(N).zIndex)},[N]),i.jsx("div",{ref:he.setFloating,"data-radix-popper-content-wrapper":"",style:{...Q,transform:oe?Q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:we,"--radix-popper-transform-origin":[(Re=G.transformOrigin)==null?void 0:Re.x,(Xe=G.transformOrigin)==null?void 0:Xe.y].join(" "),...((Ke=G.hide)==null?void 0:Ke.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(qxn,{scope:n,placedSide:V,onArrowChange:O,arrowX:fe,arrowY:Ne,shouldHideArrow:me,children:i.jsx(Dc.div,{"data-side":V,"data-align":te,...w,ref:I,style:{...w.style,animation:oe?void 0:"none"}})})})});xVe.displayName=_ue;var gVe="PopperArrow",Kxn={top:"bottom",right:"left",bottom:"top",left:"right"},bVe=m.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,a=Gxn(gVe,r),o=Kxn[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(Hxn,{...s,ref:n,style:{...s.style,display:"block"}})})});bVe.displayName=gVe;function Yxn(e){return e!==null}var Xxn=e=>({name:"transformOrigin",options:e,fn(t){var C,N,P;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]=yVe(n),f={start:"0%",center:"50%",end:"100%"}[d],x=(((N=s.arrow)==null?void 0:N.x)??0)+l/2,g=(((P=s.arrow)==null?void 0:P.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 yVe(e){const[t,n="center"]=e.split("-");return[t,n]}var kue=hVe,wU=mVe,Tue=xVe,Iue=bVe,Qxn="Portal",Pue=m.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[s,a]=m.useState(!1);Zy(()=>a(!0),[]);const o=n||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?bre.createPortal(i.jsx(Dc.div,{...r,ref:t}),o):null});Pue.displayName=Qxn;function Zxn(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var C2=e=>{const{present:t,children:n}=e,r=Jxn(t),s=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),a=ou(r.ref,egn(s));return typeof n=="function"||r.isPresent?m.cloneElement(s,{ref:a}):null};C2.displayName="Presence";function Jxn(e){const[t,n]=m.useState(),r=m.useRef(null),s=m.useRef(e),a=m.useRef("none"),o=e?"mounted":"unmounted",[l,c]=Zxn(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const u=cF(r.current);a.current=l==="mounted"?u:"none"},[l]),Zy(()=>{const u=r.current,d=s.current;if(d!==e){const x=a.current,g=cF(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]),Zy(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=g=>{const w=cF(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=cF(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 cF(e){return(e==null?void 0:e.animationName)||"none"}function egn(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 YX="rovingFocusGroup.onEntryFocus",tgn={bubbles:!1,cancelable:!0},wT="RovingFocusGroup",[mre,vVe,ngn]=rVe(wT),[rgn,wVe]=_5(wT,[ngn]),[sgn,ign]=rgn(wT),CVe=m.forwardRef((e,t)=>i.jsx(mre.Provider,{scope:e.__scopeRovingFocusGroup,children:i.jsx(mre.Slot,{scope:e.__scopeRovingFocusGroup,children:i.jsx(agn,{...e,ref:t})})}));CVe.displayName=wT;var agn=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=ou(t,x),v=sVe(a),[w,C]=yU({prop:o,defaultProp:l??null,onChange:c,caller:wT}),[N,P]=m.useState(!1),I=b1(u),R=vVe(n),O=m.useRef(!1),[U,L]=m.useState(0);return m.useEffect(()=>{const z=x.current;if(z)return z.addEventListener(YX,I),()=>z.removeEventListener(YX,I)},[I]),i.jsx(sgn,{scope:n,orientation:r,dir:v,loop:s,currentTabStopId:w,onItemFocus:m.useCallback(z=>C(z),[C]),onItemShiftTab:m.useCallback(()=>P(!0),[]),onFocusableItemAdd:m.useCallback(()=>L(z=>z+1),[]),onFocusableItemRemove:m.useCallback(()=>L(z=>z-1),[]),children:i.jsx(Dc.div,{tabIndex:N||U===0?-1:0,"data-orientation":r,...f,ref:g,style:{outline:"none",...e.style},onMouseDown:di(e.onMouseDown,()=>{O.current=!0}),onFocus:di(e.onFocus,z=>{const X=!O.current;if(z.target===z.currentTarget&&X&&!N){const ne=new CustomEvent(YX,tgn);if(z.currentTarget.dispatchEvent(ne),!ne.defaultPrevented){const J=R().filter(ie=>ie.focusable),K=J.find(ie=>ie.active),re=J.find(ie=>ie.id===w),Q=[K,re,...J].filter(Boolean).map(ie=>ie.ref.current);AVe(Q,d)}}O.current=!1}),onBlur:di(e.onBlur,()=>P(!1))})})}),SVe="RovingFocusGroupItem",NVe=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:a,children:o,...l}=e,c=rD(),u=a||c,d=ign(SVe,n),f=d.currentTabStopId===u,x=vVe(n),{onFocusableItemAdd:g,onFocusableItemRemove:v,currentTabStopId:w}=d;return m.useEffect(()=>{if(r)return g(),()=>v()},[r,g,v]),i.jsx(mre.ItemSlot,{scope:n,id:u,focusable:r,active:s,children:i.jsx(Dc.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...l,ref:t,onMouseDown:di(e.onMouseDown,C=>{r?d.onItemFocus(u):C.preventDefault()}),onFocus:di(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:di(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){d.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const N=cgn(C,d.orientation,d.dir);if(N!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let I=x().filter(R=>R.focusable).map(R=>R.ref.current);if(N==="last")I.reverse();else if(N==="prev"||N==="next"){N==="prev"&&I.reverse();const R=I.indexOf(C.currentTarget);I=d.loop?ugn(I,R+1):I.slice(R+1)}setTimeout(()=>AVe(I))}}),children:typeof o=="function"?o({isCurrentTabStop:f,hasTabStop:w!=null}):o})})});NVe.displayName=SVe;var ogn={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function lgn(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function cgn(e,t,n){const r=lgn(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return ogn[r]}function AVe(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function ugn(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var dgn=CVe,fgn=NVe,hgn=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},mC=new WeakMap,uF=new WeakMap,dF={},XX=0,jVe=function(e){return e&&(e.host||jVe(e.parentNode))},pgn=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=jVe(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})},mgn=function(e,t,n,r){var s=pgn(t,Array.isArray(e)?e:[e]);dF[n]||(dF[n]=new WeakMap);var a=dF[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=(mC.get(x)||0)+1,C=(a.get(x)||0)+1;mC.set(x,w),a.set(x,C),o.push(x),w===1&&v&&uF.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(),XX++,function(){o.forEach(function(f){var x=mC.get(f)-1,g=a.get(f)-1;mC.set(f,x),a.set(f,g),x||(uF.has(f)||f.removeAttribute(r),uF.delete(f)),g||f.removeAttribute(n)}),XX--,XX||(mC=new WeakMap,mC=new WeakMap,uF=new WeakMap,dF={})}},EVe=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=hgn(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),mgn(r,s,n,"aria-hidden")):function(){return null}},Rb=function(){return Rb=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},Rb.apply(this,arguments)};function xgn(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 ggn(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 _Ve=cRe(),QX=function(){},CU=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:QX,onWheelCapture:QX,onTouchMoveCapture:QX}),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,P=N===void 0?"div":N,I=e.gapMode,R=xgn(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=x,U=RMe([n,t]),L=Rb(Rb({},R),s);return m.createElement(m.Fragment,null,d&&m.createElement(O,{sideCar:_Ve,removeScrollBar:u,shards:f,noRelative:g,noIsolation:v,inert:w,setCallbacks:a,allowPinchZoom:!!C,lockRef:n,gapMode:I}),o?m.cloneElement(m.Children.only(l),Rb(Rb({},L),{ref:U})):m.createElement(P,Rb({},L,{className:c,ref:U}),l))});CU.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};CU.classNames={fullWidth:r9,zeroRight:n9};var xre=!1;if(typeof window<"u")try{var fF=Object.defineProperty({},"passive",{get:function(){return xre=!0,!0}});window.addEventListener("test",fF,fF),window.removeEventListener("test",fF,fF)}catch{xre=!1}var xC=xre?{passive:!1}:!1,bgn=function(e){return e.tagName==="TEXTAREA"},kVe=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!bgn(e)&&n[t]==="visible")},ygn=function(e){return kVe(e,"overflowY")},vgn=function(e){return kVe(e,"overflowX")},oNe=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=TVe(e,r);if(s){var a=IVe(e,r),o=a[1],l=a[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},wgn=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Cgn=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},TVe=function(e,t){return e==="v"?ygn(t):vgn(t)},IVe=function(e,t){return e==="v"?wgn(t):Cgn(t)},Sgn=function(e,t){return e==="h"&&t==="rtl"?-1:1},Ngn=function(e,t,n,r,s){var a=Sgn(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=IVe(e,l),v=g[0],w=g[1],C=g[2],N=w-C-a*v;(v||N)&&TVe(e,l)&&(f+=N,x+=v);var P=l.parentNode;l=P&&P.nodeType===Node.DOCUMENT_FRAGMENT_NODE?P.host:P}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},hF=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},lNe=function(e){return[e.deltaX,e.deltaY]},cNe=function(e){return e&&"current"in e?e.current:e},Agn=function(e,t){return e[0]===t[0]&&e[1]===t[1]},jgn=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},Egn=0,gC=[];function _gn(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),s=m.useState(Egn++)[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=ggn([e.lockRef.current],(e.shards||[]).map(cNe),!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=hF(w),P=n.current,I="deltaX"in w?w.deltaX:P[0]-N[0],R="deltaY"in w?w.deltaY:P[1]-N[1],O,U=w.target,L=Math.abs(I)>Math.abs(R)?"h":"v";if("touches"in w&&L==="h"&&U.type==="range")return!1;var z=oNe(L,U);if(!z)return!0;if(z?O=L:(O=L==="v"?"h":"v",z=oNe(L,U)),!z)return!1;if(!r.current&&"changedTouches"in w&&(I||R)&&(r.current=O),!O)return!0;var X=r.current||O;return Ngn(X,C,w,X==="h"?I:R)},[]),c=m.useCallback(function(w){var C=w;if(!(!gC.length||gC[gC.length-1]!==a)){var N="deltaY"in C?lNe(C):hF(C),P=t.current.filter(function(O){return O.name===C.type&&(O.target===C.target||C.target===O.shadowParent)&&Agn(O.delta,N)})[0];if(P&&P.should){C.cancelable&&C.preventDefault();return}if(!P){var I=(o.current.shards||[]).map(cNe).filter(Boolean).filter(function(O){return O.contains(C.target)}),R=I.length>0?l(C,I[0]):!o.current.noIsolation;R&&C.cancelable&&C.preventDefault()}}},[]),u=m.useCallback(function(w,C,N,P){var I={name:w,delta:C,target:N,should:P,shadowParent:kgn(N)};t.current.push(I),setTimeout(function(){t.current=t.current.filter(function(R){return R!==I})},1)},[]),d=m.useCallback(function(w){n.current=hF(w),r.current=void 0},[]),f=m.useCallback(function(w){u(w.type,lNe(w),w.target,l(w,e.lockRef.current))},[]),x=m.useCallback(function(w){u(w.type,hF(w),w.target,l(w,e.lockRef.current))},[]);m.useEffect(function(){return gC.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:x}),document.addEventListener("wheel",c,xC),document.addEventListener("touchmove",c,xC),document.addEventListener("touchstart",d,xC),function(){gC=gC.filter(function(w){return w!==a}),document.removeEventListener("wheel",c,xC),document.removeEventListener("touchmove",c,xC),document.removeEventListener("touchstart",d,xC)}},[]);var g=e.removeScrollBar,v=e.inert;return m.createElement(m.Fragment,null,v?m.createElement(a,{styles:jgn(s)}):null,g?m.createElement(hRe,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function kgn(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Tgn=dRe(_Ve,_gn);var Fue=m.forwardRef(function(e,t){return m.createElement(CU,Rb({},e,{ref:t,sideCar:Tgn}))});Fue.classNames=CU.classNames;var gre=["Enter"," "],Ign=["ArrowDown","PageUp","Home"],PVe=["ArrowUp","PageDown","End"],Pgn=[...Ign,...PVe],Fgn={ltr:[...gre,"ArrowRight"],rtl:[...gre,"ArrowLeft"]},Ogn={ltr:["ArrowLeft"],rtl:["ArrowRight"]},CT="Menu",[q_,Mgn,Rgn]=rVe(CT),[k5,FVe]=_5(CT,[Rgn,c8,wVe]),SU=c8(),OVe=wVe(),[Lgn,u8]=k5(CT),[Dgn,ST]=k5(CT),MVe=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:a,modal:o=!0}=e,l=SU(t),[c,u]=m.useState(null),d=m.useRef(!1),f=b1(a),x=sVe(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(kue,{...l,children:i.jsx(Lgn,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:i.jsx(Dgn,{scope:t,onClose:m.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:x,modal:o,children:r})})})};MVe.displayName=CT;var Bgn="MenuAnchor",Oue=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=SU(n);return i.jsx(wU,{...s,...r,ref:t})});Oue.displayName=Bgn;var $gn="MenuPortal",[Svn,RVe]=k5($gn,{forceMount:void 0}),rp="MenuContent",[Ugn,Mue]=k5(rp),LVe=m.forwardRef((e,t)=>{const n=RVe(rp,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,a=u8(rp,e.__scopeMenu),o=ST(rp,e.__scopeMenu);return i.jsx(q_.Provider,{scope:e.__scopeMenu,children:i.jsx(C2,{present:r||a.open,children:i.jsx(q_.Slot,{scope:e.__scopeMenu,children:o.modal?i.jsx(zgn,{...s,ref:t}):i.jsx(Hgn,{...s,ref:t})})})})}),zgn=m.forwardRef((e,t)=>{const n=u8(rp,e.__scopeMenu),r=m.useRef(null),s=ou(t,r);return m.useEffect(()=>{const a=r.current;if(a)return EVe(a)},[]),i.jsx(Rue,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:di(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Hgn=m.forwardRef((e,t)=>{const n=u8(rp,e.__scopeMenu);return i.jsx(Rue,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Vgn=W_("MenuContent.ScrollLock"),Rue=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=u8(rp,n),N=ST(rp,n),P=SU(n),I=OVe(n),R=Mgn(n),[O,U]=m.useState(null),L=m.useRef(null),z=ou(t,L,C.onContentChange),X=m.useRef(0),ne=m.useRef(""),J=m.useRef(0),K=m.useRef(null),re=m.useRef("right"),he=m.useRef(0),Q=v?Fue:m.Fragment,ie=v?{as:Vgn,allowPinchZoom:!0}:void 0,oe=V=>{var ye,je;const te=ne.current+V,ae=R().filter(Pe=>!Pe.disabled),fe=document.activeElement,Ne=(ye=ae.find(Pe=>Pe.ref.current===fe))==null?void 0:ye.textValue,me=ae.map(Pe=>Pe.textValue),we=n1n(me,te,Ne),xe=(je=ae.find(Pe=>Pe.textValue===we))==null?void 0:je.ref.current;(function Pe(Re){ne.current=Re,window.clearTimeout(X.current),Re!==""&&(X.current=window.setTimeout(()=>Pe(""),1e3))})(te),xe&&setTimeout(()=>xe.focus())};m.useEffect(()=>()=>window.clearTimeout(X.current),[]),oVe();const G=m.useCallback(V=>{var ae,fe;return re.current===((ae=K.current)==null?void 0:ae.side)&&s1n(V,(fe=K.current)==null?void 0:fe.area)},[]);return i.jsx(Ugn,{scope:n,searchRef:ne,onItemEnter:m.useCallback(V=>{G(V)&&V.preventDefault()},[G]),onItemLeave:m.useCallback(V=>{var te;G(V)||((te=L.current)==null||te.focus(),U(null))},[G]),onTriggerLeave:m.useCallback(V=>{G(V)&&V.preventDefault()},[G]),pointerGraceTimerRef:J,onPointerGraceIntentChange:m.useCallback(V=>{K.current=V},[]),children:i.jsx(Q,{...ie,children:i.jsx(jue,{asChild:!0,trapped:s,onMountAutoFocus:di(a,V=>{var te;V.preventDefault(),(te=L.current)==null||te.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:i.jsx(vU,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:x,onDismiss:g,children:i.jsx(dgn,{asChild:!0,...I,dir:N.dir,orientation:"vertical",loop:r,currentTabStopId:O,onCurrentTabStopIdChange:U,onEntryFocus:di(c,V=>{N.isUsingKeyboardRef.current||V.preventDefault()}),preventScrollOnEntryFocus:!0,children:i.jsx(Tue,{role:"menu","aria-orientation":"vertical","data-state":JVe(C.open),"data-radix-menu-content":"",dir:N.dir,...P,...w,ref:z,style:{outline:"none",...w.style},onKeyDown:di(w.onKeyDown,V=>{const ae=V.target.closest("[data-radix-menu-content]")===V.currentTarget,fe=V.ctrlKey||V.altKey||V.metaKey,Ne=V.key.length===1;ae&&(V.key==="Tab"&&V.preventDefault(),!fe&&Ne&&oe(V.key));const me=L.current;if(V.target!==me||!Pgn.includes(V.key))return;V.preventDefault();const xe=R().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);PVe.includes(V.key)&&xe.reverse(),e1n(xe)}),onBlur:di(e.onBlur,V=>{V.currentTarget.contains(V.target)||(window.clearTimeout(X.current),ne.current="")}),onPointerMove:di(e.onPointerMove,G_(V=>{const te=V.target,ae=he.current!==V.clientX;if(V.currentTarget.contains(te)&&ae){const fe=V.clientX>he.current?"right":"left";re.current=fe,he.current=V.clientX}}))})})})})})})});LVe.displayName=rp;var Wgn="MenuGroup",Lue=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(Dc.div,{role:"group",...r,ref:t})});Lue.displayName=Wgn;var qgn="MenuLabel",DVe=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(Dc.div,{...r,ref:t})});DVe.displayName=qgn;var iD="MenuItem",uNe="menu.itemSelect",NU=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,a=m.useRef(null),o=ST(iD,e.__scopeMenu),l=Mue(iD,e.__scopeMenu),c=ou(t,a),u=m.useRef(!1),d=()=>{const f=a.current;if(!n&&f){const x=new CustomEvent(uNe,{bubbles:!0,cancelable:!0});f.addEventListener(uNe,g=>r==null?void 0:r(g),{once:!0}),nVe(f,x),x.defaultPrevented?u.current=!1:o.onClose()}};return i.jsx(BVe,{...s,ref:c,disabled:n,onClick:di(e.onClick,d),onPointerDown:f=>{var x;(x=e.onPointerDown)==null||x.call(e,f),u.current=!0},onPointerUp:di(e.onPointerUp,f=>{var x;u.current||(x=f.currentTarget)==null||x.click()}),onKeyDown:di(e.onKeyDown,f=>{const x=l.searchRef.current!=="";n||x&&f.key===" "||gre.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});NU.displayName=iD;var BVe=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...a}=e,o=Mue(iD,n),l=OVe(n),c=m.useRef(null),u=ou(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(q_.ItemSlot,{scope:n,disabled:r,textValue:s??x,children:i.jsx(fgn,{asChild:!0,...l,focusable:!r,children:i.jsx(Dc.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:u,onPointerMove:di(e.onPointerMove,G_(v=>{r?o.onItemLeave(v):(o.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:di(e.onPointerLeave,G_(v=>o.onItemLeave(v))),onFocus:di(e.onFocus,()=>f(!0)),onBlur:di(e.onBlur,()=>f(!1))})})})}),Ggn="MenuCheckboxItem",$Ve=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return i.jsx(WVe,{scope:e.__scopeMenu,checked:n,children:i.jsx(NU,{role:"menuitemcheckbox","aria-checked":aD(n)?"mixed":n,...s,ref:t,"data-state":Bue(n),onSelect:di(s.onSelect,()=>r==null?void 0:r(aD(n)?!0:!n),{checkForDefaultPrevented:!1})})})});$Ve.displayName=Ggn;var UVe="MenuRadioGroup",[Kgn,Ygn]=k5(UVe,{value:void 0,onValueChange:()=>{}}),zVe=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,a=b1(r);return i.jsx(Kgn,{scope:e.__scopeMenu,value:n,onValueChange:a,children:i.jsx(Lue,{...s,ref:t})})});zVe.displayName=UVe;var HVe="MenuRadioItem",VVe=m.forwardRef((e,t)=>{const{value:n,...r}=e,s=Ygn(HVe,e.__scopeMenu),a=n===s.value;return i.jsx(WVe,{scope:e.__scopeMenu,checked:a,children:i.jsx(NU,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":Bue(a),onSelect:di(r.onSelect,()=>{var o;return(o=s.onValueChange)==null?void 0:o.call(s,n)},{checkForDefaultPrevented:!1})})})});VVe.displayName=HVe;var Due="MenuItemIndicator",[WVe,Xgn]=k5(Due,{checked:!1}),qVe=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,a=Xgn(Due,n);return i.jsx(C2,{present:r||aD(a.checked)||a.checked===!0,children:i.jsx(Dc.span,{...s,ref:t,"data-state":Bue(a.checked)})})});qVe.displayName=Due;var Qgn="MenuSeparator",GVe=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(Dc.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});GVe.displayName=Qgn;var Zgn="MenuArrow",KVe=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=SU(n);return i.jsx(Iue,{...s,...r,ref:t})});KVe.displayName=Zgn;var Jgn="MenuSub",[Nvn,YVe]=k5(Jgn),Mj="MenuSubTrigger",XVe=m.forwardRef((e,t)=>{const n=u8(Mj,e.__scopeMenu),r=ST(Mj,e.__scopeMenu),s=YVe(Mj,e.__scopeMenu),a=Mue(Mj,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(Oue,{asChild:!0,...u,children:i.jsx(BVe,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":JVe(n.open),...e,ref:bU(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:di(e.onPointerMove,G_(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:di(e.onPointerLeave,G_(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,P=x[C?"left":"right"],I=x[C?"right":"left"];a.onPointerGraceIntentChange({area:[{x:f.clientX+N,y:f.clientY},{x:P,y:x.top},{x:I,y:x.top},{x:I,y:x.bottom},{x:P,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:di(e.onKeyDown,f=>{var g;const x=a.searchRef.current!=="";e.disabled||x&&f.key===" "||Fgn[r.dir].includes(f.key)&&(n.onOpenChange(!0),(g=n.content)==null||g.focus(),f.preventDefault())})})})});XVe.displayName=Mj;var QVe="MenuSubContent",ZVe=m.forwardRef((e,t)=>{const n=RVe(rp,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,a=u8(rp,e.__scopeMenu),o=ST(rp,e.__scopeMenu),l=YVe(QVe,e.__scopeMenu),c=m.useRef(null),u=ou(t,c);return i.jsx(q_.Provider,{scope:e.__scopeMenu,children:i.jsx(C2,{present:r||a.open,children:i.jsx(q_.Slot,{scope:e.__scopeMenu,children:i.jsx(Rue,{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:di(e.onFocusOutside,d=>{d.target!==l.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:di(e.onEscapeKeyDown,d=>{o.onClose(),d.preventDefault()}),onKeyDown:di(e.onKeyDown,d=>{var g;const f=d.currentTarget.contains(d.target),x=Ogn[o.dir].includes(d.key);f&&x&&(a.onOpenChange(!1),(g=l.trigger)==null||g.focus(),d.preventDefault())})})})})})});ZVe.displayName=QVe;function JVe(e){return e?"open":"closed"}function aD(e){return e==="indeterminate"}function Bue(e){return aD(e)?"indeterminate":e?"checked":"unchecked"}function e1n(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function t1n(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function n1n(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=t1n(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 r1n(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 s1n(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return r1n(n,t)}function G_(e){return t=>t.pointerType==="mouse"?e(t):void 0}var i1n=MVe,a1n=Oue,o1n=LVe,l1n=Lue,c1n=DVe,u1n=NU,d1n=$Ve,f1n=zVe,h1n=VVe,p1n=qVe,m1n=GVe,x1n=KVe,g1n=XVe,b1n=ZVe,AU="DropdownMenu",[y1n,Avn]=_5(AU,[FVe]),pf=FVe(),[v1n,eWe]=y1n(AU),tWe=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:a,onOpenChange:o,modal:l=!0}=e,c=pf(t),u=m.useRef(null),[d,f]=yU({prop:s,defaultProp:a??!1,onChange:o,caller:AU});return i.jsx(v1n,{scope:t,triggerId:rD(),triggerRef:u,contentId:rD(),open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(x=>!x),[f]),modal:l,children:i.jsx(i1n,{...c,open:d,onOpenChange:f,dir:r,modal:l,children:n})})};tWe.displayName=AU;var nWe="DropdownMenuTrigger",rWe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,a=eWe(nWe,n),o=pf(n);return i.jsx(a1n,{asChild:!0,...o,children:i.jsx(Dc.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:bU(t,a.triggerRef),onPointerDown:di(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(a.onOpenToggle(),a.open||l.preventDefault())}),onKeyDown:di(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&a.onOpenToggle(),l.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});rWe.displayName=nWe;var sWe="DropdownMenuContent",iWe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=eWe(sWe,n),a=pf(n),o=m.useRef(!1);return i.jsx(o1n,{id:s.contentId,"aria-labelledby":s.triggerId,...a,...r,ref:t,onCloseAutoFocus:di(e.onCloseAutoFocus,l=>{var c;o.current||(c=s.triggerRef.current)==null||c.focus(),o.current=!1,l.preventDefault()}),onInteractOutside:di(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)"}})});iWe.displayName=sWe;var w1n="DropdownMenuGroup",C1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=pf(n);return i.jsx(l1n,{...s,...r,ref:t})});C1n.displayName=w1n;var S1n="DropdownMenuLabel",N1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=pf(n);return i.jsx(c1n,{...s,...r,ref:t})});N1n.displayName=S1n;var A1n="DropdownMenuItem",aWe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=pf(n);return i.jsx(u1n,{...s,...r,ref:t})});aWe.displayName=A1n;var j1n="DropdownMenuCheckboxItem",E1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=pf(n);return i.jsx(d1n,{...s,...r,ref:t})});E1n.displayName=j1n;var _1n="DropdownMenuRadioGroup",k1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=pf(n);return i.jsx(f1n,{...s,...r,ref:t})});k1n.displayName=_1n;var T1n="DropdownMenuRadioItem",I1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=pf(n);return i.jsx(h1n,{...s,...r,ref:t})});I1n.displayName=T1n;var P1n="DropdownMenuItemIndicator",F1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=pf(n);return i.jsx(p1n,{...s,...r,ref:t})});F1n.displayName=P1n;var O1n="DropdownMenuSeparator",M1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=pf(n);return i.jsx(m1n,{...s,...r,ref:t})});M1n.displayName=O1n;var R1n="DropdownMenuArrow",L1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=pf(n);return i.jsx(x1n,{...s,...r,ref:t})});L1n.displayName=R1n;var D1n="DropdownMenuSubTrigger",B1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=pf(n);return i.jsx(g1n,{...s,...r,ref:t})});B1n.displayName=D1n;var $1n="DropdownMenuSubContent",U1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=pf(n);return i.jsx(b1n,{...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)"}})});U1n.displayName=$1n;var ZX=tWe,z1n=rWe,JX=iWe,eQ=aWe,jU="Popover",[oWe,jvn]=_5(jU,[c8]),NT=c8(),[H1n,S2]=oWe(jU),lWe=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:a,modal:o=!1}=e,l=NT(t),c=m.useRef(null),[u,d]=m.useState(!1),[f,x]=yU({prop:r,defaultProp:s??!1,onChange:a,caller:jU});return i.jsx(kue,{...l,children:i.jsx(H1n,{scope:t,contentId:rD(),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})})};lWe.displayName=jU;var cWe="PopoverAnchor",V1n=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=S2(cWe,n),a=NT(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=s;return m.useEffect(()=>(o(),()=>l()),[o,l]),i.jsx(wU,{...a,...r,ref:t})});V1n.displayName=cWe;var uWe="PopoverTrigger",dWe=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=S2(uWe,n),a=NT(n),o=ou(t,s.triggerRef),l=i.jsx(Dc.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":xWe(s.open),...r,ref:o,onClick:di(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?l:i.jsx(wU,{asChild:!0,...a,children:l})});dWe.displayName=uWe;var $ue="PopoverPortal",[W1n,q1n]=oWe($ue,{forceMount:void 0}),fWe=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,a=S2($ue,t);return i.jsx(W1n,{scope:t,forceMount:n,children:i.jsx(C2,{present:n||a.open,children:i.jsx(Pue,{asChild:!0,container:s,children:r})})})};fWe.displayName=$ue;var ZN="PopoverContent",hWe=m.forwardRef((e,t)=>{const n=q1n(ZN,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,a=S2(ZN,e.__scopePopover);return i.jsx(C2,{present:r||a.open,children:a.modal?i.jsx(K1n,{...s,ref:t}):i.jsx(Y1n,{...s,ref:t})})});hWe.displayName=ZN;var G1n=W_("PopoverContent.RemoveScroll"),K1n=m.forwardRef((e,t)=>{const n=S2(ZN,e.__scopePopover),r=m.useRef(null),s=ou(t,r),a=m.useRef(!1);return m.useEffect(()=>{const o=r.current;if(o)return EVe(o)},[]),i.jsx(Fue,{as:G1n,allowPinchZoom:!0,children:i.jsx(pWe,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:di(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),a.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:di(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:di(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),Y1n=m.forwardRef((e,t)=>{const n=S2(ZN,e.__scopePopover),r=m.useRef(!1),s=m.useRef(!1);return i.jsx(pWe,{...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()}})}),pWe=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=S2(ZN,n),g=NT(n);return oVe(),i.jsx(jue,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:i.jsx(vU,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>x.onOpenChange(!1),children:i.jsx(Tue,{"data-state":xWe(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)"}})})})}),mWe="PopoverClose",X1n=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=S2(mWe,n);return i.jsx(Dc.button,{type:"button",...r,ref:t,onClick:di(e.onClick,()=>s.onOpenChange(!1))})});X1n.displayName=mWe;var Q1n="PopoverArrow",Z1n=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=NT(n);return i.jsx(Iue,{...s,...r,ref:t})});Z1n.displayName=Q1n;function xWe(e){return e?"open":"closed"}var J1n=lWe,ebn=dWe,tbn=fWe,nbn=hWe;const rbn=e=>`${e.slice(0,5)}...${e.slice(-4)}`,sbn=[{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 ibn(){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),[P,I]=m.useState(null),[R,O]=m.useState(""),{setSignModalOpen:U,copyTradeWatchList:L,getCopyTradeWatchList:z,getTrackedWatchList:X,setIsWhitelist:ne,setMushboomerETH:J,setMushboomerSOL:K}=m.useContext(Qr);m.useEffect(()=>{const G=()=>{const te="https://dextradata.nftinit.io/api/hyper/top_whales/",ae=d==="All"?te:`${te}?user_tier=${d}`;hs.get(ae).then(fe=>{var Ne;return t(((Ne=fe.data)==null?void 0:Ne.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 te,ae;try{const fe=await _i(V.toLowerCase(),G);fe!=null&&fe.success&&(ne(fe.whitelist),J(((te=fe.mushboomer_counts)==null?void 0:te.eth)||0),K(((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:te})=>{try{const ae=localStorage.getItem("hyperToken"),fe=localStorage.getItem("hyperAddress");if(!ae){U(!0);return}const Ne=V?"https://dextrabothypev2.nftinit.io/api/test_app/following/info/":"https://dextrabothypev2.nftinit.io/api/hyper/following/get_setting/",me=V?{address:fe?fe.toLowerCase():localAddress,token:ae,follow_address:G.toLowerCase()}:{address:fe?fe.toLowerCase():localAddress,token:ae},xe=await(await fetch(Ne,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(me)})).json();if(!xe.success){tn.error(xe.error_message||"Something went wrong");return}z(),X(),I(Array.isArray(xe==null?void 0:xe.data)?[...xe.data].sort((ye,je)=>new Date(je.created_at||0)-new Date(ye.created_at||0)):xe==null?void 0:xe.data),O(G),N(te),w(!0)}catch(ae){tn.error(ae.message||"Something went wrong")}},he=m.useMemo(()=>[...new Set(e.map(G=>G.coin))],[e]),Q=m.useMemo(()=>e.filter(G=>{if(n!=="All"&&G.coin!==n||s!=="All"&&G.direction!==s.toLowerCase()||d!=="All"&&![String(d),ed[d].label].includes(String(G.user_tier)))return!1;if(o){const V=Number(G.unrealized_pnl),te=Math.min(o.min,o.max),ae=Math.max(o.min,o.max);if(V<te||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),te=V<0?"-":"",ae=Math.abs(V);return ae>=1e9?`${te}$${(ae/1e9).toFixed(2)}B`:ae>=1e6?`${te}$${(ae/1e6).toFixed(2)}M`:ae>=1e3?`${te}$${(ae/1e3).toFixed(2)}K`:`${te}$${ae.toFixed(2)}`},oe=[{key:"rank",label:"#",width:"46px",render:(G,V,te)=>i.jsx("span",{className:"text-[#9B9B9B]",children:te+1})},{key:"wallet",label:"Wallet",width:"210px",render:(G,V)=>{const te=Aue(V.user_tier);return i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-[18px] leading-none",children:te.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:rbn(V.address)}),i.jsx("span",{className:`flex justify-center items-center px-1 h-6 rounded-[6px] text-[11px] font-medium ${te.bg} ${te.txt}`,children:te.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:sa,className:"w-5 h-5 mr-2"}),V.coin]})},{key:"direction",label:"Direction",width:"150px ",sortable:!0,render:(G,V)=>{const te=V.direction==="long",ae=te?"LONG":"SHORT",fe=te?"#67FFBD":"#FF797C",Ne=te?"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 ${Ne}`,style:{color:fe},children:[i.jsx(Fs,{className:`w-3 h-3 ${te?"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 ${Ne}`,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?aE:oE,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?aE:oE,className:"ml-[6px] w-[9px] h-[8px]"})]})}},{key:"action",label:"Action",width:"100px",render:(G,V)=>{const te=L.some(ae=>ae.wallet_address===V.address);return i.jsx("div",{onClick:ae=>{ae.preventDefault(),ae.stopPropagation(),re({walletAddress:V.address,isFollow:te})},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(w5,{open:v,setOpen:w,copyTradeData:P,copyTradeWallet:R,setCopyTradeWallet:O,isScalper:C,setCopyTradeData:I}),i.jsx(xi,{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:_0,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:Iyt,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(dNe,{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(dNe,{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(Lu,{data:Q,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 tQ({children:e,value:t}){return i.jsx(z1n,{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(A9,{className:"w-4 h-4 shrink-0"})]})})}function dNe({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),P=v===""?null:Number(v),I=N??P??0,R=P??N??1/0;l({min:I,max:R,label:`${I<0?"-":""}$${Math.abs(I)} - ${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:Tyt,className:"w-[21px] h-[21px]"}),i.jsx("span",{className:"font-manrope text-[14px] font-medium",children:"Filters"})]}),i.jsxs(ZX,{children:[i.jsxs(tQ,{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:sa,className:"w-4 h-4"}),n]})]}),i.jsx(JX,{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(eQ,{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:sa,className:"w-4 h-4"}),N]},N))})]}),i.jsxs(ZX,{children:[i.jsxs(tQ,{value:s!=="All",children:["Side ",i.jsx("span",{className:"ml-1 px-1.5 py-0.5 text-white",children:s})]}),i.jsx(JX,{sideOffset:6,className:"z-50 rounded-md bg-[#242424] p-2 text-[#A8A8A8]",children:["All","Long","Short"].map(N=>i.jsx(eQ,{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(ZX,{children:[i.jsxs(tQ,{value:c!=="All",children:["Fee ",i.jsx("span",{className:"ml-1 px-1.5 py-0.5 text-white",children:c})]}),i.jsx(JX,{sideOffset:6,className:"z-50 rounded-md bg-[#242424] p-2 text-[#A8A8A8]",children:["All","Profit","Loss"].map(N=>i.jsx(eQ,{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(J1n,{children:[i.jsx(ebn,{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(A9,{className:"w-4 h-4"})]})}),i.jsx(tbn,{children:i.jsxs(nbn,{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,P)=>{const I=P===0?x:v,R=P===0?g:w,O=I!=="";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:I,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 ${O?"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"}),sbn.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"}),V_.map(({id:N,emoji:P,description:I})=>{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(xi,{content:I,children:P})},N)})]})})]})}function abn({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(VL,{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(tse,{className:"w-[10px] h-[10px]",style:{color:c}}):i.jsx(Dl,{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 nQ,EU="HoverCard",[gWe,Evn]=_5(EU,[c8]),_U=c8(),[obn,kU]=gWe(EU),bWe=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:s,onOpenChange:a,openDelay:o=700,closeDelay:l=300}=e,c=_U(t),u=m.useRef(0),d=m.useRef(0),f=m.useRef(!1),x=m.useRef(!1),[g,v]=yU({prop:r,defaultProp:s??!1,onChange:a,caller:EU}),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(obn,{scope:t,open:g,onOpenChange:v,onOpen:w,onClose:C,onDismiss:N,hasSelectionRef:f,isPointerDownOnContentRef:x,children:i.jsx(kue,{...c,children:n})})};bWe.displayName=EU;var yWe="HoverCardTrigger",vWe=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=kU(yWe,n),a=_U(n);return i.jsx(wU,{asChild:!0,...a,children:i.jsx(Dc.a,{"data-state":s.open?"open":"closed",...r,ref:t,onPointerEnter:di(e.onPointerEnter,lD(s.onOpen)),onPointerLeave:di(e.onPointerLeave,lD(s.onClose)),onFocus:di(e.onFocus,s.onOpen),onBlur:di(e.onBlur,s.onClose),onTouchStart:di(e.onTouchStart,o=>o.preventDefault())})})});vWe.displayName=yWe;var Uue="HoverCardPortal",[lbn,cbn]=gWe(Uue,{forceMount:void 0}),wWe=e=>{const{__scopeHoverCard:t,forceMount:n,children:r,container:s}=e,a=kU(Uue,t);return i.jsx(lbn,{scope:t,forceMount:n,children:i.jsx(C2,{present:n||a.open,children:i.jsx(Pue,{asChild:!0,container:s,children:r})})})};wWe.displayName=Uue;var oD="HoverCardContent",CWe=m.forwardRef((e,t)=>{const n=cbn(oD,e.__scopeHoverCard),{forceMount:r=n.forceMount,...s}=e,a=kU(oD,e.__scopeHoverCard);return i.jsx(C2,{present:r||a.open,children:i.jsx(ubn,{"data-state":a.open?"open":"closed",...s,onPointerEnter:di(e.onPointerEnter,lD(a.onOpen)),onPointerLeave:di(e.onPointerLeave,lD(a.onClose)),ref:t})})});CWe.displayName=oD;var ubn=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:o,...l}=e,c=kU(oD,n),u=_U(n),d=m.useRef(null),f=ou(t,d),[x,g]=m.useState(!1);return m.useEffect(()=>{if(x){const v=document.body;return nQ=v.style.userSelect||v.style.webkitUserSelect,v.style.userSelect="none",v.style.webkitUserSelect="none",()=>{v.style.userSelect=nQ,v.style.webkitUserSelect=nQ}}},[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&&hbn(d.current).forEach(w=>w.setAttribute("tabindex","-1"))}),i.jsx(vU,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:o,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:di(a,v=>{v.preventDefault()}),onDismiss:c.onDismiss,children:i.jsx(Tue,{...u,...l,onPointerDown:di(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)"}})})}),dbn="HoverCardArrow",fbn=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=_U(n);return i.jsx(Iue,{...s,...r,ref:t})});fbn.displayName=dbn;function lD(e){return t=>t.pointerType==="touch"?void 0:e()}function hbn(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 pbn=bWe,mbn=vWe,xbn=wWe,gbn=CWe;const bbn="#67FFBD",ybn="#FF797C",rQ=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 vbn({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:bbn}}),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:rQ(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:ybn}}),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:rQ(r.short)}),i.jsxs("span",{className:"text-[10px] font-medium leading-[10px] text-[#909090]",children:["(",a,"%)"]})]})]});return i.jsx(xi,{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:rQ(r.total)})]})},r.coin)})]})}const wbn="https://dextradata.nftinit.io/api/hyper/wallet/whale/open_interest/?period=1d",Cbn="https://dextradata.nftinit.io/api/hyper/wallet/whale/tx_summary/?period=1d",Sbn={BTC:"Bitcoin",ETH:"Ethereum",HYPE:"Hyperliquid",SOL:"Solana",XRP:"XRP",PUMP:"Pump",FARTCOIN:"Fartcoin"},Nbn=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 Abn(){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([hs.get(wbn),hs.get(Cbn)]),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 P=C[0]||{},I=((g=(x=w.data)==null?void 0:x.whale_summary)==null?void 0:g[0])||{};t([{type:"position",title:"Highest OI",coin:P.coin||"",name:Sbn[P.coin]||P.coin,value:Nbn(P.total)},{type:"trader",title:"Most Traded",coin:I.coin||"",name:"Top Trader",value:`${I.whale_count??"-"} Whales | TX: ${I.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(pbn,{openDelay:0,closeDelay:0,children:[i.jsx(mbn,{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(xbn,{children:i.jsx(gbn,{side:"right",align:"start",sideOffset:0,collisionPadding:8,children:i.jsx(vbn,{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 jbn="https://dextradata.nftinit.io/api/hyper/wallet/whale/top_user_pnl/?period=1d",Ebn="https://dextradata.nftinit.io/api/hyper/wallet/whale/high_risk_traders/?period=1d",_bn=e=>`${e.slice(0,5)}...${e.slice(-4)}`,kbn=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 Tbn(){const[e,t]=m.useState(null);return m.useEffect(()=>{const n=async()=>{var s,a,o,l;try{const[c,u]=await Promise.all([hs.get(jbn),hs.get(Ebn)]),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:_bn(g.user_token),wallet:g.user_token,amount:`${Number(g.pnl)>=0?"+":"-"}${kbn(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(tVe,{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(xi,{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 sQ(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 Ibn({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(xi,{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:_0,alt:"Dextrabot - Whale Trades"})]})}),i.jsx("span",{className:"text-[#8B8B8B] font-inter text-[12px] not-italic font-normal leading-[14px] tracking-[0.12px]",children:sQ(t)})]}),i.jsx(abn,{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(xi,{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:_0,alt:"Dextrabot - Whale Trades"})]})}),i.jsx("span",{className:"text-[#8B8B8B] font-inter text-[12px] not-italic font-normal leading-[14px] tracking-[0.12px]",children:sQ(t)})]}),i.jsx(Abn,{})]}),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(xi,{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:_0,alt:"Dextrabot - Whale Trades"})]})}),i.jsx("span",{className:"text-[#8B8B8B] font-inter text-[12px] not-italic font-normal leading-[14px] tracking-[0.12px]",children:sQ(t)})]}),i.jsx(Tbn,{})]})]})}function Pbn(){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(No,{children:i.jsxs(Lo,{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:Myt,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(xi,{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:zbt,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(P0n,{onData:s=>{t(s),r(new Date)}})}),i.jsx("div",{className:"w-full sm:w-2/3",children:i.jsx(nxn,{})})]}),i.jsx("div",{className:"mt-4",children:i.jsx(Ibn,{data:e,lastUpdated:n})}),i.jsx("div",{className:"mt-4",children:i.jsx(ibn,{})})]})]})}const Fbn=()=>{const{setSignModalOpen:e}=m.useContext(Qr),{address:t}=ts(),[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"),P=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 I="https://dextrabothypev2.nftinit.io/api/telegram/sign_with_telegram/",R={address:t?t.toLowerCase():P,token:N,temp_password:n.join("")},U=await(await fetch(I,{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("")),tn.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),tn.error(N.message||"Something went wrong!"),a(N.message||"Something went wrong!"),f(!0),l(!1)}},g=(N,P)=>{f(!1);const I=[...n];I[P]=N.target.value.toUpperCase().slice(0,1),r(I),N.target.value.length===1&&P<5&&document.getElementById(`code-input-${P+1}`).focus()},v=N=>{f(!1);const P=N.clipboardData.getData("Text").slice(0,6),I=[...n];for(let O=0;O<P.length;O++)I[O]=P[O].toUpperCase();r(I);const R=document.getElementById(`code-input-${(P==null?void 0:P.length)-1}`);R==null||R.focus(),R==null||R.select()},w=(N,P)=>{var I,R;if(f(!1),N.key==="Backspace"){if(n[P]){const O=[...n];O[P]="",r(O)}else if(P>0){const O=document.getElementById(`code-input-${P-1}`),U=[...n];U[P-1]="",r(U),O==null||O.focus()}}else N.key==="ArrowLeft"&&P>0?(I=document.getElementById(`code-input-${P-1}`))==null||I.focus():N.key==="ArrowRight"&&P<5&&((R=document.getElementById(`code-input-${P+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:ec,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:ake,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:oke,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:Lyt,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,P)=>i.jsx("input",{id:`code-input-${P}`,type:"text",maxLength:"1",value:N,autoComplete:"off",onChange:I=>g(I,P),onKeyDown:I=>w(I,P),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`},P))}),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"})})]})]})]})},Obn=()=>{const{isConnected:e,address:t}=ts(),{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(Qr),[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,O;const P=window.localStorage.getItem("hyperToken"),I=window.localStorage.getItem("hyperAddress");if(!(!P||!I))try{const U=await _i(I.toLowerCase(),P);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((O=U==null?void 0:U.mushboomer_counts)==null?void 0:O.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(No,{children:i.jsxs(Lo,{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(Fbn,{}):i.jsx("div",{className:"flex justify-center items-center w-full",children:i.jsx(fU,{})})})]})};function Mbn({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(Nl,{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 Rbn(){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 zue={};(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 te=new OffscreenCanvas(1,1),ae=te.getContext("2d");ae.fillRect(0,0,1,1);var fe=te.transferToImageBitmap();try{ae.createPattern(fe,"no-repeat")}catch{return!1}return!0}();function c(){}function u(te){var ae=n.exports.Promise,fe=ae!==void 0?ae:t.Promise;return typeof fe=="function"?new fe(te):(te(c,c),null)}var d=function(te,ae){return{transform:function(fe){if(te)return fe;if(ae.has(fe))return ae.get(fe);var Ne=new OffscreenCanvas(fe.width,fe.height),me=Ne.getContext("2d");return me.drawImage(fe,0,0),ae.set(fe,Ne),Ne},clear:function(){ae.clear()}}}(l,new Map),f=function(){var te=Math.floor(16.666666666666668),ae,fe,Ne={},me=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(ae=function(we){var xe=Math.random();return Ne[xe]=requestAnimationFrame(function ye(je){me===je||me+te-1<je?(me=je,delete Ne[xe],we()):Ne[xe]=requestAnimationFrame(ye)}),xe},fe=function(we){Ne[we]&&cancelAnimationFrame(Ne[we])}):(ae=function(we){return setTimeout(we,te)},fe=function(we){return clearTimeout(we)}),{frame:ae,cancel:fe}}(),x=function(){var te,ae,fe={};function Ne(me){function we(xe,ye){me.postMessage({options:xe||{},callback:ye})}me.init=function(ye){var je=ye.transferControlToOffscreen();me.postMessage({canvas:je},[je])},me.fire=function(ye,je,Pe){if(ae)return we(ye,null),ae;var Re=Math.random().toString(36).slice(2);return ae=u(function(Xe){function Ke(ut){ut.data.callback===Re&&(delete fe[Re],me.removeEventListener("message",Ke),ae=null,d.clear(),Pe(),Xe())}me.addEventListener("message",Ke),we(ye,Re),fe[Re]=Ke.bind(null,{data:{callback:Re}})}),ae},me.reset=function(){me.postMessage({reset:!0});for(var ye in fe)fe[ye](),delete fe[ye]}}return function(){if(te)return te;if(!r&&a){var me=["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{te=new Worker(URL.createObjectURL(new Blob([me])))}catch(we){return typeof console!==void 0&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",we),null}Ne(te)}return te}}(),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(te,ae){return ae?ae(te):te}function w(te){return te!=null}function C(te,ae,fe){return v(te&&w(te[ae])?te[ae]:g[ae],fe)}function N(te){return te<0?0:Math.floor(te)}function P(te,ae){return Math.floor(Math.random()*(ae-te))+te}function I(te){return parseInt(te,16)}function R(te){return te.map(O)}function O(te){var ae=String(te).replace(/[^0-9a-f]/gi,"");return ae.length<6&&(ae=ae[0]+ae[0]+ae[1]+ae[1]+ae[2]+ae[2]),{r:I(ae.substring(0,2)),g:I(ae.substring(2,4)),b:I(ae.substring(4,6))}}function U(te){var ae=C(te,"origin",Object);return ae.x=C(ae,"x",Number),ae.y=C(ae,"y",Number),ae}function L(te){te.width=document.documentElement.clientWidth,te.height=document.documentElement.clientHeight}function z(te){var ae=te.getBoundingClientRect();te.width=ae.width,te.height=ae.height}function X(te){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=te,ae}function ne(te,ae,fe,Ne,me,we,xe,ye,je){te.save(),te.translate(ae,fe),te.rotate(we),te.scale(Ne,me),te.arc(0,0,1,xe,ye,je),te.restore()}function J(te){var ae=te.angle*(Math.PI/180),fe=te.spread*(Math.PI/180);return{x:te.x,y:te.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:te.startVelocity*.5+Math.random()*te.startVelocity,angle2D:-ae+(.5*fe-Math.random()*fe),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:te.color,shape:te.shape,tick:0,totalTicks:te.ticks,decay:te.decay,drift:te.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:te.gravity*3,ovalScalar:.6,scalar:te.scalar,flat:te.flat}}function K(te,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,Ne=ae.x+ae.random*ae.tiltCos,me=ae.y+ae.random*ae.tiltSin,we=ae.wobbleX+ae.random*ae.tiltCos,xe=ae.wobbleY+ae.random*ae.tiltSin;if(te.fillStyle="rgba("+ae.color.r+", "+ae.color.g+", "+ae.color.b+", "+(1-fe)+")",te.beginPath(),o&&ae.shape.type==="path"&&typeof ae.shape.path=="string"&&Array.isArray(ae.shape.matrix))te.fill(oe(ae.shape.path,ae.shape.matrix,ae.x,ae.y,Math.abs(we-Ne)*.1,Math.abs(xe-me)*.1,Math.PI/10*ae.wobble));else if(ae.shape.type==="bitmap"){var ye=Math.PI/10*ae.wobble,je=Math.abs(we-Ne)*.1,Pe=Math.abs(xe-me)*.1,Re=ae.shape.bitmap.width*ae.scalar,Xe=ae.shape.bitmap.height*ae.scalar,Ke=new DOMMatrix([Math.cos(ye)*je,Math.sin(ye)*je,-Math.sin(ye)*Pe,Math.cos(ye)*Pe,ae.x,ae.y]);Ke.multiplySelf(new DOMMatrix(ae.shape.matrix));var ut=te.createPattern(d.transform(ae.shape.bitmap),"no-repeat");ut.setTransform(Ke),te.globalAlpha=1-fe,te.fillStyle=ut,te.fillRect(ae.x-Re/2,ae.y-Xe/2,Re,Xe),te.globalAlpha=1}else if(ae.shape==="circle")te.ellipse?te.ellipse(ae.x,ae.y,Math.abs(we-Ne)*ae.ovalScalar,Math.abs(xe-me)*ae.ovalScalar,Math.PI/10*ae.wobble,0,2*Math.PI):ne(te,ae.x,ae.y,Math.abs(we-Ne)*ae.ovalScalar,Math.abs(xe-me)*ae.ovalScalar,Math.PI/10*ae.wobble,0,2*Math.PI);else if(ae.shape==="star")for(var et=Math.PI/2*3,tt=4*ae.scalar,Le=8*ae.scalar,$e=ae.x,ht=ae.y,pt=5,Kt=Math.PI/pt;pt--;)$e=ae.x+Math.cos(et)*Le,ht=ae.y+Math.sin(et)*Le,te.lineTo($e,ht),et+=Kt,$e=ae.x+Math.cos(et)*tt,ht=ae.y+Math.sin(et)*tt,te.lineTo($e,ht),et+=Kt;else te.moveTo(Math.floor(ae.x),Math.floor(ae.y)),te.lineTo(Math.floor(ae.wobbleX),Math.floor(me)),te.lineTo(Math.floor(we),Math.floor(xe)),te.lineTo(Math.floor(Ne),Math.floor(ae.wobbleY));return te.closePath(),te.fill(),ae.tick<ae.totalTicks}function re(te,ae,fe,Ne,me){var we=ae.slice(),xe=te.getContext("2d"),ye,je,Pe=u(function(Re){function Xe(){ye=je=null,xe.clearRect(0,0,Ne.width,Ne.height),d.clear(),me(),Re()}function Ke(){r&&!(Ne.width===s.width&&Ne.height===s.height)&&(Ne.width=te.width=s.width,Ne.height=te.height=s.height),!Ne.width&&!Ne.height&&(fe(te),Ne.width=te.width,Ne.height=te.height),xe.clearRect(0,0,Ne.width,Ne.height),we=we.filter(function(ut){return K(xe,ut)}),we.length?ye=f.frame(Ke):Xe()}ye=f.frame(Ke),je=Xe});return{addFettis:function(Re){return we=we.concat(Re),Pe},canvas:te,promise:Pe,reset:function(){ye&&f.cancel(ye),je&&je()}}}function he(te,ae){var fe=!te,Ne=!!C(ae||{},"resize"),me=!1,we=C(ae,"disableForReducedMotion",Boolean),xe=a&&!!C(ae||{},"useWorker"),ye=xe?x():null,je=fe?L:z,Pe=te&&ye?!!te.__confetti_initialized:!1,Re=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,Xe;function Ke(et,tt,Le){for(var $e=C(et,"particleCount",N),ht=C(et,"angle",Number),pt=C(et,"spread",Number),Kt=C(et,"startVelocity",Number),wt=C(et,"decay",Number),nn=C(et,"gravity",Number),cn=C(et,"drift",Number),zn=C(et,"colors",R),Xt=C(et,"ticks",Number),on=C(et,"shapes"),Zt=C(et,"scalar"),Ye=!!C(et,"flat"),Ze=U(et),Ft=$e,dn=[],Yt=te.width*Ze.x,Bt=te.height*Ze.y;Ft--;)dn.push(J({x:Yt,y:Bt,angle:ht,spread:pt,startVelocity:Kt,color:zn[Ft%zn.length],shape:on[P(0,on.length)],ticks:Xt,decay:wt,gravity:nn,drift:cn,scalar:Zt,flat:Ye}));return Xe?Xe.addFettis(dn):(Xe=re(te,dn,je,tt,Le),Xe.promise)}function ut(et){var tt=we||C(et,"disableForReducedMotion",Boolean),Le=C(et,"zIndex",Number);if(tt&&Re)return u(function(Kt){Kt()});fe&&Xe?te=Xe.canvas:fe&&!te&&(te=X(Le),document.body.appendChild(te)),Ne&&!Pe&&je(te);var $e={width:te.width,height:te.height};ye&&!Pe&&ye.init(te),Pe=!0,ye&&(te.__confetti_initialized=!0);function ht(){if(ye){var Kt={getBoundingClientRect:function(){if(!fe)return te.getBoundingClientRect()}};je(Kt),ye.postMessage({resize:{width:Kt.width,height:Kt.height}});return}$e.width=$e.height=null}function pt(){Xe=null,Ne&&(me=!1,t.removeEventListener("resize",ht)),fe&&te&&(document.body.contains(te)&&document.body.removeChild(te),te=null,Pe=!1)}return Ne&&!me&&(me=!0,t.addEventListener("resize",ht,!1)),ye?ye.fire(et,$e,pt):Ke(et,$e,pt)}return ut.reset=function(){ye&&ye.reset(),Xe&&Xe.reset()},ut}var Q;function ie(){return Q||(Q=he(null,{useWorker:!0,resize:!0})),Q}function oe(te,ae,fe,Ne,me,we,xe){var ye=new Path2D(te),je=new Path2D;je.addPath(ye,new DOMMatrix(ae));var Pe=new Path2D;return Pe.addPath(je,new DOMMatrix([Math.cos(xe)*me,Math.sin(xe)*me,-Math.sin(xe)*we,Math.cos(xe)*we,fe,Ne])),Pe}function G(te){if(!o)throw new Error("path confetti are not supported in this browser");var ae,fe;typeof te=="string"?ae=te:(ae=te.path,fe=te.matrix);var Ne=new Path2D(ae),me=document.createElement("canvas"),we=me.getContext("2d");if(!fe){for(var xe=1e3,ye=xe,je=xe,Pe=0,Re=0,Xe,Ke,ut=0;ut<xe;ut+=2)for(var et=0;et<xe;et+=2)we.isPointInPath(Ne,ut,et,"nonzero")&&(ye=Math.min(ye,ut),je=Math.min(je,et),Pe=Math.max(Pe,ut),Re=Math.max(Re,et));Xe=Pe-ye,Ke=Re-je;var tt=10,Le=Math.min(tt/Xe,tt/Ke);fe=[Le,0,0,Le,-Math.round(Xe/2+ye)*Le,-Math.round(Ke/2+je)*Le]}return{type:"path",path:ae,matrix:fe}}function V(te){var ae,fe=1,Ne="#000000",me='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';typeof te=="string"?ae=te:(ae=te.text,fe="scalar"in te?te.scalar:fe,me="fontFamily"in te?te.fontFamily:me,Ne="color"in te?te.color:Ne);var we=10*fe,xe=""+we+"px "+me,ye=new OffscreenCanvas(we,we),je=ye.getContext("2d");je.font=xe;var Pe=je.measureText(ae),Re=Math.ceil(Pe.actualBoundingBoxRight+Pe.actualBoundingBoxLeft),Xe=Math.ceil(Pe.actualBoundingBoxAscent+Pe.actualBoundingBoxDescent),Ke=2,ut=Pe.actualBoundingBoxLeft+Ke,et=Pe.actualBoundingBoxAscent+Ke;Re+=Ke+Ke,Xe+=Ke+Ke,ye=new OffscreenCanvas(Re,Xe),je=ye.getContext("2d"),je.font=xe,je.fillStyle=Ne,je.fillText(ae,ut,et);var tt=1/fe;return{type:"bitmap",bitmap:ye.transferToImageBitmap(),matrix:[tt,0,0,tt,-Re*tt/2,-Xe*tt/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||{}}(),zue,!1);const Lbn=zue.exports;zue.exports.create;const Dbn=200,Bbn={origin:{y:.7}};function ij(e,t){Lbn({...Bbn,...t,particleCount:Math.floor(Dbn*e)})}function $bn(){ij(.25,{spread:26,startVelocity:55}),ij(.2,{spread:60}),ij(.35,{spread:100,decay:.91,scalar:.8}),ij(.1,{spread:120,startVelocity:25,decay:.92,scalar:1.2}),ij(.1,{spread:120,startVelocity:45})}function Ubn({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=me=>{navigator.clipboard.writeText(me),tn.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=me=>me>=1e9?`${(me/1e9).toFixed(0)}B`:me>=1e6?`${(me/1e6).toFixed(0)}M`:me>=1e3?`${(me/1e3).toFixed(0)}K`:me.toFixed(0),{main:v,steps:w}=e,C=Object.values(e.steps).flat().map(me=>({...me,timestamp:new Date(me.timestamp).getTime()})).sort((me,we)=>me.timestamp-we.timestamp),N={};C.forEach(me=>{N[me.timestamp]=(N[me.timestamp]||0)+me.pnl_this_step});let P=e.main.initial_equity;const I=Object.entries(N).sort((me,we)=>me[0]-we[0]).map(([me,we])=>(P+=we,[Number(me),+P.toFixed(2)])),R=I.map(([,me])=>me);let O=R[0],U=0;R.forEach(me=>{me>O&&(O=me);const we=(O-me)/O;we>U&&(U=we)});const L=(U*100).toFixed(2),z=C.filter(me=>me.pnl_this_step>0).length,X=C.filter(me=>me.pnl_this_step<0).length,ne=`${(z/C.length*100).toFixed(2)}%`,J=I.slice(1).map(([,me],we)=>{const xe=I[we][1];return(me-xe)/xe}),K=me=>me.length?me.reduce((we,xe)=>we+xe,0)/me.length:0,re=me=>{const we=K(me),xe=K(me.map(ye=>(ye-we)**2));return Math.sqrt(xe)},he=(re(J)?K(J)/re(J):0).toFixed(2),Q=((v.my_total_equity/v.initial_equity-1)*100).toFixed(2),ie={},oe=me=>{var we;return{time:new Date(me.timestamp).toLocaleTimeString(),pnl:me.pnl_this_step,coin:me.coin,activity:{direction:((we=me.trader_direction)==null?void 0:we.toLowerCase())==="long"?"Long":"Short",leverage:me.trader_leverage},size:me.trader_szi,posValue:me.our_target_value,entry:me.our_pos_entry_price,close:me.market_price}};C.forEach(me=>{const we=new Date(me.timestamp).toLocaleDateString();ie[we]=ie[we]||{rows:[],totalPnl:0},ie[we].rows.push(oe(me)),ie[we].totalPnl+=me.pnl_this_step});const G=Object.entries(ie).sort((me,we)=>new Date(me[0])-new Date(we[0]));let V=v.initial_equity;const te=G.map(([me,{rows:we,totalPnl:xe}])=>(V+=xe,{date:me,rows:we,totalPnl:xe,equity:V}));m.useEffect(()=>{var me;if(((me=e==null?void 0:e.main)==null?void 0:me.final_pnl)>0){$bn(),o(!0);const we=setTimeout(()=>o(!1),3e3);return()=>clearTimeout(we)}},[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:me=>g(me)}},dataLabels:{enabled:!1},tooltip:{theme:"dark",x:{format:"dd/MM HH:mm"},y:{formatter:me=>`$${me.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:me=>i.jsxs("span",{className:`flex justify-end ${me<0?"text-[#FF797C]":"text-[#67FFBD]"}`,children:[me<0?"- $":"$",Math.abs(me).toFixed(2)]})},{key:"coin",label:"Symbol",sortable:!0,width:"0.7fr",render:(me,we)=>i.jsxs("div",{className:"flex items-center gap-2 text-[12px]",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${we.coin}.svg`,onError:sa,className:"w-5 h-5"}),we.coin]})},{key:"activity",label:"Direction",width:"1.3fr",render:(me,we)=>{const xe=we.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 ${xe?"text-[#67ffbd] bg-[rgba(103,255,189,0.16)]":"text-[#ff787b] bg-[rgba(255,131,117,0.16)]"}`,children:[i.jsx(Fs,{className:`w-3 h-3 ${xe?"rotate-180 text-[#67ffbd]":"text-[#ff787b]"}`}),`${we.activity.direction} - ${we.activity.leverage}x`]})}},{key:"size",label:"Size",width:"0.8fr"},{key:"posValue",label:"Position Value",width:"1fr",render:me=>`$${me.toFixed(2)}`},{key:"entry",label:"Entry Price",width:"0.9fr",render:me=>`$${me.toLocaleString()}`},{key:"close",label:"Close Price",width:"0.9fr",render:me=>`$${me.toLocaleString()}`}],Ne=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(dp,{isOpen:r,onClose:()=>s(!1),children:[i.jsx("h2",{className:"text-white text-lg mb-4",children:"Perp Equity Chart"}),i.jsx(VL,{options:{...ae,chart:{...ae.chart,sparkline:{enabled:!1}}},series:[{name:"Equity",data:I}],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",Ne?"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",`${Q}%`,Q<0?"#FF797C":"#67FFBD"],["Sharpe",he,"white"]].map(([me,we,xe])=>i.jsxs("div",{children:[i.jsx("div",{className:"text-[#8E8E8E] text-[14px] pb-1",children:me}),i.jsx("div",{style:{color:xe},className:"text-[14px] font-semibold whitespace-nowrap",children:typeof we=="number"?`$${we.toFixed(2)}`:we})]},me))}),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:Ryt,alt:"expand",className:"cursor-pointer",onClick:()=>s(!0)})]}),i.jsx(VL,{options:ae,series:[{name:"Equity",data:I}],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:te.map(({date:me,rows:we,totalPnl:xe,equity:ye})=>{const je=xe>=0,Pe=l[me];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,[me]:!Pe})),children:[i.jsx("span",{className:"text-left text-white",children:me}),i.jsxs("span",{className:"text-center text-white",children:["$",ye.toFixed(2)]}),i.jsxs("span",{className:`text-right ${je?"text-[#67FFBD]":"text-[#FF797C]"}`,children:[je?"+":"-","$",Math.abs(xe).toFixed(2)]})]}),Pe&&i.jsx("div",{className:"overflow-x-auto",children:i.jsx(Lu,{columns:fe,data:we,listHeight:Math.min(we.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})})]},me)})})]})]})}const zbn=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()},Hbn=()=>{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 Vbn(){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){tn.error(x.error_message),t("starter");return}window.history.replaceState(null,"","?"+zbn(l)),a(l.period),r(x),t("result")}catch(f){console.error(f),t("starter"),tn.error("Backtest failed. Please try again.")}},[]);return m.useEffect(()=>{const l=Hbn();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(Mbn,{onRun:o}),e==="loading"&&i.jsx(Rbn,{}),e==="result"&&i.jsx(Ubn,{result:n,period:s,onBack:()=>{window.history.replaceState(null,"",window.location.pathname),t("starter")}})]})}const Wbn=({tg:e})=>{const{address:t}=ts(),[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(f5,{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:Ki,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:oke,alt:""}),i.jsx("div",{className:"justify-start text-black text-sm font-semibold font-['Inter'] leading-none min-w-max",children:"Open Telegram App"})]})]})]})})]})},qbn=()=>{const[e]=WNe(),t=e==null?void 0:e.get("tg"),{isConnected:n,address:r}=ts(),{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(Qr),[N,P]=m.useState(!!window.localStorage.getItem("hyperToken"));return m.useEffect(()=>{const I=window.localStorage.getItem("hyperToken");P(!!I)},[r,n,s,a]),m.useEffect(()=>{(async()=>{var U,L;const R=window.localStorage.getItem("hyperToken"),O=window.localStorage.getItem("hyperAddress");if(!(!R||!O))try{const z=await _i(O.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(No,{children:i.jsxs(Lo,{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(Wbn,{tg:t}):i.jsx("div",{className:"flex justify-center items-center w-full",children:i.jsx(fU,{})})})]})},fNe="/assets/share1-C-zw_JWP.jpg",Gbn="/assets/share2-DdEku457.jpg",Kbn="/assets/share3-CNxpeTYT.jpg",Ybn="/assets/share4-DJuI_ZiE.jpg",Xbn="/assets/share5-T6uiFcTh.jpg",Qbn="/assets/share6-DjS5fdAF.jpg",Zbn="/assets/share7-BaMtg3x6.jpg",Jbn="/assets/share8-xyCgNFII.jpg",eyn="/assets/share9-BLclkV1L.jpg",tyn="/assets/share10-C9sVwYdl.jpg",nyn="/assets/share11-_FKzaoRV.jpg",ryn="/assets/share12-DHiXk6_m.jpg",syn="/assets/share13-0mVBxTxA.jpg",iyn="/assets/share14-B6N7agx8.jpg",ayn="/assets/share15-D46qu5xc.jpg",oyn="/assets/share16-B06pZYlo.jpg",lyn="/assets/share17-C9ObNWuI.jpg",cyn="/assets/share18-DafUfIIP.jpg",uyn="/assets/share19-DdeHQJDd.jpg",dyn="/assets/share20-Cx0LCWyZ.jpg",fyn="/assets/lighter-banner-B9jyiBZ3.png",hyn="#67FFBD",pyn="https://dextrabothypev2.nftinit.io/api/hyper/fee_calculator_save/";function myn({initialWalletAddress:e}){const t=Wo(),[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),[P,I]=m.useState(fNe),[R,O]=m.useState(""),[U,L]=m.useState(""),z=m.useRef(!1),X=m.useRef(null),ne=m.useRef(null),J=m.useRef(0),K=[fNe,Gbn,Kbn,Ybn,Xbn,Qbn,Zbn,Jbn,eyn,tyn,nyn,ryn,syn,iyn,ayn,oyn,lyn,cyn,uyn,dyn];m.useEffect(()=>{const Re=document.querySelector("main");Re&&(Re.style.background="#0b0b0b"),O(`${window.location.origin}${window.location.pathname}`);const Xe=decodeURIComponent((window.location.hash||"").replace(/^#/,"")),Ke=window.location.pathname.split("/").filter(Boolean),ut=Ke[Ke.length-1]||"",tt=ut&&ut.toLowerCase()!=="hyperliquid-fee-calculator"?decodeURIComponent(ut):"",Le=Xe||tt;if(Le){f(Le),r(Le);const $e=`${window.location.pathname}#${encodeURIComponent(Le)}`;window.history.replaceState(null,"",$e),L(`${window.location.origin}${$e}`),oe(Le)}return()=>{Re&&(Re.style.background="")}},[]),m.useEffect(()=>{e&&e.trim()&&oe(e)},[e]);const re=Re=>{const Xe=Number(Re||0);return Math.abs(Xe)>=1e6?`$${(Xe/1e6).toFixed(2)}M`:Math.abs(Xe)>=1e3?`$${(Xe/1e3).toFixed(2)}K`:`$${Xe.toFixed(2)}`},he=Re=>`$${Number(Re||0).toFixed(2)}`,Q=()=>new Date().toLocaleDateString("en-US",{month:"short",day:"numeric"}),ie=async Re=>{if(z.current)return;z.current=!0;const Xe=window.localStorage.getItem("hyperAddress")||"",Ke={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:Q()}};Xe&&(Ke.address=Xe);try{await fetch(pyn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ke)})}catch{}},oe=async Re=>{if(!Re){tn.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 lin(Re,Xe=>{Xe.totalFills>=2e3&&g(!0),u({...Xe,isPartial:!Xe.isComplete}),w(Math.min(Xe.requestCount/12*100,100)),Xe.isComplete&&(g(!1),w(100),a(!1),N(!0),ie(Xe),t(`/hyperliquid-fee-calculator/${Re}`,{replace:!0}))})}catch(Xe){l(Xe.message||"Failed to calculate fees"),tn.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.`})(),te=async()=>{if(X.current)try{await document.fonts.ready;const Re=await P1(X.current,{cacheBust:!0,backgroundColor:"#0b0b0b",useCORS:!0,pixelRatio:2}),Xe=document.createElement("a");Xe.href=Re,Xe.download="dextrabot-fee-card.png",document.body.appendChild(Xe),Xe.click(),document.body.removeChild(Xe)}catch{tn.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)}`,[Ne,me]=m.useState({rx:0,ry:0,gx:50,gy:50}),we=12,xe=Re=>{ne.current&&(cancelAnimationFrame(J.current),J.current=requestAnimationFrame(()=>{const Xe=ne.current.getBoundingClientRect(),Ke=(Re.clientX-Xe.left)/Xe.width,ut=(Re.clientY-Xe.top)/Xe.height,et=(Ke-.5)*(we*2),tt=(.5-ut)*(we*2);me({rx:Math.max(-12,Math.min(we,tt)),ry:Math.max(-12,Math.min(we,et)),gx:Ke*100,gy:ut*100})}))},ye=()=>{cancelAnimationFrame(J.current),me({rx:0,ry:0,gx:50,gy:50})},je=s,Pe=!n.trim();return i.jsxs(No,{children:[i.jsxs(Lo,{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(wo.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:_A,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:hyn},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(Wan,{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(eze,{className:"h-6 w-6 text-[#8ea79e] hover:text-white transition-colors"})}):null]}),i.jsxs(wo.button,{whileTap:{scale:.98},onClick:()=>oe(n),disabled:je||Pe,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]":Pe?"bg-[#16211b] text-[#7ea391] cursor-not-allowed border border-[#1e2e27]":"bg[rgba(103,255,189,0.95)]"}`,style:!je&&!Pe?{backgroundColor:"rgba(103,255,189,0.95)",color:"#0b0b0b"}:void 0,children:[i.jsx(xT,{initial:!1,children:je&&i.jsx(wo.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:QN,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,preload:"auto",className:"w-full h-[320px] lg:h-[380px] object-cover"},QN)]})})]})]}),C&&c&&i.jsx(wo.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($an,{className:"w-5 h-5"}),"Back"]})}),i.jsxs("div",{className:"shrink-0",children:[i.jsx(xyn,{refCard:X,refWrap:ne,tilt:Ne,onMove:xe,onLeave:ye,feeData:c,selectedImage:P}),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(T6t,{})}),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(YY,{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(N6t,{})}),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(YY,{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(E6t,{})}),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(YY,{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:K.map((Re,Xe)=>i.jsx(wo.button,{whileHover:{y:-2},whileTap:{scale:.98},onClick:()=>I(Re),className:`rounded-md overflow-hidden border ${P===Re?"border-[#67FFBD]":"border-[#2b2b2b]"}`,children:i.jsx("img",{src:Re,alt:`bg-${Xe}`,className:"w-full h-16 object-cover"})},Xe))}),i.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[i.jsx("button",{onClick:te,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:fyn,alt:"Lighter — Zero Fee",className:"h-full w-full cursor-pointer",loading:"eager",decoding:"async",draggable:!1,onClick:()=>{window.location.hash="lighter-farming"}})})]})]})]})}function xyn({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:Ki,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:Ki,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 hNe=()=>{const{walletAddress:e}=t5(),{setTelegramChatId:t,setSubscriberRole:n,setSubsExpireDay:r,setMushboomerETH:s,setIsWhitelist:a,setMushboomerSOL:o,setIsReferralCode:l,setIsReferralCodeName:c,setHyperToken:u,setHyperAddress:d}=m.useContext(Qr);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 _i(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(No,{children:i.jsxs(Lo,{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(myn,{initialWalletAddress:e})})})]})};function gyn(e){return _l({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 pNe(e){return _l({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 mNe(e){return _l({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 xNe(e){return _l({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 byn(e){return _l({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 yyn({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:Po,border:`1px solid ${Ma}`,color:Di},children:[i.jsx("span",{className:"truncate text-xs font-medium",style:{color:Di},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:Po,border:`1px solid ${Ma}`},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":Di},onClick:()=>{t==null||t(u.value),o(!1)},children:u.label},u.value)})})]})}const kb="#67FFBD",FO="#ff7073",pF="#60A5FA",gNe="#A78BFA",vyn="#F97316",wyn={KBONK:"BONK",KPEPE:"PEPE",KSHIB:"SHIB",KFLOKI:"FLOKI",KNEIRO:"NEIRO",KDOGS:"DOGS",KLUNC:"LUNC"},Cyn=new Set(["KBONK","KPEPE","KSHIB"]),Syn="https://app.hyperliquid.xyz/coins",bNe={SAFE:{icon:"✅",color:kb,label:"Safe",tooltip:"Order can be safely executed with sufficient collateral buffer"},WARNING:{icon:"⚠️",color:vyn,label:"Warning",tooltip:"Position is approaching liquidation risk, consider reducing leverage or adding collateral"},STOPPED:{icon:"🛑",color:FO,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"}},Ph=({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(Ai,{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"}})]})]})},tg=({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=O=>{const U=parseFloat(O);return d?d(U,O):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=O=>{let U=O.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)},P=()=>{w(!0)},I=C(t),R=x&&(g||I)?g||I:v&&I?I: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(Ph,{content:l,children:"?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{type:"number",value:t,onChange:N,onBlur:P,onWheel:O=>O.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})]})},Nyn=e=>{const t=String(e||"").toUpperCase();return Cyn.has(t)?`1000${t.slice(1)}`:t},Eo=(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)},Cb=(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)}`,Ayn=e=>e==null||isNaN(e)?"-":`${e.toFixed(2)}%`,jyn=(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)},Sc=e=>String(e||"").toUpperCase().replace(/-USD(T)?$/,"").replace(/\/USD(T)?$/,"").replace(/USD(T)?$/,""),Eyn=(e,t=[])=>{const n=Sc(e),r=t.find(s=>{var o;const a=Sc(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},_yn=(e,t=[])=>{const n=Sc(e);return t.find(r=>{var a;const s=Sc(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},kyn=({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(Ph,{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"})]})]})]})},yNe=({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 Tyn(){var Tt;const e=Sue(),t=e.length===0,n=Nue(),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(""),[P,I]=m.useState("long"),[R,O]=m.useState("10"),[U,L]=m.useState("5"),[z,X]=m.useState("10"),[ne,J]=m.useState("10"),[K,re]=m.useState("1500"),[he,Q]=m.useState(!1),[ie,oe]=m.useState("1"),[G,V]=m.useState(""),[te,ae]=m.useState(!0),[fe,Ne]=m.useState("0.50"),[me,we]=m.useState("1.1"),[xe,ye]=m.useState("1"),[je,Pe]=m.useState(!0),[Re,Xe]=m.useState(!0),[Ke,ut]=m.useState(!0),[et,tt]=m.useState(!0),[Le,$e]=m.useState("details"),[ht,pt]=m.useState([]),[Kt,wt]=m.useState(!1),[nn,cn]=m.useState([]),[zn,Xt]=m.useState(!1),[on,Zt]=m.useState(null),[Ye,Ze]=m.useState(!1),[Ft,dn]=m.useState({}),[Yt,Bt]=m.useState({}),[ot,De]=m.useState(null),_t=m.useRef(!1),ze=m.useRef(!0),nt=m.useRef(0),mt=s==="extended"?n:e,$t=s==="extended"?r:t,Pt=s==="extended"?"extended_selected_wallet_id":"lighter_selected_wallet_id",un=m.useMemo(()=>`dca_last_coin_${s}`,[s]),an=m.useMemo(()=>`dca_settings_${s}`,[s]),xn=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 Ge=window.localStorage.getItem(an),At={...xn};if(Ge)try{const Ot=JSON.parse(Ge)||{};Object.keys(xn).forEach(it=>{Ot[it]!==void 0&&Ot[it]!==null&&(At[it]=String(Ot[it]))})}catch{}L(At.baseOrderMargin),X(At.dcaOrderMargin),J(At.maxDcaOrders),oe(At.tpTarget),V(At.stopLoss),Ne(At.priceDeviation),we(At.dcaSizeMultiplier),ye(At.priceDevMultiplier)},[an,xn]),m.useEffect(()=>{if(typeof window>"u")return;const Ge={baseOrderMargin:U,dcaOrderMargin:z,maxDcaOrders:ne,tpTarget:ie,stopLoss:G,priceDeviation:fe,dcaSizeMultiplier:me,priceDevMultiplier:xe};try{window.localStorage.setItem(an,JSON.stringify(Ge))}catch{}},[an,U,z,ne,ie,G,fe,me,xe]);const An=m.useMemo(()=>{const Ge=new Map;return o.forEach(At=>{const Ot=Sc(At.value||At.label||At.symbol||At.coin);if(!Ot)return;const it=At.maxLeverage??At.max_leverage??At.leverage??null,jt=Number(it);Ge.set(Ot,Number.isFinite(jt)?jt:null)}),Ge},[o]),kn=m.useMemo(()=>mt.map(Ge=>{var jt,Nn,mn;const At=Sc(Ge.symbol||Ge.rawSymbol||((jt=Ge.raw)==null?void 0:jt.symbol)||Ge.market||Ge.coin),Ot=Ge.leverage??Ge.maxLeverage??Ge.max_leverage??(At?An.get(At):null),it=Number.isFinite(Number(Ot))&&Number(Ot)>0?Number(Ot):null;return{...Ge,symbol:Ge.symbol||((Nn=Ge.raw)==null?void 0:Nn.symbol)||Ge.rawSymbol||Ge.market||"",rawSymbol:Ge.rawSymbol||((mn=Ge.raw)==null?void 0:mn.symbol)||Ge.symbol,leverage:it,maxLeverage:Ge.maxLeverage??Ge.max_leverage??it}}),[mt,An]),yn="https://dextrabothypev2.nftinit.io/api/hyper/dca_bot",{setSignModalOpen:Vn,hyperToken:Gn,hyperAddress:Rn}=m.useContext(Qr),[Yn,Cn]=m.useState({address:null,token:null}),rn=m.useCallback(()=>Yn,[Yn]),[Oe,Jt]=m.useState(!1),sn=Ge=>{if(!Ge)return null;const At=String(Ge);return At==="null"||At==="undefined"?null:At};m.useEffect(()=>{const Ge=()=>{if(typeof window>"u")return;const Ot=sn(Rn||window.localStorage.getItem("hyperAddress")),it=sn(Gn||window.localStorage.getItem("hyperToken"));Cn({address:Ot,token:it}),(!Ot||!it)&&(Jt(!1),cn([]),Zt(null),nt.current=0)};Ge(),window.addEventListener("localStorageUpdated",Ge),window.addEventListener("storage",Ge);const At=setInterval(()=>{if(typeof window>"u")return;const Ot=sn(Rn||window.localStorage.getItem("hyperAddress")),it=sn(Gn||window.localStorage.getItem("hyperToken"));Cn(jt=>jt.address===Ot&&jt.token===it?jt:{address:Ot,token:it}),(!Ot||!it)&&(Jt(!1),cn([]),Zt(null),nt.current=0)},1500);return()=>{window.removeEventListener("localStorageUpdated",Ge),window.removeEventListener("storage",Ge),clearInterval(At)}},[Gn,Rn]),m.useEffect(()=>{const Ge=!!Yn.token,At=!!Yn.address;Jt(Ge&&At)},[Yn]),m.useEffect(()=>()=>{ze.current=!1},[]);const Et=m.useCallback(async()=>{if(_t.current)return;const Ge=Yn.address,At=Yn.token;if(!Ge||!At){_t.current=!1,Xt(!1);return}const Ot=Date.now();if(!(Ot-nt.current<4500)){nt.current=Ot,_t.current=!0,Xt(!0);try{let it=[];const Nn=await(await fetch("https://dextrabothypev2.nftinit.io/api/wallet/list-extended",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:Ge.toLowerCase(),token:At,balance:"true"})})).json().catch(()=>null);if(!ze.current||!Nn){_t.current=!1,Xt(!1);return}let mn=[];if(Array.isArray(Nn)?mn=Nn:Array.isArray(Nn==null?void 0:Nn.data)&&(mn=Nn.data),it=await Promise.all(mn.map(async(Sn,Bn)=>{var Ln,Kn,Yr;let rr=null;const ur=Number(Sn.available_balance??Sn.availableForTrade??Sn.available_for_trade??Sn.balance??Sn.available??null);Number.isFinite(ur)&&(rr=ur);const _r=Sn.wallet_id??Sn.id??Bn,Un=Sn.wallet_api_key||Sn.api_key||null;if(Un&&rr==null)try{const os=`https://express-proxy-delta.vercel.app/proxy?url==${encodeURIComponent("https://api.starknet.extended.exchange/api/v1/user/balance")}`,Je=await(await fetch(os,{headers:{"X-Api-Key":Un}})).json().catch(()=>null),bt=((Ln=Je==null?void 0:Je.data)==null?void 0:Ln.availableForTrade)??(Je==null?void 0:Je.availableForTrade)??((Kn=Je==null?void 0:Je.data)==null?void 0:Kn.available_balance)??(Je==null?void 0:Je.available_balance)??((Yr=Je==null?void 0:Je.data)==null?void 0:Yr.available)??(Je==null?void 0:Je.available),Tn=Number(bt);Number.isFinite(Tn)&&Tn>=0&&(rr=Tn)}catch{}return{wallet_id:_r,wallet_address:Sn.wallet_address||Sn.address||"",wallet_name:Sn.wallet_name||Sn.name||`Extended Wallet ${Bn+1}`,available_balance:rr,wallet_api_key:Un}})),!ze.current)return;cn(it),it.length>0?Zt(Sn=>{const Bn=typeof window<"u"?window.localStorage.getItem(Pt):null,rr=(Sn==null?void 0:Sn.id)??Bn,ur=rr&&it.find(_r=>String(_r.wallet_id)===String(rr))||it[0];return ur?{id:ur.wallet_id,address:ur.wallet_address,apiKey:ur.wallet_api_key}:null}):Zt(null)}catch(it){console.error("Error loading wallets:",it),ze.current&&cn([])}finally{_t.current=!1,ze.current&&Xt(!1)}}},[Yn.address,Yn.token,s,Pt]);m.useEffect(()=>{Oe&&Et()},[Oe,Et]),m.useEffect(()=>{Yn.address&&Yn.token?(Jt(!0),Et()):(Jt(!1),cn([]),Zt(null),nt.current=0)},[Yn.address,Yn.token,Et]),m.useEffect(()=>{const Ge=()=>Et();return window.addEventListener("localStorageUpdated",Ge),window.addEventListener("storage",Ge),()=>{window.removeEventListener("localStorageUpdated",Ge),window.removeEventListener("storage",Ge)}},[Et]),m.useEffect(()=>{nt.current=0,cn([]),Zt(null),De(null)},[s]),m.useEffect(()=>{Q(!1)},[on==null?void 0:on.id,s]);const Xn=m.useMemo(()=>{if(!on||!on.id)return null;const Ge=nn.find(Ot=>String(Ot.wallet_id)===String(on.id));if(!Ge)return null;if(s==="extended"&&on.apiKey){const Ot=Number(ot==null?void 0:ot.availableForTrade);if(Number.isFinite(Ot))return Ot}const At=Number(Ge.available_balance??Ge.availableForTrade??Ge.available_for_trade??Ge.balance??Ge.available??null);return Number.isFinite(At)?At:null},[nn,on,s,ot]),gn=m.useCallback(async()=>{const Ge=Yn.address,At=Yn.token;if(!Ge||!At){pt([]);return}wt(!0);try{const it=await(await fetch(`${yn}/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:Ge.toLowerCase(),token:At,source_market:s})})).json().catch(()=>null),Nn=(Array.isArray(it==null?void 0:it.data)?it.data:it!=null&&it.data?[it.data]:[]).filter(mn=>mn?s?String(mn.source_market||"").toLowerCase()===String(s||"").toLowerCase()?!0:s==="hyper"&&!mn.source_market:!0:!1);pt(Nn)}catch(Ot){console.error("Error loading bots:",Ot),pt([])}finally{wt(!1)}},[rn,yn,s]);m.useEffect(()=>{gn()},[gn,Yn.address,Yn.token,s]);const Dt=m.useCallback(async()=>{var Ot,it;const{address:Ge,token:At}=rn();if(!Ge||!At||!on||!on.id){tn.error("Please connect your wallet and select a wallet.");return}Ze(!0);try{const jt=(Ot=v==null?void 0:v.toUpperCase())==null?void 0:Ot.trim(),Nn=Nyn(jt);let mn=null;if(s==="lighter")try{const er=await(await fetch("https://mainnet.zklighter.elliot.ai/api/v1/funding-rates")).json().catch(()=>null);if(er!=null&&er.funding_rates&&Array.isArray(er.funding_rates)){const kr=er.funding_rates.find(Dr=>String(Dr.symbol||"").toUpperCase().trim()===jt);console.log("coinRate",kr),kr&&kr.market_id!=null?(mn=kr.market_id,console.log(`✅ Found market_id ${mn} for coin ${jt} from funding-rates API (exchange: ${kr.exchange})`)):(console.warn(`❌ Coin ${jt} not found in funding-rates API`),console.log("Sample available symbols:",er.funding_rates.slice(0,20).map(Dr=>Dr.symbol)))}else console.warn("No funding_rates array in API response")}catch(Tn){console.error("Error fetching funding-rates API:",Tn),mn=d[jt]||null,mn&&console.log(`Using cached market_id ${mn} for coin ${jt}`)}if(mn===null){if(s==="extended"&&(!mt||!mt.length)){tn.error("Extended markets are loading. Please try again in a moment."),Ze(!1);return}mn=Eyn(v,mt)}if(mn===null&&s!=="extended"){console.error("Market not found for coin:",jt),tn.error(`Unable to find market index for ${jt}. Please make sure the coin is available on ${s}.`),Ze(!1);return}mn!=null&&console.log(`Using market_index: ${mn} for coin: ${jt}`);const ir=nn.find(Tn=>String(Tn.wallet_id)===String(on.id));if(!ir||!ir.wallet_id){tn.error("Unable to find selected wallet. Please select a wallet again."),Ze(!1);return}const Sn=Math.max(1,Math.min(Number(c)||100,Number(R)||1)),Bn=_yn(v,mt),rr=String(v||"").toUpperCase(),ur=Number((Bn==null?void 0:Bn.maxLeverage)??(Bn==null?void 0:Bn.leverage)??(Bn==null?void 0:Bn.max_leverage)??c??0),_r=s==="extended"&&ur>0?Math.min(ur,Sn||ur):Sn,Un=parseFloat(ie)||0,Ln=Number(C)||Number(Bn==null?void 0:Bn.markPrice)||Number(Bn==null?void 0:Bn.lastPrice)||Number(Bn==null?void 0:Bn.last)||null,Kn=Number(((it=Bn==null?void 0:Bn.tradingConfig)==null?void 0:it.minOrderSize)??(Bn==null?void 0:Bn.minOrderSize)),Yr=Number.isFinite(Kn)&&Kn>0&&Number.isFinite(Ln)&&Ln>0?Kn*Ln:null;if(s==="extended"&&Yr!=null){const Tn=parseFloat(U)||0,er=parseFloat(z)||0,kr=Tn*_r,Dr=er*_r;if(kr<Yr||Dr<Yr){const Ur=[];kr<Yr&&Ur.push("Base Order"),Dr<Yr&&Ur.push("DCA Order");const cr=Ur.length===1?` (${Ur[0]})`:Ur.length===2?" (Base Order & DCA Order)":"";tn.error(`Minimum order size for ${rr} is $${Yr.toFixed(2)}${cr}. Increase order size or leverage.`),Ze(!1);return}}const os={direction:P,leverage:_r,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(xe)||1,volume_scale:parseFloat(me)||1.5,tp_percent:Un,stop_loss_percent:G?parseFloat(G):0};s!=="extended"&&mn!=null&&(os.market_index=Number.isFinite(Number(mn))?Number(mn):mn);const ds={address:Ge.toLowerCase(),token:At,wallet_id:ir.wallet_id,source_market:s,bot_params:os,coin:Nn};console.log("DCA Bot API Request:",JSON.stringify(ds,null,2));const bt=await(await fetch(`${yn}/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ds)})).json().catch(()=>null);bt!=null&&bt.success?(tn.success("DCA Bot started successfully!"),await gn(),$e("bots")):tn.error((bt==null?void 0:bt.error_message)||"Failed to start bot. Please try again.")}catch(jt){console.error("Error starting bot:",jt),tn.error("Error starting bot. Please try again.")}finally{Ze(!1)}},[rn,on,s,v,mt,d,nn,P,R,U,z,ne,fe,me,xe,ie,G,gn,yn]);m.useCallback(async Ge=>{const{address:At,token:Ot}=rn();if(!At||!Ot||!on||!on.id){tn.error("Please connect your wallet and select a wallet.");return}const it=nn.find(jt=>String(jt.wallet_id)===String(on.id));if(!it||!it.wallet_id){tn.error("Unable to find selected wallet. Please select a wallet again.");return}dn(jt=>({...jt,[Ge]:!0}));try{const Nn=await(await fetch(`${yn}/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:At.toLowerCase(),token:Ot,wallet_id:it.wallet_id,source_market:s,coin:v})})).json().catch(()=>null);Nn!=null&&Nn.success?await gn():tn.error((Nn==null?void 0:Nn.error_message)||"Failed to stop bot. Please try again.")}catch(jt){console.error("Error stopping bot:",jt),tn.error("Error stopping bot. Please try again.")}finally{dn(jt=>({...jt,[Ge]:!1}))}},[rn,on,s,v,nn,gn,yn]);const en=m.useCallback(async(Ge,At,Ot={})=>{const{address:it,token:jt}=rn();if(!it||!jt){tn.error("Please connect your wallet.");return}dn(Nn=>({...Nn,[Ge]:!0})),pt(Nn=>Nn.map(mn=>mn.id===Ge||mn.bot_id===Ge?{...mn,is_deleted:At,...Ot}:mn));try{const mn=await(await fetch(`${yn}/update/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:it.toLowerCase(),token:jt,bot_id:Ge,update_params:{is_deleted:At,...Ot}})})).json().catch(()=>null);if(mn!=null&&mn.success)await gn(),At&&tn.success("DCA Bot has been stopped.");else{await gn();const ir=(mn==null?void 0:mn.error_message)||(mn==null?void 0:mn.message)||(mn==null?void 0:mn.detail)||(mn==null?void 0:mn.error),Sn=At?"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.";tn.error(ir||Sn)}}catch(Nn){console.error("Error updating bot:",Nn),await gn(),tn.error(At?"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{dn(Nn=>({...Nn,[Ge]:!1}))}},[rn,gn,yn]);m.useCallback(async Ge=>{const{address:At,token:Ot}=rn();if(!At||!Ot){tn.error("Please connect your wallet.");return}if(confirm("Are you sure you want to delete this bot? This action cannot be undone.")){Bt(it=>({...it,[Ge]:!0})),pt(it=>it.filter(jt=>jt.id!==Ge&&jt.bot_id!==Ge));try{const it=await fetch(`${yn}/update/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:At.toLowerCase(),token:Ot,bot_id:Ge,update_params:{permanent_delete:!0,is_deleted:!0}})}),jt=await it.json().catch(()=>null);if(console.log("Delete bot response:",jt),console.log("Response status:",it.status),jt!=null&&jt.success)await gn();else{console.log("Trying delete endpoint as fallback...");const Nn=await fetch(`${yn}/delete/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:At.toLowerCase(),token:Ot,bot_id:Ge})}),mn=await Nn.json().catch(()=>null);if(console.log("Delete endpoint response:",mn),mn!=null&&mn.success)await gn();else{await gn();const ir=(mn==null?void 0:mn.error_message)||(jt==null?void 0:jt.error_message)||(mn==null?void 0:mn.message)||(jt==null?void 0:jt.message)||(mn==null?void 0:mn.detail)||(jt==null?void 0:jt.detail)||`Failed to delete bot. Status: ${Nn.status||it.status}`;console.error("Delete bot error:",ir,{data:jt,deleteData:mn}),tn.error(ir)}}}catch(it){console.error("Error deleting bot:",it),await gn(),tn.error(`Error deleting bot: ${it.message||"Please try again."}`)}finally{Bt(it=>({...it,[Ge]:!1}))}}},[rn,gn,yn]),m.useEffect(()=>{let Ge=!1;async function At(){try{const it=await(await fetch("https://mainnet.zklighter.elliot.ai/api/v1/funding-rates")).json().catch(()=>null);if(Ge||!(it!=null&&it.funding_rates))return;const jt={};it.funding_rates.filter(Nn=>Nn.exchange==="lighter").forEach(Nn=>{if(Nn.symbol&&Nn.market_id!=null){const mn=String(Nn.symbol).toUpperCase().trim();jt[mn]=Nn.market_id}}),Ge||(f(jt),console.log(`✅ Loaded ${Object.keys(jt).length} market IDs from funding-rates API for lighter exchange`))}catch(Ot){console.error("Error loading market IDs from funding-rates API:",Ot),Ge||f({})}}return At(),()=>{Ge=!0}},[]),m.useEffect(()=>{let Ge=!1;async function At(){try{const it=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_farming_coins/?app=lighter_fr")).json().catch(()=>null);if(Ge)return;let jt=[];Array.isArray(it)?jt=it:Array.isArray(it==null?void 0:it.data)?jt=it.data:Array.isArray(it==null?void 0:it.coins)&&(jt=it.coins);const Nn=jt.map(mn=>({value:String(mn.value||mn.label||mn.symbol||mn.coin||"").toUpperCase(),label:mn.label||mn.value||mn.symbol||mn.coin,maxLeverage:mn.maxLeverage||50}));Ge||l(Nn)}catch{Ge||l([])}}return At(),()=>{Ge=!0}},[]),m.useEffect(()=>{var ir;if(!mt.length)return;const Ge=Sc(v);if(Ge?mt.some(Sn=>Sc(Sn.symbol)===Ge):!1)return;const Ot=typeof window<"u"?window.localStorage.getItem(un):null,it=Sc(Ot),jt=Ot&&it?mt.some(Sn=>Sc(Sn.symbol)===it):!1,Nn=mt[0],mn=jt?it:Sc((Nn==null?void 0:Nn.symbol)||((ir=Nn==null?void 0:Nn.raw)==null?void 0:ir.symbol)||(Nn==null?void 0:Nn.rawSymbol));w(mn||"BTC")},[mt,v,un]);const In=m.useMemo(()=>{const Ge=Sc(v);return Ge&&(mt.find(At=>Sc(At.symbol)===Ge)||mt.find(At=>{var Ot;return Sc(((Ot=At.raw)==null?void 0:Ot.symbol)||At.rawSymbol)===Ge}))||null},[mt,v]),Qn=m.useMemo(()=>{const Ge=Sc(v);if(!Ge)return null;const At=wyn[Ge]||Ge;return(In==null?void 0:In.kind)==="hip3"&&(In!=null&&In.builder)?`${In.builder}:${At}`:At},[v,In]),ar=m.useMemo(()=>{const Ge=Sc(v);return Ge&&ht.find(At=>{var it,jt;const Ot=Sc(At.coin||At.symbol||((it=At.bot_params)==null?void 0:it.coin)||((jt=At.bot_params)==null?void 0:jt.symbol));return!At.is_deleted&&Ot===Ge})||null},[ht,v]),hr=m.useMemo(()=>{const Ge=ht.filter(Ot=>!Ot.is_deleted),At=ht.filter(Ot=>Ot.is_deleted);return[...Ge,...At]},[ht]),Gt=Number(C)||Number(In==null?void 0:In.markPrice)||Number(In==null?void 0:In.lastPrice)||Number(In==null?void 0:In.last)||null,$n=Number(((Tt=In==null?void 0:In.tradingConfig)==null?void 0:Tt.minOrderSize)??(In==null?void 0:In.minOrderSize)),nr=s==="extended"&&Number.isFinite($n)&&$n>0&&Number.isFinite(Gt)&&Gt>0?$n*Gt:null,Rt=Math.max(1,Number(R)||1),En=parseFloat(U)||0,Ee=parseFloat(z)||0,h=En*Rt,p=Ee*Rt,S=s==="extended"&&nr!=null&&h<nr,_=s==="extended"&&nr!=null&&p<nr,k=S||_,T=Ge=>{if(nr==null||!Number.isFinite(Rt)||Rt<=0)return"Minimum order size not met";const At=nr/Rt,Ot=Math.abs(Rt-Math.round(Rt))<1e-6?Math.round(Rt):Number(Rt.toFixed(2));return`${Ge} must be at least $${At.toFixed(2)} (min. $${nr.toFixed(2)} notional ÷ ${Ot}x leverage)`};m.useEffect(()=>{const Ge=o.find(it=>it.value===v),At=s==="extended"?(In==null?void 0:In.maxLeverage)??(In==null?void 0:In.leverage)??(In==null?void 0:In.max_leverage)??50:Ge==null?void 0:Ge.maxLeverage,Ot=Number(At);Number.isFinite(Ot)&&Ot>0&&(u(Ot),O(it=>{const jt=parseInt(it)||1;return String(Math.min(Ot,Math.max(1,jt)))}))},[v,o,In,s]),m.useEffect(()=>{if(s!=="extended"||!(on!=null&&on.apiKey)){De(null);return}let Ge=!1;const At=async()=>{var it,jt,Nn,mn;try{const ir=`https://express-proxy-delta.vercel.app/proxy?url=${encodeURIComponent("https://api.starknet.extended.exchange/api/v1/user/balance")}`,Bn=await(await fetch(ir,{headers:{"X-Api-Key":on.apiKey}})).json().catch(()=>null);if(Ge)return;const rr=((it=Bn==null?void 0:Bn.data)==null?void 0:it.availableForTrade)??(Bn==null?void 0:Bn.availableForTrade)??((jt=Bn==null?void 0:Bn.data)==null?void 0:jt.available_balance)??(Bn==null?void 0:Bn.available_balance)??((Nn=Bn==null?void 0:Bn.data)==null?void 0:Nn.available)??(Bn==null?void 0:Bn.available),ur=Number(rr),_r=((mn=Bn==null?void 0:Bn.data)==null?void 0:mn.equity)??(Bn==null?void 0:Bn.equity),Un=Number(_r);De({availableForTrade:Number.isFinite(ur)&&ur>=0?ur:null,equity:Number.isFinite(Un)?Un:null,raw:Bn})}catch{Ge||De(null)}};At();const Ot=setInterval(At,2e4);return()=>{Ge=!0,clearInterval(Ot)}},[s,on==null?void 0:on.apiKey]),m.useEffect(()=>{if(s!=="extended")return;const Ge=ot==null?void 0:ot.equity;Number.isFinite(Ge)&&!he&&re(String(Ge))},[ot==null?void 0:ot.equity,s,he]);const B=m.useRef(v),W=m.useRef(!1);m.useEffect(()=>{const Ge=B.current!==v,At=!W.current&&!C;if((Ge||At)&&(In!=null&&In.last)&&In.last>0){B.current=v,W.current=!0;const Ot=jyn(In.last,In.priceDecimals);N(Number(In.last).toFixed(Ot))}},[v,In==null?void 0:In.last,C]);const ee=m.useCallback(Ge=>{const At=Sc(Ge);w(At),typeof window<"u"&&window.localStorage.setItem(un,At)},[un]),ce=m.useCallback(Ge=>{Q(!0),re(Ge)},[]),ue=m.useCallback(Ge=>{N(Ge)},[]),ge=$t,Se=P==="smart",ke=m.useCallback(Ge=>{const At=parseFloat(R)||10,Ot=.6/At,it=parseFloat(C)||0,jt=parseFloat(U)||0,Nn=parseFloat(z)||0,mn=parseInt(ne)||0,ir=parseFloat(K)||1/0,Sn=parseFloat(fe)||0,Bn=parseFloat(me)||1.1,rr=parseFloat(xe)||1,ur=parseFloat(ie)||0,_r=parseFloat(G)||100,Un=Ge==="smart",Ln=Ge==="long";if(Un)return{orders:[],metrics:null};if(it<=0||jt<=0)return{orders:[],metrics:null};let Kn=jt;for(let ln=1;ln<=mn;ln++)Kn+=Nn*Math.pow(Bn,ln-1);const Yr=[];let os=0,ds=0,Je=0,bt=0,Tn=0,er=0,kr=!1,Dr=null;const Ur=ir,cr=jt*At,Cr=cr/it;os=jt,ds=cr,Je=Cr,os>ir&&(kr=!0,Dr=0);const ls=Ln?(it*Je-Ur)/(Je*(1-Ot)):(Ur+it*Je)/(Je*(1+Ot)),yr=Ln?it*(1+ur/100):it*(1-ur/100);let Jr="SAFE";ls<=0||(Ln&&ls>=it||!Ln&&ls<=it)&&(Jr="LIQUIDATED"),kr&&(Jr="WARNING",er++);const Ks=Cr*it*Ot,Es=Ur/Ks,gr=Ln?(yr-it)*Cr:(it-yr)*Cr;Yr.push({label:"Base",deviation:0,price:it,margin:jt,positionValue:cr,coins:Cr,totalCoins:Cr,totalMargin:os,avgEntry:it,tpPrice:yr,tpProfit:gr,liqPrice:ls,healthRatio:Es,status:Jr});let Vt=!1,de=ls,st=it,Ct=yr;for(let ln=1;ln<=mn;ln++){ln===1?bt=Sn:bt+=Sn*Math.pow(rr,ln-1);const pn=Ln?it*(1-bt/100):it*(1+bt/100);if(Vt){Yr.push({label:`DCA ${ln}`,deviation:bt,price:pn,margin:null,positionValue:null,coins:null,totalCoins:null,totalMargin:null,avgEntry:null,tpPrice:null,tpProfit:null,liqPrice:null,healthRatio:null,status:"CANCELLED"});continue}if(pn<=0){Vt=!0,Yr.push({label:`DCA ${ln}-${mn}`,deviation:bt,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:mn-ln+1,isLong:Ln});break}const dr=Nn*Math.pow(Bn,ln-1),jr=dr*At,pr=jr/pn,fr=os+dr;fr>ir&&!kr&&(kr=!0,Dr=ln),os=fr,ds+=jr,Je+=pr;const Kr=ds/Je,rs=Ln?(Kr*Je-Ur)/(Je*(1-Ot)):(Ur+Kr*Je)/(Je*(1+Ot));if(Ln?rs>0&&pn<=rs:rs>0&&pn>=rs){Vt=!0,Yr.push({label:"💀 Liq",deviation:null,price:de,margin:null,positionValue:null,coins:null,totalCoins:null,totalMargin:null,avgEntry:st,tpPrice:Ct,tpProfit:null,liqPrice:de,healthRatio:null,status:"LIQUIDATED"});for(let Ut=ln;Ut<=mn;Ut++){let tr=0;for(let Tr=1;Tr<=Ut;Tr++)Tr===1?tr=Sn:tr+=Sn*Math.pow(rr,Tr-1);const Wn=Ln?it*(1-tr/100):it*(1+tr/100),Fr=Wn>0;Yr.push({label:`DCA ${Ut}`,deviation:tr,price:Fr?Wn:null,margin:null,positionValue:null,coins:null,totalCoins:null,totalMargin:null,avgEntry:null,tpPrice:null,tpProfit:null,liqPrice:null,healthRatio:null,status:Fr?"CANCELLED":"EXCEEDED"})}break}const br=Ln?rs>=Kr:rs<=Kr,Zn=Ln?Kr*(1+ur/100):Kr*(1-ur/100),xs=_r>=100?null:Ln?Kr*(1-_r/100):Kr*(1+_r/100),Qs=Ln?(pn-Kr)*Je:(Kr-pn)*Je,ai=Ur+Qs,Pr=Je*pn*Ot,vn=ai/Pr;let Fn="SAFE";if(br){Vt=!0,Yr.push({label:`DCA ${ln}`,deviation:bt,price:pn,margin:dr,positionValue:jr,coins:pr,totalCoins:Je,totalMargin:os,avgEntry:Kr,tpPrice:null,tpProfit:null,liqPrice:rs,healthRatio:null,status:"LIQUIDATED"});for(let Ut=ln+1;Ut<=mn;Ut++){let tr=0;for(let Tr=1;Tr<=Ut;Tr++)Tr===1?tr=Sn:tr+=Sn*Math.pow(rr,Tr-1);const Wn=Ln?it*(1-tr/100):it*(1+tr/100),Fr=Wn>0;Yr.push({label:`DCA ${Ut}`,deviation:tr,price:Fr?Wn:null,margin:null,positionValue:null,coins:null,totalCoins:null,totalMargin:null,avgEntry:null,tpPrice:null,tpProfit:null,liqPrice:null,healthRatio:null,status:Fr?"CANCELLED":"EXCEEDED"})}break}else xs!==null&&(Ln&&pn<=xs||!Ln&&pn>=xs)?(Fn="STOPPED",Vt=!0):vn<1.5?(Fn="WARNING",er++):Tn++;const lt=Ln?(Zn-Kr)*Je:(Kr-Zn)*Je;de=rs,st=Kr,Ct=Zn,Yr.push({label:`DCA ${ln}`,deviation:bt,price:pn,margin:dr,positionValue:jr,coins:pr,totalCoins:Je,totalMargin:os,avgEntry:Kr,tpPrice:Zn,tpProfit:lt,liqPrice:rs,healthRatio:vn,status:Fn})}const vt=[...Yr].reverse().find(ln=>ln.status!=="CANCELLED")||Yr[Yr.length-1];return{orders:Yr,metrics:{totalMargin:os,totalPositionValue:ds,liquidationPrice:vt.liqPrice,breakEvenPrice:vt.avgEntry,safeCount:Tn,warningCount:er,budgetOk:!kr,budgetExceededAt:Dr,leverage:At,requiredBudget:Kn}}},[C,R,U,z,ne,K,fe,me,xe,ie,G]),Me=m.useMemo(()=>ke(P),[ke,P]),qe=m.useMemo(()=>Me.orders.filter(Ge=>Ge.status!=="CANCELLED").map(Ge=>({name:Ge.label,orderPrice:je&&Ge.price!=null&&Ge.price>0?Ge.price:null,avgEntry:Re&&Ge.avgEntry!=null&&Ge.avgEntry>0?Ge.avgEntry:null,tpPrice:Ke&&Ge.tpPrice!=null&&Ge.tpPrice>0?Ge.tpPrice:null,liqPrice:et&&Ge.liqPrice!=null&&Ge.liqPrice>0?Ge.liqPrice:null,status:Ge.status})),[Me.orders,je,Re,Ke,et]),Fe=m.useMemo(()=>{const Ge=[];if(qe.forEach(jt=>{jt.orderPrice!=null&&Ge.push(jt.orderPrice),jt.avgEntry!=null&&Ge.push(jt.avgEntry),jt.tpPrice!=null&&Ge.push(jt.tpPrice)}),Ge.length===0)return["auto","auto"];const At=Math.min(...Ge),Ot=Math.max(...Ge),it=(Ot-At)*.1;return[Math.max(0,At-it),Ot+it]},[qe]),at=Ge=>{const{cx:At,cy:Ot,payload:it}=Ge;return it.status==="LIQUIDATED"&&At&&Ot?i.jsx("text",{x:At,y:Ot,textAnchor:"middle",dominantBaseline:"middle",fontSize:14,children:"💀"}):null},se=Ge=>{switch(Ge){case"orderPrice":Pe(!je);break;case"avgEntry":Xe(!Re);break;case"tpPrice":ut(!Ke);break;case"liqPrice":tt(!et);break}},Ce=Ge=>{const{payload:At}=Ge;return i.jsx("div",{className:"flex flex-wrap justify-center gap-2 sm:gap-4 mt-2",children:At.map((Ot,it)=>{const jt=Ot.dataKey==="orderPrice"?je:Ot.dataKey==="avgEntry"?Re:Ot.dataKey==="tpPrice"?Ke:Ot.dataKey==="liqPrice"?et:!0;return i.jsxs("button",{onClick:()=>se(Ot.dataKey),className:`flex items-center gap-1.5 text-xs px-2 py-1 rounded transition-all ${jt?"opacity-100":"opacity-40"}`,style:{color:Ot.color},children:[i.jsx("span",{className:"w-3 h-0.5",style:{backgroundColor:Ot.color}}),Ot.value]},it)})})},{orders:Ue,metrics:Be}=Me,_e=Ue.filter(Ge=>Ge.status!=="CANCELLED"),rt=m.useMemo(()=>{var Sn,Bn;if(!Se)return null;const Ge=ke("long"),At=ke("short"),Ot=(Sn=Ge.metrics)==null?void 0:Sn.safeCount,it=(Bn=At.metrics)==null?void 0:Bn.safeCount,jt=Ge.orders.some(rr=>rr.status==="LIQUIDATED"),Nn=At.orders.some(rr=>rr.status==="LIQUIDATED"),mn=Number.isFinite(Ot)&&Number.isFinite(it)?Math.max(Ot,it):null;let ir=!1;return Number.isFinite(Ot)&&Number.isFinite(it)?Ot>it?ir=jt:it>Ot?ir=Nn:ir=jt&&Nn:ir=jt||Nn,{safeOrders:mn,hasLiquidation:ir}},[ke,Se]),ct=m.useMemo(()=>Se?!!(rt!=null&&rt.hasLiquidation):_e.some(Ge=>Ge.status==="LIQUIDATED"),[Se,_e,rt==null?void 0:rt.hasLiquidation]),yt=m.useMemo(()=>{if(!ct)return null;const Ge=Se?rt==null?void 0:rt.safeOrders:Be==null?void 0:Be.safeCount,At=Number.isFinite(Ge)?Ge:0,Ot=parseInt(ne)||0;return`Liquidation occurs before completing all DCA orders. Safe orders: ${At} of ${Ot}. Reduce leverage, widen spacing, or lower max DCA orders.`},[ct,Se,rt==null?void 0:rt.safeOrders,Be==null?void 0:Be.safeCount,ne]),Lt=m.useMemo(()=>{const Ge=Se?rt==null?void 0:rt.safeOrders:Be==null?void 0:Be.safeCount,At=parseInt(ne);return!Number.isFinite(Ge)||!Number.isFinite(At)?null:At>Ge?`Only ${Ge} of ${At} DCA orders are currently safe. Increase budget, reduce leverage, or lower Max DCA Orders.`:null},[Se,rt==null?void 0:rt.safeOrders,Be==null?void 0:Be.safeCount,ne]),ft=({variant:Ge="desktop"})=>{const At=Ge==="desktop"?"px-4 py-5":"p-3";return i.jsxs("div",{className:`${At} 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(mNe,{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(xNe,{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(pNe,{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(gyn,{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(xNe,{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(byn,{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(Ph,{content:"Extended is temporarily the only available market.",children:"?"})]}),i.jsx(yyn,{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(Ph,{content:"Select the wallet to use for this DCA bot. The bot will execute trades using this wallet.",children:"?"})]}),Oe?zn?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(yT,{wallets:nn,value:on&&on.id?String(on.id):"",onChange:Ge=>{const At=nn.find(Ot=>String(Ot.wallet_id)===String(Ge));At&&(Zt({id:At.wallet_id,address:At.wallet_address,apiKey:At.wallet_api_key}),typeof window<"u"&&window.localStorage.setItem(Pt,String(At.wallet_id)))},selectedBalance:Xn,mode:s}):i.jsx("div",{className:"w-full",children:i.jsx(Jp,{onClick:()=>Vn(!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(Ph,{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:`${Syn}/${Qn||"BTC"}.svg`,alt:v||"coin",className:"w-6 h-6 rounded-full bg-[#161616] border border-[#1c2a24]",loading:"lazy",onError:Ge=>hm(Ge)}),i.jsx("div",{className:"flex-1 min-w-0",children:i.jsx(xue,{markets:kn,value:v,onChange:ee,loading:ge,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(Ph,{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:()=>I("short"),className:`py-2 px-3 rounded-lg text-sm font-medium transition-all border flex items-center justify-center gap-1 ${P==="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:()=>I("long"),className:`py-2 px-3 rounded-lg text-sm font-medium transition-all border flex items-center justify-center gap-1 ${P==="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:()=>I("smart"),className:`py-2 px-3 rounded-lg text-sm font-medium transition-all border flex items-center justify-center gap-1 ${P==="smart"?"bg-[#a78bfa]/20 border-[#a78bfa] text-[#d7c8ff]":"bg-[#161616] border-[#1c2a24] text-[#7f7b9f] hover:border-[#a78bfa]/50"}`,children:[i.jsx(mNe,{className:"w-4 h-4"}),"Smart"]})]})]}),i.jsx("div",{className:"col-span-2",children:i.jsx(kyn,{value:R,onChange:O,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(tg,{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:(Ge,At)=>!At||isNaN(Ge)?"Required":Ge<1?"Must be at least 1":s==="extended"&&nr!=null&&Ge*Rt<nr?T("Base Order Margin"):null}),i.jsx(tg,{label:"DCA Order Margin",value:z,onChange:X,step:"1",min:"1",suffix:"$",tooltip:"Starting margin for DCA orders.",validate:(Ge,At)=>!At||isNaN(Ge)?"Required":Ge<1?"Must be at least 1":s==="extended"&&nr!=null&&Ge*Rt<nr?T("DCA Order Margin"):null}),i.jsx(tg,{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:(Ge,At)=>!At||isNaN(Ge)?"Required":Ge<1?"Minimum 1":Ge>50?"Maximum 50":null,forceError:ct||!!Lt,forceErrorMessage:yt||Lt}),i.jsx(tg,{label:"Available to Trade",value:Xn!=null?String(Xn):"",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(tg,{label:"Take Profit",value:ie,onChange:oe,step:"0.1",suffix:"%",tooltip:"Target profit % calculated from the weighted average entry price."}),i.jsx(tg,{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(!te),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: ",xe,"x • Size: ",me,"x"]})]}),te?i.jsx(Han,{className:"w-4 h-4 text-[#67FFBD]"}):i.jsx(Dan,{className:"w-4 h-4 text-[#67FFBD]"})]}),i.jsx(xT,{children:te&&i.jsx(wo.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(tg,{label:"Price Deviation",value:fe,onChange:Ne,step:"0.1",suffix:"%",tooltip:"Initial price change % from Entry Price to trigger DCA."}),i.jsx(tg,{label:"DCA Order Size Multiplier",value:me,onChange:we,step:"0.1",suffix:"x",tooltip:"Multiplier for each DCA order's margin."}),i.jsx(tg,{label:"Price Deviation Multiplier",value:xe,onChange:ye,step:"0.05",suffix:"x",tooltip:"Multiplier for price gaps between DCA orders."})]})})})]}),(()=>{const Ge=C&&!isNaN(parseFloat(C))&&parseFloat(C)>0,At=U&&!isNaN(parseFloat(U))&&parseFloat(U)>=1,Ot=z&&!isNaN(parseFloat(z))&&parseFloat(z)>=1,it=ne&&!isNaN(parseInt(ne))&&parseInt(ne)>=1,jt=K&&!isNaN(parseFloat(K))&&parseFloat(K)>0,Nn=Ge&&At&&Ot&&it&&jt,mn=k,ir=_r=>{const Un=parseFloat(C)||0,Ln=parseFloat(U)||0,Kn=parseFloat(z)||0,Yr=parseInt(ne)||0,os=parseFloat(K)||1/0,ds=parseFloat(me)||1.1;if(Un<=0||Ln<=0)return null;let Je=Ln,bt=0,Tn=Je>os;Tn||(bt+=1);for(let kr=1;kr<=Yr;kr++){const Dr=Kn*Math.pow(ds,kr-1);Je+=Dr,!Tn&&Je>os&&(Tn=!0),Tn||(bt+=1)}return{budgetOk:Je<=os,safeCount:bt}},Sn=Se?{long:ir(),short:ir()}:null,Bn=Se&&(Sn==null?void 0:Sn.long)&&(Sn==null?void 0:Sn.short)&&Sn.long.budgetOk&&Sn.short.budgetOk&&Sn.long.safeCount>0&&Sn.short.safeCount>0&&!mn,rr=Se?Nn&&Bn:Nn&&Be&&Be.budgetOk&&Be.safeCount>0&&!mn;let ur=null;if(!Nn)ur="Please fill in all required fields";else if(mn&&nr!=null){const _r=[];S&&_r.push("Base Order"),_&&_r.push("DCA Order");const Un=_r.length===1?` (${_r[0]})`:_r.length===2?" (Base Order & DCA Order)":"";ur=`Minimum order size for ${String(v||"").toUpperCase()} is $${nr.toFixed(2)}${Un}. Increase order size or leverage.`}else!Se&&Be&&!Be.budgetOk?ur="Budget exceeded - increase budget or reduce orders":!Se&&Be&&Be.safeCount===0?ur="No safe orders - reduce leverage or increase budget":Se&&(!(Sn!=null&&Sn.long)||!(Sn!=null&&Sn.short)||!Sn.long.budgetOk||!Sn.short.budgetOk)?ur="Budget exceeded in Smart mode - adjust margin or orders":Se&&(Sn!=null&&Sn.long)&&(Sn!=null&&Sn.short)&&(Sn.long.safeCount===0||Sn.short.safeCount===0)&&(ur="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 _r=(ar==null?void 0:ar.id)||(ar==null?void 0:ar.bot_id),Un=_r&&Ft[_r]===!0,Ln=_r&&Yt[_r]===!0,Kn=!!ar,Yr=Kn?Un||Ln:!rr||Ye||!on||!on.id,os=()=>{Kn&&_r?en(_r,!0):Dt()};return i.jsx("button",{onClick:os,disabled:Yr,className:`w-full py-2.5 rounded-lg text-sm font-semibold transition-all flex items-center justify-center gap-2 ${Kn?"bg-[#ff7073] text-black hover:bg-[#ff8a8d]":rr&&on&&on.id&&!Ye?"bg-[#67FFBD] text-[#101010] hover:bg-[#9FFFDA]":"bg-[#333] text-[#666] cursor-not-allowed"} disabled:opacity-60 disabled:cursor-not-allowed`,children:Kn?Un?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"]}):Ye?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"]})})})(),ur&&i.jsx("p",{className:"text-xs text-[#ff7073] text-center mt-2",children:ur}),(!on||!on.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(pNe,{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:"📚"})]})})]})]}),Be&&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(Ph,{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:["$",Eo(Be.totalMargin)]})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"text-xs text-[#888] flex items-center mb-1",children:["Position Value",i.jsx(Ph,{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:["$",Eo(Be.totalPositionValue)]}),i.jsxs("div",{className:"text-xs text-[#555]",children:[Be.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(Ph,{content:"DCA orders that can be executed safely.",children:"?"})]}),i.jsxs("div",{className:"text-lg sm:text-xl font-bold",style:{color:kb},children:[Be.safeCount,"/",parseInt(ne)||0]})]})]})]})}),!Se&&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(lBe,{width:"100%",height:"100%",children:i.jsxs(crn,{data:qe.length>0?qe:[{name:"No Data",orderPrice:null,avgEntry:null,tpPrice:null,liqPrice:null}],margin:{top:10,right:20,left:10,bottom:5},children:[i.jsx(eUe,{strokeDasharray:"3 3",stroke:"#1c2a24"}),i.jsx(r8,{dataKey:"name",stroke:"#666",fontSize:10,interval:0,angle:qe.length>6?-45:0,textAnchor:qe.length>6?"end":"middle",height:qe.length>6?50:30,tickFormatter:Ge=>Ge==="Base"?"B":Ge.startsWith("DCA")?`D${Ge.split(" ")[1]}`:Ge.includes("Liq")?"💀":Ge}),i.jsx(s8,{stroke:"#666",fontSize:10,tickFormatter:Ge=>`$${Eo(Ge)}`,domain:Fe,allowDataOverflow:!0}),i.jsx(Xp,{contentStyle:{backgroundColor:"#101010",border:"1px solid #333",borderRadius:"6px",fontSize:"11px"},formatter:(Ge,At)=>[Cb(Ge),At],labelFormatter:Ge=>Ge==="B"?"Base Order":Ge.startsWith("D")?`DCA ${Ge.slice(1)}`:Ge}),i.jsx(i3,{content:Ce}),i.jsx(I0,{type:"monotone",dataKey:"orderPrice",name:"Order Price",stroke:kb,strokeWidth:2,dot:{fill:kb,r:3},connectNulls:!0}),i.jsx(I0,{type:"monotone",dataKey:"avgEntry",name:"Avg Entry",stroke:pF,strokeWidth:2,dot:{fill:pF,r:2},connectNulls:!0}),i.jsx(I0,{type:"monotone",dataKey:"tpPrice",name:"TP",stroke:gNe,strokeWidth:1.5,strokeDasharray:"4 4",dot:!1,connectNulls:!0}),i.jsx(I0,{type:"monotone",dataKey:"liqPrice",name:"Liq",stroke:FO,strokeWidth:1.5,strokeDasharray:"4 4",dot:at,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:()=>$e("details"),className:`flex-1 px-4 py-3 text-sm font-medium transition-colors relative first:rounded-tl-xl last:rounded-tr-xl border ${Le==="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:()=>$e("bots"),className:`flex-1 px-4 py-3 text-sm font-medium transition-colors relative first:rounded-tl-xl last:rounded-tr-xl border ${Le==="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"})]}),Le==="details"&&(Se?i.jsx(ft,{variant:"desktop"}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"px-4 py-3",children:i.jsx(yNe,{entryPrice:C,onEntryPriceChange:ue,maxBudget:K,onBudgetChange:ce})}),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(Ph,{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((Ge,At)=>{const Ot=bNe[Ge.status];if(Ge.status==="EXCEEDED"){const it=Ge.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:Ot.icon}),i.jsxs("span",{className:"text-sm",children:[i.jsx("span",{className:"font-medium",children:Ge.label})," ","— ",it]})]})})},At)}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:Ge.label}),i.jsx("td",{className:"px-3 py-2 text-right",children:Ge.deviation!=null?Ayn(Ge.deviation):"-"}),i.jsx("td",{className:"px-3 py-2 text-right",children:Cb(Ge.price)}),i.jsx("td",{className:"px-3 py-2 text-right hidden lg:table-cell",children:Ge.margin!=null?`$${Eo(Ge.margin)}`:"-"}),i.jsx("td",{className:"px-3 py-2 text-right hidden xl:table-cell",children:Ge.positionValue!=null?`$${Eo(Ge.positionValue)}`:"-"}),i.jsx("td",{className:"px-3 py-2 text-right",children:Ge.coins!=null?Eo(Ge.coins,4):"-"}),i.jsx("td",{className:"px-3 py-2 text-right hidden lg:table-cell",children:Ge.totalMargin!=null?`$${Eo(Ge.totalMargin)}`:"-"}),i.jsx("td",{className:"px-3 py-2 text-right",style:{color:pF},children:Cb(Ge.avgEntry)}),i.jsx("td",{className:"px-3 py-2 text-right hidden lg:table-cell",style:{color:gNe},children:Cb(Ge.tpPrice)}),i.jsx("td",{className:"px-3 py-2 text-right",style:{color:kb},children:Ge.tpProfit!=null?`$${Eo(Ge.tpProfit)}`:"-"}),i.jsx("td",{className:"px-3 py-2 text-right",style:{color:Ge.liqPrice<=0?kb:FO},children:Cb(Ge.liqPrice,!0)}),i.jsx("td",{className:"px-3 py-2 text-center",children:i.jsx(Ph,{content:Ot.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:`${Ot.color}15`,color:Ot.color},children:Ot.icon})})})]},At)})})]}),_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"})]})]})]})),Le==="bots"&&i.jsx("div",{className:"p-4",children:Kt?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..."})]}):hr.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:hr.map(Ge=>{const At=!Ge.is_deleted,Ot=Ge.bot_params||{},it=Ge.created_at?new Date(Ge.created_at):null,jt=it?(()=>{const ur=Date.now()-it.getTime(),_r=Math.floor(ur/(1e3*60*60)),Un=Math.floor(_r/24);return Un>0?`${Un}d ago`:_r>0?`${_r}h ago`:`${Math.floor(ur/(1e3*60))}m ago`})():null,Nn=Ot.direction==="long"?"Long":Ot.direction==="short"?"Short":"Smart",mn=Ot.price_deviation??Ot.priceDeviation??0,ir=Ot.step_scale??Ot.price_dev_multiplier??Ot.priceDevMultiplier??0,Sn=Ot.volume_scale??Ot.dca_size_multiplier??Ot.dcaSizeMultiplier??0,Bn=Ot.tp_percent??Ot.tp_target??Ot.take_profit_percent??0,rr=Ot.stop_loss_percent??Ot.stop_loss??0;return Ot.market_index??Ot.marketIndex,Ot.coin_idx??Ot.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:[Ge.coin||v," DCA Bot"]}),At?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"})]}),jt&&i.jsx("span",{className:"text-[11px] text-[#7c7c7c]",children:jt})]}),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 ${Ot.direction==="long"?"text-[#67FFBD]":Ot.direction==="short"?"text-[#ff7073]":"text-[#A78BFA]"}`,children:Nn})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Leverage:"}),i.jsxs("span",{className:"ml-1 text-white",children:[Ot.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:["$",Eo(Ot.base_amount_usd||Ot.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:["$",Eo(Ot.safety_amount_usd||Ot.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:Ot.max_safety_orders||Ot.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:[Eo(mn),"%"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Price Deviation Multiplier:"}),i.jsxs("span",{className:"ml-1 text-white",children:[Eo(ir),"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:[Eo(Sn),"x"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Take Profit:"}),i.jsxs("span",{className:"ml-1 text-[#67FFBD]",children:[Eo(Bn),"%"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Stop Loss:"}),i.jsxs("span",{className:"ml-1 text-[#ff7073]",children:[Eo(rr),"%"]})]}),jt&&i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Created:"}),i.jsx("span",{className:"ml-1 text-white",children:jt})]})]}),i.jsx("div",{className:"mt-4",children:i.jsx("button",{onClick:()=>en(Ge.id||Ge.bot_id,At),disabled:Ft[Ge.id||Ge.bot_id]||Yt[Ge.id||Ge.bot_id],className:`w-full py-2 rounded-lg text-sm font-semibold transition-colors ${At?"bg-[#ff7073] text-black hover:bg-[#ff8a8d]":"bg-[#67FFBD] text-black hover:bg-[#8bffd0]"} disabled:opacity-60 disabled:cursor-not-allowed`,children:Ft[Ge.id||Ge.bot_id]?At?"Stopping...":"Starting...":At?"Stop Bot":"Start Bot"})})]},Ge.id||Ge.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:()=>$e("details"),className:`flex-1 px-3 py-2 text-xs font-medium transition-colors relative first:rounded-tl-xl last:rounded-tr-xl border ${Le==="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:()=>$e("bots"),className:`flex-1 px-3 py-2 text-xs font-medium transition-colors relative first:rounded-tl-xl last:rounded-tr-xl border ${Le==="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"})]}),Le==="details"&&(Se?i.jsx(ft,{variant:"mobile"}):i.jsxs("div",{className:"p-3 space-y-2",children:[i.jsx(yNe,{className:"w-full",entryPrice:C,onEntryPriceChange:ue,maxBudget:K,onBudgetChange:ce}),_e.map((Ge,At)=>{const Ot=bNe[Ge.status];if(Ge.status==="EXCEEDED"){const it=Ge.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:Ot.icon}),i.jsxs("span",{className:"text-sm",children:[i.jsx("span",{className:"font-medium",children:Ge.label})," ","— ",it]})]})},At)}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:Ge.label}),i.jsx(Ph,{content:Ot.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:`${Ot.color}15`,color:Ot.color},children:Ot.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:Cb(Ge.price)})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"text-[#666]",children:"Size:"}),i.jsx("span",{children:Ge.coins!=null?`${Eo(Ge.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:pF},children:Cb(Ge.avgEntry)})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"text-[#666]",children:"Liq:"}),i.jsx("span",{style:{color:Ge.liqPrice<=0?kb:FO},children:Cb(Ge.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:kb},className:"font-medium",children:Ge.tpProfit!=null?`$${Eo(Ge.tpProfit)}`:"-"})]})]})]},At)})]})),Le==="bots"&&i.jsx("div",{className:"p-3",children:Kt?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..."})]}):hr.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:hr.map(Ge=>{const At=!Ge.is_deleted,Ot=Ge.bot_params||{},it=Ge.created_at?new Date(Ge.created_at):null,jt=it?(()=>{const Un=Date.now()-it.getTime(),Ln=Math.floor(Un/(1e3*60*60)),Kn=Math.floor(Ln/24);return Kn>0?`${Kn}d ago`:Ln>0?`${Ln}h ago`:`${Math.floor(Un/(1e3*60))}m ago`})():null,Nn=Ot.direction==="long"?"Long":Ot.direction==="short"?"Short":"Smart",mn=Ot.price_deviation??Ot.priceDeviation??0,ir=Ot.step_scale??Ot.price_dev_multiplier??Ot.priceDevMultiplier??0,Sn=Ot.volume_scale??Ot.dca_size_multiplier??Ot.dcaSizeMultiplier??0,Bn=Ot.tp_percent??Ot.tp_target??Ot.take_profit_percent??0,rr=Ot.stop_loss_percent??Ot.stop_loss??0,ur=Ot.market_index??Ot.marketIndex,_r=Ot.coin_idx??Ot.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:[Ge.coin||v," DCA"]}),At?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"})]}),jt&&i.jsx("span",{className:"text-[10px] text-[#7c7c7c]",children:jt})]}),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 ${Ot.direction==="long"?"text-[#67FFBD]":Ot.direction==="short"?"text-[#ff7073]":"text-[#A78BFA]"}`,children:Nn})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Leverage:"}),i.jsxs("span",{className:"ml-1 text-white",children:[Ot.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:["$",Eo(Ot.base_amount_usd||Ot.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:["$",Eo(Ot.safety_amount_usd||Ot.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:Ot.max_safety_orders||Ot.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:[Eo(mn),"%"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Price Deviation Multiplier:"}),i.jsxs("span",{className:"ml-1 text-white",children:[Eo(ir),"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:[Eo(Sn),"x"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"TP:"}),i.jsxs("span",{className:"ml-1 text-[#67FFBD]",children:[Eo(Bn),"%"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"SL:"}),i.jsxs("span",{className:"ml-1 text-[#ff7073]",children:[Eo(rr),"%"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Market:"}),i.jsx("span",{className:"ml-1 text-white",children:ur??"-"})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Coin Idx:"}),i.jsx("span",{className:"ml-1 text-white",children:_r??"-"})]}),jt&&i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Created:"}),i.jsx("span",{className:"ml-1 text-white",children:jt})]})]}),i.jsx("div",{className:"mt-3",children:i.jsx("button",{onClick:()=>en(Ge.id||Ge.bot_id,At),disabled:Ft[Ge.id||Ge.bot_id]||Yt[Ge.id||Ge.bot_id],className:`w-full py-1.5 rounded-lg text-[11px] font-semibold transition-colors ${At?"bg-[#ff7073] text-black hover:bg-[#ff8a8d]":"bg-[#67FFBD] text-black hover:bg-[#8bffd0]"} disabled:opacity-60 disabled:cursor-not-allowed`,children:Ft[Ge.id||Ge.bot_id]?"...":At?"Stop Bot":"Start Bot"})})]},Ge.id||Ge.bot_id)})})})]})})]})]})})}const Iyn=()=>{const{setTelegramChatId:e,setSubscriberRole:t,setSubsExpireDay:n,setMushboomerETH:r,setIsWhitelist:s,setMushboomerSOL:a,setIsReferralCode:o,setIsReferralCodeName:l,setHyperToken:c,setHyperAddress:u}=m.useContext(Qr);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 _i(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(No,{children:i.jsxs(Lo,{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(Tyn,{})})})]})},aj=({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..."})]}),cD="/assets/subscribeAnimation-oYDBxlRF.mp4",Pyn=()=>{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(Qr),{address:f}=ts(),[x,g]=m.useState(1),[v,w]=m.useState(""),[C,N]=m.useState(""),[P,I]=m.useState(!1),[R,O]=m.useState(!1),[U,L]=m.useState(""),[z,X]=m.useState(0),[ne,J]=m.useState(0),[K,re]=m.useState(!1),he=xe=>/^\d*$/.test(xe),Q=xe=>{["e","E","+","-"].includes(xe.key)&&xe.preventDefault()},ie=m.useMemo(()=>{if(x==="")return!1;const xe=Number(x);return Number.isInteger(xe)&&xe>=1},[x]),V=(xe=>{const[ye,je]=xe.split(" "),[Pe,Re,Xe]=ye.split("-").map(Number),[Ke,ut]=je.split(":").map(Number);return new Date(Date.UTC(Xe,Re-1,Pe,Ke-3,ut))})("29-11-2025 23:59");m.useState(()=>new Date().getTime()>=V.getTime());const te=m.useRef(z);m.useEffect(()=>{te.current=z},[z]);const ae=m.useRef(0);m.useEffect(()=>{ae.current=ne},[ne]);const fe=async()=>{var je,Pe;const xe=window.localStorage.getItem("hyperToken"),ye=window.localStorage.getItem("hyperAddress");if(!(!xe||!ye))try{const Re=await _i(ye.toLowerCase(),xe);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((Pe=Re==null?void 0:Re.mushboomer_counts)==null?void 0:Pe.sol),o(Re==null?void 0:Re.referral_code),l(Re==null?void 0:Re.refcode),c(Re==null?void 0:Re.whitelist),u(xe),d(ye),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(()=>{K&&fe()},[K]),m.useEffect(()=>{const xe=localStorage.getItem("hyperToken"),ye=localStorage.getItem("hyperAddress");re(!!(xe&&ye));const je=setInterval(()=>{const Pe=localStorage.getItem("hyperToken"),Re=localStorage.getItem("hyperAddress");re(!!(Pe&&Re))},800);return()=>clearInterval(je)},[]);const Ne=async()=>new Al(window.ethereum).eth.getAccounts(ye=>ye),me=async(xe="subscribe",ye=24,je=5e3)=>{ye<=0||(await new Promise(Pe=>setTimeout(Pe,je)),await fe(),xe==="subscribe"&&te.current===ae.current?me(xe,ye-1,je):fe())},we=async xe=>{const ye=window.localStorage.getItem("hyperToken"),je=window.localStorage.getItem("hyperAddress");if(!ye||!f){e(!0);return}N(""),J(te.current),ae.current=te.current,O(!0),I(!0);try{await window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0x1"}]})}catch(Xe){console.error("Failed to switch network",Xe),I(!1);return}const Pe=new Al(window.ethereum);var Re=await Ne();if(Re.length>0?Re=Re[0]:Re=void 0,Re){const Ke=xe*.12,ut=Pe.utils.toWei(Ke.toString(),"ether"),et={from:Re,to:"0xdEAe8586eD227A5096EBae47342fFc1ED99f13F9",value:ut};await Pe.eth.sendTransaction(et).then(tt=>{console.log("txHash :>> ",tt),I(!1),L(tt.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:ye,payment_tx:tt.transactionHash,payment_role:"farming_tools",tx_qty:Number(x)})}),fe(),me("subscribe")}).catch(tt=>{console.log(tt),tt.code===-32003||tt.message.includes("insufficient funds")?N("Insufficient funds."):tt.message==="MetaMask Tx Signature: User denied transaction signature."&&O(!1)})}else await Pe.eth.requestAccounts()};return window.localStorage.getItem("hyperToken"),i.jsxs(i.Fragment,{children:[i.jsx(vd,{open:R,setOpen:O,transactionHash:U,transactionLoading:P,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:cD,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,preload:"auto",className:"w-full h-[284px] lg:h-[284px] object-cover"},cD)}),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(xe=>{const ye=Number(xe||0);return ye>1?String(ye-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:xe=>{const ye=xe.target.value.trim();if(ye==="")return g("");he(ye)&&g(ye)},onKeyDown:Q,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(xe=>{const ye=Number(xe||0);return String(ye+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:xe=>{xe.preventDefault(),ie&&we(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"})]})})]})]})},Fyn=()=>{ts();const{setTelegramChatId:e,setSubscriberRole:t,setSubsExpireDay:n,setMushboomerETH:r,setMushboomerSOL:s,setIsReferralCode:a,setIsReferralCodeName:o,setIsWhitelist:l,setHyperToken:c,setHyperAddress:u}=m.useContext(Qr);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 _i(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(No,{children:i.jsxs(Lo,{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(Pyn,{})})]})},SWe=({open:e,setOpen:t,makerStatus:n,isStatusWallet:r,info:s,modalLoading:a})=>i.jsxs(Ea,{open:e,onClose:t,className:"relative z-50 font-manrope",children:[i.jsx(ja,{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(ga,{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:$a})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Ki,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"})})]})]})})})})})]}),Oyn=({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),[P,I]=m.useState(!1);m.useState(!1);const[R,O]=m.useState(""),[U,L]=m.useState(!1),[z,X]=m.useState(null),[ne,J]=m.useState(""),[K,re]=m.useState(!1);m.useState(!1);const[he,Q]=m.useState([]),[ie,oe]=m.useState("");m.useState("");const[G,V]=m.useState(100),[te,ae]=m.useState("NEUTRAL"),[fe,Ne]=m.useState("AGGRESSIVE"),[me,we]=m.useState("");m.useState(""),m.useState("");const[xe,ye]=m.useState(!1),[je,Pe]=m.useState(!1),[Re,Xe]=m.useState(!1),{setSignModalOpen:Ke,setTelegramChatId:ut,setSubscriberRole:et,setMushboomerETH:tt,setMushboomerSOL:Le,setIsReferralCode:$e,setIsReferralCodeName:ht,setIsWhitelist:pt,setHyperToken:Kt,setHyperAddress:wt}=m.useContext(Qr),nn="https://dextrabothypev2.nftinit.io",cn="https://api.hyperliquid.xyz/info",zn={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};m.useEffect(()=>{async function Dt(){var en;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 ar=(en=Qn==null?void 0:Qn.coins)==null?void 0:en.map(Gt=>{const $n=(Gt==null?void 0:Gt.value)||"",nr=zn[$n]||$n,Rt=nr==="xyz:MSTR"?"":`https://app.hyperliquid.xyz/coins/${nr}.svg`;return{...Gt,icon:Rt}}),hr=Qn.coins.filter(Gt=>Gt.value.includes(":")).map(Gt=>{const[$n,nr]=Gt.value.split(":");return nr});f(ar),g(hr)}}catch(In){console.error("Failed to fetch coin list:",In)}}Dt()},[]);const Xt=Dt=>{var en;return((en=d.find(In=>In.label===Dt))==null?void 0:en.maxLeverage)??100},on=Dt=>({HL_FEE:15e-5,BUILDER_FEE:2e-4,GROW_RATE:(x==null?void 0:x.includes(Dt))?.1:1}),Zt=(Dt,en)=>{if(!Dt||!en)return"";const{HL_FEE:In,BUILDER_FEE:Qn,GROW_RATE:ar}=on(en);return(Number(Dt)*(In+Qn*ar)).toFixed(0)},Ye=(Dt,en)=>{if(!Dt||!en)return"";const{HL_FEE:In,BUILDER_FEE:Qn,GROW_RATE:ar}=on(en);return(Number(Dt)/(In+Qn*ar)).toFixed(0)},Ze=Dt=>Dt===""||Dt===null?"":Number(Dt).toLocaleString("en-US"),Ft=Dt=>Dt?Dt.replace(/,/g,""):"",dn=Dt=>{if(Dt==null||Dt==="")return"0.00";const en=Number(Dt);return Number.isNaN(en)?"0.00":en.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})},Yt=Dt=>/^\d*$/.test(Dt),Bt=Dt=>/^\d*\.?\d{0,6}$/.test(Dt),ot=Dt=>{["e","E","+","-"].includes(Dt.key)&&Dt.preventDefault()};m.useEffect(()=>{if(!o)return;const Dt=Xt(o),en=Number(ie);!Number.isNaN(en)&&en>Dt&&oe(String(Dt)),!Number.isNaN(en)&&en<1&&ie!==""&&oe("1")},[o]);const De=m.useMemo(()=>{if(!z||!ie||!me)return"";const Dt=fe==="NORMAL"?.02:fe==="PASSIVE"?.05:.1,en=Number(z)*Number(ie),In=Number(me)*Dt;return en>In?"":"Insufficient margin to create order, please increase your margin."},[z,ie,me,fe]),_t=m.useMemo(()=>{if(ie==="")return!1;const Dt=Number(ie),en=Xt(o);return Number.isInteger(Dt)&&Dt>=1&&Dt<=en},[ie,o,d]);m.useEffect(()=>{if(!o)return;const Dt=Xt(o),en=Number(ie);!Number.isNaN(en)&&en>Dt&&oe(String(Dt)),!Number.isNaN(en)&&en<1&&ie!==""&&oe("1")},[o]);const ze=m.useMemo(()=>{if(G==="")return!1;const Dt=Number(G);return Number.isNaN(Dt)?!1:Dt===0?!0:Dt>=0},[G]),nt=m.useMemo(()=>{if(me==="")return!1;const Dt=Number(me);return!Number.isNaN(Dt)&&Dt>0},[me]),mt=m.useMemo(()=>n.map(Dt=>{const en=(Dt==null?void 0:Dt.wallet_name)??(Dt==null?void 0:Dt.name)??(Dt==null?void 0:Dt.label)??String(Dt==null?void 0:Dt.wallet_id),In=(Dt==null?void 0:Dt.version)===3?`${en} - (API-AGENT) Wallet`:en;return{value:(Dt==null?void 0:Dt.wallet_id)??(Dt==null?void 0:Dt.id)??(Dt==null?void 0:Dt.value)??"",label:In,raw:Dt}}),[n]),$t=m.useMemo(()=>{var Dt;return(Dt=mt.find(en=>String(en.value)===String(s)))==null?void 0:Dt.raw},[mt,s]),Pt=m.useMemo(()=>{const Dt=$t||{};return Dt.address||Dt.evm_address||Dt.wallet_address||Dt.public_address||Dt.eth_address||Dt.addr||null},[$t]),un=s!==""&&o!==""&&K&&_t&&nt&&!De&&(te==="LONG"||te==="SHORT"||te==="NEUTRAL")&&(fe==="AGGRESSIVE"||fe==="NORMAL"||fe==="PASSIVE");m.useEffect(()=>{const Dt=localStorage.getItem("hyperToken"),en=localStorage.getItem("hyperAddress");re(!!(Dt&&en));const In=setInterval(()=>{const Qn=localStorage.getItem("hyperToken"),ar=localStorage.getItem("hyperAddress");re(!!(Qn&&ar))},800);return()=>clearInterval(In)},[]),m.useEffect(()=>{O(""),K&&An()},[K]),m.useEffect(()=>{Pt?an(Pt):(X(null),J(""),Q([]))},[Pt]),m.useEffect(()=>{K&&(e(),Jt())},[K]);async function an(Dt){var en;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:Dt})})).json();X((en=Qn==null?void 0:Qn.marginSummary)==null?void 0:en.accountValue)}catch(In){J(In.message||"Failed to load USDC balance.")}finally{L(!1)}}function xn(){const Dt=Pt||window.localStorage.getItem("hyperAddress");Dt&&an(Dt)}async function An(){try{w(!0);const Dt=window.localStorage.getItem("hyperToken"),en=window.localStorage.getItem("hyperAddress");if(!Dt||!en){re(!1),Ke(!0);return}const Qn=await(await fetch(`${nn}/api/wallet/confirmed-list`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:en.toLowerCase(),token:Dt})})).json();Qn!=null&&Qn.success?r((Qn==null?void 0:Qn.data)||[]):O((Qn==null?void 0:Qn.error_message)||"Failed to load wallets.")}catch(Dt){O(Dt.message||"Wallet list error.")}finally{w(!1)}}async function kn(){if(!K){Ke(!0);return}if(un)try{I(!0),O(""),Xe(!0);const Dt=window.localStorage.getItem("hyperToken"),en=window.localStorage.getItem("hyperAddress");if(!Dt||!en){re(!1),Ke(!0);return}const In={coin:c,leverage:Number(ie),volume:Number(me),orderBookDepth:1,perOrderPosValue:fe==="PASSIVE"?2:fe==="NORMAL"?5:10,direction:te,executionMode:fe,budget:Number(G)},Qn={address:en.toLowerCase(),token:Dt,wallet_id:Number(s),source_market:"hyper",bot_params:In,coin:o},hr=await(await fetch(`${nn}/api/hyper/mmbot/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Qn)})).json();hr!=null&&hr.success?(e(),tn.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"}})):(O((hr==null?void 0:hr.error_message)||"Start failed."),tn.error((hr==null?void 0:hr.error_message)||"Save failed."))}catch(Dt){O(Dt.message||"An error occurred while saving.")}finally{I(!1),Pe(!1),Xe(!1)}}const yn=32,Vn={control:(Dt,en)=>({...Dt,backgroundColor:"#242424",borderColor:en.isFocused?"#67FFBD":"#353535",minHeight:yn,height:yn,boxShadow:"none",cursor:"pointer",alignItems:"center",minWidth:"max-content"}),valueContainer:Dt=>({...Dt,height:yn,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:Dt=>({...Dt,height:yn}),input:Dt=>({...Dt,color:"#FFFFFF",margin:0,padding:0}),singleValue:Dt=>({...Dt,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:Dt=>({...Dt,color:"#7F7F7F",fontSize:"12px"}),menu:Dt=>({...Dt,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:Dt=>({...Dt,paddingTop:0,paddingBottom:0,maxHeight:180}),option:(Dt,en)=>({...Dt,backgroundColor:en.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:yn,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:Dt=>({...Dt,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:Dt=>({...Dt,backgroundColor:"#353535"})},Gn=({max:Dt})=>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:[Dt,"x"]}),Rn=()=>i.jsx("div",{className:"px-2 py-0.5 rounded-md bg-[#0f1b1b] text-[#67ffbd] text-[10px] font-semibold",children:"xyz"}),Yn=Dt=>{var In;const en=x==null?void 0:x.includes(Dt.data.label);return i.jsx(Ca.Option,{...Dt,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[(In=Dt.data)!=null&&In.icon?i.jsx("img",{src:Dt.data.icon,alt:Dt.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:Dt.data.label}),en&&i.jsx(Rn,{}),i.jsx(Gn,{max:Dt.data.maxLeverage})]})})},Cn=Dt=>{var In;const en=x==null?void 0:x.includes(Dt.data.label);return i.jsx(Ca.SingleValue,{...Dt,children:i.jsxs("div",{className:"flex items-center gap-2",children:[(In=Dt.data)!=null&&In.icon?i.jsx("img",{src:Dt.data.icon,alt:Dt.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:Dt.data.label}),en&&i.jsx(Rn,{}),i.jsx(Gn,{max:Dt.data.maxLeverage})]})})},rn=(Dt,en)=>{if(l(Dt),u(en),G===""&&me===""){V(100),we(Ye(100,Dt));return}if(G===""&&me!==""){V(Zt(me,Dt));return}if(G!==""&&me===""){we(Ye(G,Dt));return}V(Zt(me,Dt))},Oe=d,Jt=async()=>{var In,Qn;const Dt=window.localStorage.getItem("hyperToken"),en=window.localStorage.getItem("hyperAddress");if(!(!Dt||!en))try{N(!0);const ar=await _i(en.toLowerCase(),Dt);ar!=null&&ar.success?(ut(ar==null?void 0:ar.telegram_chat_id),et(ar==null?void 0:ar.subscriber_role),tt((In=ar==null?void 0:ar.mushboomer_counts)==null?void 0:In.eth),Le((Qn=ar==null?void 0:ar.mushboomer_counts)==null?void 0:Qn.sol),$e(ar==null?void 0:ar.referral_code),ht(ar==null?void 0:ar.refcode),pt(ar==null?void 0:ar.whitelist),Kt(Dt),wt(en),N(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),Kt(""),wt(""),N(!1))}catch(ar){console.error("Token verification error:",ar),console.error(ar.message||"An unknown error occurred."),N(!1)}},sn=Dt=>i.jsxs(Ca.MenuList,{...Dt,children:[i.jsxs("div",{onClick:()=>{Dt.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"}),Dt.children]}),Et=v||P,Xn=!1,gn=Xt(o);return i.jsxs(i.Fragment,{children:[xe&&Na.createPortal(i.jsx("div",{className:"fixed inset-0 z-[999999999]",children:i.jsx(f5,{open:xe,setOpen:ye,handleListRequest:An,handlePageChange:()=>{}})}),document.body),i.jsx(SWe,{open:je,setOpen:Pe,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(Nl,{styles:Vn,isDisabled:Et||v||Xn,isLoading:v,options:mt,components:{MenuList:sn},setIsGenWalletModal:ye,value:mt.find(Dt=>String(Dt.value)===String(s))||null,onChange:Dt=>{a((Dt==null?void 0:Dt.value)??""),t((Dt==null?void 0:Dt.value)??"")},placeholder:K?v?"Loading...":"Select":"Connect to select",isSearchable:!0,onMenuOpen:()=>{K||Ke(!0)},menuIsOpen:K?void 0:!1}),!K&&i.jsx("button",{type:"button",onClick:()=>Ke(!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(Nl,{styles:Vn,components:{Option:Yn,SingleValue:Cn},isDisabled:Et||Xn,options:Oe,value:Oe.find(Dt=>Dt.label===o)||null,onChange:Dt=>rn((Dt==null?void 0:Dt.label)??"",(Dt==null?void 0:Dt.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:Dt=>{const en=Dt.target.value.trim();if(en==="")return oe("");Yt(en)&&oe(en)},onKeyDown:ot,inputMode:"numeric",autoComplete:"off",placeholder:o?`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] ${ie===""?"border-[#353535]":_t?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Et||Xn})]}),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:Ze(G),onChange:Dt=>{let en=Ft(Dt.target.value);if(en===""){V(""),we("");return}if(Bt(en)){V(en);const In=Ye(en,o);we(In)}},onKeyDown:ot,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]":ze?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Et||Xn})]})]}),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:Ze(me),onChange:Dt=>{let en=Ft(Dt.target.value);if(en===""){we(""),V("");return}if(Bt(en)){we(en);const In=Zt(en,o);V(In)}},onKeyDown:ot,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] ${me===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Et||Xn})]})]}),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":te==="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||Xn?"cursor-not-allowed":"cursor-pointer",te==="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":te==="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||Xn?"cursor-not-allowed":"cursor-pointer",te==="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":te==="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||Xn?"cursor-not-allowed":"cursor-pointer",te==="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:()=>Ne("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||Xn?"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:()=>Ne("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||Xn?"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:()=>Ne("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||Xn?"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:[K&&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?"—":dn(z??"0")}),i.jsx("div",{onClick:xn,className:"flex justify-center items-center cursor-pointer",title:"Refresh balance",children:i.jsx(jS,{className:`w-4 h-4 ${U?"animate-spin":""}`})})]}),De&&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:ec,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:[De+" ",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:bm,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:()=>{Pe(!0)},disabled:!un||Et,className:`flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!un||Et?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] cursor-pointer"}`,children:P?"Loading...":"Start"})})})]})]})},Myn=({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?Na.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},Ryn=({data:e,shareModalOpen:t,setShareModalOpen:n})=>{var C,N,P,I,R;const{isReferralCodeName:r}=m.useContext(Qr),[s,a]=m.useState(Wa),[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 O=await P1(c.current,{cacheBust:!0,backgroundColor:null,useCORS:!0,style:{transform:"scale(1)",transformOrigin:"top left"}}),U=document.createElement("a");U.href=O,U.download="dextrabot-market-maker.png",document.body.appendChild(U),U.click(),document.body.removeChild(U),tn.success("PNG successfully downloaded!")}catch(O){console.error("Error generating PNG:",O),tn.error("Failed to download PNG.")}},d=async O=>{l(!0);try{const L=await(await fetch(`https://api.allorigins.win/raw?url=${encodeURIComponent(O)}`)).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(O=>a(O)).catch(()=>a(Wa))},[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(Myn,{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:_A,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:["$",(P=e==null?void 0:e.bot_params)!=null&&P.volume?Os((I=e==null?void 0:e.bot_params)==null?void 0:I.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||Wa,alt:"",className:"rounded-full w-8 h-8",onError:O=>sa(O)}),(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:O=>{O.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"})]})]})})})},Lyn=({data:e,setData:t,loading:n,error:r,fetchInfoOnOpen:s,isFilterWallet:a})=>{var Zt,Ye;m.useContext(Qr);const{isConnected:o,address:l}=ts(),[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),[P,I]=m.useState({}),[R,O]=m.useState(!1),[U,L]=m.useState({id:"",walletAddress:"",isDeleted:!1}),[z,X]=m.useState(!1),[ne,J]=m.useState(""),[K,re]=m.useState([]),[he,Q]=m.useState([]),[ie,oe]=m.useState([]),[G,V]=m.useState(!1),[te,ae]=m.useState(!1),[fe,Ne]=m.useState(!1),[me,we]=m.useState(!1),xe=m.useRef(null),ye=m.useRef(null),je=m.useRef(null),Pe=m.useRef(null),[Re,Xe]=m.useState(!1),Ke="tag",[ut,et]=m.useState(Ke),tt=Ze=>{if(!v){let Ft=e;a&&(Ft=Ft==null?void 0:Ft.filter(Yt=>String(Yt==null?void 0:Yt.wallet_id)===String(a)));const dn=Ft==null?void 0:Ft.filter(Yt=>{var Bt,ot,De,_t,ze,nt,mt,$t;if(K.length>0){const Pt=K.includes("HyperLiquid")&&(Yt==null?void 0:Yt.source_market)==="hyper",un=K.includes("Lighter")&&(Yt==null?void 0:Yt.source_market)==="lighter";if(!Pt&&!un)return!1}if(he.length>0){const Pt=he.includes("Short")&&((Bt=Yt==null?void 0:Yt.bot_params)==null?void 0:Bt.direction)==="SHORT",un=he.includes("Neutral")&&((ot=Yt==null?void 0:Yt.bot_params)==null?void 0:ot.direction)==="NEUTRAL",an=he.includes("Long")&&((De=Yt==null?void 0:Yt.bot_params)==null?void 0:De.direction)==="LONG";if(!Pt&&!un&&!an)return!1}if(ie.length>0){const Pt=ie.includes("Aggressive")&&((_t=Yt==null?void 0:Yt.bot_params)==null?void 0:_t.executionMode)==="AGGRESSIVE",un=ie.includes("Normal")&&((ze=Yt==null?void 0:Yt.bot_params)==null?void 0:ze.executionMode)==="NORMAL",an=ie.includes("Passive")&&((nt=Yt==null?void 0:Yt.bot_params)==null?void 0:nt.executionMode)==="PASSIVE";if(!Pt&&!un&&!an)return!1}return!(Re&&(Yt!=null&&Yt.is_deleted)||ne&&!(($t=(mt=Yt==null?void 0:Yt.bot_params)==null?void 0:mt.coin)!=null&&$t.toLowerCase().includes(ne.toLowerCase())))});return dn==null?void 0:dn.sort((Yt,Bt)=>{var Vn,Gn,Rn,Yn,Cn,rn,Oe,Jt,sn,Et,Xn,gn,Dt,en;const ot=((Gn=(Vn=Yt==null?void 0:Yt.bot_params)==null?void 0:Vn.coin)==null?void 0:Gn.toUpperCase())||"",De=((Yn=(Rn=Bt==null?void 0:Bt.bot_params)==null?void 0:Rn.coin)==null?void 0:Yn.toUpperCase())||"",_t=(Yt==null?void 0:Yt.wallet_id)||0,ze=(Bt==null?void 0:Bt.wallet_id)||0,nt=Number(((Cn=Yt==null?void 0:Yt.bot_params)==null?void 0:Cn.volume)||0),mt=Number(((rn=Bt==null?void 0:Bt.bot_params)==null?void 0:rn.volume)||0),$t=Number(((Oe=Yt==null?void 0:Yt.bot_params)==null?void 0:Oe.volume)||0),Pt=Number(((Jt=Bt==null?void 0:Bt.bot_params)==null?void 0:Jt.volume)||0),un=Number(((sn=Yt==null?void 0:Yt.bot_params)==null?void 0:sn.volume)||0),an=Number(((Et=Bt==null?void 0:Bt.bot_params)==null?void 0:Et.volume)||0),xn=Number(((Xn=Yt==null?void 0:Yt.bot_params)==null?void 0:Xn.leverage)||0),An=Number(((gn=Bt==null?void 0:Bt.bot_params)==null?void 0:gn.leverage)||0),kn=Number(((Dt=Yt==null?void 0:Yt.bot_params)==null?void 0:Dt.budget)||0),yn=Number(((en=Bt==null?void 0:Bt.bot_params)==null?void 0:en.budget)||0);return Ze==="coin"?ot<De?-1:ot>De?1:0:Ze==="-coin"?ot>De?-1:ot<De?1:0:Ze==="account"?_t>ze?-1:_t<ze?1:0:Ze==="-account"?_t<ze?-1:_t>ze?1:0:Ze==="volume"?nt-mt:Ze==="-volume"?mt-nt:Ze==="order"?$t-Pt:Ze==="-order"?Pt-$t:Ze==="perOrder"?un-an:Ze==="-perOrder"?an-un:Ze==="leverage"?xn-An:Ze==="-leverage"?An-xn:Ze==="budget"?kn-yn:Ze==="-budget"?yn-kn:0})}return e},Le=m.useRef(null),$e=["Short","Neutral","Long"],ht=["Aggressive","Normal","Passive"],pt=Ze=>{Q(Ft=>Ft.includes(Ze)?Ft.filter(dn=>dn!==Ze):[...Ft,Ze])},Kt=Ze=>{oe(Ft=>Ft.includes(Ze)?Ft.filter(dn=>dn!==Ze):[...Ft,Ze])};m.useEffect(()=>{function Ze(Ft){xe.current&&!xe.current.contains(Ft.target)&&ae(!1),ye.current&&!ye.current.contains(Ft.target)&&Ne(!1),Pe.current&&!Pe.current.contains(Ft.target)&&we(!1),je.current&&!je.current.contains(Ft.target)&&V(!1)}return document.addEventListener("mousedown",Ze),()=>document.removeEventListener("mousedown",Ze)},[]);const wt=async({id:Ze,walletAddress:Ft,isDeleted:dn})=>{try{const Yt=window.localStorage.getItem("hyperToken"),Bt=window.localStorage.getItem("hyperAddress");if(!Yt||!Bt||!Ze){tn.error("Something went wrong!");return}X(!0),Ft&&I(nt=>({...nt,[Ft]:!0}));const ot="https://dextrabothypev2.nftinit.io/api/hyper/mmbot/update/",De={is_deleted:!dn},ze=await(await fetch(ot,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:l?l.toLowerCase():Bt,token:Yt,bot_id:Number(Ze),update_params:De})})).json();ze.success?(t((ze==null?void 0:ze.data)||[]),tn.success("Action completed successfully.")):tn.error(ze.error_message),O(!1)}catch{tn.error("Something went wrong")}finally{X(!1),I(Yt=>({...Yt,[Ft]:!1}))}},nn=async()=>{try{const Ze=window.localStorage.getItem("hyperToken"),Ft=window.localStorage.getItem("hyperAddress");if(!Ze||!Ft)return;const Bt=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:Ze})})).json();Bt.success&&u((Bt==null?void 0:Bt.data)||[])}catch(Ze){tn.error(Ze.message||"Something went wrong")}finally{}};m.useEffect(()=>{nn();const Ze=setInterval(()=>{nn()},15e3);return()=>clearInterval(Ze)},[e]);const cn=m.useMemo(()=>{const Ze={};return c==null||c.forEach(Ft=>{Ft!=null&&Ft.id&&(Ze[Ft.id]=Ft.bot_params)}),Ze},[c]);m.useEffect(()=>{const Ze=localStorage.getItem("hyperToken"),Ft=localStorage.getItem("hyperAddress");N(!!(Ze&&Ft));const dn=setInterval(()=>{const Yt=localStorage.getItem("hyperToken"),Bt=localStorage.getItem("hyperAddress");N(!!(Yt&&Bt))},800);return()=>clearInterval(dn)},[]);const zn={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]"}},Xt=()=>i.jsx(jS,{className:"w-4 h-4 text-yellow-400"}),on={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};return i.jsxs(i.Fragment,{children:[i.jsx(SWe,{open:R,setOpen:O,makerStatus:wt,isStatusWallet:U,info:"table",modalLoading:z}),i.jsx(Ryn,{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:()=>Xe(!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:Xc,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:Le,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(pi,{title:"Coin",sortKey:"coin",sortOption:ut,setSortOption:et,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(zf,{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:Ze=>J(Ze.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(pi,{title:"Leverage",sortKey:"leverage",sortOption:ut,setSortOption:et,isFilterIcon:!1})})}),i.jsx("th",{scope:"col",className:"bg-[#090909] h-10 px-1 min-w-[110px] z-[7]",children:i.jsx(pi,{title:"Volume",sortKey:"volume",sortOption:ut,setSortOption:et,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"bg-[#090909] h-10 px-1 min-w-[120px] z-[8]",children:i.jsx(pi,{title:"Budget",sortKey:"budget",sortOption:ut,setSortOption:et,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:()=>Ne(!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(zf,{className:`w-4 h-4 ${he.length>0?"text-blue-500":"text-white"}`})}),fe&&i.jsxs("div",{ref:ye,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:()=>Q(""),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"})})]}),$e==null?void 0:$e.map(Ze=>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(Ze),onChange:()=>pt(Ze),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(Ze)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:he.includes(Ze)&&i.jsx("img",{src:Xc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[1px]"})}),Ze]},Ze))]})]})]})}),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:()=>we(!me),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(zf,{className:`w-4 h-4 ${ie.length>0?"text-blue-500":"text-white"}`})}),me&&i.jsxs("div",{ref:Pe,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"})})]}),ht==null?void 0:ht.map(Ze=>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(Ze),onChange:()=>Kt(Ze),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(Ze)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:ie.includes(Ze)&&i.jsx("img",{src:Xc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[1px]"})}),Ze]},Ze))]})]})]})}),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(Ba,{})})})}):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(Ul,{})})})}):((Zt=tt(ut))==null?void 0:Zt.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:ac,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."})})]})})})})}):(Ye=tt(ut))==null?void 0:Ye.map((Ze,Ft)=>{var $t,Pt,un,an,xn,An,kn,yn,Vn,Gn,Rn,Yn,Cn,rn;const dn=!!(Ze!=null&&Ze.is_deleted),Yt=dn?"bg-[#3c1518]/70 border-[#ff6b6b]/60 text-[#ffd4d1] hover:bg-[#571f24]/80":"bg-[#123424]/70 border-[#2bd27c]/50 text-[#9cf7cb] hover:bg-[#185134]/80",Bt=cn[Ze==null?void 0:Ze.id]||{},ot=(Bt==null?void 0:Bt.status)||(Ze!=null&&Ze.is_deleted?"completed":"started"),De=zn[ot],_t=ot==="completed",ze=_t?"↻":dn?"▶":"⏹",nt=Bt!=null&&Bt.volume_usd?Bt.current_volume/Bt.volume_usd*100:0,mt=Math.min(100,Math.max(0,nt));return i.jsxs("tr",{className:`relative group hover:bg-[#151515] h-[56px] border-b border-white/5 text-white transition-opacity ${dn?"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/${Ze==null?void 0:Ze.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/${on[($t=Ze==null?void 0:Ze.bot_params)==null?void 0:$t.coin]||((un=(Pt=Ze==null?void 0:Ze.bot_params)==null?void 0:Pt.coin)==null?void 0:un.split("/")[0])}.svg`||Wa,alt:(an=Ze==null?void 0:Ze.bot_params)==null?void 0:an.coin,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:Oe=>sa(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 Xn;const Oe=((Xn=Ze==null?void 0:Ze.bot_params)==null?void 0:Xn.coin)||"",Jt=Oe.includes(":"),sn=Jt?Oe.split(":")[1]:Oe,Et=Jt?Oe.split(":")[0]:null;return i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:sn}),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:(Ze==null?void 0:Ze.source_market)==="lighter"?i.jsx(xi,{content:"Lighter",children:i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx(up,{className:"w-4 h-4 text-[#fff]"}),i.jsx("p",{children:Ze==null?void 0:Ze.wm_name})]})}):(Ze==null?void 0:Ze.source_market)==="hyper"?i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx(xi,{content:"Hyperliquid",children:i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx("img",{src:S1,alt:"",className:"w-4 h-4 text-[#fff]"}),i.jsx("p",{children:Ze==null?void 0:Ze.wm_name})]})})}):i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx(xi,{content:"Dextrabot",children:i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx("img",{src:Ki,alt:"",className:"w-4 h-4 text-[#fff]"}),i.jsx("p",{children:Ze==null?void 0:Ze.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(oa,{info1:(xn=Ze==null?void 0:Ze.bot_params)!=null&&xn.leverage?`${(An=Ze==null?void 0:Ze.bot_params)==null?void 0:An.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(oa,{info1:(kn=Ze==null?void 0:Ze.bot_params)!=null&&kn.volume?`$${(Vn=(yn=Ze==null?void 0:Ze.bot_params)==null?void 0:yn.volume)==null?void 0:Vn.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(oa,{info1:(Gn=Ze==null?void 0:Ze.bot_params)!=null&&Gn.budget?`$${(Yn=(Rn=Ze==null?void 0:Ze.bot_params)==null?void 0:Rn.budget)==null?void 0:Yn.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(oa,{info1:(Cn=Ze==null?void 0:Ze.bot_params)==null?void 0:Cn.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(oa,{info1:(rn=Ze==null?void 0:Ze.bot_params)==null?void 0:rn.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:mt>=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:`${mt||0}%`,backgroundColor:mt>=100?"#3ec78c":"#d68b38"}}),i.jsxs("div",{className:"absolute inset-0 flex items-center justify-center text-[10px] font-bold",style:{color:mt>=100?"#d0ffd9":"#ffcb8a"},children:[mt?mt.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(oa,{info1:De==null?void 0:De.label,info1_Color:De==null?void 0:De.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:P[Ze.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(Ze==null?void 0:Ze.id),walletAddress:Ze==null?void 0:Ze.wm_address,isDeleted:_t?!0:Ze==null?void 0:Ze.is_deleted}),O(!0)},className:`h-7 px-3 w-[42px] rounded-md border justify-center items-center gap-2 inline-flex cursor-pointer transition ${_t?"bg-[#2d2d2d] border-[#444]":Yt}`,title:ze,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:_t?i.jsx(Xt,{}):i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:ze})})})})}),i.jsx("td",{className:`${Ft%2==0,"bg-[#161616]"} z-[2] group-hover:bg-[#222222] pr-4`,children:i.jsx("div",{onClick:()=>{f(Ze),g(!0)},className:"pl-1 flex flex-col items-end gap-2 font-manrope cursor-pointer",children:i.jsx(Tet,{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:ac,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."})})]})})})})})})]})})})]})]})},Dyn="https://dextrabothypev2.nftinit.io",Byn=()=>{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(`${Dyn}/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(qk,{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:l5,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(wo.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(Oyn,{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(Lyn,{data:n,setData:r,loading:e,error:s,fetchInfoOnOpen:c,isFilterWallet:o})})})]})]})},mF="#67FFBD",$yn=({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(wo.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(Ba,{})]}):i.jsxs("div",{className:"relative  h-full w-full flex justify-center items-center overflow-hidden rounded-[16px] bg-black",children:[i.jsx(wo.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(wo.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:QN,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,preload:"auto",className:"w-full h-[260px] object-cover bg-black"},QN)]}),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:mF},children:"Early Access"}),i.jsxs("div",{className:"text-lg font-semibold",children:["Enter ",i.jsx("span",{style:{color:mF},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:mF},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:mF},children:a})]})]})]})]})})},Uyn=()=>{const{setSignModalOpen:e}=m.useContext(Qr);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"})})]})]})})]})},zyn=()=>{const{setTelegramChatId:e,setSubscriberRole:t,setMushboomerETH:n,setIsWhitelist:r,setMushboomerSOL:s,setIsReferralCode:a,setIsReferralCodeName:o,setHyperToken:l,setHyperAddress:c,setSignModalOpen:u}=m.useContext(Qr),[d,f]=m.useState(!1),[x,g]=m.useState(!1),[v,w]=m.useState(""),[C,N]=m.useState(!1),[P,I]=m.useState(""),[R,O]=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{O(!0);const K=await _i(X.toLowerCase(),z);K!=null&&K.success?(e(K==null?void 0:K.telegram_chat_id),t(K==null?void 0:K.subscriber_role),n((ne=K==null?void 0:K.mushboomer_counts)==null?void 0:ne.eth),s((J=K==null?void 0:K.mushboomer_counts)==null?void 0:J.sol),a(K==null?void 0:K.referral_code),o(K==null?void 0:K.refcode),r(K==null?void 0:K.whitelist),g(K==null?void 0:K.mm_hyper_alpha_code),O(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),l(""),c(""),O(!1))}catch(K){console.error("Token verification error:",K),O(!1)}})()},[d]);const U=async()=>{var X,ne,J,K;const L=window.localStorage.getItem("hyperToken"),z=window.localStorage.getItem("hyperAddress");if(!v.trim()){tn.error("Please enter your alpha code");return}if(!L||!z){u(!0);return}N(!0),I("");try{const re={address:z==null?void 0:z.toLowerCase(),token:L,alpha_code:v.trim(),source_market:"hyper",app_type:"mm_bot"},Q=(await hs.post("https://dextrabothypev2.nftinit.io/api/subscriber/alpha_code/set/",re)).data||{};if(Q.success){const ie=Q.message||"Alpha code added successfully";tn.success(`${ie}`,{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}}),I(ie),g(!0)}else{const ie=Q.error_message||Q.message||"This alpha code is invalid";tn.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"}}),I(ie)}}catch(re){const he=((ne=(X=re==null?void 0:re.response)==null?void 0:X.data)==null?void 0:ne.error_message)||((K=(J=re==null?void 0:re.response)==null?void 0:J.data)==null?void 0:K.message)||re.message||"Failed to validate alpha code";tn.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"}}),I(he)}finally{N(!1)}};return i.jsxs(i.Fragment,{children:[i.jsx(No,{children:i.jsxs(Lo,{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(Byn,{}):i.jsx($yn,{code:v,onCodeChange:w,onSubmit:U,loading:C,loadingCheckAccount:R,message:P}):i.jsx(Uyn,{})})})]})},Hyn=({data:e,refreshAgent:t,loadingCheckAccount:n,slotCount:r})=>{var Q,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(up,{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(aMe,{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:lke},apex:{name:"Apex",type:"img",src:"https://omni.apex.exchange/assets/logo_content-CY9uyFbz.svg"}},w={lighter:{name:"Lighter",type:"component",src:i.jsx(up,{className:"w-6 h-6 text-white"})}},C=["aster","basedapp","apex","extended"],N=(e==null?void 0:e.slots_info)||{},P=Object.fromEntries(Object.entries(N).filter(([G])=>!C.includes(G))),I=Object.values(P).reduce((G,V)=>G+V.total_qty,0),R=Object.values(P).reduce((G,V)=>G+V.active_qty,0),O=(((Q=e==null?void 0:e.copy_trade_slots_info)==null?void 0:Q.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,K=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&&Na.createPortal(i.jsx(Ale,{open:l,setOpen:c,oldSlotCount:f,checkAccountTrade:n,tradeMarket:"copyTrade"}),document.body),u&&Na.createPortal(i.jsx(m5,{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:_A,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(jS,{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(aj,{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(aj,{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,"/",O," 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:O})]}),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:`${O>0?U/O*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:`${K===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(aj,{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,"/",K," 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:K})]}),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:`${K>0?J/K*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(aj,{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,"/",I," Active"]})]}),i.jsx("div",{className:"space-y-2",children:Object.entries(P).filter(([G])=>!C.includes(G)).map(([G,V])=>{var te,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:[((te=v[G])==null?void 0:te.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(aj,{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."})]})]})},Vyn=()=>{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(Qr),{address:f}=ts(),[x,g]=m.useState(1),[v,w]=m.useState({}),[C,N]=m.useState(""),[P,I]=m.useState(""),[R,O]=m.useState(!1),[U,L]=m.useState(!1),[z,X]=m.useState(""),[ne,J]=m.useState(0),[K,re]=m.useState(0),[he,Q]=m.useState(!1),[ie,oe]=m.useState(0),[G,V]=m.useState(!1),te=ut=>/^\d*$/.test(ut),ae=ut=>{["e","E","+","-"].includes(ut.key)&&ut.preventDefault()},fe=m.useMemo(()=>{if(x==="")return!1;const ut=Number(x);return Number.isInteger(ut)&&ut>=1},[x]),we=(ut=>{const[et,tt]=ut.split(" "),[Le,$e,ht]=et.split("-").map(Number),[pt,Kt]=tt.split(":").map(Number);return new Date(Date.UTC(ht,$e-1,Le,pt-3,Kt))})("29-11-2025 23:59");m.useState(()=>new Date().getTime()>=we.getTime());const xe=m.useRef(ne);m.useEffect(()=>{xe.current=ne},[ne]);const ye=m.useRef(0);m.useEffect(()=>{ye.current=K},[K]);const je=async()=>{var tt,Le,$e;const ut=window.localStorage.getItem("hyperToken"),et=window.localStorage.getItem("hyperAddress");if(!(!ut||!et))try{V(!0);const ht=await _i(et.toLowerCase(),ut);ht!=null&&ht.success?(t(ht==null?void 0:ht.telegram_chat_id),n(ht==null?void 0:ht.subscriber_role),r(ht==null?void 0:ht.subs_expire_day),s((tt=ht==null?void 0:ht.mushboomer_counts)==null?void 0:tt.eth),a((Le=ht==null?void 0:ht.mushboomer_counts)==null?void 0:Le.sol),o(ht==null?void 0:ht.referral_code),l(ht==null?void 0:ht.refcode),c(ht==null?void 0:ht.whitelist),u(ut),d(et),N(ht==null?void 0:ht.farming_tools),J(Number((ht==null?void 0:ht.subs_expire_day)||0)),w(ht),V(!1),oe((($e=ht==null?void 0:ht.copy_trade_slots_info)==null?void 0:$e.extra_slot_count)||0)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),u(""),d(""),V(!1))}catch(ht){console.error("Token verification error:",ht),console.error(ht.message||"An unknown error occurred."),V(!1)}};m.useEffect(()=>{he&&je()},[he]),m.useEffect(()=>{const ut=localStorage.getItem("hyperToken"),et=localStorage.getItem("hyperAddress");Q(!!(ut&&et));const tt=setInterval(()=>{const Le=localStorage.getItem("hyperToken"),$e=localStorage.getItem("hyperAddress");Q(!!(Le&&$e))},800);return()=>clearInterval(tt)},[]);const Pe=async()=>new Al(window.ethereum).eth.getAccounts(et=>et),Re=async(ut="subscribe",et=24,tt=5e3)=>{et<=0||(await new Promise(Le=>setTimeout(Le,tt)),await je(),ut==="subscribe"&&xe.current===ye.current?Re(ut,et-1,tt):je())},Xe=async ut=>{const et=window.localStorage.getItem("hyperToken"),tt=window.localStorage.getItem("hyperAddress");if(!et||!f){e(!0);return}I(""),re(xe.current),ye.current=xe.current,L(!0),O(!0);try{await window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0x1"}]})}catch(ht){console.error("Failed to switch network",ht),O(!1);return}const Le=new Al(window.ethereum);var $e=await Pe();if($e.length>0?$e=$e[0]:$e=void 0,$e){const pt=ut*.12,Kt=Le.utils.toWei(pt.toString(),"ether"),wt={from:$e,to:"0xdEAe8586eD227A5096EBae47342fFc1ED99f13F9",value:Kt};await Le.eth.sendTransaction(wt).then(nn=>{console.log("txHash :>> ",nn),O(!1),X(nn.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():tt,token:et,payment_tx:nn.transactionHash,payment_role:"farming_tools",tx_qty:Number(x)})}),je(),Re("subscribe")}).catch(nn=>{console.log(nn),nn.code===-32003||nn.message.includes("insufficient funds")?I("Insufficient funds."):nn.message==="MetaMask Tx Signature: User denied transaction signature."&&L(!1)})}else await Le.eth.requestAccounts()},Ke=()=>{je()};return window.localStorage.getItem("hyperToken"),i.jsxs(i.Fragment,{children:[i.jsx(vd,{open:U,setOpen:L,transactionHash:z,transactionLoading:R,paymentPresaleRole:!(ne<=K),errorFunds:P,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(Hyn,{data:v,refreshAgent:Ke,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:cD,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,preload:"auto",className:"w-full h-[284px] lg:h-[284px] object-cover"},cD)}),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(ut=>{const et=Number(ut||0);return et>1?String(et-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:ut=>{const et=ut.target.value.trim();if(et==="")return g("");te(et)&&g(et)},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(ut=>{const et=Number(ut||0);return String(et+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:ut=>{ut.preventDefault(),fe&&Xe(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"})]})})]})]})},Wyn=()=>{ts();const{setTelegramChatId:e,setSubscriberRole:t,setSubsExpireDay:n,setMushboomerETH:r,setMushboomerSOL:s,setIsReferralCode:a,setIsReferralCodeName:o,setIsWhitelist:l,setHyperToken:c,setHyperAddress:u}=m.useContext(Qr);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 _i(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(No,{children:i.jsxs(Lo,{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(Vyn,{})})})]})},qyn=()=>{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(Qr),{address:f}=ts(),[x,g]=m.useState(1),[v,w]=m.useState(""),[C,N]=m.useState(!1),[P,I]=m.useState(!1),[R,O]=m.useState(""),[U,L]=m.useState(0),[z,X]=m.useState(0),[ne,J]=m.useState(!1),[K,re]=m.useState(!1),he=Ne=>/^\d*$/.test(Ne),Q=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]),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 we,xe;const Ne=window.localStorage.getItem("hyperToken"),me=window.localStorage.getItem("hyperAddress");if(!(!Ne||!me))try{re(!0);const ye=await _i(me.toLowerCase(),Ne);ye!=null&&ye.success?(t(ye==null?void 0:ye.telegram_chat_id),n(ye==null?void 0:ye.subscriber_role),r(ye==null?void 0:ye.subs_expire_day),s((we=ye==null?void 0:ye.mushboomer_counts)==null?void 0:we.eth),a((xe=ye==null?void 0:ye.mushboomer_counts)==null?void 0:xe.sol),o(ye==null?void 0:ye.referral_code),l(ye==null?void 0:ye.refcode),c(ye==null?void 0:ye.whitelist),u(Ne),d(me),L(Number((ye==null?void 0:ye.subs_expire_day)||0)),re(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),u(""),d(""),re(!1))}catch(ye){console.error("Token verification error:",ye),console.error(ye.message||"An unknown error occurred."),re(!1)}};m.useEffect(()=>{ne&&V()},[ne]),m.useEffect(()=>{const Ne=localStorage.getItem("hyperToken"),me=localStorage.getItem("hyperAddress");J(!!(Ne&&me));const we=setInterval(()=>{const xe=localStorage.getItem("hyperToken"),ye=localStorage.getItem("hyperAddress");J(!!(xe&&ye))},800);return()=>clearInterval(we)},[]);const te=async()=>new Al(window.ethereum).eth.getAccounts(me=>me),ae=async(Ne="subscribe",me=24,we=5e3)=>{me<=0||(await new Promise(xe=>setTimeout(xe,we)),await V(),Ne==="subscribe"&&oe.current===G.current?ae(Ne,me-1,we):V())},fe=async Ne=>{const me=window.localStorage.getItem("hyperToken"),we=window.localStorage.getItem("hyperAddress");if(!me||!f){e(!0);return}w(""),X(oe.current),G.current=oe.current,I(!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 xe=new Al(window.ethereum);var ye=await te();if(ye.length>0?ye=ye[0]:ye=void 0,ye){const Pe=Ne*.09,Re=xe.utils.toWei(Pe.toString(),"ether"),Xe={from:ye,to:"0xdEAe8586eD227A5096EBae47342fFc1ED99f13F9",value:Re};await xe.eth.sendTransaction(Xe).then(Ke=>{console.log("txHash :>> ",Ke),N(!1),O(Ke.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():we,token:me,payment_tx:Ke.transactionHash,payment_role:"farming_tools",tx_qty:Number(x)})}),V(),ae("subscribe")}).catch(Ke=>{console.log(Ke),Ke.code===-32003||Ke.message.includes("insufficient funds")?w("Insufficient funds."):Ke.message==="MetaMask Tx Signature: User denied transaction signature."&&I(!1)})}else await xe.eth.requestAccounts()};return i.jsxs(i.Fragment,{children:[P&&Na.createPortal(i.jsx(vd,{open:P,setOpen:I,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(Ne=>{const me=Number(Ne||0);return me>1?String(me-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 me=Ne.target.value.trim();if(me==="")return g("");he(me)&&g(me)},onKeyDown:Q,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 me=Number(Ne||0);return String(me+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:Ne=>{Ne.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"})]})},Gyn=({open:e,setOpen:t})=>{const{subsExpireDay:n}=m.useContext(Qr),r=()=>{const s=Date.now(),a=localStorage.getItem("hyperAddress");localStorage.setItem(`lighterCopyTradeDismissedAt_${a}`,s.toString()),t(!1)};return i.jsxs(Ea,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(ja,{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(ga,{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:$a,alt:"close"})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Ki,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(qyn,{})]})})]})})})})]})},Kyn=({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(Og,{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(Og,{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(Og,{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(Og,{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(Boe,{className:"w-4 h-4"}),url:"/discover-wallets#aster-farming"},{key:"extendedBot",title:"Extended Delta Neutral",desc:"Delta-neutral farming on Extended.",icon:"https://app.extended.exchange/assets/logo/extended.svg",url:"/discover-wallets#extended-farming",badge:"New",highlighted:!0},{key:"variationalBot",title:"Variational Farming Bot",desc:"Farm points on Variational exchange.",icon:cke,url:"/discover-wallets#variational-farming"},{key:"paradexBot",title:"Paradex Farming Bot",desc:"Farm points on Paradex exchange.",icon:dke,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:uke,url:"/discover-wallets#apex-farming"}],a=o=>{if(!o)return null;if(Ae.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(Ea,{open:e,onClose:n,className:"relative z-50",children:[i.jsx(ja,{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(ga,{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:$a,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))})})]})})]})},Yyn=({open:e,setOpen:t})=>null,xF="#basedapp-farming",gF="#aster-farming",bF="#lighter-farming",yF="#apex-farming",vF="#variational-farming",wF="#extended-farming",CF="#paradex-farming",SF="#pacifica-farming";function Xyn(){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(Qr),r=oc(),s=Wo(),[a,o]=m.useState(!1),[l,c]=m.useState(!1),[u,d]=m.useState(!1),[f,x]=m.useState(!1),g=r.hash===xF,v=r.hash===gF,w=r.hash===bF,C=r.hash===yF,N=r.hash===vF,P=r.hash===wF,I=r.hash===CF,R=r.hash===SF,O=Ae.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]),U=Ae.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]),L=Ae.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]),z=Ae.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]),X=Ae.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]),ne=Ae.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]),J=Ae.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]),K=Ae.useCallback(re=>{re?r.hash!==SF&&s(r.pathname+r.search+SF,{replace:!0}):r.hash===SF&&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"),Q=Date.now();if(he&&Q<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 Q=localStorage.getItem(`lighterCopyTradeDismissedAt_${he}`);if(Q){const ie=new Date(parseInt(Q)).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(),Q=new Date().toDateString();if(he===Q){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(YYe,{})}),i.jsxs("div",{children:[i.jsx(Bin,{}),i.jsxs(qKe,{children:[i.jsx(ya,{path:"/",element:i.jsx(ton,{})}),i.jsx(ya,{path:"/sitemap",element:i.jsx(aon,{})}),i.jsx(ya,{path:"/videos",element:i.jsx(oon,{})}),e.map(({from:re,to:he})=>i.jsx(ya,{path:re,element:i.jsx(jde,{to:he,replace:!0})},re)),i.jsxs(ya,{element:i.jsx(xrn,{}),children:[i.jsx(ya,{path:"/mobile-auth",element:i.jsx(ion,{})}),i.jsx(ya,{path:"discover-wallets",element:i.jsx(Ksn,{})}),i.jsx(ya,{path:"/hyperliquid-vaults",element:i.jsx(lon,{})}),i.jsx(ya,{path:"/back-testing",element:i.jsx(Vbn,{})}),i.jsx(ya,{path:"/hyperliquid-whale-trades",element:i.jsx(Pbn,{})}),i.jsx(ya,{path:"wallet-details/:walletAddress",element:i.jsx(Lin,{})}),i.jsx(ya,{path:"tracked-wallets",element:i.jsx(Uin,{})}),i.jsx(ya,{path:"tracker",element:i.jsx(ian,{})}),i.jsx(ya,{path:"referral/:code?",element:i.jsx(dan,{})}),i.jsx(ya,{path:"wallet-management",element:i.jsx(Aan,{})}),i.jsx(ya,{path:"copy-trade",element:i.jsx(_an,{})}),i.jsx(ya,{path:"leaderboard",element:i.jsx(Oan,{})}),i.jsx(ya,{path:"ticker",element:i.jsx(fon,{})}),i.jsx(ya,{path:"terminal",element:i.jsx(jde,{to:"/terminal/hyperliquid/BTC",replace:!0})}),i.jsx(ya,{path:"terminal/:coin",element:i.jsx(Qyn,{})}),i.jsx(ya,{path:"terminal/:exchange/:coin",element:i.jsx(T0n,{})}),i.jsx(ya,{path:"telegram-verify",element:i.jsx(Obn,{})}),i.jsx(ya,{path:"telegram-api-wallet",element:i.jsx(qbn,{})}),i.jsx(ya,{path:"subscribe",element:i.jsx(Fyn,{})}),i.jsx(ya,{path:"my-profile",element:i.jsx(Wyn,{})}),i.jsx(ya,{path:"hyperliquid-fee-calculator",element:i.jsx(hNe,{})}),i.jsx(ya,{path:"hyperliquid-fee-calculator/:walletAddress",element:i.jsx(hNe,{})}),i.jsx(ya,{path:"market-maker",element:i.jsx(zyn,{})}),i.jsx(ya,{path:"dca-bot",element:i.jsx(Iyn,{})})]}),i.jsx(ya,{path:"*",element:i.jsx(Zyn,{url:"https://dextrabot.com/"})})]}),i.jsx($oe,{open:g,setOpen:O}),i.jsx(Gyn,{open:l,setOpen:c}),i.jsx(Kyn,{open:u,setOpen:d}),i.jsx(Yyn,{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(w$,{open:P,setOpen:ne}),i.jsx(Woe,{open:I,setOpen:J}),i.jsx(qoe,{open:R,setOpen:K})]})]})}function Qyn(){const{coin:e}=t5(),t=Wo();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 Zyn({url:e}){return Ae.useEffect(()=>{window.location.replace(e)},[e]),i.jsx(No,{children:i.jsxs(Lo,{children:[i.jsx("meta",{name:"prerender-status-code",content:"301"}),i.jsx("meta",{name:"prerender-header",content:`Location: ${e}`})]})})}const Jyn="4953aed406a7fd4457496250b7e4efbc",e2n=TRt({appName:"Dextrabot",projectId:Jyn,chains:[ZE,i1e,s1e,r1e],transports:{[ZE.id]:uj(),[i1e.id]:uj(),[s1e.id]:uj(),[r1e.id]:uj()},ssr:!1}),t2n=new Sxt,n2n=document.getElementById("root"),r2n=ONe.createRoot(n2n);r2n.render(i.jsx(tYe,{children:i.jsx(Q0t,{config:e2n,children:i.jsx(Wxt,{client:t2n,children:i.jsx(QOt,{modalSize:"compact",theme:fMe({borderRadius:"large",fontStack:"rounded",overlayBlur:"large"}),children:i.jsx(Ubt,{children:i.jsx(Xyn,{})})})})})}));const vNe=Object.freeze(Object.defineProperty({__proto__:null,default:Hee},Symbol.toStringTag,{value:"Module"}));export{Lr as B,Lie as E,Hj as H,is as _,X2n as a,r1 as b,cB as c,lft as d,s2 as e,X0 as f,eie as g,Ii as h,bie as i,i2n as j,Iu as k,M9e as l,L0t as m,rFt as r,Pc as s,yvn as t};